diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue index 2bfd64cd..ba6a0030 100644 --- a/src/pages/issue/job/issueDetail.vue +++ b/src/pages/issue/job/issueDetail.vue @@ -171,12 +171,6 @@ this.$refs.comIssueDetailCard.forEach(r => { r.resizeCollapse(); }) - // this.$refs.mainCollapse.forEach(r => { - // r.childrens.forEach(i => { - // i.init(); - // }) - // r.resize(); - // }) }); }, @@ -290,6 +284,7 @@ getManagementPrecisions(itemCodes, locationCode, res => { if (res.success) { this.managementList = res.list; + console.log("自动提交submitJob") this.submitJob(); } else { uni.hideLoading(); @@ -455,39 +450,43 @@ afterScan() { this.resizeCollapse(); + let str = "" this.detailSource.forEach(detail => { - let s = ''; detail.Items.forEach(item => { - let totalHandleQty = 0; - var isHandleEmpty = false; //多个库位时 handleQty =0; item.Locations.forEach(lco => { lco.Batchs.forEach(batch => { - if (batch.handleQty != 0) { - totalHandleQty = calc.add(totalHandleQty, batch - .handleQty) - } else { - isHandleEmpty = true; - } + batch.Records.forEach(record => { + if (batch.qty != record.qty) { + var tempHandleQty = 0 + if (record.qty) { + tempHandleQty = record.qty + } else { + tempHandleQty = 0 + } + str += + `包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n` + } + }) }) }) - if (item.qty == totalHandleQty) { - if (isHandleEmpty) { - return; - } - this.submit(); - } else { - this.$refs.comMessage.showQuestionMessage('实际扫描数量【' + totalHandleQty + - '】与物料需求数量【' + item.qty + - '】不一致,是否继续提交', res => { - if (res) { - this.submit(); - }else { - this.scanPopupGetFocus() - } - }); - } }) }) + + if (str) { + str = '任务明细未全部完成,是否提交?\n' + str + this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { + if (res) { + //防止重复点击 + this.$throttle(this.submit,2000,this)() + } else { + this.scanPopupGetFocus() + } + }); + } else { + //防止重复点击 + this.$throttle(this.submit,2000,this)() + + } }, scanPopupGetFocus() { diff --git a/src/pages/productionReceipt/job/productionReceiptDetail.vue b/src/pages/productionReceipt/job/productionReceiptDetail.vue index 1e246e2a..3968605d 100644 --- a/src/pages/productionReceipt/job/productionReceiptDetail.vue +++ b/src/pages/productionReceipt/job/productionReceiptDetail.vue @@ -217,9 +217,7 @@ }, autoCommit(){ //判断数量是否相等 - var noCommitInfo=null let str="" - this.detailSource.forEach((item) => { item.subList.forEach(cur => { if (cur.qty != cur.handleQty) { @@ -238,11 +236,11 @@ str = '任务明细未全部完成,是否提交?\n'+str this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { if (res) { - this.commit() + this.$throttle(this.commit,2000,this)() } }); } else { - this.commit() + this.$throttle(this.commit,2000,this)() } }, @@ -364,6 +362,7 @@ itemDetail.balance.packQty = Number(result.package.packQty) itemDetail.balance.packUnit = result.package.packUnit this.calcHandleQty(); + console.log("自动提交") this.autoCommit(); } else { this.scanPopupGetFocus(); @@ -387,6 +386,7 @@ itemDetail.balance.packQty = Number(result.package.packQty) itemDetail.balance.packUnit = result.package.packUnit this.calcHandleQty(); + this.autoCommit(); } } @@ -411,12 +411,14 @@ //扫描数量和任务数量相等,直接提交 if (this.scanCount == this.subList.length) { this.submitJob(); + console.log("提交this.submitJob()") } else if (this.scanCount < this.subList.length) { //扫描数量小于任务数量,判断是否允许部分提交 if (this.jobContent.allowPartialComplete == "TRUE") { //提交 this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => { if (res) { + console.log("提交this.submitJob()") this.submitJob() } }); @@ -470,34 +472,33 @@ this.showErrorMessage(error) }) - - var itemCodes = [] - this.detailSource.forEach(item => { - itemCodes.push(item.itemCode) - }) - - getManagementPrecisions(itemCodes, this.toLocationCode, res => { - if (res.success) { - this.managementList = res.list; - var params = this.setParams() - console.log("提交参数", JSON.stringify(params)); - - productionReceiptJobSubmit(params).then(res => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage("提交成功\n生成发料接收记录\n" + res.data) - } else { - this.showErrorMessage("提交失败[" + res.msg + "]") - } - }).catch(error => { - uni.hideLoading() - this.showErrorMessage(error) - }) - } else { - uni.hideLoading(); - this.showErrorMessage(res.message); - } - }); + // var itemCodes = [] + // this.detailSource.forEach(item => { + // itemCodes.push(item.itemCode) + // }) + + // getManagementPrecisions(itemCodes, this.toLocationCode, res => { + // if (res.success) { + // this.managementList = res.list; + // var params = this.setParams() + // console.log("提交参数", JSON.stringify(params)); + + // productionReceiptJobSubmit(params).then(res => { + // uni.hideLoading() + // if (res.data) { + // this.showCommitSuccessMessage("提交成功\n生成发料接收记录\n" + res.data) + // } else { + // this.showErrorMessage("提交失败[" + res.msg + "]") + // } + // }).catch(error => { + // uni.hideLoading() + // this.showErrorMessage(error) + // }) + // } else { + // uni.hideLoading(); + // this.showErrorMessage(res.message); + // } + // }); }, setParams() {