From 7d0e8bf1a942728cd699b5d58e08b57bbe6ab48b Mon Sep 17 00:00:00 2001 From: linfso Date: Thu, 21 Nov 2024 17:19:29 +0800 Subject: [PATCH] md --- .../emisSettleBill/BillPaybackBillList.vue | 138 +++++++++++++++++- 1 file changed, 137 insertions(+), 1 deletion(-) diff --git a/src/views/emis/emisSettleBill/BillPaybackBillList.vue b/src/views/emis/emisSettleBill/BillPaybackBillList.vue index 8a6be45b..cc98657a 100644 --- a/src/views/emis/emisSettleBill/BillPaybackBillList.vue +++ b/src/views/emis/emisSettleBill/BillPaybackBillList.vue @@ -5,6 +5,9 @@ v-loading="loading" border stripe size="mini" + + ref="refTable" + storageName="waringEmisSettleBillList_custbill_query_main" :data="emisSettleBillList" :showSearch.sync="showSearch" @@ -18,6 +21,21 @@ :summary-method="getSummaries" > +
+ + + 导出 + + + +
+ @@ -121,7 +139,9 @@ export default { }, components: { }, - dicts: [ + dicts: ['emis_qujian_fangshi','emis_declare_mode','emis_customs_clear', + 'emis_tab_packing_type','emis_tab_dispatch_mode','emis_payment_type', + 'emis_calc_fee_type','emis_print_type','emis_payment_status','emis_waybill_status','emis_tab_dispatch_mode' ], data() { return { @@ -141,6 +161,7 @@ export default { total: 0, // 结算总账单表格数据 emisSettleBillList: [], + selectList: [], currentId:null, openForm: false, @@ -343,6 +364,8 @@ export default { // 多选框选中数据 handleSelectionChange(selection) { + this.selectList=selection; + this.ids = selection.map(item => item.id) this.single = selection.length!==1 this.multiple = !selection.length @@ -367,6 +390,119 @@ export default { this.openForm = false; }, + /** 导出按钮操作 */ + handleExport() { + const loadingInstance = this.$loading({ + text: '正在导出...' + }) + + if(this.selectList&&this.selectList.length>0){ + this.exportData(this.selectList,loadingInstance); + } + else{ + + let qExportParam={...this.queryParams}; + qExportParam.pageNum=1; + qExportParam.pageSize=20000; + + listEmisSettleBill(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; + 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 => { + + if (j === 'index') { + return ++index + } + if (j === 'kjlx') { + return v['sendSiteName']+'--'+v['dispatchUnderlingSiteName']; + } + if (j === 'fjr') { + return v['sendName']+'--'+v['receiveName']; + } + if (j === 'custName') { + let paymentType=v['paymentType']; + if(paymentType==2 || paymentType==4 || paymentType==5 ){ + return v['custName']; + }else{ + return ""; + } + } + + if (j === 'sendMobile') { + return ""; + } + if (j === 'paymentStatus') { + return this.selectDictLabel(this.dict.type.emis_payment_status,v[j]); + } + + if (j === 'pickupMethod') { + return this.selectDictLabel(this.dict.type.emis_qujian_fangshi,v[j]); + } + if (j === 'customsEclaration') { + return this.selectDictLabel(this.dict.type.emis_declare_mode,v[j]); + } + if (j === 'customsClear') { + return this.selectDictLabel(this.dict.type.emis_customs_clear,v[j]); + } + if (j === 'packType') { + return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v[j]); + } + if (j === 'openBillStatus') { + if(v[j] == 0){ + return '未开票'; + } + else if(v[j] == 1){ + return '已开票'; + } + else if(v[j] == 2){ + return '部分开票'; + } + else if(v[j] == 3){ + return '不开票'; + } + else if(v[j] == 4){ + return '已完成'; + } + else{ + return '/'; + } + } + if (j === 'chargeStatus') { + if(v[j] == 0){ + return '未核销'; + }else{ + return '已核销'; + } + } + if (j === 'paymentType') { + return this.selectDictLabel(this.dict.type.emis_payment_type,v[j]); + } + return v[j] + })) + }, + /** 列索引函数 */ getIndex($index) { return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1