From 1c6ad4be1dcfd9813123aa2f7c85bd0e37f23f8c Mon Sep 17 00:00:00 2001 From: linfso Date: Sat, 14 Dec 2024 17:26:48 +0800 Subject: [PATCH] md --- .../panel/BigBatchEditForm.vue | 257 +++++++++++++++--- .../panel/BigBatchListPanel.vue | 179 ++++++++++-- 2 files changed, 374 insertions(+), 62 deletions(-) diff --git a/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue b/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue index d530411e..bd024ee5 100644 --- a/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue +++ b/src/views/emis/emisTmsSiteBatch/panel/BigBatchEditForm.vue @@ -19,6 +19,7 @@ + @@ -63,9 +64,9 @@ - + 导出批次明细 + >导出 @@ -855,7 +857,7 @@ export default { return; } - this.coData.etd = parseTime(this.coData.carTime, '{y}-{m}-{d} {h}:{i}:{s}'); + // this.coData.etd = parseTime(this.coData.carTime, '{y}-{m}-{d} {h}:{i}:{s}'); // 新增 if(this.coPackType == "add") @@ -1297,53 +1299,230 @@ export default { this.$modal.msgSuccess("删除成功"); }).catch(() => {}); }, - /** 导出按钮操作 */ - handleExport() { - // this.download('emis/emisTmsPack/export', { - // ...this.queryParams - // }, `emisTmsPack_${new Date().getTime()}.xlsx`) - const loadingInstance = this.$loading({ - text: '正在导出...' - }) - var qParam = {...this.queryParams}; - qParam.pageNum=1; - qParam.pageSize=5000; - listEmisTmsSiteBatch(this.addDateRange(qParam, this.dateTimeRange)).then(response => { - this.downloadLoading = false - if (response.code === 200) { - const curList = response.rows - import('@/vendor/Export2Excel').then(excel => { - const tHeader = ['id','组批次号','组批次名称','组批次时间','目的国家','目的国家名称','是否可拆','发出网点','下一网点','下一站','总件数','总运单数','总体积','总重量','组批次状态','扩展数据','操作员','ext1','ext2','ext3','ext4','备注','租户ID','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','创建网点','更新网点',]; - const filterVal = ['id','packNo','packName','packDate','destCountry','destCountryName','blUnpack','sendSiteCode','nextSiteCode','nextStation','totalParcelQty','totalWaybillQty','totalVolume','totalWeight','packStatus','extData','opMan','ext1','ext2','ext3','ext4','remark','tenantId','delFlag','createBy','createTime','updateBy','updateTime','createSite','updateSite',]; - const data = this.formatJson(filterVal, curList, response.rows) - excel.export_json_to_excel({ - header: tHeader, - data, - filename: 'TMS组批次', - autoWidth: true - }) - loadingInstance.close() - }) - } - }); + /** 导出按钮操作 */ + handleDownBatchDtl() { + const loadingInstance = this.$loading({ + text: '正在导出...' + }) + + let qExportParam={ + pageNum:1, + pageSize:20000, + batchNo: this.coData.batchNo + }; + + listEmisTmsSiteBatchDtl(qExportParam).then(response => { + if (response.code === 200) { + this.exportData(response.rows,loadingInstance); + } + }); + }, + exportData(selData,loadingInstance){ + const curList =selData + import('@/vendor/Export2Excel').then(excel => { + const exportParam=this.$refs.refTable.getExportParam(); + const tHeader = exportParam.header; + const filterVal = exportParam.filter; + console.log("===>filterVal===>",filterVal); + + const data = this.formatJson(filterVal, curList, selData) + excel.export_json_to_excel({ + header: tHeader, + data, + filename: '批次明细导出', + autoWidth: true + }) + loadingInstance.close() + }) }, formatJson(filterVal, jsonData, resData) { let index = 0 return jsonData.map(v => filterVal.map(j => { + + // console.log("===>1111===>",v); + if (j === 'index') { return ++index } - if (j === 'status') { - var statusStr='xxx' - if(v[j] == 10){ - statusStr='xxx' + if (j === 'kjlx') { + return v['waybillDetail']['sendSiteName']+'--'+v['waybillDetail']['dispatchUnderlingSiteName']; + } + if (j === 'fjr') { + return v['sendName']+'--'+v['receiveName']; + } + + if (j === 'receiveCountryName') { + return v['waybillDetail']['receiveCountryName']; + } + + if (j === 'sendCountryName') { + return v['waybillDetail']['sendCountryName']; + } + + + if (j === 'estimateDate') { + return v['waybillDetail']['estimateDate']; + } + + if (j === 'sendSiteName') { + return v['waybillDetail']['sendSiteName']; + } + + if (j === 'sendName') { + return v['waybillDetail']['sendName']; + } + + if (j === 'receiveName') { + return v['waybillDetail']['receiveName']; + } + + if (j === 'sendDate') { + return v['waybillDetail']['sendDate']; + } + + if (j === 'sendCompany') { + return v['waybillDetail']['sendCompany']; + } + + if (j === 'receiveCompany') { + return v['waybillDetail']['receiveCompany']; + } + + if (j === 'transLineTypeName') { + return v['waybillDetail']['transLineTypeName']; + } + + if (j === 'productTypeName') { + return v['waybillDetail']['productTypeName']; + } + + + if (j === 'sendName') { + return v['waybillDetail']['sendName']; + } + + if (j === 'parcelQty') { + return v['waybillDetail']['parcelQty']; + } + + if (j === 'billWeight') { + return v['waybillDetail']['billWeight']; + } + + if (j === 'volumeWeight') { + return v['waybillDetail']['volumeWeight']; + } + + if (j === 'totalVolume') { + return v['waybillDetail']['totalVolume']; + } + + if (j === 'settlementWeight') { + return v['waybillDetail']['settlementWeight']; + } + + if (j === 'freight') { + return v['waybillDetail']['freight']; + } + + if (j === 'realFee') { + return v['waybillDetail']['realFee']; + } + + if (j === 'remark') { + return v['waybillDetail']['remark']; + } + + if (j === 'feeRemark') { + return v['waybillDetail']['feeRemark']; + } + + if (j === 'salesmen') { + return v['waybillDetail']['salesmen']; + } + + if (j === 'payee') { + return v['waybillDetail']['payee']; + } + + if (j === 'payee') { + return v['waybillDetail']['payee']; + } + + if (j === 'problemTypeName') { + return v['waybillDetail']['problemTypeName']; + } + + if (j === 'problemCause') { + return v['waybillDetail']['problemCause']; + } + + if (j === 'sendMobile') { + return ""; + } + + if (j === 'calcFeeType') { + return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['waybillDetail']['calcFeeType']); + } + + if (j === 'waybillDetail.paymentStatus') { + return this.selectDictLabel(this.dict.type.emis_payment_status,v['waybillDetail']['paymentStatus']); + } + + if (j === 'pickupMethod') { + return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v['waybillDetail']['pickupMethod']); + } + if (j === 'customsEclaration') { + return this.selectDictLabel(this.dict.type.emis_declare_mode,v['waybillDetail']['customsEclaration']); + } + if (j === 'customsClear') { + return this.selectDictLabel(this.dict.type.emis_customs_clear,v['waybillDetail']['customsClear']); + } + if (j === 'packType') { + return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['waybillDetail']['packType']); + } + + if (j === 'dispatchMethod') { + if(v['waybillDetail']['dispatchMethod'] == 1){ + return '派送'; + }else{ + return '自提'; } - return statusStr; + } + + + + + + if (j === 'blMessage') { + if(v['waybillDetail']['blMessage'] == 1){ + return '发送'; + }else{ + return '不发送'; + } + } + if (j === 'blAcceptMessage') { + if(v['waybillDetail']['blAcceptMessage'] == 1){ + return '发送'; + }else{ + return '不发送'; + } + } + if (j === 'blSign') { + if(v['waybillDetail']['blSign'] == 1){ + return '已签收'; + }else{ + return '未签收'; + } + } + if (j === 'paymentType') { + return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail']['paymentType']); } return v[j] })) }, + /** 列索引函数 */ getIndex($index) { return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1 diff --git a/src/views/emis/emisTmsSiteBatch/panel/BigBatchListPanel.vue b/src/views/emis/emisTmsSiteBatch/panel/BigBatchListPanel.vue index 58f35ccf..9ff8d6ac 100644 --- a/src/views/emis/emisTmsSiteBatch/panel/BigBatchListPanel.vue +++ b/src/views/emis/emisTmsSiteBatch/panel/BigBatchListPanel.vue @@ -150,6 +150,7 @@