From d2c09783210de093d619dc8d85dff2eb4a0de8ce Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 27 Mar 2023 15:09:38 +0800 Subject: [PATCH] =?UTF-8?q?update=203.27=20=E7=AA=91=E8=BD=A6=E5=8A=A0?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/atomViews/ListViewWithHead.vue | 12 +- .../components/ListViewWithHead.vue | 547 ++++++++++++++++++ src/views/modules/pms/carHistory/config.js | 3 +- src/views/modules/pms/carHistory/index.vue | 2 +- .../components/ListViewWithHead.vue | 15 +- .../modules/pms/detectionPlatform/config.js | 1 + .../components/ListViewWithHead.vue | 19 +- .../modules/pms/kilnWaitingRoom/config.js | 1 + .../order/components/ListSectionWithHead.vue | 1 + .../components/ListViewWithHead.vue | 15 +- .../modules/pms/palletizingLine/config.js | 1 + 11 files changed, 603 insertions(+), 14 deletions(-) create mode 100644 src/views/modules/pms/carHistory/components/ListViewWithHead.vue diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index 1a8b24d..dae9a3e 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -235,8 +235,14 @@ export default { // payload: { type: string, data: string | number | object } switch (type) { case "delete": { + // 找到删除的 prompt 字段 + const deleteConfig = data.head?.options?.find((item) => item.name === "delete"); + let promptName = data.name ?? data.id; + if (deleteConfig && "promptField" in deleteConfig) { + promptName = data[deleteConfig.promptField]; + } // 确认是否删除 - return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", { + return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", @@ -246,7 +252,11 @@ export default { this.$http({ url: this.urls.base, method: "DELETE", + // data: data.id, data: [`${data.id}`], + // headers: { + // "Content-Type": "application/json" + // } }).then(({ data: res }) => { if (res.code === 0) { this.$message.success("删除成功!"); diff --git a/src/views/modules/pms/carHistory/components/ListViewWithHead.vue b/src/views/modules/pms/carHistory/components/ListViewWithHead.vue new file mode 100644 index 0000000..c352664 --- /dev/null +++ b/src/views/modules/pms/carHistory/components/ListViewWithHead.vue @@ -0,0 +1,547 @@ + + + + + + diff --git a/src/views/modules/pms/carHistory/config.js b/src/views/modules/pms/carHistory/config.js index 7070e85..cbc6da4 100644 --- a/src/views/modules/pms/carHistory/config.js +++ b/src/views/modules/pms/carHistory/config.js @@ -21,7 +21,8 @@ export default function () { width: 90, subcomponent: TableOperaionComponent, options: [ - { name: "to-car-payload", label: "装载详情", icon: 'document' } + { name: "to-car-payload", label: "装载详情", icon: 'document' }, + { name: "delete", label: "删除", icon: 'delete', emitFull: true, promptField: 'code' } ], }, ]; diff --git a/src/views/modules/pms/carHistory/index.vue b/src/views/modules/pms/carHistory/index.vue index 247758e..aeac545 100644 --- a/src/views/modules/pms/carHistory/index.vue +++ b/src/views/modules/pms/carHistory/index.vue @@ -12,7 +12,7 @@