index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. <template>
  2. <div>
  3. <el-card class="box-card">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. :searchConfig="searchConfig"
  10. highlight-current-row
  11. :action-list="[
  12. // {
  13. // text: '登记对账',
  14. // action: () => clickModal(),
  15. // },
  16. {
  17. text: 'Excel文件',
  18. action: () => clickExcelFile(),
  19. },
  20. {
  21. text: '手动同步',
  22. action: () => clickManualSynchronization(),
  23. },
  24. ]"
  25. @get-list="getList"
  26. @clickReset="clickReset">
  27. <template #timePeriod="{ item }">
  28. <div>
  29. <el-row>
  30. <el-col :span="11">{{ item.timePeriod }}</el-col>
  31. <el-col :span="2" style="text-align: center">-</el-col>
  32. <el-col :span="11">{{ item.timePeriod }}</el-col>
  33. </el-row>
  34. </div>
  35. </template>
  36. <template #receiptFileList="{ item }">
  37. <div>
  38. <el-button type="primary" @click="clickReceiptFile(item)" v-if="item.receiptFileList && item.receiptFileList.length > 0" text>查看</el-button>
  39. <el-button type="danger" @click="clickReceiptFile(item)" v-else text>上传</el-button>
  40. </div>
  41. </template>
  42. <template #proofFileList="{ item }">
  43. <div>
  44. <el-button type="primary" @click="clickProofFile(item)" v-if="item.proofFileList && item.proofFileList.length > 0" text>查看</el-button>
  45. <el-button type="danger" @click="clickProofFile(item)" v-else text>上传</el-button>
  46. </div>
  47. </template>
  48. </byTable>
  49. </el-card>
  50. <el-dialog :title="modalType == 'add' ? '登记对账' : '编辑对账'" v-if="openDialog" v-model="openDialog" width="80%">
  51. <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data">
  52. <template #orderIdList>
  53. <div style="width: 100%">
  54. <el-form-item label="事业部" prop="departmentId" style="margin-bottom: 18px">
  55. <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable @change="changeDepartment" :disabled="formData.data.id">
  56. <el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
  57. </el-select>
  58. <el-button type="primary" size="small" style="margin-left: 16px" @click="clickAddOrder()">选择合同</el-button>
  59. </el-form-item>
  60. <el-table :data="formData.data.orderList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
  61. <el-table-column label="事业部" prop="departmentName" width="140" />
  62. <el-table-column label="订单号" prop="orderCode" min-width="180" />
  63. <el-table-column label="订单总金额 ¥" prop="totalAmount" align="right" width="120" />
  64. <el-table-column label="产品总金额 ¥" prop="productTotalAmount" align="right" width="120" />
  65. <el-table-column label="定制加工费 ¥" prop="customProcessingFee" align="right" width="110" />
  66. <el-table-column label="代发费 ¥" prop="lssueFee" align="right" width="100" />
  67. <el-table-column label="快递包材费 ¥" prop="deliveryMaterialsFee" align="right" width="110" />
  68. <el-table-column label="包装人工费 ¥" prop="packingLabor" align="right" width="110" />
  69. <el-table-column label="包材费 ¥" prop="packagingMaterialCost" align="right" width="100" />
  70. <el-table-column label="管理费 ¥" prop="managementFee" align="right" width="100" />
  71. <el-table-column label="外箱包装费 ¥" prop="outerBoxPackingFee" align="right" width="110" />
  72. <el-table-column label="操作" align="center" fixed="right" width="60">
  73. <template #default="{ $index }">
  74. <el-button type="danger" @click="clickOrderDelete($index)" text>删除</el-button>
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. </div>
  79. </template>
  80. </byForm>
  81. <template #footer>
  82. <el-button @click="openDialog = false" size="large">取 消</el-button>
  83. <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
  84. </template>
  85. </el-dialog>
  86. <el-dialog title="上传对账单" v-if="openReceiptFile" v-model="openReceiptFile" width="600">
  87. <el-upload
  88. v-model:fileList="fileList"
  89. action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
  90. :data="uploadReceiptData"
  91. multiple
  92. :before-upload="uploadReceiptFile"
  93. :on-success="handleReceiptSuccess"
  94. :on-preview="onPreviewFile">
  95. <el-button type="primary">上传</el-button>
  96. </el-upload>
  97. <template #footer>
  98. <el-button @click="openReceiptFile = false" size="large">取 消</el-button>
  99. <el-button type="primary" @click="submitReceiptFile()" size="large" v-preReClick>确 定</el-button>
  100. </template>
  101. </el-dialog>
  102. <el-dialog title="上传转账凭证" v-if="openProofFile" v-model="openProofFile" width="600">
  103. <el-upload
  104. v-model:fileList="fileList"
  105. action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
  106. :data="uploadProofData"
  107. multiple
  108. :before-upload="uploadProofFile"
  109. :on-success="handleProofSuccess"
  110. :on-preview="onPreviewFile">
  111. <el-button type="primary">上传</el-button>
  112. </el-upload>
  113. <template #footer>
  114. <el-button @click="openProofFile = false" size="large">取 消</el-button>
  115. <el-button type="primary" @click="submitProofFile()" size="large" v-preReClick>确 定</el-button>
  116. </template>
  117. </el-dialog>
  118. <el-dialog title="选择合同" v-if="openOrder" v-model="openOrder" width="90%">
  119. <SelectOrder :selectStatus="true" :departmentId="formData.data.departmentId" @selectOrder="selectOrder"></SelectOrder>
  120. <template #footer>
  121. <el-button @click="openOrder = false" size="large">关 闭</el-button>
  122. </template>
  123. </el-dialog>
  124. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="94%" class="print">
  125. <el-tabs v-model="tabsCard" type="card">
  126. <el-tab-pane v-for="(item, index) in cardList" :key="index" :label="item.dictValue" :name="item.dictKey"> </el-tab-pane>
  127. </el-tabs>
  128. <div style="padding: 0 10px">
  129. <el-tabs v-model="activeName">
  130. <el-tab-pane label="SKU对账单" name="sku">
  131. <PrintSKU :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintSKU>
  132. </el-tab-pane>
  133. <el-tab-pane label="BOM对账单" name="bom">
  134. <PrintBOM :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintBOM>
  135. </el-tab-pane>
  136. <el-tab-pane label="订单对账单" name="order">
  137. <PrintOrder :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="clickCancel"></PrintOrder>
  138. </el-tab-pane>
  139. </el-tabs>
  140. </div>
  141. </el-dialog>
  142. <el-dialog title="Excel文件" v-if="openFileList" v-model="openFileList" width="60%">
  143. <ExcelFile></ExcelFile>
  144. <template #footer>
  145. <el-button @click="openFileList = false" size="large">关 闭</el-button>
  146. </template>
  147. </el-dialog>
  148. </div>
  149. </template>
  150. <script setup>
  151. import byTable from "/src/components/byTable/index";
  152. import byForm from "/src/components/byForm/index";
  153. import { ElMessage, ElMessageBox } from "element-plus";
  154. import SelectOrder from "/src/views/group/order/management/index";
  155. import PrintSKU from "/src/views/group/finance/check-bill/printSKU.vue";
  156. import PrintBOM from "/src/views/group/finance/check-bill/printBOM.vue";
  157. import PrintOrder from "/src/views/group/finance/check-bill/printOrder.vue";
  158. import { copyText } from "vue3-clipboard";
  159. import ExcelFile from "/src/views/group/finance/check-bill/ExcelFile.vue";
  160. const { proxy } = getCurrentInstance();
  161. const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
  162. const sourceList = ref({
  163. data: [],
  164. pagination: {
  165. total: 0,
  166. pageNum: 1,
  167. pageSize: 10,
  168. code: "",
  169. departmentId: "",
  170. beginTime: "",
  171. endTime: "",
  172. },
  173. });
  174. const loading = ref(false);
  175. const searchConfig = computed(() => {
  176. return [
  177. {
  178. type: "input",
  179. prop: "code",
  180. label: "对账单号",
  181. },
  182. {
  183. type: "select",
  184. prop: "departmentId",
  185. data: departmentList.value,
  186. label: "事业部",
  187. },
  188. {
  189. type: "date",
  190. propList: ["beginTime", "endTime"],
  191. label: "对账日期",
  192. },
  193. ];
  194. });
  195. const config = computed(() => {
  196. return [
  197. {
  198. attrs: {
  199. label: "对账单号",
  200. prop: "code",
  201. 'min-width': 200,
  202. },
  203. },
  204. {
  205. attrs: {
  206. label: "创建时间",
  207. prop: "createTime",
  208. width: 160,
  209. },
  210. },
  211. {
  212. attrs: {
  213. label: "客户",
  214. prop: "departmentName",
  215. width:200
  216. },
  217. },
  218. {
  219. attrs: {
  220. label: "对账金额",
  221. prop: "amount",
  222. align: "right",
  223. width: 180,
  224. },
  225. },
  226. {
  227. attrs: {
  228. label: "合同数量",
  229. prop: "orderNum",
  230. width: 100,
  231. },
  232. },
  233. {
  234. attrs: {
  235. label: "对账时间",
  236. prop: "timePeriod",
  237. align: "center",
  238. width: 180,
  239. },
  240. },
  241. {
  242. attrs: {
  243. label: "对账单",
  244. slot: "receiptFileList",
  245. align: "center",
  246. width: 120,
  247. },
  248. },
  249. {
  250. attrs: {
  251. label: "转账凭证",
  252. slot: "proofFileList",
  253. align: "center",
  254. width: 120,
  255. },
  256. },
  257. {
  258. attrs: {
  259. label: "操作",
  260. width: 300,
  261. align: "center",
  262. fixed: "right",
  263. btnNum: 6,
  264. },
  265. renderHTML(row) {
  266. return [
  267. {
  268. attrs: {
  269. label: "复制单号",
  270. type: "primary",
  271. text: true,
  272. },
  273. el: "button",
  274. click() {
  275. clickCopyWLNCode(row);
  276. },
  277. },
  278. {
  279. attrs: {
  280. label: "导出",
  281. type: "primary",
  282. text: true,
  283. },
  284. el: "button",
  285. click() {
  286. deriveExcel(row);
  287. },
  288. },
  289. {
  290. attrs: {
  291. label: "打印",
  292. type: "primary",
  293. text: true,
  294. },
  295. el: "button",
  296. click() {
  297. clickPrint(row);
  298. },
  299. },
  300. {
  301. attrs: {
  302. label: "编辑",
  303. type: "primary",
  304. text: true,
  305. },
  306. el: "button",
  307. click() {
  308. clickUpdate(row);
  309. },
  310. },
  311. {
  312. attrs: {
  313. label: "删除",
  314. type: "danger",
  315. text: true,
  316. },
  317. el: "button",
  318. click() {
  319. clickDelete(row);
  320. },
  321. },
  322. ];
  323. },
  324. },
  325. ];
  326. });
  327. const getDemandData = () => {
  328. proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  329. if (res.rows && res.rows.length > 0) {
  330. departmentList.value = departmentList.value.concat(
  331. res.rows.map((item) => {
  332. return {
  333. dictKey: item.id,
  334. dictValue: item.name,
  335. };
  336. })
  337. );
  338. }
  339. });
  340. };
  341. getDemandData();
  342. const getList = async (req, status) => {
  343. if (status) {
  344. sourceList.value.pagination = {
  345. pageNum: sourceList.value.pagination.pageNum,
  346. pageSize: sourceList.value.pagination.pageSize,
  347. };
  348. } else {
  349. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  350. }
  351. loading.value = true;
  352. proxy.post("/statementOfAccount/page", sourceList.value.pagination).then((res) => {
  353. sourceList.value.data = res.rows;
  354. sourceList.value.pagination.total = res.total;
  355. setTimeout(() => {
  356. loading.value = false;
  357. }, 200);
  358. });
  359. };
  360. getList();
  361. const clickReset = () => {
  362. getList("", true);
  363. };
  364. const modalType = ref("add");
  365. const openDialog = ref(false);
  366. const formOption = reactive({
  367. inline: true,
  368. labelWidth: "120px",
  369. itemWidth: 100,
  370. rules: [],
  371. labelPosition: "right",
  372. });
  373. const formData = reactive({
  374. data: {},
  375. });
  376. const formConfig = computed(() => {
  377. return [
  378. {
  379. type: "title",
  380. title: "对账合同",
  381. label: "",
  382. },
  383. {
  384. type: "slot",
  385. slotName: "orderIdList",
  386. label: "",
  387. },
  388. ];
  389. });
  390. const clickModal = () => {
  391. modalType.value = "add";
  392. formData.data = {
  393. departmentId: "",
  394. amount: "",
  395. orderIdList: [],
  396. orderList: [],
  397. };
  398. openDialog.value = true;
  399. };
  400. const changeDepartment = () => {
  401. formData.data.orderList = [];
  402. };
  403. const openOrder = ref(false);
  404. const clickAddOrder = () => {
  405. if (formData.data.departmentId) {
  406. openOrder.value = true;
  407. } else {
  408. return ElMessage("请先选择事业部");
  409. }
  410. };
  411. const selectOrder = (row) => {
  412. if (formData.data.orderList && formData.data.orderList.length > 0) {
  413. let list = formData.data.orderList.filter((item) => item.orderId === row.id);
  414. if (list && list.length > 0) {
  415. return ElMessage("该订单已添加");
  416. }
  417. } else {
  418. formData.data.orderList = [];
  419. }
  420. formData.data.orderList.push({
  421. orderId: row.id,
  422. departmentName: row.departmentName,
  423. orderCode: row.code,
  424. totalAmount: row.totalAmount,
  425. productTotalAmount: row.productTotalAmount,
  426. customProcessingFee: row.customProcessingFee,
  427. lssueFee: row.lssueFee,
  428. deliveryMaterialsFee: row.deliveryMaterialsFee,
  429. packingLabor: row.packingLabor,
  430. managementFee: row.managementFee,
  431. outerBoxPackingFee: row.outerBoxPackingFee,
  432. packagingMaterialCost: row.packagingMaterialCost,
  433. });
  434. ElMessage({ message: "添加成功", type: "success" });
  435. };
  436. const clickOrderDelete = (index) => {
  437. formData.data.orderList.splice(index, 1);
  438. };
  439. const submitForm = () => {
  440. if (formData.data.orderList && formData.data.orderList.length > 0) {
  441. let amount = 0;
  442. for (let i = 0; i < formData.data.orderList.length; i++) {
  443. amount = Number(Math.round((amount + formData.data.orderList[i].totalAmount) * 100) / 100);
  444. }
  445. let orderIdList = formData.data.orderList.map((item) => item.orderId);
  446. proxy
  447. .post("/statementOfAccount/" + modalType.value, {
  448. id: formData.data.id,
  449. departmentId: formData.data.departmentId,
  450. amount: amount,
  451. orderIdList: orderIdList,
  452. })
  453. .then(() => {
  454. ElMessage({
  455. message: modalType.value == "add" ? "添加成功" : "编辑成功",
  456. type: "success",
  457. });
  458. openDialog.value = false;
  459. getList();
  460. });
  461. } else {
  462. return ElMessage("请先添加订单");
  463. }
  464. };
  465. const clickUpdate = (row) => {
  466. formData.data = {
  467. id: row.id,
  468. };
  469. modalType.value = "edit";
  470. proxy.post("/statementOfAccount/detail", { id: row.id }).then((res) => {
  471. if (res && res.length > 0) {
  472. formData.data.departmentId = res[0].departmentId;
  473. formData.data.orderList = res;
  474. }
  475. openDialog.value = true;
  476. });
  477. };
  478. const clickDelete = (row) => {
  479. ElMessageBox.confirm("你是否确认此操作", "提示", {
  480. confirmButtonText: "确定",
  481. cancelButtonText: "取消",
  482. type: "warning",
  483. })
  484. .then(() => {
  485. proxy.post("/statementOfAccount/delete", { id: row.id }).then(() => {
  486. ElMessage({ message: "删除成功", type: "success" });
  487. getList();
  488. });
  489. })
  490. .catch(() => {});
  491. };
  492. const openReceiptFile = ref(false);
  493. const formReceiptData = reactive({
  494. data: {
  495. id: "",
  496. fileList: [],
  497. },
  498. });
  499. const fileList = ref([]);
  500. const clickReceiptFile = (row) => {
  501. formReceiptData.data = {
  502. id: row.id,
  503. fileList: [],
  504. };
  505. if (row.receiptFileList && row.receiptFileList.length > 0) {
  506. fileList.value = proxy.deepClone(
  507. row.receiptFileList.map((item) => {
  508. return {
  509. raw: item,
  510. name: item.fileName,
  511. url: item.fileUrl,
  512. };
  513. })
  514. );
  515. } else {
  516. fileList.value = [];
  517. }
  518. openReceiptFile.value = true;
  519. };
  520. const uploadReceiptData = ref({});
  521. const uploadReceiptFile = async (file) => {
  522. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  523. uploadReceiptData.value = res.uploadBody;
  524. file.id = res.id;
  525. file.fileName = res.fileName;
  526. file.fileUrl = res.fileUrl;
  527. file.uploadState = true;
  528. return true;
  529. };
  530. const handleReceiptSuccess = (any, UploadFile) => {
  531. UploadFile.raw.uploadState = false;
  532. };
  533. const onPreviewFile = (file) => {
  534. window.open(file.raw.fileUrl, "_blank");
  535. };
  536. const submitReceiptFile = () => {
  537. if (fileList.value && fileList.value.length > 0) {
  538. for (let i = 0; i < fileList.value.length; i++) {
  539. if (fileList.value[i].raw.uploadState) {
  540. return ElMessage("文件上传中,请稍后提交");
  541. }
  542. }
  543. formReceiptData.data.fileList = fileList.value.map((item) => {
  544. return {
  545. id: item.raw.id,
  546. fileName: item.raw.fileName,
  547. fileUrl: item.raw.fileUrl,
  548. };
  549. });
  550. } else {
  551. formReceiptData.data.fileList = [];
  552. }
  553. proxy.post("/statementOfAccount/editReceiptFile", formReceiptData.data).then(() => {
  554. openReceiptFile.value = false;
  555. getList();
  556. });
  557. };
  558. const openProofFile = ref(false);
  559. const formProofData = reactive({
  560. data: {
  561. id: "",
  562. fileList: [],
  563. },
  564. });
  565. const clickProofFile = (row) => {
  566. formProofData.data = {
  567. id: row.id,
  568. fileList: [],
  569. };
  570. if (row.proofFileList && row.proofFileList.length > 0) {
  571. fileList.value = proxy.deepClone(
  572. row.proofFileList.map((item) => {
  573. return {
  574. raw: item,
  575. name: item.fileName,
  576. url: item.fileUrl,
  577. };
  578. })
  579. );
  580. } else {
  581. fileList.value = [];
  582. }
  583. openProofFile.value = true;
  584. };
  585. const uploadProofData = ref({});
  586. const uploadProofFile = async (file) => {
  587. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  588. uploadProofData.value = res.uploadBody;
  589. file.id = res.id;
  590. file.fileName = res.fileName;
  591. file.fileUrl = res.fileUrl;
  592. file.uploadState = true;
  593. return true;
  594. };
  595. const handleProofSuccess = (any, UploadFile) => {
  596. UploadFile.raw.uploadState = false;
  597. };
  598. const submitProofFile = () => {
  599. if (fileList.value && fileList.value.length > 0) {
  600. for (let i = 0; i < fileList.value.length; i++) {
  601. if (fileList.value[i].raw.uploadState) {
  602. return ElMessage("文件上传中,请稍后提交");
  603. }
  604. }
  605. formProofData.data.fileList = fileList.value.map((item) => {
  606. return {
  607. id: item.raw.id,
  608. fileName: item.raw.fileName,
  609. fileUrl: item.raw.fileUrl,
  610. };
  611. });
  612. } else {
  613. formProofData.data.fileList = [];
  614. }
  615. proxy.post("/statementOfAccount/editProofFile", formProofData.data).then(() => {
  616. openProofFile.value = false;
  617. getList();
  618. });
  619. };
  620. const openPrint = ref(false);
  621. const rowData = ref({});
  622. const cardList = ref([
  623. {
  624. dictKey: 1,
  625. dictValue: "万里牛订单",
  626. },
  627. {
  628. dictKey: 2,
  629. dictValue: "采购订单",
  630. },
  631. {
  632. dictKey: 3,
  633. dictValue: "委外订单",
  634. },
  635. {
  636. dictKey: 4,
  637. dictValue: "售后订单",
  638. },
  639. {
  640. dictKey: 5,
  641. dictValue: "无理由订单",
  642. },
  643. ]);
  644. const tabsCard = ref(1);
  645. const activeName = ref("sku");
  646. const clickPrint = (row) => {
  647. tabsCard.value = 1;
  648. activeName.value = "sku";
  649. rowData.value = row;
  650. openPrint.value = true;
  651. proxy.post("/statementOfAccount/getOrderClassifyTotalCount", [row.id]).then((res) => {
  652. cardList.value = [
  653. {
  654. dictKey: 1,
  655. dictValue: "万里牛订单(" + res.wlnOrderCount + ")",
  656. },
  657. {
  658. dictKey: 2,
  659. dictValue: "采购订单(" + res.purchaseOrderCount + ")",
  660. },
  661. {
  662. dictKey: 3,
  663. dictValue: "委外订单(" + res.outsourceOrderCount + ")",
  664. },
  665. {
  666. dictKey: 4,
  667. dictValue: "售后订单(" + res.afterSaleOrderCount + ")",
  668. },
  669. {
  670. dictKey: 5,
  671. dictValue: "无理由订单(" + res.noReasonOrderCount + ")",
  672. },
  673. ];
  674. });
  675. };
  676. const clickCopyWLNCode = (row) => {
  677. ElMessage("复制数据中,请稍后");
  678. proxy.post("/statementOfAccount/getOrderWlnCodeStr", [row.id]).then((res) => {
  679. copyText(res, undefined, (error) => {
  680. if (error) {
  681. ElMessage.error(`复制失败: ${error} !`);
  682. } else {
  683. ElMessage.success(`复制成功!`);
  684. }
  685. });
  686. });
  687. };
  688. const openFileList = ref(false);
  689. const clickCancel = (status) => {
  690. openPrint.value = false;
  691. if (status) {
  692. openFileList.value = true;
  693. }
  694. };
  695. const clickExcelFile = () => {
  696. openFileList.value = true;
  697. };
  698. const clickManualSynchronization = () => {
  699. loading.value = true;
  700. proxy.post("/orderHandle/createStatementOfAccount", {}).then(
  701. () => {
  702. loading.value = false;
  703. ElMessage({ message: "同步完成", type: "success" });
  704. getList();
  705. },
  706. (err) => {
  707. console.log(err);
  708. loading.value = false;
  709. }
  710. );
  711. };
  712. const deriveExcel = (row) => {
  713. ElMessageBox.confirm("你是否确认此操作", "提示", {
  714. confirmButtonText: "确定",
  715. cancelButtonText: "取消",
  716. type: "warning",
  717. })
  718. .then(() => {
  719. proxy.postFile("/statementOfAccountMerge/exportDeliveryOfGoodsExcel", [row.id]).then((res) => {
  720. proxy.downloadFile(res, "货物交接单-" + row.code + ".xlsx");
  721. });
  722. })
  723. .catch(() => {});
  724. };
  725. </script>
  726. <style lang="scss" scoped>
  727. :deep(.el-dialog) {
  728. margin-top: 10px !important;
  729. margin-bottom: 10px !important;
  730. }
  731. :deep(.print) {
  732. .el-dialog__body {
  733. padding: 10px 20px !important;
  734. .el-tabs__header {
  735. margin: 0 !important;
  736. }
  737. }
  738. }
  739. </style>