From ce51bd898a101194c2b3308ac0aab3b0cdc99cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Tue, 29 Oct 2024 10:46:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E6=96=99=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=9F=A5=E8=AF=A2=E5=B7=B2=E7=BB=8F=E6=9C=89=E5=BA=93?= =?UTF-8?q?=E5=AD=98=202024/8/9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/issue/coms/comScanIssuePack.vue | 65 +++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 25ae3e06..c9c664dc 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -107,6 +107,7 @@ const detailOptions = ref([]) const comscan = ref() const balanceSelectRef = ref() const balanceQtyEditRef = ref() +const toLocationAreaTypeList = ref([]) onMounted(() => { detailOptions.value = getDetailOption() scanOptions.value = getDetailEditRemoveOption() @@ -148,6 +149,7 @@ const initData = () => { fromInventoryStatuses.value = jobContent.value.outInventoryStatuses toLocation.value = dataContent.value[0] toLocationCode.value = dataContent.value[0].toLocationCode + toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) // fromLocationList.value = getFromLocationList() } } @@ -182,7 +184,7 @@ const fromLocationUpdate = (fromlocation) => { showErrorMessage(`发料库位【${fromlocation}】不存在`) } } -const onScanResult = (result) => { +const queryBalance = (result) => { try { // if (fromLocationCode.value == '') { // showErrorMessage('请选择来源库位', (res) => { @@ -318,15 +320,72 @@ const onScan = (result) => { if (result.package.packUnit !== item.packUnit) { comMessageRef.value.showQuestionMessage(`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, (res) => { if (res) { - onScanResult(result) + getToLocationBalance(result) } }) } else { - onScanResult(result) + getToLocationBalance(result) } } } +//查询到目标库位的库存余额 +const getToLocationBalance = (result)=> { + uni.showLoading({ + title: '查询中', + mask: true + }) + let filters = [] + if (result.package.parentNumber) { + let 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: toLocationAreaTypeList.value.join(',') + }) + + + let params = { + filters: filters, + pageNo: 1, + pageSize: 100, + } + getBalanceByFilter(params).then(res => { + uni.hideLoading() + if (res.data.list.length > 0) { + showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额"); + } else { + queryBalance(result); + } + // callback(res.data) + }).catch(err => { + uni.hideLoading() + showErrorMessage(err.message); + }) +} const selectBalanceItem = (balance) => { afterGetBalance(label.value, balance, packageInfo.value)