diff --git a/src/pages/putaway/record/putawayRecord.vue b/src/pages/putaway/record/putawayRecord.vue index afefd46d..9f5b8add 100644 --- a/src/pages/putaway/record/putawayRecord.vue +++ b/src/pages/putaway/record/putawayRecord.vue @@ -100,9 +100,7 @@ getPrecisionStrategyParams } from '@/common/balance.js'; - import { - calc - } from '@/common/calc' + import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' diff --git a/src/pages/unPlanned/job/issueJobDetail.vue b/src/pages/unPlanned/job/issueJobDetail.vue index 9f548107..b9188d32 100644 --- a/src/pages/unPlanned/job/issueJobDetail.vue +++ b/src/pages/unPlanned/job/issueJobDetail.vue @@ -250,6 +250,13 @@ }, getScanResult(result) { + if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){ + this.setDataBatch(result) + }else{ + this.setData(result) + } + }, + setDataBatch(result){ try { var packingNumber = result.balance.packingNumber; var batch = result.balance.batch; @@ -258,13 +265,12 @@ var locationCode = result.balance.locationCode; var inventoryStatus = result.balance.inventoryStatus; var detail = this.detailSource.find(r => r.itemCode == itemCode); - + if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { var itemDetail = detail.subList.find(r => { - return r.packingNumber == packingNumber && - r.batch == batch && + return r.batch == batch && r.fromLocationCode == result.fromLocationCode&& r.isRecommend==false }) @@ -273,7 +279,7 @@ itemCode:itemCode, packingNumber:packingNumber, batch:batch, - handleQty:detail.qty r.itemCode == itemCode); + + if (detail == undefined) { + this.showErrorMessage("物料号【" + itemCode + "】不在列表中") + } else { + var itemDetail = detail.subList.find(r => { + return r.packingNumber == packingNumber && + r.batch == batch && + r.fromLocationCode == result.fromLocationCode&& + r.isRecommend==false + }) + if (itemDetail == undefined) { + var newAdd = { + itemCode:itemCode, + packingNumber:packingNumber, + batch:batch, + handleQty:detail.qty { diff --git a/src/pages/unPlanned/job/receiptJobDetail.vue b/src/pages/unPlanned/job/receiptJobDetail.vue index c2396f7b..a5b94d1e 100644 --- a/src/pages/unPlanned/job/receiptJobDetail.vue +++ b/src/pages/unPlanned/job/receiptJobDetail.vue @@ -12,13 +12,9 @@ - - + :locationAreaTypeList='toLocationAreaTypeList'> @@ -70,12 +66,15 @@ calcHandleQty, getScanCount } from '@/common/detail.js'; + + import { + calc + } from '@/common/calc.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue' import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' - import comReceiptDetailCardBatch from '@/pages/unPlanned/coms/comReceiptDetailCardBatch.vue' import jobTop from '@/mycomponents/job/jobTop.vue' export default { @@ -84,7 +83,6 @@ winScanButton, winScanPack, comReceiptDetailCard, - comReceiptDetailCardBatch, locationCompare, jobTop }, @@ -229,6 +227,14 @@ getScanResult(result) { + if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){ + this.setDataBatch(result) + }else{ + this.setData(result) + } + + }, + setDataBatch(result){ try { var packingNumber = result.label.packingNumber; var batch = result.label.batch; @@ -238,7 +244,42 @@ if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { - + + var itemDetail = detail.subList.find(r => r.batch == batch); + if (itemDetail == undefined) { + this.showErrorMessage("批次【" + batch + "】" + "不在列表中") + } else { + if (itemDetail.scaned) { + // this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "已经扫描") + itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty)); + } else { + itemDetail.scaned = true; + itemDetail.handleQty = Number(result.label.qty); + itemDetail.toLocationCode = this.toLocationCode ? this.toLocationCode : itemDetail + .toLocationCode; + itemDetail.packQty = result.package.packQty + itemDetail.labelQty = Number(result.label.qty); + this.continueScan() + } + } + calcHandleQty(this.detailSource); + } + + } catch (e) { + this.showErrorMessage(e.message) + } + }, + setData(result){ + try { + var packingNumber = result.label.packingNumber; + var batch = result.label.batch; + var qty = result.label.qty; + var itemCode = result.label.itemCode; + var detail = this.detailSource.find(r => r.itemCode == itemCode); + if (detail == undefined) { + this.showErrorMessage("物料号【" + itemCode + "】不在列表中") + } else { + var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); if (itemDetail == undefined) { this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "不在列表中") @@ -257,12 +298,11 @@ } } } - + } catch (e) { this.showErrorMessage(e.message) } }, - commit() { this.scanCount = getScanCount(this.subList); if (this.scanCount == 0) { @@ -326,6 +366,7 @@ this.detailSource.forEach(item => { itemCodes.push(item.itemCode) }) + return getManagementPrecisions(itemCodes, this.toLocationCode, res => { if (res.success) {