diff --git a/src/pages/issue/job/issueDetailBatch.vue b/src/pages/issue/job/issueDetailBatch.vue index 090066d4..0ad14d29 100644 --- a/src/pages/issue/job/issueDetailBatch.vue +++ b/src/pages/issue/job/issueDetailBatch.vue @@ -621,6 +621,7 @@ let str="" let str1="" let str2="" + let str3="" var totalQty =0; var taskQty =0; console.log(877,this.detailSource) @@ -628,56 +629,57 @@ detail.subList.forEach(item => { if(item.scaned){ taskQty =calc.add(taskQty,item.qty) - totalQty =calc.add(totalQty,item.handleQty) - if (this.jobContent.allowSmallerQty == "FALSE") { - if(parseFloat(item.handleQty) parseFloat(item.qty)){ - str1 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许大于任务数量【${item.qty}】` - } + totalQty =calc.add(totalQty,item.handleQty) + if(parseFloat(item.handleQty) parseFloat(item.qty)){ + str1 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不允许大于任务数量【${item.qty}】` } + if(parseFloat(item.handleQty)>parseFloat( item.balance.qty)){ str2 += `批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}】` } + } }) }) - console.log(877,str) - if (str) { - str1 = '不允许提交\n' + str - this.showErrorMessage(str) - return + if (this.jobContent.allowSmallerQty == "FALSE") { + if (str) { + str = '不允许提交\n' + str + this.showErrorMessage(str) + return + } } - if (str1) { - str1 = '不允许提交\n' + str1 - this.showErrorMessage(str1) - return + if (this.jobContent.allowBiggerQty == 'FALSE') { + 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 => { + console.log(str3) + if(str3){ + str3 = str3+",是否提交" + this.$refs.comMessage.showQuestionMessage1(str3, 'red', res => { if (res) { //防止重复点击 - this.$throttle(this.submit, 2000, this)() + // this.$throttle(this.submit, 2000, this)() } else { this.scanPopupGetFocus() } }); }else { //防止重复点击 - this.$throttle(this.submit, 2000, this)() + // this.$throttle(this.submit, 2000, this)() } },