导出成本明细

This commit is contained in:
wuteng 2025-12-16 09:39:03 +08:00
parent 31b39decf2
commit 191fc066a7

View File

@ -255,15 +255,17 @@
<script>
import { listEmisTmsCostFee, getEmisTmsCostFee,reCalcSplitCostFee, delEmisTmsCostFee, addEmisTmsCostFee, updateEmisTmsCostFee } from "@/api/emis/emisTmsCostFee";
import { listEmisTmsCostFeeSplit } from "@/api/emis/emisTmsCostFeeSplit";
import EmisTmsCostFeeForm from '@/views/emis/emisTmsCostFee/emisTmsCostFeeForm';
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
import EmisSupplierPicker from '@/views/emis/EmisBaseTools/EmisSupplierPicker';
import EmisTmsSiteBatchPicker from '@/views/emis/EmisBaseTools/EmisTmsSiteBatchPicker';
import { listEmisTmsSiteBatchDtl} from "@/api/emis/emisTmsSiteBatchDtl";
export default {
name: "EmisTmsCostFee",
components: { EmisTmsCostFeeForm ,elDateAdvPicker,EmisSupplierPicker,EmisTmsSiteBatchPicker},
dicts: ['emis_cost_fee_type','emis_supplier_name','emis_cost_split_type','emis_biz_shipping_method','emis_payment_type'],
dicts: ['emis_cost_fee_type','emis_supplier_name','emis_cost_split_type','emis_biz_shipping_method','emis_payment_type','emis_qujian_fangshi','emis_declare_mode','emis_customs_clear','emis_cost_split_type'],
data() {
return {
// 遮罩层
@ -606,62 +608,89 @@ export default {
}))
},
handleDownBatchDtl(batchName){
async handleDownBatchDtl(batchName){
const loadingInstance = this.$loading({
text: '正在导出...'
})
if(this.selectionList&&this.selectionList.length>0){
this.selectionList.forEach(item=>{
})
if(this.selectList&&this.selectList.length>0){
// this.selectList.forEach(item=>{
const batchNo=this.selectList[0].batchNo;
let billCodeList='';
let qExportParam={
pageNum:1,
pageSize:20000,
batchNo: item.batchNo
batchNo: batchNo
};
let batchName=item.batchNo;
listEmisTmsSiteBatchDtl(qExportParam).then(response => {
if (response.code === 200) {
this.exportDataDtl(batchName,response.rows,loadingInstance);
}
});
});
let res= await listEmisTmsSiteBatchDtl(qExportParam);
if (res.code === 200) {
//拼接运单号
billCodeList=res.rows.map(item=>item.billCode).join(',');
}
let qExportParamSplit={
pageNum:1,
pageSize:20000,
batchNo: batchNo,
billCode:billCodeList
};
let resSplit= await listEmisTmsCostFeeSplit(qExportParamSplit);
if (resSplit.code === 200) {
//拼接运单号
this.exportDataDtl(batchNo,resSplit.rows,loadingInstance);
}
}
},
exportDataDtl(batchName,selData,loadingInstance){
exportDataDtl(batchNo,selData,loadingInstance){
const curList =selData
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['运单号','寄件国家','目的国家','线路','产品类型','预计到达时间','总件数','实际重量','总体积','体积重量','结算重量','收件人','收件公司','取件方式','付款方式','运费','寄件人','寄件公司','录单备注','寄件网点','清关方式','报关方式'];
const tHeader = ['运单号','主单号','成本时间','费用类型','费用','分摊类型','分摊重量','供应商','发件地','目的地','运输号','批次号','固定费用','计算总重量','分摊总费用','计算公式','计算备注','备注','账单月份','快件类型','支付方式','月结客户','起始国','目的国','寄件日期','寄件网点','寄件公司','线路','产品类型','寄件人','件数','实际重量','体积','体积重量','结算重量','运费','收款状态','标准报价','费用备注','创建日期'];
const filterVal=[
"billCode",
"mainBillCode",
"tradeDate",
"feeType",
"costFee",
"splitType",
"billWeight",
"supplierName",
"sendPlace",
"destPlace",
"transSignNo",
"batchNo",
"blManual",
"transWeight",
"transCostFee",
"calcExpr",
"calcRemark",
"remark",
"billMonth",
"kjlx",
"paymentType",
"custName",
"sendCountryName",
"receiveCountryName",
"sendDate",
"sendSiteName",
"sendCompany",
"transLineTypeName",
"productTypeName",
"estimateDate",
"sendName",
"parcelQty",
"billWeight",
"totalVolume",
"totalVolume",//1
"volumeWeight",
"settlementWeight",
"receiveName",
"receiveCompany",
"pickupMethod",
"paymentType",
"freight",
"sendName",
"sendCompany",
"remark",
"sendSiteName",
"customsEclaration",
"customsClear"
"billFee",
"paymentStatus",
"realFee",
"feeRemark",
"createTime"
];
const data = this.formatJsonDtl(filterVal, curList, selData)
excel.export_json_to_excel({
header: tHeader,
data,
filename: batchName+'批次明细表',
filename: batchNo+'批次明细表',
autoWidth: true
})
loadingInstance.close()
@ -671,7 +700,8 @@ export default {
let index = 0
return jsonData.map(v => filterVal.map(j => {
// console.log('v',v);
// console.log('j', j);
if (j === 'index') {
return ++index
}
@ -792,26 +822,26 @@ export default {
return "";
}
if (j === 'calcFeeType') {
return this.selectDictLabel(this.dict.type.emis_calc_fee_type,v['waybillDetail']['calcFeeType']);
}
// 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 === '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') {
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 === 'packType') {
// return this.selectDictLabels(this.dict.type.emis_tab_packing_type,v['waybillDetail']['packType']);
// }
if (j === 'dispatchMethod') {
if(v['waybillDetail']['dispatchMethod'] == 1){
@ -844,6 +874,40 @@ export default {
if (j === 'paymentType') {
return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail']['paymentType']);
}
if (j === 'custName') {
return v['waybillDetail']['custName'];
}
if (j === 'feeType') {
return this.selectDictLabel(this.dict.type.emis_cost_fee_type,v['feeType']);
}
if(j === 'blManual'){
if(v['blManual'] == 1){
return '是';
}else{
return '否';
}
}
if(j === 'billFee'){
const realFee = v['waybillDetail']['realFee'];
const freight = v['waybillDetail']['freight'];
if(realFee!==freight){
return freight;
}else{
return realFee;
}
}
if(j === 'paymentStatus'){
if(v['waybillDetail']['paymentStatus'] == 0){
return '未付款';
}else if(v['waybillDetail']['paymentStatus'] == 1){
return '已付款';
}else if(v['waybillDetail']['paymentStatus'] == 2){
return '部分付款';
}
}
if(j === 'splitType'){
return this.selectDictLabel(this.dict.type.emis_cost_split_type,v['splitType']);
}
return v[j]
}))
},