From 96344ed345fca43520d5150ab225dbf77410f152 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 25 Jul 2023 16:33:59 +0800 Subject: [PATCH] update testingStep dialgowithmenu --- src/components/DialogWithMenu.vue | 102 +- .../noTemplateComponents/textOnlyComponent.js | 2 +- src/views/modules/pms/blenderOrder/config.js | 2 +- src/views/modules/pms/blenderPress/config.js | 4 +- .../components/tabs/subOrderDetail.vue | 4 +- src/views/modules/pms/finishedOrder/config.js | 2 +- .../order/components/tabs/subOrderDetail.vue | 2 +- src/views/modules/pms/order/config.js | 2 +- .../modules/pms/qualityPackOrder/config.js | 2 +- .../testingStep/components/DialogWithMenu.vue | 996 ++++++++++++++++++ .../components/ListViewWithHead.vue | 523 +++++++++ src/views/modules/pms/testingStep/index.vue | 17 +- 12 files changed, 1572 insertions(+), 86 deletions(-) create mode 100644 src/views/modules/pms/testingStep/components/DialogWithMenu.vue create mode 100644 src/views/modules/pms/testingStep/components/ListViewWithHead.vue diff --git a/src/components/DialogWithMenu.vue b/src/components/DialogWithMenu.vue index 4c86ca4..6a22324 100644 --- a/src/components/DialogWithMenu.vue +++ b/src/components/DialogWithMenu.vue @@ -270,7 +270,6 @@ export default { inject: ["urls"], data() { const dataForm = {}; - let dataForm__duplicate = null; const autoDisabledQueue = []; const watingToRefreshQueue = []; const cached = {}; @@ -374,15 +373,12 @@ export default { }); }); - if (this.configs.form.duplicate) dataForm__duplicate = JSON.parse(JSON.stringify(dataForm)); - return { // configs, btnLoading: false, loadingStatus: false, activeMenu: this.configs.menu[0].name, dataForm, - dataForm__duplicate, detailMode: false, autoDisabledQueue, watingToRefreshQueue, @@ -423,44 +419,44 @@ export default { }; }, mounted() { - // this.configs.form.rows.forEach((row) => { - // row.forEach((col) => { - // if ( - // col.changeReflects && - // typeof col.changeReflects === "object" && - // "fromKey" in col.changeReflects && - // "toProp" in col.changeReflects - // ) { - // this.$watch( - // () => this.dataForm[col.prop], - // (val) => { - // if (val && col.prop in this.cached) { - // console.log("here changeReflects", col.prop, col.changeReflects.toProp, this.cached[col.prop]); - // if (typeof col.changeReflects.fromKey === "string") { - // this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find((item) => item.id === val)?.[ - // col.changeReflects.fromKey - // ]; - // } else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) { - // const foundItem = (this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find( - // (item) => item.id === val - // )); - // if (foundItem) { - // const values = col.changeReflects.fromKey.map((key) => foundItem[key]); - // this.dataForm[col.changeReflects.toProp] = values.join(col.changeReflects.delimiter); - // } else { - // this.dataForm[col.changeReflects.toProp] = col.changeReflects.delimiter; - // console.log("[DialogWithMenu] mounted() 没找到对应数据"); - // } - // } - // } - // }, - // { - // immediate: false, - // } - // ); - // } - // }); - // }); + this.configs.form.rows.forEach((row) => { + row.forEach((col) => { + if ( + col.changeReflects && + typeof col.changeReflects === "object" && + "fromKey" in col.changeReflects && + "toProp" in col.changeReflects + ) { + this.$watch( + () => this.dataForm[col.prop], + (val) => { + if (val && col.prop in this.cached) { + console.log("here changeReflects", col.prop, col.changeReflects.toProp, this.cached[col.prop]); + if (typeof col.changeReflects.fromKey === "string") { + this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find((item) => item.id === val)?.[ + col.changeReflects.fromKey + ]; + } else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) { + const foundItem = (this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find( + (item) => item.id === val + )); + if (foundItem) { + const values = col.changeReflects.fromKey.map((key) => foundItem[key]); + this.dataForm[col.changeReflects.toProp] = values.join(col.changeReflects.delimiter); + } else { + this.dataForm[col.changeReflects.toProp] = col.changeReflects.delimiter; + console.log("[DialogWithMenu] mounted() 没找到对应数据"); + } + } + } + }, + { + immediate: false, + } + ); + } + }); + }); }, watch: { @@ -782,17 +778,7 @@ export default { console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); }, handleSelectChange(col, eventValue) { - console.log("[dialog] select change: ", col, eventValue, this.dataForm__duplicate); - if (this.dataForm__duplicate !== null) { - console.log("before B--------->", this.dataForm__duplicate); - const shape = this.cached[col.prop].find((item) => item.id === eventValue); - this.$set( - this.dataForm__duplicate, - col.changeReflects.toProp, - shape && col.changeReflects.toProp in shape ? shape[col.changeReflects.toProp] : null - ); - console.log("B--------->", shape, this.dataForm__duplicate); - } + console.log("[dialog] select change: ", col, eventValue); }, handleSwitchChange(val) { console.log("[dialog] switch change: ", val, this.dataForm); @@ -812,8 +798,6 @@ export default { case "update": { this.$refs.dataForm[0].validate((passed, result) => { if (passed) { - // 判断dataForm类型 - let dataForm = this.dataForm__duplicate !== null ? this.dataForm__duplicate : this.dataForm; // 如果通过验证 this.btnLoading = true; this.loadingStatus = true; @@ -823,8 +807,7 @@ export default { const hasAttachment = !!this.configs.menu.find((item) => item.key === "attachment"); if (hasAttachment) { const fileIds = this.fileList.map((item) => item.id); - // this.$set(this.dataForm, "fileIds", fileIds); - dataForm.fileIds = fileIds; + this.$set(this.dataForm, "fileIds", fileIds); } // 加载额外需要的 id @@ -845,8 +828,6 @@ export default { // console.log('actualPayload', actualPayload); // } - console.log("before update:", dataForm); - // 实际发送请求 this.btnLoading = true; this.$http({ @@ -854,8 +835,7 @@ export default { method, data: { ...extraIds, - // ...this.dataForm, - ...dataForm, + ...this.dataForm, }, }) .then(({ data: res }) => { diff --git a/src/components/noTemplateComponents/textOnlyComponent.js b/src/components/noTemplateComponents/textOnlyComponent.js index a4b55dd..4762042 100644 --- a/src/components/noTemplateComponents/textOnlyComponent.js +++ b/src/components/noTemplateComponents/textOnlyComponent.js @@ -11,7 +11,7 @@ export default { }, data() { return { - orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"], + orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"], }; }, render: function (h) { diff --git a/src/views/modules/pms/blenderOrder/config.js b/src/views/modules/pms/blenderOrder/config.js index e6bf14d..77309ea 100644 --- a/src/views/modules/pms/blenderOrder/config.js +++ b/src/views/modules/pms/blenderOrder/config.js @@ -20,7 +20,7 @@ export default function () { prop: "statusDictValue", label: "订单状态", filter: (val) => - val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-", + val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-", }, // { prop: "startTime", label: "开始时间" }, // { prop: "shapeCode", label: "砖型" }, diff --git a/src/views/modules/pms/blenderPress/config.js b/src/views/modules/pms/blenderPress/config.js index ffd4264..a0b628b 100644 --- a/src/views/modules/pms/blenderPress/config.js +++ b/src/views/modules/pms/blenderPress/config.js @@ -13,7 +13,7 @@ export default function () { { prop: "statusDictValue", label: "订单状态", - filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), + filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), }, { prop: "bomCode", label: "配方" }, { width: 120, prop: "qty", label: "混料总量 [kg]" }, @@ -49,7 +49,7 @@ export default function () { { width: 60, prop: "orderCate", label: "子号" }, { width: 160, prop: "code", label: "压制订单号" }, { width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") }, - { prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), }, + { prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), }, { prop: "startTime", label: "开始时间" }, { width: 100, prop: "shapeCode", label: "砖型" }, { prop: "pressCode", label: "压机" }, diff --git a/src/views/modules/pms/finishedOrder/components/tabs/subOrderDetail.vue b/src/views/modules/pms/finishedOrder/components/tabs/subOrderDetail.vue index 14cd223..cbda80a 100644 --- a/src/views/modules/pms/finishedOrder/components/tabs/subOrderDetail.vue +++ b/src/views/modules/pms/finishedOrder/components/tabs/subOrderDetail.vue @@ -97,7 +97,7 @@ export default { width: 575, prop: "statusDictValue", label: "订单状态", - filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), + filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), }, { prop: "qty", label: "混料总量 [kg]" }, { @@ -121,7 +121,7 @@ export default { { prop: "statusDictValue", label: "订单状态", - filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), + filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), }, { prop: "qty", label: "生产量" }, { prop: "qtyComplete", label: "完成量" }, diff --git a/src/views/modules/pms/finishedOrder/config.js b/src/views/modules/pms/finishedOrder/config.js index 3981db6..d670492 100644 --- a/src/views/modules/pms/finishedOrder/config.js +++ b/src/views/modules/pms/finishedOrder/config.js @@ -81,7 +81,7 @@ export default function () { }, data() { return { - orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"], + orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"], }; }, render: function (h) { diff --git a/src/views/modules/pms/order/components/tabs/subOrderDetail.vue b/src/views/modules/pms/order/components/tabs/subOrderDetail.vue index 8b5b990..1b93082 100644 --- a/src/views/modules/pms/order/components/tabs/subOrderDetail.vue +++ b/src/views/modules/pms/order/components/tabs/subOrderDetail.vue @@ -97,7 +97,7 @@ export default { width: 575, prop: "statusDictValue", label: "订单状态", - filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), + filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), }, { prop: "qty", label: "混料总量 [kg]" }, { diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js index 86b5e7c..9931999 100644 --- a/src/views/modules/pms/order/config.js +++ b/src/views/modules/pms/order/config.js @@ -233,7 +233,7 @@ export default function () { }, data() { return { - orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"], + orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"], }; }, render: function (h) { diff --git a/src/views/modules/pms/qualityPackOrder/config.js b/src/views/modules/pms/qualityPackOrder/config.js index 6a7dd85..90ec789 100644 --- a/src/views/modules/pms/qualityPackOrder/config.js +++ b/src/views/modules/pms/qualityPackOrder/config.js @@ -19,7 +19,7 @@ export default function () { // { // prop: "statusDictValue", // label: "订单状态", - // filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), + // filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), // }, // { width: 120, prop: "startTime", label: "开始时间" }, { width: 120, prop: "shapeCode", label: "砖型" }, diff --git a/src/views/modules/pms/testingStep/components/DialogWithMenu.vue b/src/views/modules/pms/testingStep/components/DialogWithMenu.vue new file mode 100644 index 0000000..c0f0e82 --- /dev/null +++ b/src/views/modules/pms/testingStep/components/DialogWithMenu.vue @@ -0,0 +1,996 @@ + + + + + diff --git a/src/views/modules/pms/testingStep/components/ListViewWithHead.vue b/src/views/modules/pms/testingStep/components/ListViewWithHead.vue new file mode 100644 index 0000000..269f500 --- /dev/null +++ b/src/views/modules/pms/testingStep/components/ListViewWithHead.vue @@ -0,0 +1,523 @@ + + + + + + diff --git a/src/views/modules/pms/testingStep/index.vue b/src/views/modules/pms/testingStep/index.vue index d619bc7..3d72d66 100644 --- a/src/views/modules/pms/testingStep/index.vue +++ b/src/views/modules/pms/testingStep/index.vue @@ -9,7 +9,8 @@