From 75eae232825a4dff28af4693de7934bb52f67637 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, 12 Nov 2024 16:15:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20productionReturn\job=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9=20Vue2=E5=8D=87=E7=BA=A7Vue3=2011/1?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 2 +- src/pages/index/index.vue | 2 +- .../productionReturn/job/okToReturnDetail.vue | 80 ++++++++++++++++++- src/pages/setter/index.vue | 3 +- 4 files changed, 80 insertions(+), 7 deletions(-) diff --git a/src/api/request2.js b/src/api/request2.js index f0937b0f..baaa79cf 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -2907,7 +2907,7 @@ export function getBalanceByParams(data) { */ export function getBusinessType() { - return http.get("/wms/businesstype/page?pageSize=1000&pageNo=1") + return http.get("/wms/businesstype/page?pageSize=100&pageNo=1") } /** * 获取生产计划信息通过生产线和日期 diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index f10a0aef..8ee98504 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -346,7 +346,7 @@ const getDictory = () => { const unitparams = { filters: [], pageNo: 1, - pageSize: 1000 + pageSize: 100 } getPackageUnitList(unitparams) .then((unitres) => { diff --git a/src/pages/productionReturn/job/okToReturnDetail.vue b/src/pages/productionReturn/job/okToReturnDetail.vue index 72a48396..dda90427 100644 --- a/src/pages/productionReturn/job/okToReturnDetail.vue +++ b/src/pages/productionReturn/job/okToReturnDetail.vue @@ -66,7 +66,9 @@ import { getManagementPrecisions } from '@/common/balance.js'; - +import { + calc +} from '@/common/calc' import { getDataSource, createRecordInfo, @@ -238,10 +240,80 @@ const openDetail = (item) => { }; const openScanPopup = () => { - scanPopup.value.openScanPopup(); + scanPopup.value.openScanPopup(fromLocationCode.value); }; - -const getScanResult = (result) => { +const getScanResult = (result)=> { + managementType.value = result.managementType + if (managementType.value == 'BY_BATCH' || managementType.value == 'BY_QUANTITY') { + setDataBatch(result) + } else { + setData(result) + } +} +const setDataBatch = (result)=>{ + try { + const packingNumber = result.label.packingNumber; + const batch = result.label.batch; + const qty = result.label.qty; + const itemCode = result.label.itemCode; + const detail = detailSource.value.find(r => r.itemCode == itemCode); + if (detail == undefined) { + showErrorMessage("物料号【" + itemCode + "】不在列表中") + } else { + let itemDetail = detail.subList.find(r => { + return r.batch == batch + }) + if (itemDetail == undefined) { + showErrorMessage("批次[" + batch + "]不在列表中") + } else { + if (itemDetail.scaned) { + // this.showErrorMessage("批次[" + batch + "]已经扫描") + itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.package.qty)) + } else { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.package.qty) + itemDetail.inventoryStatus = "OK" + itemDetail.packQty = result.package.packQty + itemDetail.packUnit = result.package.packUnit + + + //合格退料时不能查库存余额,因为生产退料时新生成的批次是000000 --nxt + // let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); + // let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); + // if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { + // this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + + // ']不一致,是否继续上架?', res => { + // if (res) { + // itemDetail.scaned = true; + // itemDetail.handleQty = Number(result.balance.qty) + // itemDetail.balance = result.balance; + // itemDetail.balance.balanceQty = result.balance.qty; + // itemDetail.balance.packQty = result.package.packQty + // itemDetail.balance.packUnit = result.package.packUnit + // this.calcHandleQty(); + // } else { + // this.scanPopupGetFocus(); + // } + // }); + // } else { + // itemDetail.scaned = true; + // itemDetail.handleQty = Number(result.balance.qty) + // itemDetail.balance = result.balance; + // itemDetail.balance.balanceQty = result.balance.qty; + // itemDetail.balance.packQty = result.package.packQty + // itemDetail.balance.packUnit = result.package.packUnit + // this.calcHandleQty(); + // } + } + calcHandleQty(); + } + } + scanPopupGetFocus(); + } catch (e) { + showErrorMessage(e.message); + } +} +const setData = (result) => { try { const packingNumber = result.label.packingNumber; const batch = result.label.batch; diff --git a/src/pages/setter/index.vue b/src/pages/setter/index.vue index 8f1ac077..83943853 100644 --- a/src/pages/setter/index.vue +++ b/src/pages/setter/index.vue @@ -54,7 +54,8 @@ const userInfo = ref(null) onLoad(() => { getAppVersion() getUserProfile().then((res) => { - userInfo.value = res.data + console.log(res); + userInfo.value = res.data || null // nextTick(()=>{ // const userInfo = res.data.nickname // console.log("打印",userInfo)