update 窑车详情的layout

This commit is contained in:
lb 2023-04-11 13:54:40 +08:00
parent e33feed314
commit 351720ffc1
3 changed files with 37 additions and 19 deletions

View File

@ -6,14 +6,19 @@
:destroy-on-close="false"
:close-on-click-modal="configs.clickModalToClose ?? true"
:width="configs.dialogWidth ?? '50%'"
:append-to-body="true"
>
:append-to-body="true">
<!-- title -->
<div slot="title" class="dialog-title" style="display: flex; align-items: center">
<span style="font-size: 18px">装载详情</span>
<el-button v-if="configs.showAdd ?? false" size="small" type="primary" plain style="margin-left: 16px" @click="$emit('add-record', id)"
>添加记录</el-button
>
<el-button
v-if="configs.showAdd ?? false"
size="small"
type="primary"
plain
style="margin-left: 16px"
@click="$emit('add-record', id)">
添加记录
</el-button>
</div>
<!-- main content -->
@ -24,8 +29,7 @@
:table-data="dataList"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<!-- @operate-event="handleOperate" -->
<el-pagination
@ -37,8 +41,7 @@
:page-sizes="[1, 5, 10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</el-dialog>
</template>
@ -78,7 +81,7 @@ export default {
totalPage: 0,
dataList: [],
tableLoading: false,
refreshLayoutKey: null,
refreshLayoutKey: "",
id: null,
showPaination: false,
};
@ -151,6 +154,10 @@ export default {
});
}
this.tableLoading = false;
this.$nextTick(() => {
this.refreshLayoutKey = Math.random();
});
})
.catch((err) => {
this.$message({

View File

@ -15,7 +15,7 @@
<SubOrderDetail v-if="order !== null" :order="order" />
</el-tab-pane>
<el-tab-pane name="car" label="窑车详情">
<CarDetail v-if="order !== null" :order-id="order.id" />
<CarDetail v-if="order !== null" :order-id="order.id" :table-layout="carLayoutKey" />
</el-tab-pane>
<el-tab-pane name="tray" label="托盘详情">
<TrayDetail />

View File

@ -7,8 +7,7 @@
:column-config="tableConfig"
:table-data="dataList"
@operate-event="handleOperate"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
@size-change="handleSizeChange"
@ -17,15 +16,13 @@
:page-sizes="[1, 5, 10, 20]"
:page-size="listQuery.limit"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<DialogCarPayload
ref="car-payload-dialog"
v-if="!!carPayloadDialogConfigs"
:dialog-visible.sync="carPayloadDialogVisible"
:configs="carPayloadDialogConfigs"
/>
:configs="carPayloadDialogConfigs" />
<!-- @refreshDataList="getList" -->
</div>
</template>
@ -37,7 +34,6 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationC
import { timeFilter } from "@/utils/filters";
import DialogCarPayload from "@/components/DialogCarPayload.vue";
export default {
name: "CarDetailTag",
components: { BaseListTable, DialogCarPayload },
@ -46,6 +42,10 @@ export default {
type: String,
default: null,
},
tableLayout: {
type: Number,
default: 0
}
},
data() {
return {
@ -67,7 +67,7 @@ export default {
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "to-car-payload", label: "装载详情", icon: "document" },
{ name: "to-car-payload", label: "装载详情", icon: "shopping-cart-full" }, // or el-icon-box
// { name: "delete", label: "", icon: "delete", emitFull: true, promptField: "code" },
],
},
@ -111,8 +111,19 @@ export default {
},
immediate: true,
},
tableLayout() {
this.doLayout()
}
},
// activated() {
// console.log("hhh");
// this.refreshLayoutKey = Math.random();
// },
methods: {
doLayout() {
this.refreshLayoutKey = Math.random();
},
handleOperate({ type, data }) {
switch (type) {
case "delete": {