From fdb11f13d7921facc7511f70842bbdf084391228 Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Fri, 19 Jan 2024 13:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A0=87=E7=AD=BE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mycomponents/qty/CountQtyEdit.vue | 45 +++++--- pages/count/coms/comCountDetailCard.vue | 1 - pages/count/job/countDetail.vue | 118 +++++--------------- pages/purchaseReceipt/job/receiptDetail.vue | 2 +- 4 files changed, 62 insertions(+), 104 deletions(-) diff --git a/mycomponents/qty/CountQtyEdit.vue b/mycomponents/qty/CountQtyEdit.vue index 72bc32e6..62ac8adb 100644 --- a/mycomponents/qty/CountQtyEdit.vue +++ b/mycomponents/qty/CountQtyEdit.vue @@ -16,7 +16,7 @@ 标包个数 : - + {{getStdPackUnitInfo(dataContent.stdPackUnit)}} @@ -108,8 +108,9 @@ seconds: 0, timer: {}, showConfirmCountdown: false, - detaiList: [], - maxlength: 10 + detailList: [], + maxlength: 10, + mode: 'add' //add 新增 edit 编辑 } }, watch: { @@ -156,26 +157,38 @@ this.maxlength = 10; } }, - openEditPopup(item, detaiList) { - this.dataContent = item - this.inventoryStatus = this.dataContent.inventoryStatus; - this.allQty = Number(this.dataContent.qty) + + //编辑时弹出 + openEditPopup(item, detailList) { + this.initData(item, detailList); + // this.dataContent = item + // this.inventoryStatus = this.dataContent.inventoryStatus; + // this.allQty = Number(this.dataContent.qty) + // this.stdCount = Math.ceil(this.allQty / this.dataContent.stdPackQty); + // this.detailList = detailList this.showConfirmCountdown = false; - this.detaiList = detaiList + this.mode = 'edit'; this.$refs.popup.open('bottom') clearInterval(this.timer) }, - openEditPopupShowSeconds(item, detaiList) { - this.dataContent = item; - this.inventoryStatus = this.dataContent.inventoryStatus; - this.allQty = Number(this.dataContent.qty); + //新增时弹出 + openEditPopupShowSeconds(item, detailList) { + this.initData(item, detailList); this.showConfirmCountdown = true; - this.detaiList = detaiList; + this.mode = 'add'; this.$refs.popup.open('bottom') this.startTimer() + }, + initData(item, detailList) { + this.dataContent = item; + this.inventoryStatus = this.dataContent.inventoryStatus; + this.allQty = Number(this.dataContent.qty); + this.stdCount = Math.ceil(this.allQty / this.dataContent.stdPackQty); + this.detailList = detailList; }, + mousedown() { this.showConfirmCountdown = false; clearInterval(this.timer) @@ -188,6 +201,7 @@ closeEditPopup() { clearInterval(this.timer) + this.$emit("close"); this.$refs.popup.close() }, confirm() { @@ -202,7 +216,8 @@ this.timer = setInterval(() => { this.seconds-- if (this.seconds <= 0) { - this.cancel() + this.confirm(); + // this.cancel() return } }, 1000) @@ -215,7 +230,7 @@ setValue() { this.dataContent.handleQty = Number(this.allQty) - this.$emit("confirm", Number(this.allQty), this.inventoryStatus); + this.$emit("confirm", Number(this.allQty), this.inventoryStatus, this.mode); this.closeEditPopup(); }, diff --git a/pages/count/coms/comCountDetailCard.vue b/pages/count/coms/comCountDetailCard.vue index 95d1e176..5b38e514 100644 --- a/pages/count/coms/comCountDetailCard.vue +++ b/pages/count/coms/comCountDetailCard.vue @@ -128,7 +128,6 @@ this.$emit("editItem", detail) }, - detail(item) { this.showItem = item; this.$refs.detailInfoPopup.openPopup(item); diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue index ff6b163f..464ac304 100644 --- a/pages/count/job/countDetail.vue +++ b/pages/count/job/countDetail.vue @@ -50,7 +50,7 @@ - @@ -110,11 +110,11 @@ jobContent: {}, //任务内容 subList: [], //接口返回的任务subList detailSource: [], //绑定在页面上的数据源 - itemEditInfo: {}, balance: {}, //库存余额 editInventoryStatus: false, package: {}, //包装 - label: {} //标签 + label: {}, //标签 + currentEditItem: {} }; }, onLoad(option) { @@ -315,7 +315,6 @@ } }, - //明盘 getScanResult(result) { try { @@ -333,11 +332,11 @@ }) if (subItem != undefined && subItem.scaned) { - this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber + - "】已经完成盘点,是否要编辑数量", + this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + + "】已经完成盘点,是否要编辑盘点结果?", res => { if (res) { - this.$refs.countQtyEdit.openEditPopup(subItem, + this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem, item.subList); } else { this.scanPopupGetFocus(); @@ -357,8 +356,8 @@ item.handleQty = Number(that.label.qty); item.balanceQty = 0; item.inventoryStatus = "OK"; - this.balance = item; - that.$refs.countQtyEdit.openEditPopup(item, + that.balance = item; + that.$refs.countQtyEdit.openEditPopupShowSeconds(item, null); } else { //继续扫描 @@ -366,88 +365,20 @@ } }) } else if (result.balance.length == 1) { - this.balance = result.balance[0]; - that.$refs.countQtyEdit.openEditPopup(this.balance, + 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); } } - return; - // var packingNumber = that.label.packingNumber; - // var batch = that.label.batch; - // var itemCode = that.label.itemCode; - // var balanceQty = 0; - // var inventoryStatus = "OK" - - // var detail = this.detailSource.find(r => r.itemCode == itemCode); - // var itemEditInfo; - // //检查物料号是否存在 - // if (detail == undefined) { - // //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 - // this.addNewItemCodeToList(result) - // } else { - // if (result.balance.length == 0) { - // this.balance = label; - // this.balanceQty = 0; - // this.inventoryStatus = "OK"; - // this.editInventoryStatus = true; - - // //物料号存在,查询是否在任务列表中 - // itemEditInfo = detail.subList.find(item => { - // if (item.packingNumber == packingNumber && - // item.batch == batch) { - // return item; - // } - // }) - // } else { - // this.balance = result.balance[0]; - // balanceQty = this.balance.qty; - // inventoryStatus = this.balance.inventoryStatus; - // //物料号存在,查询是否在任务列表中 - // itemEditInfo = detail.subList.find(item => { - // if (item.packingNumber == packingNumber && - // item.batch == batch && - // item.inventoryStatus == inventoryStatus) { - // return item; - // } - // }) - // } - - // if (itemEditInfo == undefined) { - // //不在任务列表中,提示是否添加到列表 - // this.addExistItemCodeToList(detail, result); - - // } else { - // //在列表中,更新已扫描状态, - // if (itemEditInfo.scaned) { - // this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber + - // "】已经完成盘点,是否要编辑数量", - // res => { - // if (res) { - // this.$refs.countQtyEdit.openEditPopup(itemEditInfo, - // detail.subList); - // } else { - // this.scanPopupGetFocus(); - // } - // }) - - // } else { - // itemEditInfo.scaned = true; - // itemEditInfo.handleQty = balanceQty; - // itemEditInfo.balanceQty = balanceQty; - // itemEditInfo.stdPackQty = result.package.stdPackQty; - // itemEditInfo.stdPackUnit = result.package.stdPackUnit; - // this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail - // .subList); - // this.updateData() - // } - // } - // } } catch (e) { this.showErrorMessage(e.message) } }, - editConfirm(qty, inventoryStatus) { + editConfirm(qty, inventoryStatus, mode) { let that = this; var detail = this.detailSource.find(r => r.itemCode == that.package.itemCode); @@ -478,11 +409,24 @@ this.updateData() } - this.calcHandleQty(); - this.scanPopupGetFocus(); + //如果是编辑,移除之前的盘点结果 + if (mode == 'edit') { + this.currentEditItem.handleQty = 0; + this.currentEditItem.scaned = false; + this.currentEditItem = {}; + } + + setTimeout(r => { + this.calcHandleQty(); + this.scanPopupGetFocus(); + }, 100) } }, + editClose() { + this.scanPopupGetFocus(); + }, + //盲盘 getUnOpenScanResult(result) { try { @@ -599,7 +543,7 @@ scaned: true, countDetailNumber: "", ownerCode: balance.ownerCode, - packingNumber: pack.packingNumber, + packingNumber: pack.number, containerNumber: balance.containerNumber, batch: pack.batch, inventoryStatus: balance.inventoryStatus, @@ -620,7 +564,6 @@ stdPackUnit: pack.stdPackUnit, creator: this.$store.state.user.id } - debugger; return detail; }, @@ -766,6 +709,7 @@ }, editItem(item) { + this.currentEditItem = item; var detail = this.detailSource.find(r => r.itemCode == item.itemCode); this.$refs.countQtyEdit.openEditPopup(item, detail.subList); diff --git a/pages/purchaseReceipt/job/receiptDetail.vue b/pages/purchaseReceipt/job/receiptDetail.vue index 6fcf56ed..abb8f91c 100644 --- a/pages/purchaseReceipt/job/receiptDetail.vue +++ b/pages/purchaseReceipt/job/receiptDetail.vue @@ -36,7 +36,7 @@ - +