diff --git a/pages/count/coms/comCountDetailCard.vue b/pages/count/coms/comCountDetailCard.vue index 5b38e514..d62df983 100644 --- a/pages/count/coms/comCountDetailCard.vue +++ b/pages/count/coms/comCountDetailCard.vue @@ -7,7 +7,7 @@ + :handleQty="dataContent.handleQty" :showItemQty="settingParam.isOpenCount=='FALSE'"> diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue index ccbde924..e31e9d53 100644 --- a/pages/count/job/countDetail.vue +++ b/pages/count/job/countDetail.vue @@ -260,7 +260,8 @@ item.handleQty = 0; for (let detail of item.subList) { if (detail != undefined && detail.scaned) { - item.handleQty = calc.add(item.handleQty, detail.qty) + item.handleQty = calc.add(Number(item.handleQty), Number(detail.handleQty)); + // item.handleQty = item.handleQty + detail.handleQty; } } } @@ -321,56 +322,30 @@ let that = this; that.package = result.package; that.label = result.label; - - //盘点了没有库存余额的数据,直接编辑盘点数量和盘点状态 var item = this.detailSource.find(r => r.itemCode == that.package.itemCode); - let subItem = item.subList.find(item => { - if (item.packingNumber == that.label.packingNumber && - item.batch == that.label.batch) { - return item; - } - }) - - if (subItem != undefined && subItem.scaned) { - this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + - "】已经完成盘点,是否要编辑盘点结果?", - res => { - if (res) { - this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem, - item.subList); - } else { - this.scanPopupGetFocus(); - } - }) + if (item == undefined) { + that.scanByBalance(result); } else { - if (result.balance.length == 0) { - that.scanPopupLoseFocus() - that.$refs.comMessage.showQuestionMessage("该包装在来源库位[" + that.fromLocationCode + - "],未查找到库存,是否继续盘点?", + let subItem = item.subList.find(item => { + if (item.packingNumber == that.label.packingNumber && + item.batch == that.label.batch) { + return item; + } + }) + + if (subItem != undefined && subItem.scaned) { + this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + + "】已经完成盘点,是否要编辑盘点结果?", res => { if (res) { - that.editInventoryStatus = true; - let item = that.package; - item.packingNumber = that.label.packingNumber; - item.qty = Number(that.label.qty); - item.handleQty = Number(that.label.qty); - item.balanceQty = 0; - item.inventoryStatus = "OK"; - that.balance = item; - that.$refs.countQtyEdit.openEditPopupShowSeconds(item, - null); + this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem, + item.subList); } else { - //继续扫描 - that.scanPopupGetFocus(); + this.scanPopupGetFocus(); } }) - } else if (result.balance.length == 1) { - that.balance = result.balance[0]; - that.balance.balanceQty = that.balance.qty; - that.balance.stdPackQty = that.package.stdPackQty; - that.balance.stdPackUnit = that.package.stdPackUnit; - that.$refs.countQtyEdit.openEditPopupShowSeconds(that.balance, - null); + } else { + that.scanByBalance(result); } } } catch (e) { @@ -378,6 +353,41 @@ } }, + scanByBalance(result) { + let that = this; + if (result.balance.length == 0) { + that.scanPopupLoseFocus() + that.$refs.comMessage.showQuestionMessage("该包装在来源库位[" + that.fromLocationCode + + "],未查找到库存,是否继续盘点?", + res => { + if (res) { + that.editInventoryStatus = true; + let item = that.package; + item.packingNumber = that.label.packingNumber; + item.qty = 0 + item.handleQty = Number(that.label.qty); + item.balanceQty = 0; + item.inventoryStatus = "OK"; + that.balance = item; + that.$refs.countQtyEdit.openEditPopupShowSeconds(item, + null); + } else { + //继续扫描 + that.scanPopupGetFocus(); + } + }) + } else if (result.balance.length == 1) { + that.balance = result.balance[0]; + that.balance.qty = 0 + that.balance.handleQty = Number(that.label.qty); + that.balance.balanceQty = that.balance.qty; + that.balance.stdPackQty = that.package.stdPackQty; + that.balance.stdPackUnit = that.package.stdPackUnit; + that.$refs.countQtyEdit.openEditPopupShowSeconds(that.balance, + null); + } + }, + editConfirm(qty, inventoryStatus, mode) { let that = this; var detail = that.detailSource.find(r => r.itemCode == that.package.itemCode); @@ -385,7 +395,7 @@ //检查物料号是否存在 if (detail == undefined) { //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 - that.addNewItemCodeToList() + that.addNewItemCodeToList(qty, inventoryStatus) } else { var itemEditInfo = detail.subList.find(item => { if (item.packingNumber == that.package.number && @@ -433,18 +443,19 @@ this.scanPopupGetFocus(); }, - addNewItemCodeToList() { + addNewItemCodeToList(qty, inventoryStatus) { this.$refs.comMessage.showQuestionMessage("物料[" + this.package.itemCode + "]不在列表中,是否添加到列表?", res => { if (res) { var item = this.createAddItemInfo(this.balance, this.package); - let newDetail = this.createAddDetailInfo(this.balance, this.package); // + let newDetail = this.createAddDetailInfo(qty, inventoryStatus); // item.subList.push(newDetail); this.detailSource.push(item) + this.showMessage('添加成功'); this.updateData() + this.scanPopupGetFocus(); } }) - }, addExistItemCodeToList(detail, qty, inventoryStatus) { @@ -453,9 +464,10 @@ this.$refs.comMessage.showQuestionMessage("盘点结果不在明细列表中,是否添加到列表?", res => { if (res) { - detail.qty = calc.add(qty, qty) + // detail.qty = calc.add(qty, qty) let newDetail = that.createAddDetailInfo(qty, inventoryStatus); // detail.subList.push(newDetail); + this.showMessage('添加成功'); that.updateData() } that.scanPopupGetFocus(); @@ -468,14 +480,16 @@ itemName: this.package.itemName, stdPackQty: this.package.stdPackQty, stdPackUnit: this.package.stdPackUnit, - qty: Number(qty), + // qty: Number(qty), + qty: 0, handleQty: 0, - uom: pack.uom, + uom: this.package.uom, subList: [], } return item; }, + //创建盘盈的明细 createAddDetailInfo(qty, inventoryStatus) { var detail = { id: "0", //新增的明细 diff --git a/static/config.json b/static/config.json index c47cdf8a..2b2e6eed 100644 --- a/static/config.json +++ b/static/config.json @@ -21,7 +21,7 @@ "value": "http://192.168.0.158:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api", "chefang": "http://192.168.0.176:12080/admin-api", - "chenxinming": "http://192.168.0.230:12080/admin-api", + "chenxinming": "http://192.179.0.230:12080/admin-api", "liuchen": "http://192.168.0.157:12080/admin-api", "xuebing": "http://192.168.0.106:12080/admin-api", "dev": "http://dev.ccwin-in.com:25100/api/admin-api",