add CarPayloadDialog

This commit is contained in:
lb
2023-03-23 10:47:41 +08:00
parent 264d5cb3c7
commit 1df948e577
7 changed files with 266 additions and 87 deletions

View File

@@ -26,7 +26,7 @@
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- :current-page.sync="currentPage"
:page-size.sync="pageSize" -->
:page-size.sync="pageSize" -->
<DialogWithMenu
ref="edit-dialog"
@@ -42,6 +42,13 @@
:configs="dialogConfigs"
@refreshDataList="getList"
/>
<DialogCarPayload
ref="car-payload-dialog"
v-if="!!dialogConfigs && dialogType === DIALOG_CARPAYLOAD"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
/>
</div>
</template>
@@ -50,14 +57,16 @@ import BaseListTable from "@/components/BaseListTable.vue";
import BaseSearchForm from "@/components/BaseSearchForm.vue";
import DialogWithMenu from "@/components/DialogWithMenu.vue";
import DialogJustForm from "@/components/DialogJustForm.vue";
import DialogCarPayload from "@/components/DialogCarPayload.vue";
import moment from "moment";
const DIALOG_WITH_MENU = "DialogWithMenu";
const DIALOG_JUST_FORM = "DialogJustForm";
const DIALOG_CARPAYLOAD = "DialogCarPayload";
export default {
name: "ListViewWithHead",
components: { BaseSearchForm, BaseListTable, DialogWithMenu, DialogJustForm },
components: { BaseSearchForm, BaseListTable, DialogWithMenu, DialogJustForm, DialogCarPayload },
props: {
tableConfig: {
type: Object,
@@ -93,7 +102,7 @@ export default {
},
computed: {
dialogType() {
return this.dialogConfigs.menu ? DIALOG_WITH_MENU : DIALOG_JUST_FORM;
return this.dialogConfigs.menu ? DIALOG_WITH_MENU : this.dialogConfigs.carPayloadDialog ? DIALOG_CARPAYLOAD : DIALOG_JUST_FORM;
},
},
activated() {
@@ -104,8 +113,8 @@ export default {
triggerUpdate(val, oldVal) {
if (val && val !== oldVal) {
// get list
this.page = 1
this.size = 20
this.page = 1;
this.size = 20;
this.getList();
}
},
@@ -114,6 +123,7 @@ export default {
return {
DIALOG_WITH_MENU,
DIALOG_JUST_FORM,
DIALOG_CARPAYLOAD,
dialogVisible: false,
topBtnConfig: null,
totalPage: 100,
@@ -261,11 +271,11 @@ export default {
}
case "view-blender-batch-details": {
this.$router.push({
name: 'pms-blenderBatchDetails',
name: "pms-blenderBatchDetails",
query: {
batchId: data
}
})
batchId: data,
},
});
break;
}
case "status": {
@@ -301,10 +311,10 @@ export default {
// console.log('to-bom-detail', data.name)
// 查看配方详情
return this.$router.push({
name: 'pms-bomDetails',
name: "pms-bomDetails",
query: {
name: data.name
}
name: data.name,
},
});
}
case "copy": {
@@ -402,15 +412,26 @@ export default {
}
case "to-car-history": {
return this.$router.push({
name: 'pms-carHistory',
name: "pms-carHistory",
query: {
code: data.code
}
})
code: data.code,
},
});
}
case "to-car-payload": {
// open dialog instead of redirect to a new page
this.openCarPayloadDialog(data);
}
}
},
openCarPayloadDialog(id) {
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["car-payload-dialog"].init(id);
});
},
handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) {
@@ -484,7 +505,7 @@ export default {
});
}
this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`)
console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
});
},