fix:不合格校验

This commit is contained in:
shijing 2024-08-01 17:38:43 +08:00
parent 061ebbb09f
commit 263a914fa9
2 changed files with 63 additions and 15 deletions

View File

@ -74,10 +74,26 @@
<el-table-column label="批次" prop="batch" min-width="100"> <el-table-column label="批次" prop="batch" min-width="100">
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="count"></el-table-column> <el-table-column label="数量" prop="count"></el-table-column>
<el-table-column label="类型" prop="type"> <el-table-column label="交接类型" prop="type">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.type == 10">正常</el-tag> <el-text
<el-tag v-if="scope.row.type == 20" type="danger" v-if="scope.row.send_mgroup == mgroupId"
type="primary"
>交送</el-text
>
<el-text
v-if="scope.row.recive_mgroup == mgroupId"
type="success"
>接收</el-text
>
</template>
</el-table-column>
<el-table-column label="状态" prop="type">
<template #default="scope">
<el-tag v-if="scope.row.type == 10" type="success"
>正常</el-tag
>
<el-tag v-if="scope.row.type == 20" type="warning"
>返工</el-tag >返工</el-tag
> >
</template> </template>

View File

@ -62,6 +62,7 @@
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="countChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -72,6 +73,7 @@
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="countChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -82,6 +84,7 @@
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="countChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -92,6 +95,7 @@
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="countChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -102,6 +106,7 @@
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="countChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -112,6 +117,7 @@
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="countChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -122,6 +128,7 @@
:min="0" :min="0"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@change="countChange"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -181,7 +188,17 @@ export default {
Object.assign(this.form, data); Object.assign(this.form, data);
console.log(this.form); console.log(this.form);
}, },
countChange() {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_qp +
this.form.count_n_swen +
this.form.count_n_bb +
this.form.count_n_md +
this.form.count_n_xh +
this.form.count_n_wm;
this.form.count_ok = this.form.count_real - this.form.count_notok;
},
// //
submit() { submit() {
let that = this; let that = this;
@ -189,6 +206,16 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
that.form.mlog = that.mlog; that.form.mlog = that.mlog;
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_qp +
this.form.count_n_swen +
this.form.count_n_bb +
this.form.count_n_md +
this.form.count_n_xh +
this.form.count_n_wm;
let sum = this.form.count_ok + this.form.count_notok;
if (sum - this.form.count_real == 0) {
that.$API.wpm.mlogb.updateOut that.$API.wpm.mlogb.updateOut
.req(that.form.id, that.form) .req(that.form.id, that.form)
.then((res) => { .then((res) => {
@ -200,6 +227,11 @@ export default {
.catch((err) => { .catch((err) => {
that.isSaveing = false; that.isSaveing = false;
}); });
} else {
this.$message.error(
"使用数量与合格数不合格数数量不对等"
);
}
} }
}); });
}, },