From 281c52e21a28335b0f348413ed83f2df800c6686 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Fri, 9 Aug 2024 15:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A5=E6=96=99=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E6=9C=89=E5=BA=93=E5=AD=98=E4=BD=99=E9=A2=9D=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repleinsh/coms/comScanReplishPack.vue | 71 +++++++++++++++++-- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/src/pages/repleinsh/coms/comScanReplishPack.vue b/src/pages/repleinsh/coms/comScanReplishPack.vue index b65006d4..58a21ce1 100644 --- a/src/pages/repleinsh/coms/comScanReplishPack.vue +++ b/src/pages/repleinsh/coms/comScanReplishPack.vue @@ -84,7 +84,7 @@ import { getWorkShopLineStation, getBalanceByFilter, - getBalanceByParams + getBalanceByParams, } from '@/api/request2.js'; import { @@ -142,7 +142,9 @@ defaultValueList: [], label: {}, fromInventoryStatuses: "", - packageInfo: {} + packageInfo: {}, + toLocationAreaTypeList:[] + } }, created() { @@ -194,6 +196,7 @@ that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.toLocation = that.dataContent[0]; that.toLocationCode = that.dataContent[0].toLocationCode; + that.toLocationAreaTypeList=getDirectoryItemArray(this.jobContent.toAreaTypes) // that.fromLocationList = that.getFromLocationList(); } }, @@ -250,16 +253,74 @@ this.$refs.comMessage.showQuestionMessage( `扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => { if (res) { - this.onScanResult(result) + this.getToLocationBalance(result) } }); } else { - this.onScanResult(result) + this.getToLocationBalance(result) } } }, + + //查询到目标库位的库存余额 + getToLocationBalance(result) { + uni.showLoading({ + title: '查询中', + mask: true + }) + var filters = [] + if (result.package.parentNumber) { + var packingNumber = result.package.parentNumber + "," + result.package.number; + filters.push({ + column: "packingNumber", + action: "in", + value: packingNumber + }) + } else { + filters.push({ + column: "packingNumber", + action: "==", + value: result.package.number + }) + } + + filters.push({ + column: "itemCode", + action: "==", + value: result.package.itemCode + }) + filters.push({ + column: "batch", + action: "==", + value: result.package.batch + }) + + filters.push({ + column: "areaType", + action: "in", + value: this.toLocationAreaTypeList.join(',') + }) + + + var params = { + filters: filters, + pageNo: 1, + pageSize: 100, + } + getBalanceByFilter(params).then(res => { + uni.hideLoading() + if (res.data.list.length > 0) { + this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额"); + } else { + this.queryBalance(result); + } + // callback(res.data) + }).catch(err => { + this.showErrorMessage(err.message); + }) + }, - onScanResult(result) { + queryBalance(result) { try { let that = this; // if (that.fromLocationCode == '') {