From 868a186ede72af7249fd46a5d2923ff0b071f537 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 12 Nov 2024 15:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E6=96=99=E5=88=A4=E6=96=AD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/deliver/job/deliverDetailBatch.vue | 2 +- .../issue/coms/comIssueDetailCardBatch.vue | 2 +- src/pages/issue/job/issueDetailBatch.vue | 95 ++++++++++++------- 3 files changed, 62 insertions(+), 37 deletions(-) diff --git a/src/pages/deliver/job/deliverDetailBatch.vue b/src/pages/deliver/job/deliverDetailBatch.vue index 0db4d140..a5a43e30 100644 --- a/src/pages/deliver/job/deliverDetailBatch.vue +++ b/src/pages/deliver/job/deliverDetailBatch.vue @@ -509,7 +509,7 @@ item.totalQty=0 item.taskQty =calc.add(item.taskQty,item.qty) item.totalQty =calc.add(item.totalQty,item.handleQty) - if (this.jobContent.allowPartialComplete == "FALSE") { + if (this.jobContent.allowSmallerQty == "FALSE") { if(item.handleQty!=item.taskQty){ str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.taskQty}】不一致\n` } diff --git a/src/pages/issue/coms/comIssueDetailCardBatch.vue b/src/pages/issue/coms/comIssueDetailCardBatch.vue index 33de6657..2e59bcf8 100644 --- a/src/pages/issue/coms/comIssueDetailCardBatch.vue +++ b/src/pages/issue/coms/comIssueDetailCardBatch.vue @@ -14,7 +14,7 @@ + :right-options="(item.scaned&&settingParam.allowModifyQty == 'TRUE')?editAndRemoveOptions : item.scaned? removeOptions:options" @click="itemCoceClick($event,item,index)"> diff --git a/src/pages/issue/job/issueDetailBatch.vue b/src/pages/issue/job/issueDetailBatch.vue index ecfc19cb..f8af2d29 100644 --- a/src/pages/issue/job/issueDetailBatch.vue +++ b/src/pages/issue/job/issueDetailBatch.vue @@ -217,7 +217,7 @@ that.showMessage('未获取到详情'); } else { if (res.data.subList.length > 0) { - res.data.allowModifyLocation = 'FALSE' + // res.data.allowModifyLocation = 'FALSE' that.jobContent = res.data; that.jobStatus = res.data.status that.subList = res.data.subList; @@ -261,16 +261,36 @@ }, getScanResult(result, managementTypeParams) { - console.log(this.jobContent.allowModifyLocation) - // if(this.jobContent.allowModifyLocation == 'TRUE'){ - // this.managementType = managementTypeParams - // if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ - // this.setDataBatch(result) - // } - // }else{ - // this.showErrorMessage(`不可以扫描推荐库位【${this.fromLocationCode}】的库位`) - // } this.managementType = managementTypeParams + let array1 = []//记录推荐的库位 + let array2 = []//记录推荐的批次 + this.detailSource.forEach(item=>{ + item.subList.forEach(cur=>{ + array1.push(cur.fromLocationCode) + array2.push(cur.batch) + }) + }) + // 扫描的库位是否在 + const obj1 = array1.find(item=>item == result.fromLocationCode) + const obj2 = array2.find(item=>item == result.label.batch) + if(this.jobContent.allowModifyLocation == 'FALSE'){ + if(!obj1){ + this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) + return + } + } + if(this.jobContent.allowModifyBatch == 'FALSE'){ + if(!obj2){ + this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) + return + } + } + if(!obj1){ + this.recommendQty = 0 + }else{ + this.recommendQty = result.balance.qty + } + // this.managementType = managementTypeParams if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ this.setDataBatch(result) } @@ -327,7 +347,7 @@ toLocationCode:this.toLocationCode, batch:result.label.batch, handleQty:result.label.qty, - qty:result.balance.qty, + qty:this.recommendQty, inventoryStatus:result.balance.inventoryStatus, toLocation:result.balance.toLocation, balance:result.balance, @@ -596,8 +616,11 @@ autoCommit(){ // this.$throttle(this.submit, 2000, this)() + // this.jobContent.allowSmallerQty = 'FALSE' + this.jobContent.allowBiggerQty = 'FALSE' let str="" let str1="" + let str2="" var totalQty =0; var taskQty =0; console.log(877,this.detailSource) @@ -605,29 +628,43 @@ detail.subList.forEach(item => { if(item.scaned){ taskQty =calc.add(taskQty,item.qty) - totalQty =calc.add(totalQty,item.handleQty) - if(item.handleQty parseFloat(item.qty)){ + str1 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许大于任务数量【${item.qty}】` + } } - if(item.handleQty>item.balance.qty){ - str1 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}】` + if(parseFloat(item.handleQty)>parseFloat( item.balance.qty)){ + str2 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}】` } } }) }) - if(str1){ - this.$refs.comMessage.showMessage(str1, res => { - if (res) { - this.afterCloseMessage() - } - }); + console.log(877,str) + if (str) { + str1 = '不允许提交\n' + str + this.showErrorMessage(str) + return + } + if (str1) { + str1 = '不允许提交\n' + str1 + this.showErrorMessage(str1) + return + } + if (str2) { + str2 = '不允许提交\n' + str2 + this.showErrorMessage(str2) return } if(str){ str = '任务明细未全部完成,是否提交?\n' + str } - if(totalQty!=taskQty){ str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交" this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { @@ -635,18 +672,6 @@ //防止重复点击 this.$throttle(this.submit, 2000, this)() } else { - // this.detailSource.forEach(detail => { - // detail.Items.forEach(item => { - // taskQty =calc.add(taskQty,item.qty) - // item.Locations.forEach(lco => { - // lco.Batchs.forEach(batch => { - // batch.Records = [] - // }) - // }) - // }) - // }) - // this.$refs.comScanIssuePack.clearList() - this.scanPopupGetFocus() } });