factory_web/src/views/wpm_bx/check_drawer.vue

101 lines
2.3 KiB
Vue

<template>
<el-drawer
v-model="visible"
title="检验记录"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-main>
<scTable
ref="drawer_table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsObj"
>
<el-table-column label="检验类型">
<template #default="scope">
<el-tag v-if="scope.row.type2 == 10">
{{ type2_[scope.row.type2] }}
</el-tag>
<el-tag v-else type="success">
{{ type2_[scope.row.type2] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="物料批次" prop="batch">
</el-table-column>
<el-table-column label="检验数" prop="count">
</el-table-column>
<el-table-column label="合格数" prop="count_ok">
</el-table-column>
<!-- <el-table-column label="不合格数" prop="count_notok">
<el-table-column v-for="item in qct_defects" :label="item.defect_name" :key="item.id">
<template #default="scope">
{{ scope.row.}}
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="检验日期" prop="test_date">
</el-table-column>
<el-table-column label="检验人" prop="test_user_name">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["closed"],
props: {
wm: { type: String, default: "" },
material: { type: String, default: "" },
},
data() {
return {
visible: false,
apiObj: null,
paramsObj: {},
form: {},
type2_: {
10: "抽检",
20: "全检",
},
qct_defects:[],
isSaveing: false,
};
},
mounted() {
},
methods: {
open() {
this.visible = true;
this.paramsObj.wm = this.wm;
this.apiObj = this.$API.qm.ftestwork.list;
this.getdefects();
return this;
},
//获取不合格项
getdefects(){
let that = this;
that.$API.qm.qct.list.req({ page: 0, qctmat__material: that.material }).then((res) => {
if(res.length>0){
that.$API.qm.qct.item.req(res[0].id).then((res) => {
that.qct_defects = res;
})
}
});
},
table_del(row){
this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$refs.drawer_table.fetch();
});
},
},
};
</script>