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"
:type="type" v-if="visibleDrawer"
:cate="cate" :type="type"
:mioId="mioId" :cate="cate"
ref="recordDialogs" :mioId="mioId"
> @closed="visibleDrawer = false"
</record-dialog> >
</el-drawer> </record-dialog>
</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"
:type="type" v-if="visibleDrawer"
:cate="cate" :type="type"
:mioId="mioId" :cate="cate"
ref="recordDialogs" :mioId="mioId"
> @closed="visibleDrawer = false"
</record-dialog> >
</el-drawer> </record-dialog>
</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"
:type="type" v-if="visibleDrawer"
:cate="cate" :type="type"
:mioId="mioId" :cate="cate"
ref="recordDialogs" :mioId="mioId"
> @closed="visibleDrawer = false"
</record-dialog> >
</el-drawer> </record-dialog>
</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"
:type="type" v-if="visibleDrawer"
:cate="cate" :type="type"
:mioId="mioId" :cate="cate"
ref="recordDialogs" :mioId="mioId"
> @closed="visibleDrawer = false"
</record-dialog> >
</el-drawer> </record-dialog>
</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,175 +1,189 @@
<template> <template>
<div style="padding: 8px"> <el-drawer
<div> v-model="visible"
<el-card style="width: 100%" header="基本信息" shadow="hover"> title="出入库记录"
<el-descriptions> :size="'90%'"
<el-descriptions-item label="编号">{{ destroy-on-close
mioObj.number @closed="$emit('closed')"
}}</el-descriptions-item> >
<el-descriptions-item label="出入库类型">{{ <div style="padding: 8px">
typeDict[mioObj.type] <div>
}}</el-descriptions-item> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions-item label="状态">{{ <el-descriptions>
stateDict[mioObj.state] <el-descriptions-item label="编号">{{
}}</el-descriptions-item> mioObj.number
<el-descriptions-item label="部门/车间">{{ }}</el-descriptions-item>
mioObj.belong_dept_name <el-descriptions-item label="出入库类型">{{
}}</el-descriptions-item> typeDict[mioObj.type]
<el-descriptions-item label="执行人">{{ }}</el-descriptions-item>
mioObj.do_user_name <el-descriptions-item label="状态">{{
}}</el-descriptions-item> stateDict[mioObj.state]
<el-descriptions-item label="创建时间">{{ }}</el-descriptions-item>
mioObj.create_time <el-descriptions-item label="部门/车间">{{
}}</el-descriptions-item> mioObj.belong_dept_name
<el-descriptions-item }}</el-descriptions-item>
label="采购订单" <el-descriptions-item label="执行人">{{
v-if="mioObj.type == 'pur_in'" mioObj.do_user_name
>{{ mioObj.order_number }}</el-descriptions-item }}</el-descriptions-item>
> <el-descriptions-item label="创建时间">{{
<el-descriptions-item mioObj.create_time
label="供应商" }}</el-descriptions-item>
v-if="mioObj.type == 'pur_in'" <el-descriptions-item
>{{ mioObj.supplier_name }}</el-descriptions-item label="采购订单"
> v-if="mioObj.type == 'pur_in'"
<el-descriptions-item >{{ mioObj.order_number }}</el-descriptions-item
label="销售订单" >
v-if="mioObj.type == 'sale_out'" <el-descriptions-item
>{{ mioObj.pu_order_number }}</el-descriptions-item label="供应商"
> v-if="mioObj.type == 'pur_in'"
<el-descriptions-item >{{ mioObj.supplier_name }}</el-descriptions-item
label="客户" >
v-if="mioObj.type == 'sale_out'" <el-descriptions-item
>{{ mioObj.customer_name }}</el-descriptions-item label="销售订单"
> v-if="mioObj.type == 'sale_out'"
</el-descriptions> >{{ mioObj.pu_order_number }}</el-descriptions-item
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10"> >
<el-descriptions-item
label="客户"
v-if="mioObj.type == 'sale_out'"
>{{ mioObj.customer_name }}</el-descriptions-item
>
</el-descriptions>
<!-- <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10">
提交 提交
</el-button> --> </el-button> -->
</el-card> </el-card>
</div> </div>
<div style="height: 8px"></div> <div style="height: 8px"></div>
<div> <div>
<el-card style="width: 100%" header="物料明细" shadow="hover"> <el-card style="width: 100%" header="物料明细" shadow="hover">
<div> <div>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@click="table_add" @click="table_add"
v-if="mioObj.state == 10" v-if="mioObj.state == 10"
>新增</el-button >新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
hideDo
> >
</div> <el-table-column type="index" width="50" />
<scTable <el-table-column
ref="table" label="物料"
:apiObj="apiObj" prop="material"
row-key="id" show-overflow-tooltip
stripe >
:params="params" <template #default="scope"
hidePagination >{{ scope.row.material_name }}
hideDo </template>
> </el-table-column>
<el-table-column type="index" width="50" /> <el-table-column label="批次号" prop="batch">
<el-table-column </el-table-column>
label="物料" <el-table-column label="仓库" prop="warehouse_name">
prop="material" </el-table-column>
show-overflow-tooltip <el-table-column label="数量" prop="count">
> </el-table-column>
<template #default="scope" <el-table-column
>{{ scope.row.material_name }} label="组合件信息"
</template> v-if="cate == 'good'"
</el-table-column> width="300"
<el-table-column label="批次号" prop="batch"> >
</el-table-column> <template #default="scope">
<el-table-column label="仓库" prop="warehouse_name"> <div v-if="scope.row.assemb.length > 0">
</el-table-column> <div
<el-table-column label="数量" prop="count"> v-for="item in scope.row.assemb"
</el-table-column> :key="item.id"
<el-table-column >
label="组合件信息" <div>
v-if="cate == 'good'" {{ item.material_name }}
width="300" <span
> style="
<template #default="scope"> color: gray;
<div v-if="scope.row.assemb.length > 0"> font-size: 12px;
<div "
v-for="item in scope.row.assemb" >:</span
:key="item.id" >{{ item.batch }}
> <span
<div> style="
{{ item.material_name }} color: gray;
<span font-size: 12px;
style="color: gray; font-size: 12px" "
>:</span >:</span
>{{ item.batch }} >{{ item.rate }}
<span </div>
style="color: gray; font-size: 12px"
>:</span
>{{ item.rate }}
</div> </div>
</div> </div>
</div> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="不合格数量" prop="count_notok">
<el-table-column label="不合格数量" prop="count_notok"> </el-table-column>
</el-table-column> <el-table-column
<el-table-column label="创建时间"
label="创建时间" prop="create_time"
prop="create_time" show-overflow-tooltip
show-overflow-tooltip >
> </el-table-column>
</el-table-column> <el-table-column
<el-table-column label="操作"
label="操作" fixed="right"
fixed="right" align="center"
align="center" width="100px"
width="100px" >
> <template #default="scope">
<template #default="scope"> <el-button
<el-button link
link type="primary"
type="primary" @click="table_check(scope.row)"
@click="table_check(scope.row)" v-if="
v-if=" scope.row.test_date == null &&
scope.row.test_date == null && mioObj.state == 20 &&
mioObj.state == 20 && (type == 'pur_in' ||
(type == 'pur_in' || type == 'do_in' ||
type == 'do_in' || type == 'other_in')
type == 'other_in') "
" v-auth="'mioitem.test'"
v-auth="'mioitem.test'" >
> 检验
检验 </el-button>
</el-button> <el-button
<el-button link
link type="primary"
type="primary" @click="check_Show(scope.row)"
@click="check_Show(scope.row)" v-if="scope.row.test_date !== null"
v-if="scope.row.test_date !== null" >
> 查看
查看 </el-button>
</el-button> <el-button
<el-button link
link type="danger"
type="danger" @click="check_reSet(scope.row)"
@click="check_reSet(scope.row)" v-if="scope.row.test_date !== null"
v-if="scope.row.test_date !== null" >
> 撤回
撤回 </el-button>
</el-button> <el-button
<el-button link
link type="danger"
type="danger" @click="table_del(scope.row)"
@click="table_del(scope.row)" v-if="mioObj.state == 10"
v-if="mioObj.state == 10" >
> 删除
删除 </el-button>
</el-button> </template>
</template> </el-table-column>
</el-table-column> </scTable>
</scTable> </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;