fix: 修复项目编辑时报名费字段映射问题

This commit is contained in:
Developer
2025-12-29 11:48:03 +08:00
parent 5bbe374ebf
commit 0b9f107b2a

View File

@@ -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