From 4265112a4239231863668871801323d22eb332d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= <9634538+git_rabbit@user.noreply.gitee.com> Date: Wed, 27 Mar 2024 17:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93-=E5=87=BA=E5=BA=93=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pda-scan-input/index.vue | 29 ++++++++++++++++++++------- pages/inWarehouse/inWarehouse.vue | 31 +++++++++++++++++++++++------ pages/outWarehouse/outWarehouse.vue | 2 +- 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/components/pda-scan-input/index.vue b/components/pda-scan-input/index.vue index b0e1a44..2111305 100644 --- a/components/pda-scan-input/index.vue +++ b/components/pda-scan-input/index.vue @@ -10,7 +10,7 @@ import * as WarehoseApi from '@/api/warehouse/warehose.js'; export default { name: 'pda-scan-input', props: { - hasFocus:{ + hasFocus: { default: true, type: Boolean }, @@ -58,8 +58,8 @@ export default { emitInputChange(data, type) { this.$emit('getInfo', data, type); }, - handlerBlur(){ - if(this.hasFocus){ + handlerBlur() { + if (this.hasFocus) { this.isFocus = false; setTimeout(() => { this.$nextTick(function () { @@ -126,6 +126,21 @@ export default { // type = 2 入库扫货物编码 async handleScanGoodsCode(text) { let package_code = text; + let resolutionData = { + code: package_code + }; + const emitRes = await WarehoseApi.resolutionPackage(resolutionData); + if (emitRes.code !== 200 || emitRes.data === null) { + uni.showModal({ + title: '提示', + content: '该箱号数据解析异常!', + showCancel: false, + confirmText: '确定' + }); + return; + } + this.emitInputChange(emitRes.data, 2); + return; // 临时库处理 // let _warehouseInfo = this.warehouseInfo; // if (_warehouseInfo != null && _warehouseInfo != undefined) { @@ -154,6 +169,7 @@ export default { }; // 判断是否是箱号 const checkRes = await WarehoseApi.isProductionPackage(locationCheckData); + console.log(checkRes); if (checkRes.code !== 200) { uni.showModal({ title: '提示', @@ -180,7 +196,6 @@ export default { }); return; } else if (checkRes.data === 1) { - // 判断是否为满箱 // const isFullRes = await WarehoseApi.isFullPackage(locationCheckData); // if (isFullRes.code !== 200 || !isFullRes.data) { @@ -192,9 +207,9 @@ export default { // }); // return; // } - // let resolutionData = { - // code: package_code - // }; + let resolutionData = { + code: package_code + }; const emitRes = await WarehoseApi.resolutionPackage(resolutionData); if (emitRes.code !== 200 || emitRes.data === null) { uni.showModal({ diff --git a/pages/inWarehouse/inWarehouse.vue b/pages/inWarehouse/inWarehouse.vue index b02b3e8..dedc67b 100644 --- a/pages/inWarehouse/inWarehouse.vue +++ b/pages/inWarehouse/inWarehouse.vue @@ -57,6 +57,8 @@ export default { }, data() { return { + // 入库模式(true严格追溯 false不严格不追溯) + isStrict:true, loading: false, // 双击判定 touchNum: 0, @@ -129,12 +131,29 @@ export default { this.warehouseInfo = data?.warehoseInfo; this.newMaterialList = []; } else if (type === 2) { + // 此时扫描的是箱号 + // 当前录入的箱号是否在同一批次录入过 + // 曾经是否扫过 + if (this.newMaterialList.length > 0) { + for (let item of this.newMaterialList) { + if (item.patchCode === data.patchCode) { + uni.showModal({ + title: '提示', + content: '此货物已录入过', + showCancel: false, + confirmText: '确定' + }); + return; + } + } + } const checkData = { production_packcode: data.originalCode, - location:this.warehouseInfo.location, - isStrict:true, + location: this.warehouseInfo.location, + //严格模式 + isStrict: this.isStrict }; - WarehoseApi.checkWarehousing(checkData).then(res=>{ + WarehoseApi.checkWarehousing(checkData).then((res) => { if (res.code === 200 && res.data) { this.newMaterialList.push(data); } else { @@ -145,7 +164,7 @@ export default { confirmText: '确定' }); } - }) + }); // const checkData = { // originalCode: data.originalCode // }; @@ -175,8 +194,8 @@ export default { // } // } // } - - }); + + // }); } }, diff --git a/pages/outWarehouse/outWarehouse.vue b/pages/outWarehouse/outWarehouse.vue index 6818059..3676e59 100644 --- a/pages/outWarehouse/outWarehouse.vue +++ b/pages/outWarehouse/outWarehouse.vue @@ -12,7 +12,7 @@ 已扫箱数:{{ newMaterialList.length }} - 操作指示-请扫出货单 + 操作指示-请扫出库单 操作指示-请扫货物码