diff --git a/src/views/wpm_bx/mlog_detail.vue b/src/views/wpm_bx/mlog_detail.vue index 4bd10c2b..91457c32 100644 --- a/src/views/wpm_bx/mlog_detail.vue +++ b/src/views/wpm_bx/mlog_detail.vue @@ -58,7 +58,11 @@ {{ wmState[mlogItem.wm_in_state]?.text }} -
+
+
+ 合格B类不拆批 + +
Array.isArray(row.mlogbdefect) + && row.mlogbdefect.some(d => Number(d.defect_okcate) === 20 && Number(d.count) > 0)); + }, + }, data() { return { wmState, @@ -976,14 +987,25 @@ export default { submitFun(){ let that = this; that.isSaveing = true; - that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { - that.isSaveing = false; - that.visible = false; - that.$emit('closed',false); - that.$message.success("操作成功"); - }).catch(() => { - that.isSaveing = false; - }); + const doSubmit = () => { + that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { + that.isSaveing = false; + that.visible = false; + that.$emit('closed',false); + that.$message.success("操作成功"); + }).catch(() => { + that.isSaveing = false; + }); + }; + if (that.hasOkBDefect) { + that.$API.wpm.mlog.change.req(that.mlogItem.id, { clear_defect: !!that.mlogItem.clear_defect }).then(() => { + doSubmit(); + }).catch(() => { + that.isSaveing = false; + }); + } else { + doSubmit(); + } }, saveMuserSubmit(row){ let that = this; diff --git a/src/views/wpm_gx/mlog_detail.vue b/src/views/wpm_gx/mlog_detail.vue index 5708975a..987d8b45 100644 --- a/src/views/wpm_gx/mlog_detail.vue +++ b/src/views/wpm_gx/mlog_detail.vue @@ -61,7 +61,11 @@ {{mlogItem.test_file}} -
+
+
+ 合格B类不拆批 + +
Array.isArray(row.mlogbdefect) + && row.mlogbdefect.some(d => Number(d.defect_okcate) === 20 && Number(d.count) > 0)); + }, + }, data() { return { wmState, @@ -638,11 +649,25 @@ export default { //表单提交方法 mlogSubmit() { let that = this; - that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { - that.isSaveing = false; - that.visible = false; - that.$message.success("操作成功"); - }); + that.isSaveing = true; + const doSubmit = () => { + that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { + that.isSaveing = false; + that.visible = false; + that.$message.success("操作成功"); + }).catch(() => { + that.isSaveing = false; + }); + }; + if (that.hasOkBDefect) { + that.$API.wpm.mlog.change.req(that.mlogItem.id, { clear_defect: !!that.mlogItem.clear_defect }).then(() => { + doSubmit(); + }).catch(() => { + that.isSaveing = false; + }); + } else { + doSubmit(); + } }, // //渲染工单提交按钮 // getInit() {