This commit is contained in:
shijing 2026-05-14 09:25:35 +08:00
commit 9ec1c19b58
2 changed files with 62 additions and 15 deletions

View File

@ -58,7 +58,11 @@
<el-tag :type="wmState[mlogItem.wm_in_state]?.type">{{ wmState[mlogItem.wm_in_state]?.text }}</el-tag> <el-tag :type="wmState[mlogItem.wm_in_state]?.type">{{ wmState[mlogItem.wm_in_state]?.text }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;"> <div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
<div v-if="mlogItem.submit_time == null && hasOkBDefect" style="margin-right: 16px;display:flex;align-items:center;">
<span style="margin-right: 6px;">合格B类不拆批</span>
<el-switch v-model="mlogItem.clear_defect"></el-switch>
</div>
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null" v-if="mlogItem.submit_time == null"
@ -485,6 +489,13 @@ export default {
print print
}, },
emits: ["success", "closed"], emits: ["success", "closed"],
computed: {
hasOkBDefect() {
const rows = this.tableData2 || [];
return rows.some(row => Array.isArray(row.mlogbdefect)
&& row.mlogbdefect.some(d => Number(d.defect_okcate) === 20 && Number(d.count) > 0));
},
},
data() { data() {
return { return {
wmState, wmState,
@ -976,14 +987,25 @@ export default {
submitFun(){ submitFun(){
let that = this; let that = this;
that.isSaveing = true; that.isSaveing = true;
that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { const doSubmit = () => {
that.isSaveing = false; that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => {
that.visible = false; that.isSaveing = false;
that.$emit('closed',false); that.visible = false;
that.$message.success("操作成功"); that.$emit('closed',false);
}).catch(() => { that.$message.success("操作成功");
that.isSaveing = false; }).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){ saveMuserSubmit(row){
let that = this; let that = this;

View File

@ -61,7 +61,11 @@
<el-link :href="mlogItem.test_file" target="_blank" type="primary" :underline="false">{{mlogItem.test_file}}</el-link> <el-link :href="mlogItem.test_file" target="_blank" type="primary" :underline="false">{{mlogItem.test_file}}</el-link>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;"> <div style="padding: 5px 10px;display: flex;justify-content: end;align-items: center;">
<div v-if="mlogItem.submit_time == null && hasOkBDefect" style="margin-right: 16px;display:flex;align-items:center;">
<span style="margin-right: 6px;">合格B类不拆批</span>
<el-switch v-model="mlogItem.clear_defect"></el-switch>
</div>
<el-button <el-button
type="primary" type="primary"
v-if="mlogItem.submit_time == null" v-if="mlogItem.submit_time == null"
@ -397,6 +401,13 @@ export default {
printDialog printDialog
}, },
emits: ["success", "closed"], emits: ["success", "closed"],
computed: {
hasOkBDefect() {
const rows = this.tableData2 || [];
return rows.some(row => Array.isArray(row.mlogbdefect)
&& row.mlogbdefect.some(d => Number(d.defect_okcate) === 20 && Number(d.count) > 0));
},
},
data() { data() {
return { return {
wmState, wmState,
@ -638,11 +649,25 @@ export default {
// //
mlogSubmit() { mlogSubmit() {
let that = this; let that = this;
that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => { that.isSaveing = true;
that.isSaveing = false; const doSubmit = () => {
that.visible = false; that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => {
that.$message.success("操作成功"); 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() { // getInit() {