From 0b9f107b2ae7de444364402ded44328cc1ff0805 Mon Sep 17 00:00:00 2001 From: Developer Date: Mon, 29 Dec 2025 11:48:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=97=B6=E6=8A=A5=E5=90=8D=E8=B4=B9=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=98=A0=E5=B0=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/martial/project/index.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/views/martial/project/index.vue b/src/views/martial/project/index.vue index b967d9b..e6c5fd3 100644 --- a/src/views/martial/project/index.vue +++ b/src/views/martial/project/index.vue @@ -669,6 +669,10 @@ const handleEdit = (row) => { Object.keys(form).forEach((key) => { form[key] = row[key] }) + // 处理字段名映射:后端返回 price,表单使用 registrationFee + if (row.price !== undefined) { + form.registrationFee = row.price + } dialogVisible.value = true } @@ -725,11 +729,16 @@ const handleSubmit = async () => { if (valid) { submitLoading.value = true try { + // 构建提交数据,确保字段名与后端一致 + const submitData = { + ...form, + price: form.registrationFee // 后端使用 price 字段 + } if (form.id) { - await submitProject(form) + await submitProject(submitData) ElMessage.success('修改成功') } else { - await submitProject(form) + await submitProject(submitData) ElMessage.success('新增成功') } dialogVisible.value = false