fix:el-drawer缓存显示问题-库存

This commit is contained in:
shijing 2024-05-30 09:23:00 +08:00
parent 1e930db135
commit b768946738
5 changed files with 239 additions and 221 deletions

View File

@ -132,15 +132,15 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<el-drawer title="出入库记录" v-model="dialog.record" :size="'90%'">
<record-dialog <record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type" :type="type"
:cate="cate" :cate="cate"
:mioId="mioId" :mioId="mioId"
ref="recordDialogs" @closed="visibleDrawer = false"
> >
</record-dialog> </record-dialog>
</el-drawer>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
@ -185,6 +185,7 @@ export default {
type: "", type: "",
cate: "good", cate: "good",
mioId: "", mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -206,11 +207,10 @@ export default {
table_detail(row) { table_detail(row) {
this.type = row.type; this.type = row.type;
this.mioId = row.id; this.mioId = row.id;
this.dialog.record = true; this.visibleDrawer = true;
// this.$router.push({ this.$nextTick(() => {
// name: "mioitem", this.$refs.showDrawer.open();
// query: { mio: row.id, type: row.type, cate: "good" }, });
// });
}, },
// //
table_del(row) { table_del(row) {

View File

@ -149,15 +149,15 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<el-drawer title="出入库记录" v-model="dialog.record" :size="'90%'">
<record-dialog <record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type" :type="type"
:cate="cate" :cate="cate"
:mioId="mioId" :mioId="mioId"
ref="recordDialogs" @closed="visibleDrawer = false"
> >
</record-dialog> </record-dialog>
</el-drawer>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
@ -201,6 +201,7 @@ export default {
type: "", type: "",
cate: "halfgood", cate: "halfgood",
mioId: "", mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -222,11 +223,10 @@ export default {
table_detail(row) { table_detail(row) {
this.type = row.type; this.type = row.type;
this.mioId = row.id; this.mioId = row.id;
this.dialog.record = true; this.visibleDrawer = true;
// this.$router.push({ this.$nextTick(() => {
// name: "mioitem", this.$refs.showDrawer.open();
// query: { mio: row.id, type: row.type, cate: "halfgood" }, });
// });
}, },
// //
table_del(row) { table_del(row) {

View File

@ -132,15 +132,15 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<el-drawer title="出入库记录" v-model="dialog.record" :size="'90%'">
<record-dialog <record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type" :type="type"
:cate="cate" :cate="cate"
:mioId="mioId" :mioId="mioId"
ref="recordDialogs" @closed="visibleDrawer = false"
> >
</record-dialog> </record-dialog>
</el-drawer>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
@ -179,6 +179,7 @@ export default {
type: "", type: "",
cate: "helpso", cate: "helpso",
mioId: "", mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -200,11 +201,10 @@ export default {
table_detail(row) { table_detail(row) {
this.type = row.type; this.type = row.type;
this.mioId = row.id; this.mioId = row.id;
this.dialog.record = true; this.visibleDrawer = true;
// this.$router.push({ this.$nextTick(() => {
// name: "mioitem", this.$refs.showDrawer.open();
// query: { mio: row.id, type: row.type, cate: "helpso" }, });
// });
}, },
// //
table_del(row) { table_del(row) {

View File

@ -149,15 +149,15 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<el-drawer title="出入库记录" v-model="dialog.record" :size="'90%'">
<record-dialog <record-dialog
ref="showDrawer"
v-if="visibleDrawer"
:type="type" :type="type"
:cate="cate" :cate="cate"
:mioId="mioId" :mioId="mioId"
ref="recordDialogs" @closed="visibleDrawer = false"
> >
</record-dialog> </record-dialog>
</el-drawer>
</template> </template>
<script> <script>
import saveDialog from "./mio_form.vue"; import saveDialog from "./mio_form.vue";
@ -202,6 +202,7 @@ export default {
type: "", type: "",
cate: "mainso", cate: "mainso",
mioId: "", mioId: "",
visibleDrawer: false,
}; };
}, },
methods: { methods: {
@ -223,11 +224,10 @@ export default {
table_detail(row) { table_detail(row) {
this.type = row.type; this.type = row.type;
this.mioId = row.id; this.mioId = row.id;
this.dialog.record = true; this.visibleDrawer = true;
// this.$router.push({ this.$nextTick(() => {
// name: "mioitem", this.$refs.showDrawer.open();
// query: { mio: row.id, type: row.type, cate: "mainso" }, });
// });
}, },
// //
table_del(row) { table_del(row) {

View File

@ -1,4 +1,11 @@
<template> <template>
<el-drawer
v-model="visible"
title="出入库记录"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<div style="padding: 8px"> <div style="padding: 8px">
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="hover"> <el-card style="width: 100%" header="基本信息" shadow="hover">
@ -98,11 +105,17 @@
<div> <div>
{{ item.material_name }} {{ item.material_name }}
<span <span
style="color: gray; font-size: 12px" style="
color: gray;
font-size: 12px;
"
>:</span >:</span
>{{ item.batch }} >{{ item.batch }}
<span <span
style="color: gray; font-size: 12px" style="
color: gray;
font-size: 12px;
"
>:</span >:</span
>{{ item.rate }} >{{ item.rate }}
</div> </div>
@ -170,6 +183,7 @@
</el-card> </el-card>
</div> </div>
</div> </div>
</el-drawer>
<save-dialog <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
@ -240,6 +254,7 @@ export default {
other_in: "其他入库", other_in: "其他入库",
other_out: "其他出库", other_out: "其他出库",
}, },
visible: false,
mioitemId: "", mioitemId: "",
// type: "", // type: "",
// cate: "", // cate: "",
@ -256,6 +271,9 @@ export default {
this.getMio(); this.getMio();
}, },
methods: { methods: {
open() {
this.visible = true;
},
getMio() { getMio() {
this.$API.inm.mio.item.req(this.mioId).then((res) => { this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.mioObj = res; this.mioObj = res;