fix:el-drawer缓存显示问题-成品检验

This commit is contained in:
shijing 2024-05-30 09:40:11 +08:00
parent b768946738
commit c2034fc737
2 changed files with 294 additions and 287 deletions

View File

@ -63,15 +63,14 @@
@closed="dialog.save = false"
>
</save-dialog>
<el-drawer title="成品检验" v-model="dialog.check" :size="'90%'">
<check-dialog
ref="checkDialogs"
:type="product_type"
:ftestWork="ftestWork"
>
</check-dialog>
</el-drawer>
<check-dialog
ref="checkDialogs"
v-if="dialog.check"
:type="product_type"
:ftestWork="ftestWork"
@closed="dialog.check = false"
>
</check-dialog>
</el-container>
</template>
<script>
@ -149,13 +148,9 @@ export default {
that.product_type = type;
that.ftestWork = row.id;
that.dialog.check = true;
// this.$router.push({
// name: "productDetail",
// query: {
// type: type,
// ftestWork: row.id,
// },
// });
this.$nextTick(() => {
this.$refs.checkDialogs.open();
});
},
handleQuery() {
this.$refs.table.queryData(this.query);

View File

@ -1,283 +1,291 @@
<template>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="日期">{{
workObj.test_date
}}</el-descriptions-item>
<el-descriptions-item label="批次号">{{
workObj.batch
}}</el-descriptions-item>
<el-descriptions-item label="总数">{{
workObj.count
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="检验记录" shadow="hover">
<!-- 预制棒 -->
<sc-form-table
ref="formTable"
v-if="type == 'bang'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column
prop="val"
label="抽检编号"
min-width="180"
<el-drawer
v-model="visible"
title="成品检验"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="日期">{{
workObj.test_date
}}</el-descriptions-item>
<el-descriptions-item label="批次号">{{
workObj.batch
}}</el-descriptions-item>
<el-descriptions-item label="总数">{{
workObj.count
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="检验记录" shadow="hover">
<!-- 预制棒 -->
<sc-form-table
ref="formTable"
v-if="type == 'bang'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<template #default="scope">
<!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> -->
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item0, $index) in ftestitems"
:key="item0.id"
<el-table-column
prop="val"
label="抽检编号"
min-width="180"
>
<el-table-column
prop="test_val"
:label="item0.name"
min-width="130"
<template #default="scope">
<!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> -->
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item0, $index) in ftestitems"
:key="item0.id"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
>
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</template>
</el-table-column>
<el-table-column
prop="test_user"
label="检验人"
width="120"
>
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
<template #default="scope">
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.note"
placeholder="备注"
></el-input>
</template>
</el-table-column>
<el-table-column
prop="open"
label="操作"
fixed="right"
width="90"
align="center"
>
<template #default="scope">
<el-link
type="primary"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-link
>
<el-link
type="primary"
v-else
@click="editCheck(scope.row)"
>编辑</el-link
>
<el-link
type="danger"
@click="delCheck(scope.row.id)"
style="margin-left: 2px"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
<!-- 预制管 -->
<sc-form-table
ref="formTable"
v-else-if="type == 'guan'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column
prop="val"
label="抽检编号"
min-width="180"
>
<template #default="scope">
<!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> -->
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item, $index) in ftestitems"
:key="item.id"
<el-table-column
prop="test_val"
:label="item0.name"
min-width="130"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
>
<el-table-column
prop="test_val"
:label="item.name"
min-width="130"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
align="center"
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</template>
</el-table-column>
<el-table-column
prop="test_user"
label="检验人"
width="120"
>
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
<template #default="scope">
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.note"
placeholder="备注"
></el-input>
</template>
</el-table-column>
<el-table-column
prop="open"
label="操作"
fixed="right"
width="90"
align="center"
>
<template #default="scope">
<el-link
type="primary"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-link
>
<el-link
type="primary"
v-else
@click="editCheck(scope.row)"
>编辑</el-link
>
<el-link
type="danger"
@click="delCheck(scope.row.id)"
style="margin-left: 2px"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
<!-- 预制管 -->
<sc-form-table
ref="formTable"
v-else-if="type == 'guan'"
v-model="formTableData"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
:disabled="!scope.row.isEdit"
style="width: 100%"
<el-table-column
prop="val"
label="抽检编号"
min-width="180"
>
<template #default="scope">
<!-- <span v-if="scope.row.id">{{ scope.row.test_numer }}</span> -->
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.test_numer"
placeholder="抽检编号"
></el-input>
</template>
</el-table-column>
<el-table-column label="检验记录" align="center">
<template
v-for="(item, $index) in ftestitems"
:key="item.id"
>
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</template>
</el-table-column>
<el-table-column
prop="test_user"
label="检验人"
min-width="120"
align="center"
>
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
<el-table-column
prop="test_val"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
<template #default="scope">
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.note"
placeholder="备注"
></el-input>
</template>
</el-table-column>
<el-table-column
prop="open"
label="操作"
fixed="right"
width="90"
align="center"
>
<template #default="scope">
<el-link
type="primary"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-link
>
<el-link
type="primary"
v-else
@click="editCheck(scope.row)"
>编辑</el-link
>
<el-link
type="danger"
v-if="scope.row.id"
@click="delCheck(scope.row.id)"
style="margin-left: 2px"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
</el-card>
min-width="130"
>
<template #default="scope">
<el-input-number
v-model="
scope.row.ftestitems[$index]
.test_val
"
:disabled="!scope.row.isEdit"
:min="0"
style="width: 100%"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
</template>
</el-table-column>
<el-table-column
prop="test_val"
label="合格判定"
min-width="90"
align="center"
>
<template #default="scope">
<el-select
v-model="scope.row.is_ok"
placeholder="是否合格"
clearable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</template>
</el-table-column>
<el-table-column
prop="test_user"
label="检验人"
min-width="120"
align="center"
>
<template #default="scope">
<el-select
v-model="scope.row.test_user"
placeholder="检验人"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="备注">
<template #default="scope">
<el-input
:disabled="!scope.row.isEdit"
v-model="scope.row.note"
placeholder="备注"
></el-input>
</template>
</el-table-column>
<el-table-column
prop="open"
label="操作"
fixed="right"
width="90"
align="center"
>
<template #default="scope">
<el-link
type="primary"
v-if="scope.row.isEdit"
@click="saveCheck(scope.row)"
>保存</el-link
>
<el-link
type="primary"
v-else
@click="editCheck(scope.row)"
>编辑</el-link
>
<el-link
type="danger"
v-if="scope.row.id"
@click="delCheck(scope.row.id)"
style="margin-left: 2px"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
</el-card>
</div>
</div>
</div>
</el-drawer>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@ -333,6 +341,7 @@ export default {
// type: "",
userList: [],
workObj: {},
visible: false,
};
},
watch: {
@ -356,6 +365,9 @@ export default {
that.getUserList(that.ftestWork);
},
methods: {
open() {
this.visible = true;
},
//
getTestItem(tag, ftestWork) {
let that = this;