From 15b2fe59298f0cb9a8d167cea68b5fd400856808 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Thu, 26 Sep 2024 20:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=B8=8A=E6=9E=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/deliver/coms/comScanDeliverPack.vue | 26 +-- .../job/productPutawayDetail.vue | 2 +- .../record/productPutawayRecord.vue | 193 ++++++++++++------ 3 files changed, 140 insertions(+), 81 deletions(-) diff --git a/src/pages/deliver/coms/comScanDeliverPack.vue b/src/pages/deliver/coms/comScanDeliverPack.vue index 6f46fb84..1793b008 100644 --- a/src/pages/deliver/coms/comScanDeliverPack.vue +++ b/src/pages/deliver/coms/comScanDeliverPack.vue @@ -165,7 +165,7 @@ fromLocationList: [], fromLocationCode: '', fromLocation: null, - issueRecord: [], //发料历史 + issueRecord: [], //发货历史 expand: true, scanOptions: {}, editItem: {}, @@ -266,7 +266,7 @@ let location = this.fromLocationList.find(r => r == fromlocation) if (location == undefined) { this.fromLocationCode = '' - this.showErrorMessage('发料库位【' + fromlocation + '】不存在') + this.showErrorMessage('发货库位【' + fromlocation + '】不存在') } }, @@ -285,7 +285,7 @@ let lot = result.label.batch; let item = that.toLocation.Items.find(r => r.itemCode == itemCode); if (item == undefined) { - that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细', + that.showErrorMessage('未查找到物料【' + itemCode + '】的发货明细', res => { that.getfocus(); } @@ -543,7 +543,7 @@ } else { if (this.jobContent.allowModifyBatch == "TRUE") { this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + - '】的发料明细,是否要继续发料?', res => { + '】的发货明细,是否要继续发货?', res => { if (res) { let batch = that.createBatchInfo(label, balance, packageInfo); //新增加的批次赋值details @@ -556,7 +556,7 @@ } }) } else { - that.showErrorMessage('未查找到批次【' + lot + '】的发料明细', + that.showErrorMessage('未查找到批次【' + lot + '】的发货明细', res => { that.getfocus(); }); @@ -567,7 +567,7 @@ //扫描的不在任务列表中,询问是否可以添加, if (this.jobContent.allowModifyLocation == "TRUE") { this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + - "】与推荐的库位不一致,是否要继续发料?", res => { + "】与推荐的库位不一致,是否要继续发货?", res => { if (res) { let locaion = that.createLocationInfo(label, balance, packageInfo); item.Locations.push(locaion); @@ -578,7 +578,7 @@ } else { this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + - "】与推荐的库位不一致,不允许继续发料?") + "】与推荐的库位不一致,不允许继续发货?") } } @@ -624,7 +624,7 @@ // } else { // if (this.jobContent.allowModifyBatch == "TRUE") { // this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + - // '】的发料明细,是否要继续发料?', res => { + // '】的发货明细,是否要继续发货?', res => { // if (res) { // let batch = that.createBatchInfo(label, balance, packageInfo); // //新增加的批次赋值details @@ -637,7 +637,7 @@ // } // }) // } else { - // that.showErrorMessage('未查找到批次【' + lot + '】的发料明细', + // that.showErrorMessage('未查找到批次【' + lot + '】的发货明细', // res => { // that.getfocus(); // }); @@ -686,7 +686,7 @@ // } else { // if (this.jobContent.allowModifyBatch == "TRUE") { // this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + - // '】的发料明细,是否要继续发料?', res => { + // '】的发货明细,是否要继续发货?', res => { // if (res) { // let batch = that.createBatchInfo(label, balance, packageInfo); // //新增加的批次赋值details @@ -699,7 +699,7 @@ // } // }) // } else { - // that.showErrorMessage('未查找到批次【' + lot + '】的发料明细', + // that.showErrorMessage('未查找到批次【' + lot + '】的发货明细', // res => { // that.getfocus(); // }); @@ -708,7 +708,7 @@ // } else { // if (this.jobContent.allowModifyLocation == "TRUE") { // this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + - // "】与推荐的库位不一致,是否要继续发料?", res => { + // "】与推荐的库位不一致,是否要继续发货?", res => { // if (res) { // let locaion = that.createLocationInfo(label, balance, packageInfo); // item.Locations.push(locaion); @@ -719,7 +719,7 @@ // } else { // this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + - // "】与推荐的库位不一致,不允许继续发料?") + // "】与推荐的库位不一致,不允许继续发货?") // } // } diff --git a/src/pages/productPutaway/job/productPutawayDetail.vue b/src/pages/productPutaway/job/productPutawayDetail.vue index 8cef3a48..f3827242 100644 --- a/src/pages/productPutaway/job/productPutawayDetail.vue +++ b/src/pages/productPutaway/job/productPutawayDetail.vue @@ -308,7 +308,7 @@ getScanResult(result) { try { - var packingNumber = result.balance.packingNumber; + var packingNumber = result.balance.packingNumber==result.package.number?result.balance.packingNumber:result.package.number; var batch = result.balance.batch; var qty = result.balance.qty; var itemCode = result.balance.itemCode; diff --git a/src/pages/productPutaway/record/productPutawayRecord.vue b/src/pages/productPutaway/record/productPutawayRecord.vue index f2dab7c8..dbd95eac 100644 --- a/src/pages/productPutaway/record/productPutawayRecord.vue +++ b/src/pages/productPutaway/record/productPutawayRecord.vue @@ -36,7 +36,10 @@ - + + + + @@ -77,7 +80,7 @@ import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" - + import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import { updateTitle } from '@/common/basic.js'; @@ -90,7 +93,8 @@ comBlankView, recordComDetailCard, winScanPackage, - winScanLocation + winScanLocation, + winComScanBalance }, data() { return { @@ -106,7 +110,7 @@ toLocationAreaTypeList: [], inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态:"", - bussinessCode: "ProductPutaway", + businessTypeCode: "ProductPutaway", businessType: {}, managementList: [], type: '', @@ -131,12 +135,11 @@ onPullDownRefresh() {}, mounted() { - getBusinessType(this.bussinessCode, res => { + getBusinessType(this.businessTypeCode, res => { if (res.success) { this.businessType = res.businessType; - this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; - this.toLocationAreaTypeList = res.toLocationAreaTypeList; - this.tolocationTypeList = res.tolocationTypeList; + this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); + this.fromLocationAreaTypeList = res.fromLocationAreaTypeList this.openScanPopup(); } else { this.showErrorMessage(res.message) @@ -146,55 +149,126 @@ methods: { getScanResult(result) { + this.setData(result); + }, + + setData(result) { + let balance = result.balance; let label = result.label; let pack = result.package; - let errorHint="" - result.balance.forEach( - balance => { - let item = this.detailSource.find(res => { - if (res.itemCode == balance.itemCode && res.containerNumber == balance - .parentPackingNumber) { - return res - } - }) - if (item == undefined) { - var itemp = createItemInfo(balance, pack); - itemp.containerNumber = balance.parentPackingNumber - //查询推荐的目标库位 - let newDetail = createDetailInfo(balance, pack); - newDetail.fromInventoryStatus = balance.inventoryStatus; - itemp.subList.push(newDetail); - this.detailSource.push(itemp) - this.calcHandleQty(); - this.getRecommendLocation(balance) - } else { - var detail = item.subList.find(r => { - if (r.packingNumber == balance.packingNumber && - r.batch == balance.batch && - r.locationCode == balance.locationCode && - r.inventoryStatus == balance.inventoryStatus) { + + var item = this.detailSource.find(res => { + if (res.itemCode == balance.itemCode) { + return res + } + }) + if (item == undefined) { + var itemp = createItemInfo(balance, pack); + // itemp.containerNumber="" + let newDetail = createDetailInfo(balance, pack); // + newDetail.fromLocationCode=balance.locationCode + + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = pack.packUnit; + newDetail.packQty = pack.packQty; + if (balance.lableQty) { + newDetail.handleQty = balance.lableQty + } + itemp.subList.push(newDetail); + this.detailSource.push(itemp) + this.itemCode = balance.itemCode; + this.fromLocationCode = balance.locationCode + this.getRecommendLocation(balance) + this.scanPopupGetFocus() + } else { + var detail = item.subList.find(r => { + if (r.packingNumber == pack.number && + r.batch == balance.batch && + r.fromLocationCode == balance.locationCode && + r.inventoryStatus == balance.inventoryStatus) { + return r; + } + }) + if (detail == undefined) { + //如果最开始扫父,在扫子,提示已经扫描父包装 + //如果扫子在扫父,提示扫描的是父包装,是否移除子包装,是移除子包装,显示父包装 + //扫描的是子包装, + if (pack.parentNumber) { + var checkData = item.subList.find(r => { + if (r.packingNumber == pack.parentNumber && + r.batch == balance.batch&& + r.fromLocationCode == balance.locationCode) { return r; } }) - if (detail == undefined) { + if (checkData) { + //提示已经扫描 + this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch + + "]的父包装已经扫描") + console.log("父包装已经扫描") + } else { let newDetail = createDetailInfo(balance, pack); - newDetail.fromInventoryStatus = balance.inventoryStatus; + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = pack.packUnit; + newDetail.packQty = pack.packQty; + newDetail.fromLocationCode=balance.locationCode + if (balance.lableQty) { + newDetail.handleQty = balance.lableQty + } item.subList.push(newDetail); + } + } else { + //扫描的是父包装 + var checkData = item.subList.find(r => { + if (r.parentNumber == pack.number && + r.batch == balance.batch&& + r.fromLocationCode == balance.locationCode) { + return r; + } + }) + if (checkData) { + //是否移除 + this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance + .batch + "]是父包装,是否移除子包装", res => { + if (res) { + item.subList = []; + let newDetail = createDetailInfo(balance, pack); + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = pack.packUnit; + newDetail.packQty = pack.packQty; + newDetail.fromLocationCode=balance.locationCode + if (balance.lableQty) { + newDetail.handleQty = balance.lableQty + } + item.subList.push(newDetail); + } + }) + console.log("扫描的是父包装,是否移除子包装") } else { - if (detail.scaned == true) { - errorHint+="箱码[" + balance.packingNumber + "批次[" + balance.batch + - "]重复扫描\n" + let newDetail = createDetailInfo(balance, pack); + newDetail.fromLocationCode=balance.locationCode + newDetail.parentNumber = pack.parentNumber; + newDetail.packingNumber = pack.number + newDetail.packUnit = pack.packUnit; + newDetail.packQty = pack.packQty; + if (balance.lableQty) { + newDetail.handleQty = balance.lableQty } + item.subList.push(newDetail); } } - this.calcHandleQty(); + + this.scanPopupGetFocus() + } else { + if (detail.scaned == true) { + this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描") + } } - ) - if(errorHint){ - this.showErrorMessage(errorHint) - }else { - this.scanPopupGetFocus() } + calcHandleQty(this.detailSource); }, getRecommendLocation(balance) { @@ -214,7 +288,7 @@ uni.hideLoading(); let item = this.detailSource.find(res => { if (res.itemCode == balance.itemCode && res.containerNumber == balance - .parentPackingNumber) { + .packingNumber) { return res } }) @@ -274,9 +348,11 @@ }, openScanPopup() { - setTimeout(r => { - this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType); - }) + if (this.businessType) { + this.$refs.scanPopup.openScanPopup(this.businessType); + } else { + this.getBusinessType() + } }, closeScanPopup() { @@ -313,12 +389,6 @@ title: "提交中....", mask: true }); - // this.managementList = []; - // var precisionStrategParams = this.setPrecisionStrategParams() - - // getPrecisionStrategyList(precisionStrategParams, res => { - // if (res.success) { - // this.managementList = res.list; var params = this.setParams() console.log("提交" + JSON.stringify(params)) @@ -383,27 +453,16 @@ item.subList.forEach(detail => { if (detail.scaned) { var submitItem = deepCopyData(detail) - // var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, - // detail.packingNumber, detail.toLocationCode, detail.batch); submitItem.itemCode = detail.itemCode; submitItem.itemName = detail.package.itemName; submitItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc2 = detail.package.itemDesc2; - submitItem.inventoryStatus = detail.inventoryStatus; - // submitItem.fromPackingNumber = info.packingNumber; - // submitItem.toPackingNumber = info.packingNumber; - submitItem.fromPackingNumber = detail.packingNumber; submitItem.toPackingNumber = detail.packingNumber; - - //submitItem.fromContainerNumber = detail.containerNumber; - //submitItem.toContainerNumber = detail.containerNumber - - //submitItem.fromBatch = info.batch; - //submitItem.toBatch = info.batch; - + + submitItem.fromParentPackingNumber = detail.parentNumber; submitItem.fromBatch = detail.package.batch; submitItem.toBatch = detail.package.batch;