diff --git a/src/views/emis/emisSettleInvoiceRecord/emisSettleInvoiceRecordForm.vue b/src/views/emis/emisSettleInvoiceRecord/emisSettleInvoiceRecordForm.vue index 8e3bb8bd..2571d18f 100644 --- a/src/views/emis/emisSettleInvoiceRecord/emisSettleInvoiceRecordForm.vue +++ b/src/views/emis/emisSettleInvoiceRecord/emisSettleInvoiceRecordForm.vue @@ -115,9 +115,8 @@ - 结算编号 + 账单名称 - + @@ -636,21 +641,21 @@ @@ -863,7 +868,6 @@ data() { addressType:null, // 遮罩层 loading: true, - isNeedSave:false, triggerCount:0, action:null, addFrom:null, @@ -876,6 +880,8 @@ data() { openSelectAddress:false, printerStatus:0, + origBillCode:null, + // 可用面单数 totalAvailablePag:{ mainHasCnt:0, @@ -1125,12 +1131,12 @@ methods: { // printDataList.push(customerItem); // 主单 - // let mainBillItem ={ - // "tplCode":"TAN-GM-130", - // "printerName":this.$refs.tanexPrinter.getDefaultPrinter(), - // "orderList":orderList.toString() - // } - // printDataList.push(mainBillItem); + let mainBillItem ={ + "tplCode":"TAN-GM-130", + "printerName":this.$refs.tanexPrinter.getDefaultPrinter(), + "orderList":orderList.toString() + } + printDataList.push(mainBillItem); @@ -1275,8 +1281,51 @@ methods: { onDestCountryChange(item){ if(item){ this.form.reciever.country=item.code; + this.autoAjustBillCode(); } }, + // 如果目的国为孟加拉,自动调整运单号 + autoAjustBillCode(){ + if(this.action != "add"){ + return; + } + + if(!this.form.reciever.country){ + return + } + + if(this.form.reciever.country!='0880'){ + return; + } + + if(!this.form.billCode){ + return; + } + + if(this.form.billCode.length!=14){ + return; + } + + // 记住历史单号 + this.origBillCode=this.form.billCode; + + this.$confirm("注意:根据要求孟加拉单号自动调整为12位", "提示", { + confirmButtonText: "确定", + type: "warning", + distinguishCancelAndClose: true, + closeOnClickModal: false, + showCancelButton: false, + showClose: false + }).then(() => { + // 去除第7,8个字符 + // T7080300001796 + let str =this.form.billCode; + let prefix=str.substring(0,6); + let other = str.substring(8); + this.form.billCode=prefix+other; + }); + + }, onPaymentTypeChange(){ // 非月结清空月结客户选择 if(this.form.paymentType == '1' || @@ -1358,31 +1407,14 @@ methods: { if(this.billCode && this.billCode!=undefined) { this.loading = true; getWaybillDetail(this.billCode).then(response => { - this.form = response.data; if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){ - if(this.$store.getters.ownerSiteCode!=this.form.sendSiteCode){ + if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){ this.$message.error('此单归属不允许修改'); return; } } - this.form.productTypeSelArr=[this.form.transLine,this.form.productType]; - this.loading = false; - - this.isNeedSave=true; - this.form.printTypeCheckList=[0,1,5] - this.form.destinationCountry=this.form.reciever.country; - - if(this.form.packType&&this.form.packType!=''){ - this.form.packType=this.form.packType.split(","); - } - - - - if(!this.form.attachmentList){ - this.form.attachmentList=[]; - } - + this.form = response.data; if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){ this.$confirm(this.form.lockReason, '提示', { confirmButtonText: '确认', @@ -1395,9 +1427,22 @@ methods: { }) } + this.form.productTypeSelArr=[this.form.transLine,this.form.productType]; + this.loading = false; + + this.form.printTypeCheckList=[0,1,5] + this.form.destinationCountry=this.form.reciever.country; + + if(this.form.packType&&this.form.packType!=''){ + this.form.packType=this.form.packType.split(","); + } + + if(!this.form.attachmentList){ + this.form.attachmentList=[]; + } - + // 接单处理 if(this.addFrom=="userOrder"){ if(!this.form.feeItems){ this.form.feeItems=[]; @@ -1405,18 +1450,17 @@ methods: { if(!this.form.cargoList){ this.form.cargoList=[]; - this.handleInitGenGoods(); } // 获取可用运单数 this.initGetTotalAvailablePag(this.form.sendSiteCode); + this.startTimer(); } }); }else{ - // this.startTimer(); // this.form.sendDate = parseTime(new Date()); this.form.sendSiteCode=this.$store.getters.ownerSiteCode; @@ -1437,7 +1481,7 @@ methods: { this.form.calcFeeType='1'; this.form.blMessage='1' this.form.blAcceptMessage='1' - this.isNeedSave=true; + // this.form.printTypeCheckList=[0,1,5], // 获取可用运单数 @@ -1446,6 +1490,8 @@ methods: { this.handleInitGenGoods(); this.startTimer(); + + } @@ -1767,17 +1813,16 @@ methods: { } }, focusNextInput(nextRef) { - this.$refs[nextRef].focus() + // console.log("====focusNextInput===>",nextRef) + if(this.$refs[nextRef]){ + this.$refs[nextRef].focus() + } }, handleCalcVolumeDebounce(row){ // 控制触发频率 debounce(250, this.handleCalcVolume(row)) }, handleCalcVolume(row){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } if(row!=null){ let singleVolume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height); @@ -1798,10 +1843,10 @@ methods: { async handleCalcFeeItem(row){ - if(row!=null){ + if(row!=null && this.form.settlementWeight!=null){ // console.log("===>calcExp====>",row.calcExp); // console.log("===>calcExp111==row==>",row); - if(row.calcExp){ + if(row.calcExp&&row.calcExp!='undefined'){ let expr=row.calcExp; // 如果公式包含变量,使用变量进行计算 if(expr.indexOf('s')!=-1 || expr.indexOf('d')!=-1){ @@ -1816,10 +1861,13 @@ methods: { }else{ let expr="s+w*d"; if(row.initialWeightFee>0||row.addWeightPrice>0){ + expr=expr.replace("s",row.initialWeightFee); expr=expr.replace("d",row.addWeightPrice); expr=expr.replace("w",this.form.settlementWeight); row.realFee=parseFloat(eval(expr)).toFixed(2); + // console.log("===>calcExp222==expr==>",expr); + // console.log("===>calcExp222==row==>",row); } } @@ -1859,10 +1907,6 @@ methods: { }, // 计算体积重量 handleCalcVolumeWeight(){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } if( this.form.totalVolume && this.form.productType @@ -1882,10 +1926,6 @@ methods: { }, // 计算结算重量 handleCalcSettlementWeight(){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } if(this.form.billWeight && this.form.volumeWeight @@ -1912,10 +1952,7 @@ methods: { }, calcBillFee(){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } + if(this.form.settlementWeight && this.form.productType @@ -2111,18 +2148,21 @@ methods: { debounce(250, this.handleCargoQtyChange(row)) }, handleCargoQtyChange(row){ + // console.log("====>handleCargoQtyChange===>") + this.handleGenSubbill(); this.handleInitGenGoods(); - this.handleCalcVolume(row); + this.handleCalcVolumeDebounce(row); }, deleteGoodsItem(row,index){ + this.$confirm('确定删除?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.form.cargoList.splice(index,1) - this.handleCalcVolume(row); + this.handleCalcVolumeDebounce(row); }).catch(() => { }) }, @@ -2131,7 +2171,7 @@ methods: { newItem.cargoQty=1; this.form.cargoList.splice(index+1, 0, newItem); // this.form.cargoList.push(newItem); - this.handleCargoQtyChange(); + this.handleCargoQtyChangeDebounce(row); }, showLocalTime(){ @@ -2154,6 +2194,7 @@ methods: { this.form.billCode=response.data; this.initGetTotalAvailablePag(this.form.sendSiteCode); this.handleGenSubbill(); + this.autoAjustBillCode(); }); }else{ this.form.billCode="" diff --git a/src/views/emis/emisWaybill/waybillRecord.vue b/src/views/emis/emisWaybill/waybillRecord.vue index e05abbe2..62dc4d3f 100644 --- a/src/views/emis/emisWaybill/waybillRecord.vue +++ b/src/views/emis/emisWaybill/waybillRecord.vue @@ -393,27 +393,32 @@ @@ -636,21 +641,21 @@ @@ -863,7 +868,6 @@ data() { addressType:null, // 遮罩层 loading: true, - isNeedSave:false, triggerCount:0, action:null, addFrom:null, @@ -1403,31 +1407,14 @@ methods: { if(this.billCode && this.billCode!=undefined) { this.loading = true; getWaybillDetail(this.billCode).then(response => { - this.form = response.data; if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){ - if(this.$store.getters.ownerSiteCode!=this.form.sendSiteCode){ + if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){ this.$message.error('此单归属不允许修改'); return; } } - this.form.productTypeSelArr=[this.form.transLine,this.form.productType]; - this.loading = false; - - this.isNeedSave=true; - this.form.printTypeCheckList=[0,1,5] - this.form.destinationCountry=this.form.reciever.country; - - if(this.form.packType&&this.form.packType!=''){ - this.form.packType=this.form.packType.split(","); - } - - - - if(!this.form.attachmentList){ - this.form.attachmentList=[]; - } - + this.form = response.data; if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){ this.$confirm(this.form.lockReason, '提示', { confirmButtonText: '确认', @@ -1440,9 +1427,22 @@ methods: { }) } + this.form.productTypeSelArr=[this.form.transLine,this.form.productType]; + this.loading = false; + + this.form.printTypeCheckList=[0,1,5] + this.form.destinationCountry=this.form.reciever.country; + + if(this.form.packType&&this.form.packType!=''){ + this.form.packType=this.form.packType.split(","); + } + + if(!this.form.attachmentList){ + this.form.attachmentList=[]; + } - + // 接单处理 if(this.addFrom=="userOrder"){ if(!this.form.feeItems){ this.form.feeItems=[]; @@ -1450,18 +1450,17 @@ methods: { if(!this.form.cargoList){ this.form.cargoList=[]; - this.handleInitGenGoods(); } // 获取可用运单数 this.initGetTotalAvailablePag(this.form.sendSiteCode); + this.startTimer(); } }); }else{ - // this.startTimer(); // this.form.sendDate = parseTime(new Date()); this.form.sendSiteCode=this.$store.getters.ownerSiteCode; @@ -1482,7 +1481,7 @@ methods: { this.form.calcFeeType='1'; this.form.blMessage='1' this.form.blAcceptMessage='1' - this.isNeedSave=true; + // this.form.printTypeCheckList=[0,1,5], // 获取可用运单数 @@ -1491,6 +1490,8 @@ methods: { this.handleInitGenGoods(); this.startTimer(); + + } @@ -1812,17 +1813,16 @@ methods: { } }, focusNextInput(nextRef) { - this.$refs[nextRef].focus() + // console.log("====focusNextInput===>",nextRef) + if(this.$refs[nextRef]){ + this.$refs[nextRef].focus() + } }, handleCalcVolumeDebounce(row){ // 控制触发频率 debounce(250, this.handleCalcVolume(row)) }, handleCalcVolume(row){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } if(row!=null){ let singleVolume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height); @@ -1843,10 +1843,10 @@ methods: { async handleCalcFeeItem(row){ - if(row!=null){ + if(row!=null && this.form.settlementWeight!=null){ // console.log("===>calcExp====>",row.calcExp); // console.log("===>calcExp111==row==>",row); - if(row.calcExp){ + if(row.calcExp&&row.calcExp!='undefined'){ let expr=row.calcExp; // 如果公式包含变量,使用变量进行计算 if(expr.indexOf('s')!=-1 || expr.indexOf('d')!=-1){ @@ -1861,10 +1861,13 @@ methods: { }else{ let expr="s+w*d"; if(row.initialWeightFee>0||row.addWeightPrice>0){ + expr=expr.replace("s",row.initialWeightFee); expr=expr.replace("d",row.addWeightPrice); expr=expr.replace("w",this.form.settlementWeight); row.realFee=parseFloat(eval(expr)).toFixed(2); + // console.log("===>calcExp222==expr==>",expr); + // console.log("===>calcExp222==row==>",row); } } @@ -1904,10 +1907,6 @@ methods: { }, // 计算体积重量 handleCalcVolumeWeight(){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } if( this.form.totalVolume && this.form.productType @@ -1927,10 +1926,6 @@ methods: { }, // 计算结算重量 handleCalcSettlementWeight(){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } if(this.form.billWeight && this.form.volumeWeight @@ -1957,10 +1952,7 @@ methods: { }, calcBillFee(){ - // 初始化不计算 - if(!this.isNeedSave){ - return; - } + if(this.form.settlementWeight && this.form.productType @@ -2156,18 +2148,21 @@ methods: { debounce(250, this.handleCargoQtyChange(row)) }, handleCargoQtyChange(row){ + // console.log("====>handleCargoQtyChange===>") + this.handleGenSubbill(); this.handleInitGenGoods(); - this.handleCalcVolume(row); + this.handleCalcVolumeDebounce(row); }, deleteGoodsItem(row,index){ + this.$confirm('确定删除?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.form.cargoList.splice(index,1) - this.handleCalcVolume(row); + this.handleCalcVolumeDebounce(row); }).catch(() => { }) }, @@ -2176,7 +2171,7 @@ methods: { newItem.cargoQty=1; this.form.cargoList.splice(index+1, 0, newItem); // this.form.cargoList.push(newItem); - this.handleCargoQtyChange(); + this.handleCargoQtyChangeDebounce(row); }, showLocalTime(){