feat: 成品检验依据子项确定抽检数等

This commit is contained in:
caoqianming 2024-11-19 15:23:04 +08:00
parent 1849fe6eef
commit e94d3194ef
3 changed files with 48 additions and 55 deletions

View File

@ -38,6 +38,7 @@
<el-table-column label="物料名" prop="material_name" show-overflow-tooltip> </el-table-column>
<el-table-column label="总数" prop="count"> </el-table-column>
<el-table-column label="抽检数" prop="count_sampling"> </el-table-column>
<el-table-column label="抽检合格数" prop="count_sampling_ok"> </el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="不合格数" prop="count_notok"> </el-table-column>
<el-table-column label="操作" fixed="right" width="150">
@ -86,7 +87,7 @@
v-if="dialog.check"
:materialCate="materialCate"
:ftestWork="ftestWork"
@closed="dialog.check = false"
@closed="handleCheckClose"
>
</check-dialog>
</el-container>
@ -169,6 +170,10 @@ export default {
handleQuery() {
this.$refs.table.queryData(this.query);
},
handleCheckClose() {
this.dialog.check = false;
this.$refs.table.refresh();
},
resetQuery() {
this.query = {};
},

View File

@ -32,7 +32,7 @@
workObj.count_sampling
}}</el-descriptions-item>
<el-descriptions-item label="配棒管批次号" v-if=" workObj.mb_&&workObj.mb_.assemb">
<span v-for="item in workObj.mb_.assemb" :key="item.id">{{item.batch}}</span>
<span v-for="item in workObj.mb_.assemb" :key="item.id">{{item.batch}}; </span>
</el-descriptions-item>
</el-descriptions>
<el-button
@ -87,7 +87,7 @@
</el-input-number>
</template>
<!-- 整数 -->
<template v-else-if="ftestitems[$index].field_type == 'input_int'" #default="scope">
<template v-else-if="ftestitems[$index].field_type == 'input-int'" #default="scope">
<el-input-number
v-model="scope.row.ftestitems[$index].test_val_json"
:precision="0"
@ -99,7 +99,7 @@
</el-input-number>
</template>
<!-- 文本 -->
<template v-else-if="ftestitems[$index].field_type == 'input_text'" #default="scope">
<template v-else-if="ftestitems[$index].field_type == 'input-text'" #default="scope">
<el-input
v-model="scope.row.ftestitems[$index].test_val_json"
:disabled="!scope.row.isEdit"
@ -107,7 +107,7 @@
</el-input>
</template>
<!-- 单选 -->
<template v-else-if="ftestitems[$index].field_type == 'select'" #default="scope">
<template v-else-if="ftestitems[$index].field_type == 'select-text'" #default="scope">
<el-select
v-model="scope.row.ftestitems[$index].test_val_json"
clearable
@ -124,7 +124,7 @@
</el-select>
</template>
<!-- 多选 -->
<template v-else-if="ftestitems[$index].field_type == 'selects'" #default="scope">
<template v-else-if="ftestitems[$index].field_type == 'selects-text'" #default="scope">
<el-select
v-model="scope.row.ftestitems[$index].test_val_json"
clearable
@ -164,24 +164,20 @@
<el-table-column
prop="test_user"
label="检验人"
width="120"
width="160"
>
<template #default="scope">
<el-select
<xtSelect
:apiObj="apiUserObj"
:params="apiUserParams"
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
v-model:label="scope.row.test_user_name"
:edit="scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-table-column label="账号" prop="username"></el-table-column>
<el-table-column label="名称" prop="name"></el-table-column>
</xtSelect>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
@ -215,7 +211,7 @@
>
<el-link
type="danger"
@click="delCheck(scope.row.id)"
@click="delCheck(scope.row, scope.$index)"
style="margin-left: 2px"
>删除</el-link
>
@ -266,6 +262,8 @@ export default {
},
data() {
return {
apiUserObj: this.$API.system.user.list,
apiUserParams: {posts__code__contains: "check"},
addTemplate: {
ftestitems: [{ test_val_json: "", check_val: "", testitem: "" ,choices:[],field_type:'',name:''}],
test_date: "", //work
@ -306,7 +304,6 @@ export default {
let tags = that.materialCate;
that.getTestItem(tags, that.ftestWork);
that.getUserList(that.ftestWork);
},
methods: {
open() {
@ -335,15 +332,6 @@ export default {
});
},
//
getUserList() {
let that = this;
this.$API.system.user.list
.req({ page: 0, posts__code__contains: "check" })
.then((res) => {
that.userList = res;
});
},
table_edit(row) {
this.dialog.worksave = true;
this.$nextTick(() => {
@ -381,17 +369,22 @@ export default {
});
},
//
delCheck(id) {
delCheck(row, index) {
if (row.id == undefined) {
this.formTableData.splice(index, 1);
return
}
let that = this;
that.$confirm(`确定删除吗?`, "提示", {
type: "warning",
})
.then(() => {
that.$API.qm.ftest.delete
.req(id)
.req(row.id)
.then((res) => {
that.$message.success("删除成功");
that.getCheckList(that.ftestWork);
this.getFtestWork();
return res;
})
.catch((err) => {
@ -400,9 +393,14 @@ export default {
})
.catch(() => {});
},
getFtestWork() {
let that = this;
that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => {
that.workObj = res;
});
},
saveCheck(row) {
let that = this;
console.log(row);
let index = this.formTableData.findIndex(
(item) => item.id == row.id
);
@ -413,6 +411,7 @@ export default {
.then((res) => {
that.formTableData[index].isEdit = false;
that.$message.success("操作成功");
this.getFtestWork();
})
.catch((err) => {
return err;
@ -424,6 +423,7 @@ export default {
that.formTableData[index].isEdit = false;
that.$message.success("操作成功");
that.getCheckList(that.ftestWork);
this.getFtestWork();
})
.catch((err) => {
return err;

View File

@ -23,6 +23,7 @@
clearable
style="width: 100%"
@change="handleChange"
disabled="mode != 'add'"
>
<el-option
v-for="item in options"
@ -52,16 +53,7 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="抽检数量">
<el-input-number
controls-position="right"
v-model="form.count_sampling"
style="width: 100%"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-col :md="12" :sm="24" v-if="form.type2 == 10">
<el-form-item label="合格数量">
<el-input-number
controls-position="right"
@ -71,7 +63,7 @@
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-col :md="12" :sm="24" v-if="form.type2 == 10">
<el-form-item label="不合格数量">
<el-input-number
controls-position="right"
@ -83,20 +75,15 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检验人" prop="test_user">
<el-select
<xtSelect
:apiObj="apiUserObj"
v-model="form.test_user"
placeholder="检验人"
clearable
filterable
v-model:label="form.test_user_name"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-table-column label="账号" prop="username"></el-table-column>
<el-table-column label="名称" prop="name"></el-table-column>
</xtSelect>
</el-form-item>
</el-col>
</el-row>
@ -116,6 +103,7 @@ export default {
emits: ["success", "closed"],
data() {
return {
apiUserObj: this.$API.system.user.list,
loading: false,
form: {
type:'prod',