From 5abb3f056286b02298165982de00b825a9330048 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Fri, 24 Nov 2023 09:20:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=B0=E8=B4=A7=E6=A3=80?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/inspect/job/inspectDetail.vue | 56 +++++++------ pages/inspect/job/inspectResult.vue | 124 +++++++++++++++++++++------- 2 files changed, 125 insertions(+), 55 deletions(-) diff --git a/pages/inspect/job/inspectDetail.vue b/pages/inspect/job/inspectDetail.vue index e9142465..071da10b 100644 --- a/pages/inspect/job/inspectDetail.vue +++ b/pages/inspect/job/inspectDetail.vue @@ -105,6 +105,7 @@ // } this.getDetail(); } + }, //返回首页 onNavigationBarButtonTap(e) { @@ -113,24 +114,24 @@ } }, - onBackPress(e) { - //已经接收但是没提交任务 - if (e.from == 'backbutton') { - if (this.received) { - //取消承接任务 - cancleTakeInspectJob(this.id).then(res => { - uni.navigateBack(); - }).catch(error => { - uni.navigateBack(); - }) - } else { - uni.navigateBack(); - } - - return true; - } - - }, + // onBackPress(e) { + // //已经接收但是没提交任务 + // if (e.from == 'backbutton') { + // if (this.received) { + // //取消承接任务 + // cancleTakeInspectJob(this.id).then(res => { + // uni.navigateBack(); + // }).catch(error => { + // uni.navigateBack(); + // }) + // } else { + // uni.navigateBack(); + // } + + // return true; + // } + + // }, onPullDownRefresh() { this.getDetail(); @@ -174,7 +175,7 @@ that.jobContent = res.data; that.subList = res.data.subList; that.subList.forEach(res => { - res.batch =that.jobContent.batch + res.batch = that.jobContent.batch res.goodQty = 0; res.failedQty = 0; res.crackQty = 0; @@ -265,8 +266,8 @@ } else { var itemDetail = detail.subList.find(r => { return r.packingNumber == packingNumber - // && - // r.batch == batch + && + r.batch == batch }) if (itemDetail == undefined) { this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中") @@ -281,7 +282,7 @@ ']不一致,是否继续上架?', res => { if (res) { itemDetail.scaned = true; - // itemDetail.handleQty = Number(result.label.qty); + itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):Number(result.label.qty); this.calcHandleQty(); } else { this.scanPopupGetFocus(); @@ -289,7 +290,7 @@ }); } else { itemDetail.scaned = true; - // itemDetail.handleQty = Number(result.label.qty); + itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):Number(result.label.qty); this.calcHandleQty(); } } @@ -302,6 +303,11 @@ }, commit() { + this.scanCount = getScanCount(this.subList); + if( this.scanCount==0){ + this.showErrorMessage("扫描数为0,请先扫描") + return; + } //扫描数量和任务数量相等,直接提交 if (this.scanCount == this.subList.length) { this.submitJob(); @@ -330,7 +336,7 @@ }); var params = this.setParams(); - console.log("提交参数", params) + console.log("提交参数", JSON.stringify(params)); inspectJobSubmit(params).then(res => { uni.hideLoading() if (res.data) { @@ -410,7 +416,6 @@ detail.crackQty = detail.crackQty; detail.notPassedQty = detail.notPassedQty; detail.goodQty = detail.qty - detail.failedQty - detail.crackQty; - detail.fromInventoryStatus = detail.inventoryStatus; detail.inspectUser = this.$store.state.user.id //合格数==样品数,全部合格 @@ -430,6 +435,7 @@ }) }) this.jobContent.subList = list + return this.jobContent; }, showCommitSuccessMessage(hint) { diff --git a/pages/inspect/job/inspectResult.vue b/pages/inspect/job/inspectResult.vue index 7b91b8f4..4e6656a8 100644 --- a/pages/inspect/job/inspectResult.vue +++ b/pages/inspect/job/inspectResult.vue @@ -110,7 +110,7 @@ + v-for="(item, index) in detailList" :key="item.id"> {{index+1}}. @@ -134,17 +134,21 @@ - +