Commit 3ad77478 authored by 黄媛媛's avatar 黄媛媛

修改出库扫码多次

parent 1415d361
...@@ -184,11 +184,13 @@ ...@@ -184,11 +184,13 @@
var scanMsg = {}; var scanMsg = {};
var data2 = JSON.parse(JSON.stringify(this.tableData)); var data2 = JSON.parse(JSON.stringify(this.tableData));
this.orderNum=0; this.orderNum=0;
let isUpdate=false
data2.forEach(x => { for (let i = 0; i < data2.length; i++) {
let x = data2[i];
if ((myData.GoodsId == x.GoodsId) && (myData.SpecificationKey == x.NewSpecificationSort)) { if ((myData.GoodsId == x.GoodsId) && (myData.SpecificationKey == x.NewSpecificationSort)) {
this.orderNum++; this.orderNum++;
if(x.nowBound<x.NewNumber){ if(x.nowBound<x.NewNumber){
isUpdate=true;
x.nowBound++; x.nowBound++;
this.tableData = data2; this.tableData = data2;
this.scanData.unshift(myData); this.scanData.unshift(myData);
...@@ -199,11 +201,14 @@ ...@@ -199,11 +201,14 @@
scanMsg.NewSpecificationSort = x.NewSpecificationSort; scanMsg.NewSpecificationSort = x.NewSpecificationSort;
scanMsg.StockInId = myData.StockInId; scanMsg.StockInId = myData.StockInId;
this.sureMsg.WarehouseOutGoodsDetailList.push(scanMsg); this.sureMsg.WarehouseOutGoodsDetailList.push(scanMsg);
}else{ break;
this.Error('超过了出库数量');
} }
} }
}) }
console.log(this.orderNum>0 && !isUpdate)
if(this.orderNum>0 && !isUpdate){
this.Error("超过了出库数量");
}
this.getorderNum(); this.getorderNum();
}else{ }else{
this.Error(res.data.data.Msg); this.Error(res.data.data.Msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment