diff --git a/pages/inspect/job/inspectResult.vue b/pages/inspect/job/inspectResult.vue
index d0d67ec2..b62d0e1b 100644
--- a/pages/inspect/job/inspectResult.vue
+++ b/pages/inspect/job/inspectResult.vue
@@ -48,38 +48,40 @@
- 不合格数量
+ 下一步动作
-
-
+
+
-
- 报废数量
+ 不合格数量
-
+
+
- 下一步动作
+ 报废数量
-
-
+
+
+
+
最终不合格
@@ -155,7 +157,7 @@
getInspectType,
getUnitInfo
} from '@/common/directory.js';
-
+
import {
goHome,
navigateBack
@@ -303,8 +305,10 @@
},
nextStepChange(e) {
- this.nextAction = e.detail.value[0].value;
- this.calcNotPassQty();
+ if (e.detail.value.length > 0) {
+ this.nextAction = e.detail.value[0].value;
+ this.calcNotPassQty();
+ }
},
calcNotPassQty() {
@@ -328,145 +332,211 @@
}
}
},
-
- clearFailedQty(){
+
+ clearFailedQty() {
this.jobContent.failedQty = null;
},
-
- clearCrackQty(){
+
+ clearCrackQty() {
this.jobContent.crackQty = null
},
commit() {
-
- if (this.jobContent.failedQty == null) {
- this.showMessage("请输入不合格数量")
- return
- }
-
- if (this.jobContent.crackQty == null) {
- this.showMessage("请输入不报废数量")
- return
- }
- var receiveQty = Number(this.jobContent.receiveQty)
- var failedQty = Number(this.jobContent.failedQty);
- var crackQty = Number(this.jobContent.crackQty);
-
- if (crackQty + failedQty > receiveQty) {
- var total = crackQty + failedQty;
- this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
- receiveQty + "]")
- return
- }
-
- //不合格数量==0、(全部合格)、明细全部合格
- if (failedQty == 0) {
- if (crackQty == 0) {
- if (this.nextAction == "ALL_NOK") {
- this.jobContent.subList.forEach(res => {
- res.handleQty = res.qty
- res.failedQty = res.qty;
- res.notPassedQty = res.failedQty;
- res.crackQty = 0;
- res.goodQty = 0;
- res.failedReason = "";
- res.photos = ""
- res.inspectResult = ""
- res.toInventoryStatus = "NOK"
- res.inspectUser = this.$store.state.user.id
- })
- this.jobContent.nextAction = this.nextAction;
- this.jobContent.goodQty = 0
- this.submitJob(this.jobContent)
- }else {
- //报废数==0,直接提交
- this.jobContent.subList.forEach(res => {
- res.handleQty = res.qty
- res.failedQty = 0;
- res.notPassedQty = res.failedQty;
- res.crackQty = 0;
- res.goodQty = res.qty;
- res.failedReason = "";
- res.photos = ""
- res.inspectResult = ""
- res.toInventoryStatus = "OK"
- res.inspectUser = this.$store.state.user.id
- })
-
- this.jobContent.nextAction = "";
- this.jobContent.goodQty = this.jobContent.receiveQty
- this.submitJob(this.jobContent)
- }
-
- } else {
- //报废数大于0,进入详情
- //进入下一页面
- uni.navigateTo({
- url: './inspectDetail?id=' + this.id +
- '&status=' + this.status +
- '&failedQty=' + this.jobContent.failedQty +
- '&crackQty=' + this.jobContent.crackQty
- });
- }
-
- } else {
-
- //不合格数量>0
- //下一步动作
if (this.nextAction == null) {
this.showMessage("请选择下一步动作")
return
}
-
- //全不合格
- if (this.nextAction == "ALL_NOK") {
- //提交
- this.jobContent.subList.forEach(res => {
- res.handleQty = res.qty
- res.failedQty = res.qty;
- res.notPassedQty = res.failedQty;
- res.crackQty = 0;
- res.goodQty = 0;
- res.failedReason = "";
- res.photos = ""
- res.inspectResult = ""
- res.toInventoryStatus = "NOK"
- res.inspectUser = this.$store.state.user.id
- })
- this.jobContent.nextAction = this.nextAction;
- this.jobContent.goodQty = 0
- this.submitJob(this.jobContent)
- //部分合格
- } else if (this.nextAction == "PARTIAL_OK") {
- //进入下一页面
- uni.navigateTo({
- url: './inspectDetail?id=' + this.id +
- '&status=' + this.status +
- '&failedQty=' + this.jobContent.failedQty +
- '&crackQty=' + this.jobContent.crackQty
- });
- //全检 生成全检任务
- } else if (this.nextAction == "FULL_INSPECT") {
- //提交
- this.jobContent.subList.forEach(res => {
- res.handleQty = res.qty
- res.failedQty = 0;
- res.notPassedQty = res.failedQty;
- res.crackQty = 0;
- res.goodQty = res.qty;
- res.failedReason = "";
- res.photos = ""
- res.inspectResult = ""
- res.toInventoryStatus = "OK"
- res.inspectUser = this.$store.state.user.id
- })
- this.jobContent.goodQty = this.jobContent.receiveQty
- this.jobContent.nextAction = this.nextAction;
- this.submitJob(this.jobContent)
- }
+ if (this.nextAction == "ALL_OK") {
+ //全合格
+ this.jobContent.subList.forEach(res => {
+ res.handleQty = res.qty //要查询库存余额
+ res.failedQty = 0;
+ res.notPassedQty = 0;
+ res.crackQty = 0;
+ res.goodQty = res.qty;
+ res.failedReason = "";
+ res.photos = ""
+ res.inspectResult = ""
+ res.toInventoryStatus = "OK"
+ res.inspectUser = this.$store.state.user.id
+ })
+ this.jobContent.goodQty = this.jobContent.receiveQty
+ this.jobContent.nextAction = this.nextAction;
+ this.submitJob(this.jobContent)
+
+ } else if (this.nextAction == "ALL_NOK") {
+ //全都不合格
+ this.jobContent.subList.forEach(res => {
+ res.handleQty = res.qty
+ res.failedQty = res.qty;
+ res.notPassedQty = res.failedQty;
+ res.crackQty = 0;
+ res.goodQty = 0;
+ res.failedReason = "";
+ res.photos = ""
+ res.inspectResult = ""
+ res.toInventoryStatus = "NOK"
+ res.inspectUser = this.$store.state.user.id
+ })
+ this.jobContent.nextAction = this.nextAction;
+ this.jobContent.goodQty = 0
+ this.submitJob(this.jobContent)
+
+ } else if (this.nextAction == "PARTIAL_OK") {
+ //部分合格
+ if (this.jobContent.failedQty == null) {
+ this.showMessage("请输入不合格数量")
+ return
+ }
+ if (this.jobContent.crackQty == null) {
+ this.showMessage("请输入报废数量")
+ return
+ }
+ var receiveQty = Number(this.jobContent.receiveQty)
+ var failedQty = Number(this.jobContent.failedQty);
+ var crackQty = Number(this.jobContent.crackQty);
+
+ if (crackQty + failedQty > receiveQty) {
+ var total = crackQty + failedQty;
+ this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
+ receiveQty + "]")
+ return
+ }
+ uni.navigateTo({
+ url: './inspectDetail?id=' + this.id +
+ '&status=' + this.status +
+ '&failedQty=' + this.jobContent.failedQty +
+ '&crackQty=' + this.jobContent.crackQty
+ });
+ } else if (this.nextAction == "FULL_INSPECT") {
+ //全检
+ this.jobContent.subList.forEach(res => {
+ res.handleQty = res.qty
+ res.failedQty = 0;
+ res.notPassedQty = res.failedQty;
+ res.crackQty = 0;
+ // res.goodQty = res.qty;
+ res.goodQty = 0;
+ res.failedReason = "";
+ res.photos = ""
+ res.inspectResult = ""
+ res.toInventoryStatus = "OK"
+ res.inspectUser = this.$store.state.user.id
+ })
+ this.jobContent.goodQty = this.jobContent.receiveQty
+ this.jobContent.nextAction = this.nextAction;
+ this.submitJob(this.jobContent)
}
+ //不合格数量==0、(全部合格)、明细全部合格
+ // if (failedQty == 0) {
+ // if (crackQty == 0) {
+ // if (this.nextAction == "ALL_NOK") {
+ // this.jobContent.subList.forEach(res => {
+ // res.handleQty = res.qty
+ // res.failedQty = res.qty;
+ // res.notPassedQty = res.failedQty;
+ // res.crackQty = 0;
+ // res.goodQty = 0;
+ // res.failedReason = "";
+ // res.photos = ""
+ // res.inspectResult = ""
+ // res.toInventoryStatus = "NOK"
+ // res.inspectUser = this.$store.state.user.id
+ // })
+ // this.jobContent.nextAction = this.nextAction;
+ // this.jobContent.goodQty = 0
+ // this.submitJob(this.jobContent)
+ // }else {
+ // //报废数==0,直接提交
+ // this.jobContent.subList.forEach(res => {
+ // res.handleQty = res.qty
+ // res.failedQty = 0;
+ // res.notPassedQty = res.failedQty;
+ // res.crackQty = 0;
+ // res.goodQty = res.qty;
+ // res.failedReason = "";
+ // res.photos = ""
+ // res.inspectResult = ""
+ // res.toInventoryStatus = "OK"
+ // res.inspectUser = this.$store.state.user.id
+ // })
+
+ // this.jobContent.nextAction = "";
+ // this.jobContent.goodQty = this.jobContent.receiveQty
+ // this.submitJob(this.jobContent)
+ // }
+
+ // } else {
+ // //报废数大于0,进入详情
+ // //进入下一页面
+ // uni.navigateTo({
+ // url: './inspectDetail?id=' + this.id +
+ // '&status=' + this.status +
+ // '&failedQty=' + this.jobContent.failedQty +
+ // '&crackQty=' + this.jobContent.crackQty
+ // });
+ // }
+
+ // } else {
+
+ // //不合格数量>0
+ // //下一步动作
+ // if (this.nextAction == null) {
+ // this.showMessage("请选择下一步动作")
+ // return
+ // }
+
+ // //全不合格
+ // if (this.nextAction == "ALL_NOK") {
+ // //提交
+ // this.jobContent.subList.forEach(res => {
+ // res.handleQty = res.qty
+ // res.failedQty = res.qty;
+ // res.notPassedQty = res.failedQty;
+ // res.crackQty = 0;
+ // res.goodQty = 0;
+ // res.failedReason = "";
+ // res.photos = ""
+ // res.inspectResult = ""
+ // res.toInventoryStatus = "NOK"
+ // res.inspectUser = this.$store.state.user.id
+ // })
+ // this.jobContent.nextAction = this.nextAction;
+ // this.jobContent.goodQty = 0
+ // this.submitJob(this.jobContent)
+ // //部分合格
+ // } else if (this.nextAction == "PARTIAL_OK") {
+ // //进入下一页面
+ // uni.navigateTo({
+ // url: './inspectDetail?id=' + this.id +
+ // '&status=' + this.status +
+ // '&failedQty=' + this.jobContent.failedQty +
+ // '&crackQty=' + this.jobContent.crackQty
+ // });
+ // //全检 生成全检任务
+ // } else if (this.nextAction == "FULL_INSPECT") {
+ // //提交
+ // this.jobContent.subList.forEach(res => {
+ // res.handleQty = res.qty
+ // res.failedQty = 0;
+ // res.notPassedQty = res.failedQty;
+ // res.crackQty = 0;
+ // res.goodQty = res.qty;
+ // res.failedReason = "";
+ // res.photos = ""
+ // res.inspectResult = ""
+ // res.toInventoryStatus = "OK"
+ // res.inspectUser = this.$store.state.user.id
+ // })
+ // this.jobContent.goodQty = this.jobContent.receiveQty
+ // this.jobContent.nextAction = this.nextAction;
+ // this.submitJob(this.jobContent)
+ // }
+
+ // }
+
},
submitJob(params) {
uni.showLoading({
@@ -477,11 +547,11 @@
inspectJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
- var hint="";
- if(this.jobContent.nextAction=="FULL_INSPECT"){
- hint ="提交成功
生成到货检验任务
" + res.data
- }else {
- hint ="提交成功
生成到货检验记录
" + res.data
+ var hint = "";
+ if (this.jobContent.nextAction == "FULL_INSPECT") {
+ hint = "提交成功
生成到货检验任务
" + res.data
+ } else {
+ hint = "提交成功
生成到货检验记录
" + res.data
}
this.showCommitSuccessMessage(hint)
} else {
diff --git a/pages/putaway/job/putawayDetail.vue b/pages/putaway/job/putawayDetail.vue
index 7c6d743d..f2eede04 100644
--- a/pages/putaway/job/putawayDetail.vue
+++ b/pages/putaway/job/putawayDetail.vue
@@ -425,7 +425,7 @@
putawayJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
- this.showCommitSuccessMessage("提交成功
生成采购收货记录" + res.data)
+ this.showCommitSuccessMessage("提交成功
生成原料上架记录
" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}