diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue index aa092715..c56d690c 100644 --- a/pages/count/job/countDetail.vue +++ b/pages/count/job/countDetail.vue @@ -328,18 +328,21 @@ } else { let subItem = item.subList.find(item => { if (item.packingNumber == that.label.packingNumber && - item.batch == that.label.batch) { + item.batch == that.label.batch && item.scaned == true) { return item; } }) - if (subItem != undefined && subItem.scaned) { + if (subItem != undefined) { this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + "】已经完成盘点,是否要编辑盘点结果?", res => { if (res) { - this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem, + this.currentEditItem = subItem; + this.$refs.countQtyEdit.openEditPopup(subItem, item.subList); + // this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem, + // item.subList); } else { this.scanPopupGetFocus(); } @@ -390,46 +393,36 @@ editConfirm(qty, inventoryStatus, mode) { let that = this; - var detail = that.detailSource.find(r => r.itemCode == that.package.itemCode); - - //检查物料号是否存在 - if (detail == undefined) { - //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 - that.addNewItemCodeToList(qty, inventoryStatus) - } else { - var itemEditInfo = detail.subList.find(item => { - if (item.packingNumber == that.package.number && - item.batch == that.package.batch && - item.inventoryStatus == inventoryStatus) { - return item; - } - }) + //编辑 + if (mode == 'edit') { + this.currentEditItem.handleQty = qty; + this.currentEditItem.inventoryStatus = inventoryStatus; + } else { //新增盘点 + //检查物料号是否存在 + var detail = that.detailSource.find(r => r.itemCode == that.package.itemCode); + if (detail == undefined) { + //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 + that.addNewItemCodeToList(qty, inventoryStatus) + } else { + var itemEditInfo = detail.subList.find(item => { + if (item.packingNumber == that.package.number && + item.batch == that.package.batch && + item.inventoryStatus == inventoryStatus) { + return item; + } + }) - if (itemEditInfo == undefined) { - //不在任务列表中,提示是否添加到列表 - if (mode == 'edit') { - that.currentEditItem.handleQty = qty; - that.currentEditItem.inventoryStatus = inventoryStatus; - } else { + if (itemEditInfo == undefined) { + //不在任务列表中,提示是否添加到列表 that.addExistItemCodeToList(detail, qty, inventoryStatus); + } else { //已经扫描是否编辑 + itemEditInfo.scaned = true; + itemEditInfo.handleQty = qty; + itemEditInfo.inventoryStatus = inventoryStatus; + itemEditInfo.balanceQty = that.balance.qty; + itemEditInfo.stdPackQty = that.package.stdPackQty; + itemEditInfo.stdPackUnit = that.package.stdPackUnit; } - } else { - itemEditInfo.scaned = true; - itemEditInfo.handleQty = qty; - itemEditInfo.inventoryStatus = inventoryStatus; - itemEditInfo.balanceQty = that.balance.qty; - itemEditInfo.stdPackQty = that.package.stdPackQty; - itemEditInfo.stdPackUnit = that.package.stdPackUnit; - - //编辑后的结果对应到其它明细,当前编辑结果为0 - if (mode == 'edit') { - itemEditInfo.scaned = false; - that.currentEditItem.handleQty = 0; - } - - // this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail - // .subList); - that.updateData() } setTimeout(r => { @@ -437,8 +430,64 @@ this.scanPopupGetFocus(); }, 100) } + }, + // editConfirm(qty, inventoryStatus, mode) { + // let that = this; + // var detail = that.detailSource.find(r => r.itemCode == that.package.itemCode); + + // //检查物料号是否存在 + // if (detail == undefined) { + // //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 + // that.addNewItemCodeToList(qty, inventoryStatus) + // } else { + // var itemEditInfo = detail.subList.find(item => { + // if (item.packingNumber == that.package.number && + // item.batch == that.package.batch && + // item.inventoryStatus == inventoryStatus) { + // return item; + // } + // }) + + // if (itemEditInfo == undefined) { + // //不在任务列表中,提示是否添加到列表 + // if (mode == 'edit') { + // that.currentEditItem.handleQty = qty; + // that.currentEditItem.inventoryStatus = inventoryStatus; + // } else { + // that.addExistItemCodeToList(detail, qty, inventoryStatus); + // } + // } else { //已经扫描是否编辑 + // if (itemEditInfo.scaned) { + + // } + + // itemEditInfo.scaned = true; + // itemEditInfo.handleQty = qty; + // itemEditInfo.inventoryStatus = inventoryStatus; + // itemEditInfo.balanceQty = that.balance.qty; + // itemEditInfo.stdPackQty = that.package.stdPackQty; + // itemEditInfo.stdPackUnit = that.package.stdPackUnit; + + // //编辑后的结果对应到其它明细,当前编辑结果为0 + // if (mode == 'edit') { + // itemEditInfo.scaned = false; + // that.currentEditItem.handleQty = 0; + // } + + // // this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail + // // .subList); + // that.updateData() + // } + + // setTimeout(r => { + // this.calcHandleQty(); + // this.scanPopupGetFocus(); + // }, 100) + // } + // }, + editClose() { this.scanPopupGetFocus(); }, @@ -554,7 +603,6 @@ return totalCount; }, - commit() { this.scanCount = this.getScanCount();