From bd7543f09d284a5b42f09d19e1f506efb558ffa3 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Thu, 21 Dec 2023 19:59:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A5=E6=96=99=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8F=90=E4=BA=A4=E6=89=AB=E6=8F=8F=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/productionReturn/coms/comReturn.vue | 3 +-- pages/repleinsh/job/repleinshDetail.vue | 27 ++++++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/pages/productionReturn/coms/comReturn.vue b/pages/productionReturn/coms/comReturn.vue index 2915c41d..a64553a4 100644 --- a/pages/productionReturn/coms/comReturn.vue +++ b/pages/productionReturn/coms/comReturn.vue @@ -107,7 +107,6 @@ data() { return { id: '', - scanCount: 0, dataContent: {}, //任务内容 subList: [], //接口返回的任务subList detailSource: [], //绑定在页面上的数据源 @@ -297,7 +296,7 @@ productionReturnRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { - this.showCommitSuccessMessage("提交成功
生成制品收货记录
" + res.data) + this.showCommitSuccessMessage("提交成功
生成退料收货记录
" + res.data) } else { this.showErrorMessage("提交失败[" + res.msg + "]") } diff --git a/pages/repleinsh/job/repleinshDetail.vue b/pages/repleinsh/job/repleinshDetail.vue index a4a1f3ed..429f3377 100644 --- a/pages/repleinsh/job/repleinshDetail.vue +++ b/pages/repleinsh/job/repleinshDetail.vue @@ -173,7 +173,6 @@ that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) that.detailSource = getDataSource(that.detailSource, that.subList) that.resizeCollapse(); - uni.hideLoading(); } else { that.showMessage('列表数据为0'); } @@ -198,7 +197,11 @@ submit() { - + var scanCount= this.getScanCount(this.subList); + if(scanCount==0){ + this.showErrorMessage("扫描数为0,请先扫描") + return; + } uni.showLoading({ title: "提交中....", mask: true @@ -237,7 +240,7 @@ repleinshJobSubmit(params).then(res => { uni.hideLoading() if (res.data) { - this.showCommitSuccessMessage("提交成功
生成补料记录" + res.data) + this.showCommitSuccessMessage("提交成功
生成补料记录
" + res.data) } else { this.showErrorMessage("提交失败[" + res.msg + "]") } @@ -432,6 +435,24 @@ }) }, + getScanCount(subList){ + var scanCount = 0; + this.detailSource.forEach(toLocationCode => { + toLocationCode.Items.forEach(item => { + item.Locations.forEach(fromLocation => { + fromLocation.Batchs.forEach(batch => { + let subItem = batch.detail; + if (batch.Records.length > 0) { + scanCount+=batch.Records.length + } + }) + }) + }) + }) + return scanCount; + } + + } };