factory_web/src/views/wpm_bx/check_drawer.vue

108 lines
2.8 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 type="index" width="50" /> -->
<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="检验数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling }}</span>
<span v-else>{{ scope.row.count }}</span>
</template>
</el-table-column>
<el-table-column label="合格数">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok }}</span>
<span v-else>{{ scope.row.count_ok }}</span>
</template>
</el-table-column>
<el-table-column label="不合格数" prop="count_notok">
</el-table-column>
<el-table-column label="合格率">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok/scope.row.count_sampling*100 }}%</span>
<span v-else>{{ scope.row.count_ok/scope.row.count*100 }}%</span>
</template>
</el-table-column>
<el-table-column label="检验日期" prop="test_date">
</el-table-column>
<el-table-column label="检验人" prop="test_user_name">
</el-table-column>
<!-- <el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-button
link
type="primary"
v-auth="'ftestwork.update'"
@click="table_del(scope.row)"
>删除
</el-button>
</template>
</el-table-column> -->
</scTable>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["closed"],
props: {
wm: { type: String, default: "" },
},
data() {
return {
visible: false,
apiObj: null,
paramsObj: {},
form: {},
type2_: {
10: "抽检",
20: "全检",
},
isSaveing: false,
};
},
mounted() {},
methods: {
open() {
this.visible = true;
this.paramsObj.wm = this.wm;
this.apiObj = this.$API.qm.ftestwork.list;
return this;
},
table_del(row){
this.$API.qm.ftestwork.delete.req(row.id).then((res) => {
this.$refs.drawer_table.fetch();
});
},
},
};
</script>