货物组批次-查看-导出

This commit is contained in:
wuteng 2025-08-12 19:06:34 +08:00
parent b666a66a95
commit 3c513f2c91

View File

@ -228,7 +228,7 @@
</el-col>
<el-col :span="1.5" v-if="this.form.id!=null">
<el-button style="margin-right: 5px;" type="warning" plain icon="el-icon-download" size="mini"
@click="handleDownBatchDtl">导出</el-button>
@click="handleExport">导出</el-button>
</el-col>
</el-row>
</div>
@ -1307,6 +1307,43 @@ export default {
dateTimeChange(value){
this.dateTimeRange=value;
},
/** 导出按钮操作 */
handleExport() {
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
listEmisTmsSiteBatchDtl({batchNo: this.form.batchNo}).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows.map(item=>{
return {
"billCode":item.billCode,
...item.waybillDetail,
}
})
console.log(curList)
setTimeout(()=>{
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['运单号','寄件网点','寄件国家','目的国家','线路','产品类型','寄件日期','预计到达时间','总件数','实际重量','总体积','体积重量','结算重量','收件人','收件公司','报关方式','清关方式','取件方式','付款方式','运费','寄件人','寄件公司','录单备注'];
const filterVal = ['billCode','sendSiteName','sendCountryName','receiveCountryName','transLineTypeName','productTypeName','sendDate','estimateDate','parcelQty','billWeight','totalVolume','volumeWeight','settlementWeight','receiveName','receiveCompany','customsEclaration','customsClear','pickupMethod','paymentType','freight','sendName','sendCompany','remark'];
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '批次明细导出',
autoWidth: true
})
loadingInstance.close()
})
},500 )
}
});
},
}
};
</script>