|
@@ -153,13 +153,18 @@
|
|
|
url:'/pagesStorage/moveStorage/goods?ids='+ids+'&warehouseId='+this.movementDto.sourceWarehouseId,
|
|
|
events:{
|
|
|
addGoods:list=>{
|
|
|
- this.movementDto.details = list;
|
|
|
- this.movementDto.details.forEach((d,i)=>{
|
|
|
+ let aList = JSON.parse(JSON.stringify(list));
|
|
|
+ this.movementDto.details.forEach(d=>{
|
|
|
+ aList = list.filter(l=>l.skuId!=d.skuId)
|
|
|
+ })
|
|
|
+ aList.forEach((d,i)=>{
|
|
|
let amount = d.checknum*d.itemSku.costPrice;
|
|
|
- this.$set(this.movementDto.details[i],'amount',amount);
|
|
|
- this.$set(this.movementDto.details[i],'quantity',d.checknum);
|
|
|
+ this.$set(aList[i],'amount',amount);
|
|
|
+ this.$set(aList[i],'quantity',d.checknum);
|
|
|
})
|
|
|
+ this.movementDto.details = [...this.movementDto.details,...aList];
|
|
|
this.computeNum();
|
|
|
+ this.autoCalculate();
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -168,6 +173,7 @@
|
|
|
this.movementDto.details.splice(index,1);
|
|
|
this.$nextTick(()=>{
|
|
|
this.computeNum();
|
|
|
+ this.autoCalculate();
|
|
|
})
|
|
|
},
|
|
|
changeRkNum(e,index){
|
|
@@ -178,6 +184,7 @@
|
|
|
},
|
|
|
changeRkMoney(e,index){
|
|
|
this.$set(this.movementDto.details[index],'amount',e.value);
|
|
|
+ this.autoCalculate();
|
|
|
},
|
|
|
computeNum(){
|
|
|
this.movementDto.totalQuantity = this.movementDto.details.reduce((cur,pre)=>cur+pre.quantity,0);
|