From 3f7a11fbf2a6f652056edb8e3bca0f67f56b28e0 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:24:09 +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=202024/8/9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repleinsh/coms/comScanReplishPack.vue | 65 ++++++++++++++++++- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/src/pages/repleinsh/coms/comScanReplishPack.vue b/src/pages/repleinsh/coms/comScanReplishPack.vue index 7af382f8..037b24b2 100644 --- a/src/pages/repleinsh/coms/comScanReplishPack.vue +++ b/src/pages/repleinsh/coms/comScanReplishPack.vue @@ -97,6 +97,7 @@ const comscan = ref() const balanceQtyEditRef = ref() const detailOptions = ref([]) const detailGiveupOptions = ref([]) +const toLocationAreaTypeList = ref([]) onMounted(() => { detailOptions.value = getDetailOption() detailGiveupOptions.value = getDetailGiveupOption() @@ -138,6 +139,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() } } @@ -194,15 +196,72 @@ const onScan = (result)=> { comMessageRef.value.showQuestionMessage( `扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => { if (res) { - onScanResult(result) + getToLocationBalance(result) } }); } else { - onScanResult(result) + getToLocationBalance(result) } } } -const onScanResult = (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(',') + }) + + + var 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 => { + showErrorMessage(err.message); + }) +} +const queryBalance = (result) => { try { // if (fromLocationCode.value == '') { // showErrorMessage('请选择来源库位', (res) => {