From fa8ca927562a677c65b113585a6b0023df0d9692 Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Wed, 17 Jan 2024 15:56:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=98=E7=82=B9=E6=89=AB?= =?UTF-8?q?=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mycomponents/scan/winScanPackAndLocation.vue | 23 +++- pages/count/job/countDetail.vue | 120 ++++++++++++++++--- static/config.json | 2 +- 3 files changed, 127 insertions(+), 18 deletions(-) diff --git a/mycomponents/scan/winScanPackAndLocation.vue b/mycomponents/scan/winScanPackAndLocation.vue index 64b32b96..1e95e325 100644 --- a/mycomponents/scan/winScanPackAndLocation.vue +++ b/mycomponents/scan/winScanPackAndLocation.vue @@ -91,6 +91,11 @@ type: Boolean, default: false }, + //不提示库存 + noShowBalanceMessage: { + type: Boolean, + default: false + }, //是否允许修改库位 allowModifyLocation: { type: Boolean, @@ -239,6 +244,8 @@ afterQueryBalance(datas) { if (this.allowNullBalance) { this.allowNoneBalance(datas); + } else if (this.noShowBalanceMessage) { + this.countCallBack(datas); } else { this.mustHavaBalance(datas); } @@ -267,7 +274,7 @@ this.packCallBack(balance); //因为盘点时有负库存,暂时去掉判断 2023年12月28日 - + // if (balance.qty > 0) { // this.packCallBack(balance); // } else { @@ -298,6 +305,20 @@ // } }, + //盘点回调 + countCallBack(datas) { + this.$refs.comscan.clear(); + //返回标签信息、库存信息和管理模式 + let data = { + label: this.scanResult.label, + package: this.scanResult.package, + balance: datas, + fromLocationCode: this.fromLocationCode, + } + this.packGetFocus(); + this.$emit("getCountScanResult", data); + }, + packCallBack(item) { this.$refs.comscan.clear(); //返回标签信息、库存信息和管理模式 diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue index 0eeeae92..cb409033 100644 --- a/pages/count/job/countDetail.vue +++ b/pages/count/job/countDetail.vue @@ -25,7 +25,7 @@ - + @@ -48,7 +48,8 @@ - + + @@ -75,7 +76,7 @@ import { getCountStageName } from '@/common/directory.js'; - + import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' @@ -109,7 +110,8 @@ jobContent: {}, //任务内容 subList: [], //接口返回的任务subList detailSource: [], //绑定在页面上的数据源 - itemEditInfo: {} + itemEditInfo: {}, + balance: {} //库存余额 }; }, onLoad(option) { @@ -305,13 +307,29 @@ } }, - getScanResult(result) { + //明盘 + getOpenScanResult(result) { try { - var packingNumber = result.balance.packingNumber; - var batch = result.balance.batch; - var balanceQty = result.balance.qty; - var itemCode = result.balance.itemCode; - var inventoryStatus = result.balance.inventoryStatus; + let label = result.label; + this.balance = result.balance[0]; + //盘点了没有库存余额的数据,直接编辑盘点数量和盘点状态 + if (result.balance.length == 0) { + + return; + } else { + + } + + + this.balance = result.balance[0]; + + var packingNumber = label.packingNumber; + var batch = label.batch; + var itemCode = label.itemCode; + + var balanceQty = this.balance.qty; + var inventoryStatus = this.balance.inventoryStatus; + var detail = this.detailSource.find(r => r.itemCode == itemCode); var itemEditInfo; //检查物料号是否存在 @@ -320,7 +338,75 @@ this.addNewItemCodeToList(result) } else { //物料号存在,查询是否在任务列表中 + 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.showSelectMessageModal("箱码【" + 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) + } + }, + + //盲盘 + getUnOpenScanResult(result) { + try { + debugger; + //盘点了没有库存余额的数据 + if (result.balance.length == 0) { + + } + let label = result.label; + this.balance = result.balance[0]; + var packingNumber = label.packingNumber; + var batch = label.batch; + var itemCode = label.itemCode; + + var balanceQty = this.balance.qty; + var inventoryStatus = this.balance.inventoryStatus; + + var detail = this.detailSource.find(r => r.itemCode == itemCode); + var itemEditInfo; + //检查物料号是否存在 + if (detail == undefined) { + //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 + this.addNewItemCodeToList(result) + } else { + //物料号存在,查询是否在任务列表中 itemEditInfo = detail.subList.find(item => { if (item.packingNumber == packingNumber && item.batch == batch && @@ -365,12 +451,14 @@ }, + + addNewItemCodeToList(result) { - this.$refs.comMessage.showSelectMessageModal("物料[" + result.balance.itemCode + "]不在列表中,是否添加到列表?", + this.$refs.comMessage.showSelectMessageModal("物料[" + this.balance.itemCode + "]不在列表中,是否添加到列表?", res => { if (res) { - var item = this.createAddItemInfo(result.balance, result.package); - let newDetail = this.createAddDetailInfo(result.balance, result.package); // + var item = this.createAddItemInfo(this.balance, result.package); + let newDetail = this.createAddDetailInfo(this.balance, result.package); // item.subList.push(newDetail); this.detailSource.push(item) this.updateData() @@ -380,12 +468,12 @@ }, addExistItemCodeToList(detail, result) { - this.$refs.comMessage.showSelectMessageModal("箱码[" + result.balance.packingNumber + + this.$refs.comMessage.showSelectMessageModal("箱码[" + this.balance.packingNumber + "]不在列表中,是否添加到列表?", res => { if (res) { - detail.qty = calc.add(detail.qty,detail.qty) - let newDetail = this.createAddDetailInfo(result.balance, result.package); // + detail.qty = calc.add(detail.qty, detail.qty) + let newDetail = this.createAddDetailInfo(this.balance, result.package); // detail.subList.push(newDetail); this.updateData() diff --git a/static/config.json b/static/config.json index 61fe3fd0..4fb72ee7 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://192.168.0.106:12080/admin-api", + "value": "http://192.168.0.178: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",