diff --git a/src/views/emis/emisWaybill/emisWaybillRecord.vue b/src/views/emis/emisWaybill/emisWaybillRecord.vue index 26972a7d..e7e3928b 100644 --- a/src/views/emis/emisWaybill/emisWaybillRecord.vue +++ b/src/views/emis/emisWaybill/emisWaybillRecord.vue @@ -190,8 +190,11 @@ - - + + @@ -252,7 +255,9 @@ - + @@ -318,7 +323,7 @@ - + @@ -380,7 +385,7 @@ @@ -393,9 +398,26 @@ @@ -644,10 +666,6 @@ - - - - @@ -824,6 +842,9 @@ data() { province: [ { required: true, message: "省不能为空", trigger: ["blur",'change'] } ], + company: [ + { required: true, message: "发件公司不能为空", trigger: ["blur",'change'] } + ], // city: [ // { required: true, message: "市不能为空", trigger: "blur" } // ], @@ -847,6 +868,10 @@ data() { province: [ { required: true, message: "寄件省不能为空", trigger: ["blur",'change'] } ], + company: [ + { required: true, message: "发件公司不能为空", trigger: ["blur",'change'] } + ], + // city: [ // { required: true, message: "寄件市不能为空", trigger: "blur" } // ], @@ -1180,20 +1205,7 @@ methods: { }) }, - deleteGoodsItem(row){ - this.$confirm('确定删除?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let newList = this.form.cargoList.filter(item => item.goodsName !== row.goodsName); - this.form.cargoList=newList; - this.handleCalcQty(); - this.handleCalcVolume(); - }).catch(() => { - }) - }, lpadZero(val,len) { return (new Array(len + 1).join('0') + val).slice(-len); }, @@ -1203,10 +1215,10 @@ methods: { for(let i=1;i<=this.form.parcelQty;i++){ let subBillCode = this.form.billCode+""+this.lpadZero(i,4); billSubCodeStr=billSubCodeStr+subBillCode+"," - console.log(billSubCodeStr); + // console.log(billSubCodeStr); } // let billSubCodeStr = this.form.billCode+"["+this.lpadZero(1,3)+"-"+this.lpadZero(this.form.parcelQty,3)+"]"; - console.log(billSubCodeStr); + // console.log(billSubCodeStr); this.form.billCodeSub=billSubCodeStr; }else{ this.form.billCodeSub=null; @@ -1254,7 +1266,7 @@ methods: { this.isNeedSave=true; this.form.printTypeCheckList=[1,5], - this.handleGenGoods(); + this.handleInitGenGoods(); } @@ -1464,7 +1476,7 @@ methods: { let totalVolume=0.0; if(row!=null){ let volume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height); - row.volume=parseFloat((volume/1000000).toFixed(5)); + row.volume=parseFloat((volume/1000000).toFixed(5))*parseFloat(row.cargoQty); } this.form.cargoList.forEach(item=>{ @@ -1473,21 +1485,7 @@ methods: { this.form.totalVolume = parseFloat(totalVolume.toFixed(5)); }, - handleCalcQty(val,row){ - let totalCargoQty=0; - let goodsInfo=''; - this.form.cargoList.forEach(item=>{ - totalCargoQty=totalCargoQty+parseInt(item.cargoQty); - goodsInfo=goodsInfo+item.goodsName+"x"+item.cargoQty+","; - - }); - - - this.form.parcelQty = totalCargoQty; - - this.handleGenSubbill(); - }, handleCalcFeeItem(val,row){ if(row!=null){ @@ -1608,53 +1606,21 @@ methods: { this.form.goodsInfo = selNameStr; }, - handleGenGoods(){ + handleInitGenGoods(){ if(this.form.parcelQty>0){ + + let currentParcelQty = 0; + this.form.cargoList.forEach(item=>{ + currentParcelQty = currentParcelQty+parseInt(item.cargoQty); + }); // 新件数大于 - if(this.form.parcelQty>=this.form.cargoList.length){ - console.log() - let len=this.form.parcelQty-this.form.cargoList.length; - for(let i=0;icurrentParcelQty){ + let len=this.form.parcelQty-currentParcelQty; + if(this.form.parcelQty>20){ let cargo={ - "goodsCode": "", - "goodsName": "", - "cargoQty": 1, - "length": 0, - "width": 0, - "height": 0, - "volume": 0, - } - this.form.cargoList.push(cargo); - } - } - else{ - let newList=[]; - for(let i=0;i0){ - this.form.cargoList.forEach(item=>{ - nameOldMap[item.goodsName]=item; - }); - } - - if(!(goodsName in nameOldMap)){ - let cargo={ - "goodsCode": goodsName, - "goodsName": goodsName, - "cargoQty": 1, + "goodsCode": "", + "goodsName": "", + "cargoQty": len, "length": 0, "width": 0, "height": 0, @@ -1662,10 +1628,81 @@ methods: { } this.form.cargoList.push(cargo); } - - this.handleCalcQty(); - this.handleCalcVolume(); + else{ + for(let i=0;i { + // let newList = this.form.cargoList.filter(item => item.goodsName !== row.goodsName); + // this.form.cargoList=newList; + console.log(index); + this.form.cargoList.splice(index,1) + this.handleCalcVolume(); + }).catch(() => { + }) + }, + copyGoodsItem(row,index){ + let newItem = Object.assign({},row); + newItem.cargoQty=1; + this.form.cargoList.splice(index+1, 0, newItem); + // this.form.cargoList.push(newItem); + handleCargoQtyChange(); }, showLocalTime(){