diff --git a/.prettierrc b/.prettierrc index 3e7e729..a2658aa 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "printWidth": 120, + "printWidth": 108, "bracketSameLine": true, "htmlWhitespaceSensitivity": "ignore", "semi": true, diff --git a/public/importTemplates/orderImport.xlsx b/public/importTemplates/orderImport.xlsx index 4b6a312..79ba14f 100644 Binary files a/public/importTemplates/orderImport.xlsx and b/public/importTemplates/orderImport.xlsx differ diff --git a/src/components/DialogJustForm.vue b/src/components/DialogJustForm.vue index 13b98f3..314c9a4 100644 --- a/src/components/DialogJustForm.vue +++ b/src/components/DialogJustForm.vue @@ -78,6 +78,14 @@ {{ opt[col.customLabel] || "无描述" }} + { - console.log("getData: ", col.prop, "/", param ?? "no param!"); + // console.log("getData: ", col.prop, "/", param ?? "no param!"); // 获取数据 - 不需要等待前置条件时 promiseHistory[col.prop] = col.fetchData(param).then(({ data: res }) => { if (res.code === 0) { if ("list" in res.data) { - console.log( - "SdASD ", - res.data.list.map((i) => ({ + let options = []; + if (col.customLabel) { + options = res.data.list.map((i) => ({ label: col.optionLabel ? i[col.optionLabel] : i.name, value: col.optionValue ? i[col.optionValue] : i.id, [col.customLabel]: i[col.customLabel], - })) - ); + })); + } else if (col.customLabels) { + options = res.data.list.map((i) => { + let extraOptions = {}; + col.customLabels.forEach((label) => { + extraOptions[label] = i[label]; + }); + return { + label: col.optionLabel ? i[col.optionLabel] : i.name, + value: col.optionValue ? i[col.optionValue] : i.id, + ...extraOptions, + }; + }); + } else { + options = res.data.list.map((i) => ({ + label: col.optionLabel ? i[col.optionLabel] : i.name, + value: col.optionValue ? i[col.optionValue] : i.id, + })); + } // 填充 options - this.$set( - col, - "options", - col.customLabel - ? res.data.list.map((i) => ({ - label: col.optionLabel ? i[col.optionLabel] : i.name, - value: col.optionValue ? i[col.optionValue] : i.id, - [col.customLabel]: i[col.customLabel], - })) - : res.data.list.map((i) => ({ - label: col.optionLabel ? i[col.optionLabel] : i.name, - value: col.optionValue ? i[col.optionValue] : i.id, - })) - ); + this.$set(col, "options", options); // 是否需要缓存数据列表 if ("injectTo" in col || col.cached) { diff --git a/src/views/modules/pms/blenderOrder/components/edit-dialog.vue b/src/views/modules/pms/blenderOrder/components/edit-dialog.vue index 73e0153..427a845 100644 --- a/src/views/modules/pms/blenderOrder/components/edit-dialog.vue +++ b/src/views/modules/pms/blenderOrder/components/edit-dialog.vue @@ -279,12 +279,12 @@ export default { }, handleSwitchChange(val) { - console.log("[dialog] switch change: ", val, this.dataForm); + // console.log("[dialog] switch change: ", val, this.dataForm); }, handleComponentModelUpdate(propName, { subject, payload: { data } }) { this.dataForm[propName] = JSON.stringify(data); - console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); + // console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); }, addOrUpdate(method = "POST") { diff --git a/src/views/modules/pms/blenderOrder/config.js b/src/views/modules/pms/blenderOrder/config.js index 08d0d18..941ea1c 100644 --- a/src/views/modules/pms/blenderOrder/config.js +++ b/src/views/modules/pms/blenderOrder/config.js @@ -305,7 +305,13 @@ export default function () { return { dialogConfigs, tableConfig: { - table: null, // 此处可省略,el-table 上的配置项 + table: { + "cell-class-name": ({ row, column, rowIndex, columnIndex }) => { + if ("statusDictValue" in row && row.statusDictValue == "2") { + return "cell-in-production"; + } + }, + }, column: tableProps, // el-column-item 上的配置项 }, headFormConfigs: { diff --git a/src/views/modules/pms/blenderOrder/index.vue b/src/views/modules/pms/blenderOrder/index.vue index de8ab96..83d9b95 100644 --- a/src/views/modules/pms/blenderOrder/index.vue +++ b/src/views/modules/pms/blenderOrder/index.vue @@ -1,5 +1,6 @@