From eb63ed4f5e9342a2b85659b5eef23ef138557736 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Sat, 17 Aug 2024 19:49:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E6=96=99=E8=A1=A5?= =?UTF-8?q?=E6=96=99=E6=8F=90=E4=BA=A4=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/issue/coms/comScanIssuePack.vue | 2 +- .../repleinsh/coms/comScanReplishPack.vue | 53 +++++++++++------ src/pages/repleinsh/job/repleinshDetail.vue | 59 ++++++++++++++++++- 3 files changed, 95 insertions(+), 19 deletions(-) diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 50dff7a6..816e70bf 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -564,7 +564,7 @@ } } else { - if (this.jobContent.allowModifyLocation == "FALSE") { + if (this.jobContent.allowModifyLocation == "TRUE") { this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + "】与推荐的库位不一致,是否要继续发料?", res => { if (res) { diff --git a/src/pages/repleinsh/coms/comScanReplishPack.vue b/src/pages/repleinsh/coms/comScanReplishPack.vue index 0f764fe2..37db779d 100644 --- a/src/pages/repleinsh/coms/comScanReplishPack.vue +++ b/src/pages/repleinsh/coms/comScanReplishPack.vue @@ -143,8 +143,8 @@ label: {}, fromInventoryStatuses: "", packageInfo: {}, - toLocationAreaTypeList:[] - + toLocationAreaTypeList: [] + } }, created() { @@ -197,7 +197,7 @@ that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.toLocation = that.dataContent[0]; that.toLocationCode = that.dataContent[0].toLocationCode; - that.toLocationAreaTypeList=getDirectoryItemArray(this.jobContent.toAreaTypes) + that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes) // that.fromLocationList = that.getFromLocationList(); } }, @@ -231,7 +231,7 @@ let location = this.fromLocationList.find(r => r == fromlocation) if (location == undefined) { this.fromLocationCode = '' - this.showErrorMessage('发料库位【' + fromlocation + '】不存在',res=>{ + this.showErrorMessage('发料库位【' + fromlocation + '】不存在', res => { this.getfocus(); }) } @@ -250,9 +250,9 @@ let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode); if (!item) { this.showErrorMessage('扫描物料代码不属于该任务', - res => { - this.getfocus(); - }); + res => { + this.getfocus(); + }); return } if (result.package.packUnit !== item.packUnit) { @@ -267,7 +267,7 @@ } } }, - + //查询到目标库位的库存余额 getToLocationBalance(result) { uni.showLoading({ @@ -289,7 +289,7 @@ value: result.package.number }) } - + filters.push({ column: "itemCode", action: "==", @@ -300,14 +300,14 @@ action: "==", value: result.package.batch }) - + filters.push({ column: "areaType", action: "in", value: this.toLocationAreaTypeList.join(',') }) - - + + var params = { filters: filters, pageNo: 1, @@ -412,12 +412,14 @@ res => { this.getfocus(); }) - + } }, selectBalanceItem(balance) { - this.afterGetBalance(this.label, balance, this.packageInfo); + if(balance){ + this.afterGetBalance(this.label, balance, this.packageInfo); + } }, afterGetBalance(label, balance, packageInfo) { @@ -431,7 +433,7 @@ that.fromLocationCode = balance.locationCode; let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); //如果库存余额中的库位与任务推荐的不一致 - if (fromLocation != undefined) { + if (fromLocation && !fromLocation.isNewAdd) { let batch = fromLocation.Batchs.find(r => r.batch == lot); if (batch != undefined) { if (batch.Records == undefined) { @@ -487,8 +489,24 @@ } } } else { - let locaion = that.createLocationInfo(label, balance, packageInfo); - item.Locations.push(locaion); + + if (this.jobContent.allowModifyLocation == "TRUE") { + this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + + "】与推荐的库位不一致,是否要继续发料?", res => { + if (res) { + let locaion = that.createLocationInfo(label, balance, packageInfo); + item.Locations.push(locaion); + this.getfocus(); + that.$emit("afterScan"); + } + }) + + } else { + this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode + + "】与推荐的库位不一致,不允许继续发料?") + } + + } } catch (e) { this.showErrorMessage(e.stack, @@ -506,6 +524,7 @@ qty: balance.qty, uom: balance.uom, handleQty: 0, + isNewAdd: true, Batchs: [] } let batch = this.createBatchInfo(label, balance, packageInfo); diff --git a/src/pages/repleinsh/job/repleinshDetail.vue b/src/pages/repleinsh/job/repleinshDetail.vue index e24a5d25..894906db 100644 --- a/src/pages/repleinsh/job/repleinshDetail.vue +++ b/src/pages/repleinsh/job/repleinshDetail.vue @@ -30,7 +30,7 @@ :locationAreaTypeList="toLocationAreaTypeList"> - + @@ -225,6 +225,58 @@ }); }, + clickSubmit(){ + let str="" + var totalQty =0; + var taskQty =0; + this.detailSource.forEach(detail => { + detail.Items.forEach(item => { + taskQty =calc.add(taskQty,item.qty) + item.Locations.forEach(lco => { + lco.Batchs.forEach(batch => { + batch.Records.forEach(record => { + if (batch.qty != record.qty) { + var tempHandleQty = 0 + if (record.qty) { + tempHandleQty = record.qty + } else { + tempHandleQty = 0 + } + if (batch.qty != 0) { + str += + `包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n` + } + } + if(record){ + var hanleQty =record.qty?record.qty:0 + totalQty = calc.add(totalQty,hanleQty) + } + + }) + }) + }) + }) + }) + + if(str){ + str = '任务明细未全部完成,是否提交?\n' + str + } + if(totalQty!=taskQty){ + str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交" + this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { + if (res) { + //防止重复点击 + this.$throttle(this.submitJob, 2000, this)() + } else { + this.scanPopupGetFocus() + } + }); + }else { + //防止重复点击 + this.$throttle(this.submitJob, 2000, this)() + } + }, + submit() { var scanCount = this.getScanCount(this.subList); @@ -277,6 +329,11 @@ mask: true }); var params = this.setParams() + if (!params.subList || params.subList.length == 0) { + uni.hideLoading() + this.showErrorMessage("请扫描您需要提交的补料任务") + return + } console.log("提交参数", JSON.stringify(params)); repleinshJobSubmit(params).then(res => { uni.hideLoading()