fix:el-drawer缓存显示问题-订单管理

This commit is contained in:
shijing 2024-05-30 10:35:33 +08:00
parent 4843e7a6d1
commit c7887fc5f2
2 changed files with 117 additions and 101 deletions

View File

@ -31,6 +31,7 @@
row-key="id"
stripe
:params="query"
:query="query"
>
<el-table-column type="index" width="50" />
<el-table-column label="订单编号" prop="number">
@ -119,9 +120,13 @@
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-drawer title="订单详情" v-model="dialog.detail" :size="'90%'">
<detail-dialog :orderId="orderId" ref="detailDialogs"> </detail-dialog>
</el-drawer>
<detail-dialog
v-model="dialog.detail"
:orderId="orderId"
ref="detailDialogs"
@closed="dialog.detail = false"
>
</detail-dialog>
</template>
<script>
import saveDialog from "./order_form.vue";
@ -184,11 +189,9 @@ export default {
table_detail(row) {
this.orderId = row.id;
this.dialog.detail = true;
// this.$router.push({
// name: "samOrderitem",
// query: { order: row.id }
// });
this.$nextTick(() => {
this.$refs.detailDialogs.open();
});
},
//
async table_del(row) {
@ -208,7 +211,6 @@ export default {
})
.catch(() => {});
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {

View File

@ -1,97 +1,108 @@
<template>
<div style="padding: 8px">
<div>
<el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions>
<el-descriptions-item label="订单编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="客户">{{
orderObj.customer_name
}}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{
orderObj.state
}}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{
orderObj.delivery_date
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'order.update'"
></el-button>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
>
<el-table-column type="index" width="50" />
<el-table-column
label="所需产品"
prop="material"
show-overflow-tooltip
<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="订单编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="客户">{{
orderObj.customer_name
}}</el-descriptions-item>
<el-descriptions-item label="订单状态">{{
orderObj.state
}}</el-descriptions-item>
<el-descriptions-item label="截止交货">{{
orderObj.delivery_date
}}</el-descriptions-item>
</el-descriptions>
</el-card>
</div>
<div style="height: 8px"></div>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'order.update'"
></el-button>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
hidePagination
>
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template>
</el-table-column>
<!-- <el-table-column label="关联订单" prop="order" show-overflow-tooltip>
<el-table-column type="index" width="50" />
<el-table-column
label="所需产品"
prop="material"
show-overflow-tooltip
>
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.name }}</span
>
</template>
</el-table-column>
<!-- <el-table-column label="关联订单" prop="order" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.order_"> {{ scope.row.order_.name }}</span>
</template>
</el-table-column> -->
<el-table-column label="所需数量" prop="count">
</el-table-column>
<el-table-column label="已交货数量" prop="delivered_count">
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'order.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'order.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-card>
<el-table-column label="所需数量" prop="count">
</el-table-column>
<el-table-column
label="已交货数量"
prop="delivered_count"
>
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'order.update'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'order.delete'"
>
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
</div>
</el-drawer>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@ -128,14 +139,17 @@ export default {
30: "在修",
40: "禁用",
},
visible: false,
};
},
mounted() {
this.params.order = this.orderId;
this.apiObj = this.$API.sam.orderitem.list;
this.getOrder();
},
mounted() {},
methods: {
open() {
this.visible = true;
this.params.order = this.orderId;
this.apiObj = this.$API.sam.orderitem.list;
this.getOrder();
},
getOrder() {
this.$API.sam.order.item.req(this.orderId).then((res) => {
this.orderObj = res;