fix: 修复计划模块保存失败(client_name列重复)

- routes.py: planFinances列列表去掉重复的client_name
- plan.js: 拆分try-catch区分保存错误和刷新错误
- 版本号 v1.0.0.32
This commit is contained in:
mac
2026-07-08 17:04:47 +08:00
parent 0a0caa959c
commit cfd5137edc
3 changed files with 8 additions and 3 deletions

View File

@@ -935,13 +935,18 @@ window.createPlanFinance = async (event) => {
const result = await api("/api/planFinances", { method: "POST", body: JSON.stringify({ data }) });
if (result.id && data.customer_name) logActivity("finance", result.id, "创建了「" + data.customer_name + "」的财务项目");
}
} catch (error) {
toast("保存失败:" + error.message, "error");
return;
}
try {
form.reset();
document.querySelector("#plan_pf-id-input").value = "";
document.querySelector("#planModalTitle").textContent = "新增项目财务";
closePlanModal();
await load();
} catch (error) {
toast("保存失败:" + error.message, "error");
toast("刷新失败:" + error.message, "error");
}
};