From e57a33aa1f1f7af530f28ebc9e06af37dc2b0fff Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Fri, 6 Sep 2024 16:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E5=8C=85=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=92=8C=E6=89=AB=E6=8F=8F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/package/job/overPackageJob.vue | 1 + .../package/job/overPackageJobDetail.vue | 56 +++++++++++++------ 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/pages/package/job/overPackageJob.vue b/src/pages/package/job/overPackageJob.vue index 4dc05588..5ba2e277 100644 --- a/src/pages/package/job/overPackageJob.vue +++ b/src/pages/package/job/overPackageJob.vue @@ -235,6 +235,7 @@ uni.hideLoading(); if (type === "refresh") { uni.stopPullDownRefresh(); + this.openScanPopup() } var list = res.data.list; this.totalCount = res.data.total diff --git a/src/pages/package/job/overPackageJobDetail.vue b/src/pages/package/job/overPackageJobDetail.vue index d7527616..d42813db 100644 --- a/src/pages/package/job/overPackageJobDetail.vue +++ b/src/pages/package/job/overPackageJobDetail.vue @@ -338,23 +338,47 @@ // } }, checkSubmit() { - var tempHandleQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].handleQty - var tempQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].qty - var toPackQty = this.detailSource[0].Items[0].Locations[0].Batchs[0].toPackQty - if (tempHandleQty == 0) { - this.showErrorMessage("实际数量为0,请先扫描数据") - return - } - if (tempHandleQty > tempQty) { - //大于需求数量 - this.showCommitMessage("实际数量【" + tempHandleQty + "】大于需求数量" + "【" + tempQty + "】, 是否提交?", tempHandleQty, - toPackQty) - } else if (tempHandleQty < tempQty) { - this.showCommitMessage("实际数量【" + tempHandleQty + "】小于需求数量" + "【" + tempQty + "】, 是否提交?", tempHandleQty, - toPackQty) - } else { - this.packageHint(tempHandleQty, toPackQty) + + let str="" + this.detailSource.forEach(detail => { + detail.Items.forEach(item => { + var taskQty =0; + item.taskQty =calc.add(taskQty,item.qty) + var totalQty =0; + item.Locations.forEach(lco => { + lco.Batchs.forEach(batch => { + batch.Records.forEach(record => { + if(record){ + var hanleQty =record.qty?record.qty:0 + totalQty = calc.add(totalQty,hanleQty) + } + + }) + }) + }) + //实际扫描的数量 + item.totalQty =totalQty + + }) + }) + + //如果允许部分提交任务有扫描记录就可以直接提交;如果不允许部分执行,任务数量和提交数量不一致给出提示 + this.detailSource.forEach(detail=>{ + detail.Items.forEach(item=>{ + if(item.taskQty!=item.totalQty){ + str += `物料号【${item.itemCode}】实际提交数量【${item.totalQty}】与任务数量【${item.taskQty}】与不一致\n` + } + }) + }) + var toPackQty = this.detailSource[0].Items[0].qty + var commitHandleQty =this.detailSource[0].Items[0].totalQty + if(str){ + str ="是否提交\n"+str + this.showCommitMessage(str,commitHandleQty,toPackQty) + }else { + this.packageHint(commitHandleQty, toPackQty) } + }, packageHint(tempHandleQty, toPackQty) { //包装提示