Showing
3 changed files
with
133 additions
and
20 deletions
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | +const baseUrl = process.env.VUE_APP_BASE_API; //接口地址 | ||
| 2 | 3 | ||
| 3 | //获取自定义设置数据 | 4 | //获取自定义设置数据 |
| 4 | /** | 5 | /** |
| ... | @@ -59,7 +60,7 @@ export function getOrderReceipt(data) { | ... | @@ -59,7 +60,7 @@ export function getOrderReceipt(data) { |
| 59 | }) | 60 | }) |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | -//查询物流单回执 | 63 | +//查看离境回执 |
| 63 | /** | 64 | /** |
| 64 | * @param declareId * id | 65 | * @param declareId * id |
| 65 | */ | 66 | */ |
| ... | @@ -95,5 +96,49 @@ export function getTotalReceipt(data) { | ... | @@ -95,5 +96,49 @@ export function getTotalReceipt(data) { |
| 95 | params: data, | 96 | params: data, |
| 96 | }) | 97 | }) |
| 97 | } | 98 | } |
| 99 | +/** | ||
| 100 | + * 查看物流回执 | ||
| 101 | + * @param {*} data | ||
| 102 | + * @returns | ||
| 103 | + */ | ||
| 104 | +export function getWayBillReceipt(data) { | ||
| 105 | + return request({ | ||
| 106 | + url: '/bus-customer/declareData/wayBillReceipt', | ||
| 107 | + method: 'get', | ||
| 108 | + params: data, | ||
| 109 | + }) | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +/** | ||
| 113 | + * 查看物流回执 | ||
| 114 | + * @param {*} data | ||
| 115 | + * @returns | ||
| 116 | + */ | ||
| 117 | +export function exportDeclareData(data) { | ||
| 118 | + | ||
| 119 | + return new Promise((resolve, reject) => { | ||
| 120 | + var url = baseUrl + '/bus-customer/declareData/exportDeclareData'; | ||
| 121 | + request({ | ||
| 122 | + url: url, | ||
| 123 | + method: 'post', | ||
| 124 | + responseType: 'blob', // 确保响应类型为 blob | ||
| 125 | + data: data.declareIds, | ||
| 126 | + }) | ||
| 127 | + .then((res) => { | ||
| 128 | + const aLink = document.createElement("a"); | ||
| 129 | + aLink.href = URL.createObjectURL(res); | ||
| 130 | + aLink.setAttribute("download", "申报数据.xlsx"); // 设置下载文件名称 | ||
| 131 | + document.body.appendChild(aLink); | ||
| 132 | + aLink.click(); | ||
| 133 | + document.body.removeChild(aLink); | ||
| 134 | + resolve(res); | ||
| 135 | + | ||
| 136 | + }) | ||
| 137 | + .catch((err) => { | ||
| 138 | + reject(err); | ||
| 139 | + }); | ||
| 140 | + }); | ||
| 141 | +} | ||
| 142 | + | ||
| 98 | 143 | ||
| 99 | 144 | ... | ... |
| ... | @@ -81,12 +81,6 @@ export function delCertificate(id, certificate) { | ... | @@ -81,12 +81,6 @@ export function delCertificate(id, certificate) { |
| 81 | //下载证书 | 81 | //下载证书 |
| 82 | export function downloadCertificate(id,filename) { | 82 | export function downloadCertificate(id,filename) { |
| 83 | 83 | ||
| 84 | - // return request({ | ||
| 85 | - // url: '/bus-customer/customers/getCertificate/' + id, | ||
| 86 | - // method: 'get', | ||
| 87 | - // responseType: 'blob', // 确保响应类型为 blob | ||
| 88 | - // // data: formData, | ||
| 89 | - // }); | ||
| 90 | console.log("fileName"+filename); | 84 | console.log("fileName"+filename); |
| 91 | return new Promise((resolve, reject) => { | 85 | return new Promise((resolve, reject) => { |
| 92 | // axios({ | 86 | // axios({ |
| ... | @@ -102,7 +96,6 @@ export function downloadCertificate(id,filename) { | ... | @@ -102,7 +96,6 @@ export function downloadCertificate(id,filename) { |
| 102 | params: id, | 96 | params: id, |
| 103 | }) | 97 | }) |
| 104 | .then((res) => { | 98 | .then((res) => { |
| 105 | - console.log("aaaaaa"+res); | ||
| 106 | const aLink = document.createElement("a"); | 99 | const aLink = document.createElement("a"); |
| 107 | aLink.href = URL.createObjectURL(res); | 100 | aLink.href = URL.createObjectURL(res); |
| 108 | aLink.setAttribute("download", filename); // 设置下载文件名称 | 101 | aLink.setAttribute("download", filename); // 设置下载文件名称 | ... | ... |
| ... | @@ -175,6 +175,7 @@ | ... | @@ -175,6 +175,7 @@ |
| 175 | class="entrySaveButton" | 175 | class="entrySaveButton" |
| 176 | size="small" | 176 | size="small" |
| 177 | icon="el-icon-download" | 177 | icon="el-icon-download" |
| 178 | + v-loading="loadings.exportDeclareLoading" | ||
| 178 | @click="downloadData" | 179 | @click="downloadData" |
| 179 | > | 180 | > |
| 180 | 导出 | 181 | 导出 |
| ... | @@ -225,10 +226,10 @@ | ... | @@ -225,10 +226,10 @@ |
| 225 | </div> | 226 | </div> |
| 226 | </TablePopover> | 227 | </TablePopover> |
| 227 | </template> | 228 | </template> |
| 228 | - <template v-slot:logisticsReceiptStatus="scope"> | 229 | + <template v-slot:wayBillReceipt="scope"> |
| 229 | <TablePopover | 230 | <TablePopover |
| 230 | - ref="logisticsReceiptStatusPopover" | 231 | + ref="wayBillReceiptPopover" |
| 231 | - dataKey="logisticsReceiptStatus" | 232 | + dataKey="wayBillReceipt" |
| 232 | idKey="declareId" | 233 | idKey="declareId" |
| 233 | :parentDom="$refs.entryTable" | 234 | :parentDom="$refs.entryTable" |
| 234 | :receiptDataHead="receiptDataHead" | 235 | :receiptDataHead="receiptDataHead" |
| ... | @@ -242,7 +243,7 @@ | ... | @@ -242,7 +243,7 @@ |
| 242 | >{{ scope.row.orderno }} | 243 | >{{ scope.row.orderno }} |
| 243 | </div> | 244 | </div> |
| 244 | <div slot="buttonLabel"> | 245 | <div slot="buttonLabel"> |
| 245 | - {{ scope.row.logisticsReceiptStatus }} | 246 | + {{ scope.row.wayBillReceipt }} |
| 246 | </div> | 247 | </div> |
| 247 | </TablePopover> | 248 | </TablePopover> |
| 248 | </template> | 249 | </template> |
| ... | @@ -288,6 +289,27 @@ | ... | @@ -288,6 +289,27 @@ |
| 288 | </div> | 289 | </div> |
| 289 | </TablePopover> | 290 | </TablePopover> |
| 290 | </template> | 291 | </template> |
| 292 | + <template v-slot:logisticsReceiptStatus="scope"> | ||
| 293 | + <TablePopover | ||
| 294 | + ref="logisticsReceiptStatusPopover" | ||
| 295 | + dataKey="logisticsReceiptStatus" | ||
| 296 | + idKey="declareId" | ||
| 297 | + :parentDom="$refs.entryTable" | ||
| 298 | + :receiptDataHead="receiptDataHead" | ||
| 299 | + :rowData="scope.row" | ||
| 300 | + :tableData="tableData" | ||
| 301 | + @popoverChange="popoverChange" | ||
| 302 | + @popoverClose="popoverClose" | ||
| 303 | + > | ||
| 304 | + <div slot="title"> | ||
| 305 | + <span style="font-weight: 700; color: #515a6e">订单编号:</span | ||
| 306 | + >{{ scope.row.orderno }} | ||
| 307 | + </div> | ||
| 308 | + <div slot="buttonLabel"> | ||
| 309 | + {{ scope.row.logisticsReceiptStatus }} | ||
| 310 | + </div> | ||
| 311 | + </TablePopover> | ||
| 312 | + </template> | ||
| 291 | </Table> | 313 | </Table> |
| 292 | <DialogVue | 314 | <DialogVue |
| 293 | :outerVisible="outerVisible" | 315 | :outerVisible="outerVisible" |
| ... | @@ -302,9 +324,11 @@ import { | ... | @@ -302,9 +324,11 @@ import { |
| 302 | searchDeclareData, | 324 | searchDeclareData, |
| 303 | declareDataUpload, | 325 | declareDataUpload, |
| 304 | getOrderReceipt, | 326 | getOrderReceipt, |
| 305 | - getLogisticsReceipt, | 327 | + getWayBillReceipt, |
| 306 | getListReceipt, | 328 | getListReceipt, |
| 307 | getTotalReceipt, | 329 | getTotalReceipt, |
| 330 | + getLogisticsReceipt, | ||
| 331 | + exportDeclareData | ||
| 308 | } from "@/api/declareData-api.js"; | 332 | } from "@/api/declareData-api.js"; |
| 309 | import DialogVue from "./dialog.vue"; | 333 | import DialogVue from "./dialog.vue"; |
| 310 | export default { | 334 | export default { |
| ... | @@ -369,7 +393,7 @@ export default { | ... | @@ -369,7 +393,7 @@ export default { |
| 369 | // }, | 393 | // }, |
| 370 | { | 394 | { |
| 371 | name: "物流单回执", | 395 | name: "物流单回执", |
| 372 | - value: "logisticsReceiptStatus", | 396 | + value: "wayBillReceipt", |
| 373 | width: "", | 397 | width: "", |
| 374 | align: "left", | 398 | align: "left", |
| 375 | slot: true, | 399 | slot: true, |
| ... | @@ -388,6 +412,13 @@ export default { | ... | @@ -388,6 +412,13 @@ export default { |
| 388 | align: "left", | 412 | align: "left", |
| 389 | slot: true, | 413 | slot: true, |
| 390 | }, | 414 | }, |
| 415 | + { | ||
| 416 | + name: "离境回执", | ||
| 417 | + value: "logisticsReceiptStatus", | ||
| 418 | + width: "", | ||
| 419 | + align: "left", | ||
| 420 | + slot: true, | ||
| 421 | + }, | ||
| 391 | ], | 422 | ], |
| 392 | receiptDataHead: [ | 423 | receiptDataHead: [ |
| 393 | { | 424 | { |
| ... | @@ -421,6 +452,7 @@ export default { | ... | @@ -421,6 +452,7 @@ export default { |
| 421 | dwonloadModelLoading: false, | 452 | dwonloadModelLoading: false, |
| 422 | dropDownLoading: false, | 453 | dropDownLoading: false, |
| 423 | logTableLoading: false, | 454 | logTableLoading: false, |
| 455 | + exportDeclareLoading:false, | ||
| 424 | }, | 456 | }, |
| 425 | textareaVisible: {}, | 457 | textareaVisible: {}, |
| 426 | tableMaxheight: null, | 458 | tableMaxheight: null, |
| ... | @@ -466,8 +498,9 @@ export default { | ... | @@ -466,8 +498,9 @@ export default { |
| 466 | item.index = idx; | 498 | item.index = idx; |
| 467 | item.orderReceiptStatusPopoverType = false; | 499 | item.orderReceiptStatusPopoverType = false; |
| 468 | item.listReceiptStatusPopoverType = false; | 500 | item.listReceiptStatusPopoverType = false; |
| 469 | - item.logisticsReceiptStatusPopoverType = false; | 501 | + item.wayBillReceiptPopoverType = false; |
| 470 | item.totalSplitOrderStatusPopoverType = false; | 502 | item.totalSplitOrderStatusPopoverType = false; |
| 503 | + item.logisticsReceiptStatusPopoverType = false; | ||
| 471 | item.popoverData = []; | 504 | item.popoverData = []; |
| 472 | }); | 505 | }); |
| 473 | } else { | 506 | } else { |
| ... | @@ -511,7 +544,33 @@ export default { | ... | @@ -511,7 +544,33 @@ export default { |
| 511 | }); | 544 | }); |
| 512 | }, | 545 | }, |
| 513 | //导出 | 546 | //导出 |
| 514 | - downloadData() {}, | 547 | + downloadData() { |
| 548 | + if (this.selected.length > 0) { | ||
| 549 | + this.loadings.exportDeclareLoading = true; | ||
| 550 | + let obj = { | ||
| 551 | + declareIds: [], | ||
| 552 | + }; | ||
| 553 | + this.selected.forEach((item) => { | ||
| 554 | + obj.declareIds.push(item.declareId); | ||
| 555 | + }); | ||
| 556 | + exportDeclareData(obj).then((res)=>{ | ||
| 557 | + // if (res.code === "200") { | ||
| 558 | + // // this.alertSuccessMsg(res.message); | ||
| 559 | + // } else { | ||
| 560 | + // console.log(res.message); | ||
| 561 | + // this.alertWarningMsg(res.message); | ||
| 562 | + // } | ||
| 563 | + this.loadings.exportDeclareLoading = false; | ||
| 564 | + }).catch((err)=>{ | ||
| 565 | + console.log(err); | ||
| 566 | + this.alertErrorMsg(err); | ||
| 567 | + this.loadings.exportDeclareLoading = false; | ||
| 568 | + }) | ||
| 569 | + }else { | ||
| 570 | + this.alertWarningMsg("请选择需导出的数据!"); | ||
| 571 | + } | ||
| 572 | + | ||
| 573 | + }, | ||
| 515 | //申报 | 574 | //申报 |
| 516 | declareData() { | 575 | declareData() { |
| 517 | if (this.selected.length > 0) { | 576 | if (this.selected.length > 0) { |
| ... | @@ -567,9 +626,10 @@ export default { | ... | @@ -567,9 +626,10 @@ export default { |
| 567 | .finally(() => { | 626 | .finally(() => { |
| 568 | this.$nextTick(() => { | 627 | this.$nextTick(() => { |
| 569 | this.$refs.orderReceiptStatusPopover.tableLoading = false; | 628 | this.$refs.orderReceiptStatusPopover.tableLoading = false; |
| 570 | - this.$refs.logisticsReceiptStatusPopover.tableLoading = false; | 629 | + this.$refs.wayBillReceiptPopover.tableLoading = false; |
| 571 | this.$refs.listReceiptStatusPopover.tableLoading = false; | 630 | this.$refs.listReceiptStatusPopover.tableLoading = false; |
| 572 | this.$refs.totalSplitOrderStatusPopover.tableLoading = false; | 631 | this.$refs.totalSplitOrderStatusPopover.tableLoading = false; |
| 632 | + this.$refs.logisticsReceiptStatusPopover.tableLoading = false; | ||
| 573 | }); | 633 | }); |
| 574 | }); | 634 | }); |
| 575 | }, | 635 | }, |
| ... | @@ -590,8 +650,8 @@ export default { | ... | @@ -590,8 +650,8 @@ export default { |
| 590 | console.log(err); | 650 | console.log(err); |
| 591 | reject(); | 651 | reject(); |
| 592 | }); | 652 | }); |
| 593 | - } else if (type == "logisticsReceiptStatus") { | 653 | + } else if (type == "wayBillReceipt") { |
| 594 | - getLogisticsReceipt(obj) | 654 | + getWayBillReceipt(obj) |
| 595 | .then((res) => { | 655 | .then((res) => { |
| 596 | if (res.code === "200") { | 656 | if (res.code === "200") { |
| 597 | resolve(res.data); | 657 | resolve(res.data); |
| ... | @@ -630,14 +690,29 @@ export default { | ... | @@ -630,14 +690,29 @@ export default { |
| 630 | reject(); | 690 | reject(); |
| 631 | }); | 691 | }); |
| 632 | } | 692 | } |
| 693 | + else if (type == "logisticsReceiptStatus") { | ||
| 694 | + getLogisticsReceipt(obj) | ||
| 695 | + .then((res) => { | ||
| 696 | + if (res.code === "200") { | ||
| 697 | + resolve(res.data); | ||
| 698 | + } else { | ||
| 699 | + reject(); | ||
| 700 | + } | ||
| 701 | + }) | ||
| 702 | + .catch((err) => { | ||
| 703 | + console.log(err); | ||
| 704 | + reject(); | ||
| 705 | + }); | ||
| 706 | + } | ||
| 633 | }); | 707 | }); |
| 634 | }, | 708 | }, |
| 635 | popoverClose(val) { | 709 | popoverClose(val) { |
| 636 | this.tableData.forEach((item) => { | 710 | this.tableData.forEach((item) => { |
| 637 | item.orderReceiptStatusPopoverType = false; | 711 | item.orderReceiptStatusPopoverType = false; |
| 638 | item.listReceiptStatusPopoverType = false; | 712 | item.listReceiptStatusPopoverType = false; |
| 639 | - item.logisticsReceiptStatusPopoverType = false; | 713 | + item.wayBillReceiptPopoverType = false; |
| 640 | item.totalSplitOrderStatusPopoverType = false; | 714 | item.totalSplitOrderStatusPopoverType = false; |
| 715 | + item.logisticsReceiptStatusPopoverType = false; | ||
| 641 | item.popoverData = []; | 716 | item.popoverData = []; |
| 642 | }); | 717 | }); |
| 643 | this.$refs.entryTable.$refs.tables.$refs.bodyWrapper.style.overflowY = | 718 | this.$refs.entryTable.$refs.tables.$refs.bodyWrapper.style.overflowY = | ... | ... |
-
Please register or login to post a comment