fix:el-drawer缓存显示问题-采购计划

This commit is contained in:
shijing 2024-05-30 09:53:17 +08:00
parent c2034fc737
commit 4843e7a6d1
4 changed files with 266 additions and 239 deletions

View File

@ -125,9 +125,13 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<el-drawer title="订单详情" v-model="dialog.detail" :size="'90%'"> <detail-dialog
<detail-dialog :orderId="orderId" ref="detailDialogs"> </detail-dialog> ref="detailDialogs"
</el-drawer> v-if="dialog.detail"
:orderId="orderId"
@closed="dialog.detail = false"
>
</detail-dialog>
</template> </template>
<script> <script>
import saveDialog from "./order_form.vue"; import saveDialog from "./order_form.vue";
@ -177,14 +181,9 @@ export default {
table_detail(row) { table_detail(row) {
this.orderId = row.id; this.orderId = row.id;
this.dialog.detail = true; this.dialog.detail = true;
// this.$nextTick(() => { this.$nextTick(() => {
// this.$router.push({ this.$refs.detailDialogs.open();
// name: "orderitem", });
// query: {
// pu_order: row.id,
// },
// });
// });
}, },
table_submit(row) { table_submit(row) {
this.$API.pum.order.submit.req(row.id).then((res) => { this.$API.pum.order.submit.req(row.id).then((res) => {

View File

@ -1,118 +1,129 @@
<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
orderObj.number @closed="$emit('closed')"
}}</el-descriptions-item> >
<el-descriptions-item label="订单状态">{{ <div style="padding: 8px">
stateOption[orderObj.state] <div>
}}</el-descriptions-item> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions-item label="供应商">{{ <el-descriptions>
orderObj.supplier_name <el-descriptions-item label="订单编号">{{
}}</el-descriptions-item> orderObj.number
<el-descriptions-item label="所属部门">{{ }}</el-descriptions-item>
orderObj.belong_dept_name <el-descriptions-item label="订单状态">{{
}}</el-descriptions-item> stateOption[orderObj.state]
<el-descriptions-item label="创建人">{{ }}</el-descriptions-item>
orderObj.create_by_name <el-descriptions-item label="供应商">{{
}}</el-descriptions-item> orderObj.supplier_name
<el-descriptions-item label="创建时间">{{ }}</el-descriptions-item>
orderObj.create_time <el-descriptions-item label="所属部门">{{
}}</el-descriptions-item> orderObj.belong_dept_name
</el-descriptions> }}</el-descriptions-item>
</el-card> <el-descriptions-item label="创建人">{{
orderObj.create_by_name
}}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{
orderObj.create_time
}}</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"
@click="addLinkPlanItem"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>计划明细变更采购明细</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>手动新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
:query="query"
hidePagination
hideDo
>
<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="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="更新时间"
prop="update_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="left"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_orderitem.update'"
v-if="orderObj.state == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_orderitem.delete'"
v-if="orderObj.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div> </div>
<div style="height: 8px"></div> </el-drawer>
<div>
<el-card style="width: 100%" header="订单明细" shadow="hover">
<div>
<el-button
type="primary"
@click="addLinkPlanItem"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>计划明细变更采购明细</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@click="add"
v-auth="'pu_orderitem.create'"
v-if="orderObj.state == 10"
>手动新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="params"
:query="query"
hidePagination
hideDo
>
<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="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="更新时间"
prop="update_time"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="left"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_orderitem.update'"
v-if="orderObj.state == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_orderitem.delete'"
v-if="orderObj.state == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
@ -163,6 +174,7 @@ export default {
30: "到货中", 30: "到货中",
40: "已完成", 40: "已完成",
}, },
visible: false,
}; };
}, },
mounted() { mounted() {
@ -172,6 +184,9 @@ export default {
this.getOrder(); this.getOrder();
}, },
methods: { methods: {
open() {
this.visible = true;
},
getOrder() { getOrder() {
this.$API.pum.order.item.req(this.puOrder).then((res) => { this.$API.pum.order.item.req(this.puOrder).then((res) => {
this.orderObj = res; this.orderObj = res;

View File

@ -107,9 +107,13 @@
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></save-dialog> ></save-dialog>
<el-drawer title="计划详情" v-model="dialog.detail" :size="'90%'"> <detail-dialog
<detail-dialog :planId="planId" ref="detailDialogs"> </detail-dialog> ref="detailDialogs"
</el-drawer> v-if="dialog.detail"
:planId="planId"
@closed="dialog.detail = false"
>
</detail-dialog>
</template> </template>
<script> <script>
import saveDialog from "./plan_form.vue"; import saveDialog from "./plan_form.vue";
@ -155,12 +159,9 @@ export default {
table_detail(row) { table_detail(row) {
this.planId = row.id; this.planId = row.id;
this.dialog.detail = true; this.dialog.detail = true;
// this.$nextTick(() => { this.$nextTick(() => {
// this.$router.push({ this.$refs.detailDialogs.open();
// name: "planitem", });
// query: { pu_plan: row.id },
// });
// });
}, },
// //
table_edit(row) { table_edit(row) {

View File

@ -1,110 +1,118 @@
<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
orderObj.name @closed="$emit('closed')"
}}</el-descriptions-item> >
<el-descriptions-item label="计划编号">{{ <div style="padding: 8px">
orderObj.number <div>
}}</el-descriptions-item> <el-card style="width: 100%" header="基本信息" shadow="hover">
<el-descriptions-item label="计划状态">{{ <el-descriptions>
stateOption[orderObj.state] <el-descriptions-item label="计划名称">{{
}}</el-descriptions-item> orderObj.name
</el-descriptions> }}</el-descriptions-item>
</el-card> <el-descriptions-item label="计划编号">{{
orderObj.number
}}</el-descriptions-item>
<el-descriptions-item label="计划状态">{{
stateOption[orderObj.state]
}}</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"
v-auth="'pu_planitem.create'"
@click="add"
v-if="orderObj.state == 10"
>新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:query="query"
hidePagination
hideDo
>
<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="need_count">
</el-table-column>
<el-table-column
label="需求日期"
prop="need_date"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="部门" prop="belong_dept_name">
</el-table-column>
<el-table-column label="关联采购订单" prop="pu_order">
<template #default="scope">
<span v-if="scope.row.pu_order"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column
label="备注"
prop="note"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_planitem.update'"
v-if="orderObj == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_planitem.delete'"
v-if="orderObj == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div> </div>
<div style="height: 8px"></div> </el-drawer>
<div>
<el-card style="width: 100%" header="计划明细" shadow="hover">
<div>
<el-button
type="primary"
icon="el-icon-plus"
v-auth="'pu_planitem.create'"
@click="add"
v-if="orderObj.state == 10"
>新增</el-button
>
</div>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
:query="query"
hidePagination
hideDo
>
<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="need_count">
</el-table-column>
<el-table-column
label="需求日期"
prop="need_date"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="部门" prop="belong_dept_name">
</el-table-column>
<el-table-column label="关联采购订单" prop="pu_order">
<template #default="scope">
<span v-if="scope.row.pu_order"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="创建人" prop="create_by_name">
</el-table-column>
<el-table-column
label="备注"
prop="note"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="100px"
>
<template #default="scope">
<el-button
link
type="primary"
@click="table_edit(scope.row)"
v-auth="'pu_planitem.update'"
v-if="orderObj == 10"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="table_del(scope.row)"
v-auth="'pu_planitem.delete'"
v-if="orderObj == 10"
>
删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-card>
</div>
</div>
<save-dialog <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
@ -146,16 +154,20 @@ export default {
40: "下单完成", 40: "下单完成",
40: "已完成", 40: "已完成",
}, },
visible: false,
}; };
}, },
mounted() { mounted() {
this.puPlan = this.planId; this.puPlan = this.planId;
this.query.pu_plan = this.planId; this.query.pu_plan = this.planId;
this.apiObj = this.$API.pum.planitem.list; this.apiObj = this.$API.pum.planitem.list;
this.$refs.table.refresh(); // this.$refs.table.refresh();
this.getOrder(); this.getOrder();
}, },
methods: { methods: {
open() {
this.visible = true;
},
getOrder() { getOrder() {
this.$API.pum.plan.item.req(this.puPlan).then((res) => { this.$API.pum.plan.item.req(this.puPlan).then((res) => {
this.orderObj = res; this.orderObj = res;