From b62db4d40cdf59d43afc7b62f4c5349169dba0fa Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 28 Mar 2023 15:49:50 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85-?= =?UTF-8?q?=E7=AA=91=E8=BD=A6tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pms/order/components/DialogWithMenu.vue | 214 +++++------------ .../order/components/ListSectionWithHead.vue | 19 +- .../pms/order/components/tabs/carDetail.vue | 218 +++++++++++++++++- .../pms/order/components/tabs/trayDetail.vue | 2 +- src/views/modules/pms/order/config.js | 2 +- 5 files changed, 285 insertions(+), 170 deletions(-) diff --git a/src/views/modules/pms/order/components/DialogWithMenu.vue b/src/views/modules/pms/order/components/DialogWithMenu.vue index 70a2ac3..ae7a354 100644 --- a/src/views/modules/pms/order/components/DialogWithMenu.vue +++ b/src/views/modules/pms/order/components/DialogWithMenu.vue @@ -8,94 +8,20 @@ :destroy-on-close="false" :close-on-click-modal="configs.clickModalToClose ?? true" > - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - @@ -180,76 +106,49 @@ export default { detailMode: false, baseDialogConfig: null, visible: false, - activeTab: "子订单进度", + activeTab: "sub", + orderId: null, + orderSubId: null, + carLayoutKey: 0 }; }, mounted() { /** 处理 injectTo 选项 */ - this.configs.form.rows.forEach((row) => { - row.forEach((col) => { - if ("injectTo" in col && Array.isArray(col.injectTo)) { - // console.log("watching options ..... ", col); - col.injectTo.map((item) => { - const unwatch = this.$watch( - () => this.dataForm[col.prop], - (newVal) => { - const chosenObject = this.cachedList[col.prop].find((i) => i.id === newVal); - if (chosenObject) { - // 如果找到了 - this.$set(this.dataForm, item[0], chosenObject[item[1]]); - } - }, - { - immediate: false, - } - ); - this.watchList.push(unwatch); - }); - } - }); - }); + // this.configs.form.rows.forEach((row) => { + // row.forEach((col) => { + // if ("injectTo" in col && Array.isArray(col.injectTo)) { + // // console.log("watching options ..... ", col); + // col.injectTo.map((item) => { + // const unwatch = this.$watch( + // () => this.dataForm[col.prop], + // (newVal) => { + // const chosenObject = this.cachedList[col.prop].find((i) => i.id === newVal); + // if (chosenObject) { + // // 如果找到了 + // this.$set(this.dataForm, item[0], chosenObject[item[1]]); + // } + // }, + // { + // immediate: false, + // } + // ); + // this.watchList.push(unwatch); + // }); + // } + // }); + // }); }, - computed: { - uploadHeaders() { - return { - token: Cookies.get("token") || "", - }; - }, - actualMenus() { - // return this.configs.menu.filter((m) => { - // if (m.onlyEditMode && !this.dataForm.id) { - // return false; - // } - // return true; - // }); - return [ - { name: "子订单进度", key: "sub" }, - { name: "窑车详情", key: "car" }, - { name: "托盘详情", key: "tray" }, - { name: "订单详情", key: "order" }, - ]; - }, - }, - methods: { - handleTabClick(payload) {}, - handleFilelistUpdate(newFilelist) { - // TODO: 直接访问 .files 可能不太合适 - this.dataForm.files = newFilelist.map((file) => ({ - id: file.id, - name: file.name, - url: file.url, - typeCode: file.typeCode, - })); - // 更新请求 - if ("id" in this.dataForm && this.dataForm.id !== null && this.dataForm.id !== undefined) this.addOrUpdate("PUT"); - else - this.$notify({ - title: "等待保存", - message: "已添加文件,请手动点击保存!", - type: "warning", - duration: 2500, - }); + methods: { + handleTabClick(tab, event) { + console.log('handle tab click', tab, event) + // tab.getAList(this.orderId) + switch (tab.label) { + case "子订单进度": break; + case "窑车详情": this.carLayoutKey = Math.random(); break; + case "托盘详情": break; + case "订单详情": break; + } }, /** utitilities */ @@ -280,18 +179,17 @@ export default { }, /** init **/ - init(id, detailMode) { + init(order, detailMode) { + this.orderId = order.id; + console.log("init menu dialog,", order); this.visible = true; - // console.log("[DialogJustForm] init", this.dataForm, id, detailMode); - if (this.$refs.dataForm) { - // console.log("[DialogJustForm] clearing form validation..."); - // 当不是首次渲染dialog的时候,一开始就清空验证信息,本组件的循环里只有一个 dataForm 所以只用取 [0] 即可 - this.$refs.dataForm.clearValidate(); - } + // if (this.$refs.dataForm) { + // this.$refs.dataForm.clearValidate(); + // } this.detailMode = detailMode ?? false; this.$nextTick(() => { - this.dataForm.id = id || null; + // this.dataForm.id = id || null; if (this.dataForm.id) { // 如果是编辑 this.loadingStatus = true; diff --git a/src/views/modules/pms/order/components/ListSectionWithHead.vue b/src/views/modules/pms/order/components/ListSectionWithHead.vue index e7867fa..fe6d641 100644 --- a/src/views/modules/pms/order/components/ListSectionWithHead.vue +++ b/src/views/modules/pms/order/components/ListSectionWithHead.vue @@ -37,11 +37,11 @@ /> --> @@ -114,6 +114,7 @@ export default { dataList: [], totalPage: 0, renderDialog: false, + renderMenuDialog: false, }; }, mounted() { @@ -298,6 +299,11 @@ export default { this.openDialog(data, true); break; } + case "view-ongoing": { + console.log('view-ongoing', data) + this.openMenuDialog(data, false); + break; + } } }, @@ -349,6 +355,13 @@ export default { this.$refs["order-dialog"].init(/** some args... */ row_id, detail_mode); }); }, + + openMenuDialog(row, detail) { + this.renderMenuDialog = true; + this.$nextTick(() => { + this.$refs["menu-dialog"].init(/** some args... */ row, detail); + }); + }, }, }; diff --git a/src/views/modules/pms/order/components/tabs/carDetail.vue b/src/views/modules/pms/order/components/tabs/carDetail.vue index 99ab734..2736f3c 100644 --- a/src/views/modules/pms/order/components/tabs/carDetail.vue +++ b/src/views/modules/pms/order/components/tabs/carDetail.vue @@ -1,19 +1,223 @@ diff --git a/src/views/modules/pms/order/components/tabs/trayDetail.vue b/src/views/modules/pms/order/components/tabs/trayDetail.vue index ddf292b..40acf04 100644 --- a/src/views/modules/pms/order/components/tabs/trayDetail.vue +++ b/src/views/modules/pms/order/components/tabs/trayDetail.vue @@ -1,6 +1,6 @@ diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js index 65d0bb2..7d72ba8 100644 --- a/src/views/modules/pms/order/config.js +++ b/src/views/modules/pms/order/config.js @@ -24,7 +24,7 @@ export default function () { const operations = { ongoing: [ // { name: 'confirm-order', label: '确认', icon: 'success', showText: true }, - { name: 'view', label: '查看详情', icon: 'view' }, + { name: 'view-ongoing', label: '查看详情', icon: 'view', emitFull: true }, { name: "end-order", label: "结束", icon: "finished" }, { name: "move-up", label: "上移", icon: "arrow-up" }, { name: "move-down", label: "下移", icon: "arrow-down" },