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>
<el-table-column label="数量" prop="count"></el-table-column>
<el-table-column label="类型" prop="type">
<el-table-column label="交接类型" prop="type">
<template #default="scope">
<el-tag v-if="scope.row.type == 10">正常</el-tag>
<el-tag v-if="scope.row.type == 20" type="danger"
<el-text
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
>
</template>

View File

@ -62,6 +62,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -72,6 +73,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -82,6 +84,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -92,6 +95,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -102,6 +106,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -112,6 +117,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -122,6 +128,7 @@
:min="0"
class="width-100"
controls-position="right"
@change="countChange"
/>
</el-form-item>
</el-col>
@ -181,7 +188,17 @@ export default {
Object.assign(this.form, data);
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() {
let that = this;
@ -189,17 +206,32 @@ export default {
if (valid) {
that.isSaveing = true;
that.form.mlog = that.mlog;
that.$API.wpm.mlogb.updateOut
.req(that.form.id, that.form)
.then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
that.isSaveing = false;
});
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
.req(that.form.id, that.form)
.then((res) => {
that.isSaveing = false;
that.$emit("success");
that.visible = false;
that.$message.success("操作成功");
})
.catch((err) => {
that.isSaveing = false;
});
} else {
this.$message.error(
"使用数量与合格数不合格数数量不对等"
);
}
}
});
},