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 @@ - +