From 4a91d4d3503201ac47f503f828bd2dea1a93d613 Mon Sep 17 00:00:00 2001 From: wx-jincw Date: Sun, 22 Mar 2026 17:41:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=87=E8=B4=AD=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/api/pmcanteendemand.js | 24 ++ .../views/pm/canteen/demand/DispatchList.vue | 42 +-- admin/src/views/pm/canteen/demand/index.vue | 70 ++-- .../demand/pmcanteendemand-add-and-update.vue | 306 ++++++++++++++++-- 4 files changed, 355 insertions(+), 87 deletions(-) diff --git a/admin/src/api/pmcanteendemand.js b/admin/src/api/pmcanteendemand.js index a21f4e2..9160d4e 100644 --- a/admin/src/api/pmcanteendemand.js +++ b/admin/src/api/pmcanteendemand.js @@ -25,6 +25,30 @@ export function pmcanteendemandUpdateApi(data) { }) } +/** + * 新增pmcanteendemand + * @param pram + */ +export function pmcanteendemandBatchCreateApi(data) { + return request({ + url: `autogencode/pmcanteendemand/batchSave`, + method: 'POST', + data + }) +} + +/** + * pmcanteendemand更新 + * @param pram + */ +export function pmcanteendemandBatchUpdateApi(data) { + return request({ + url: `autogencode/pmcanteendemand/batchUpdate`, + method: 'POST', + data + }) +} + /** * pmcanteendemand详情 * @param pram diff --git a/admin/src/views/pm/canteen/demand/DispatchList.vue b/admin/src/views/pm/canteen/demand/DispatchList.vue index 8ca687a..aa5bad9 100644 --- a/admin/src/views/pm/canteen/demand/DispatchList.vue +++ b/admin/src/views/pm/canteen/demand/DispatchList.vue @@ -1,24 +1,20 @@ diff --git a/admin/src/views/pm/canteen/demand/index.vue b/admin/src/views/pm/canteen/demand/index.vue index 2b2517d..1c2fcc7 100644 --- a/admin/src/views/pm/canteen/demand/index.vue +++ b/admin/src/views/pm/canteen/demand/index.vue @@ -29,7 +29,7 @@ 重置 新增需求 提交 - 批量删除 + @@ -142,7 +143,6 @@ dataListLoading: false, dataListSelections: [], addOrUpdateVisible: false, - expandedRowKeys: [] // 存储展开的行的ID } }, components: { @@ -158,29 +158,7 @@ this.getDataList() }, methods: { - // 处理行的展开和折叠事件 - handleExpandChange(row, expandedRows) { - if (expandedRows.includes(row)) { - // 展开行,将其ID添加到 expandedRowKeys 数组 - if (!this.expandedRowKeys.includes(row.id)) { - this.expandedRowKeys.push(row.id) - } - } else { - // 折叠行,将其ID从 expandedRowKeys 数组中移除 - const index = this.expandedRowKeys.indexOf(row.id) - if (index !== -1) { - this.expandedRowKeys.splice(index, 1) - } - } - }, - // 新增需求详情 - addDetail(orderId) { - // 这里可以添加新增需求详情的逻辑 - }, - // 编辑需求详情 - editDetail(orderId, detailId) { - // 这里可以添加编辑需求详情的逻辑 - }, + // 重置表单 resetForm() { this.dataForm = { @@ -238,6 +216,19 @@ this.$refs.addOrUpdate.init(id) }) }, + rejectDemand(id) { + this.$confirm(`确定驳回该需求吗?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + // 调用API更新状态 + api.pmcanteendemandUpdateApi({id: id, status: '2'}).then(res => { + this.$message.success('驳回成功') + this.getDataList() + }) + }) + }, // 提交需求 submitDemand (id) { this.$confirm(`确定提交该需求吗?`, '提示', { @@ -246,7 +237,7 @@ type: 'warning' }).then(() => { // 调用API更新状态 - api.pmcanteendemandUpdateApi({id: id, status: '4'}).then(res => { + api.pmcanteendemandUpdateApi({id: id, status: '3'}).then(res => { this.$message.success('提交成功') this.getDataList() }) @@ -299,3 +290,10 @@ } } + \ No newline at end of file diff --git a/admin/src/views/pm/canteen/demand/pmcanteendemand-add-and-update.vue b/admin/src/views/pm/canteen/demand/pmcanteendemand-add-and-update.vue index 7e13c01..176d8f2 100644 --- a/admin/src/views/pm/canteen/demand/pmcanteendemand-add-and-update.vue +++ b/admin/src/views/pm/canteen/demand/pmcanteendemand-add-and-update.vue @@ -3,7 +3,8 @@ + :visible.sync="visible" + width="80%"> @@ -30,22 +31,127 @@ - - - + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + 确认添加 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + 取消 - 确定 + +
@@ -53,20 +159,34 @@ + +