From cfd5137edc7bdfe16a8f41ad27bd1fe34b256f70 Mon Sep 17 00:00:00 2001 From: mac Date: Wed, 8 Jul 2026 17:04:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5(client?= =?UTF-8?q?=5Fname=E5=88=97=E9=87=8D=E5=A4=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - routes.py: planFinances列列表去掉重复的client_name - plan.js: 拆分try-catch区分保存错误和刷新错误 - 版本号 v1.0.0.32 --- backend/routes.py | 2 +- static/modules/plan.js | 7 ++++++- templates/index.html | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/routes.py b/backend/routes.py index 154d5ae..b90682d 100644 --- a/backend/routes.py +++ b/backend/routes.py @@ -25,7 +25,7 @@ TABLES = { "tasks": ("project_tasks", ["project_id", "phase", "milestone", "task", "owner", "due_date", "blockers", "notes", "status", "sort_order", "priority", "tenant"]), "projectFinances": ("project_finances", ["project_id", "tenant", "business_type", "customer_name", "client_name", "sign_amount", "sign_month", "sales_person", "owner", "total_rev", "total_gross", "total_payment", "total_cost", "total_paid", "budget_data", "expense_data", "start_date", "end_date", "task_type", "task_count", "service_fee_standard", "project_manager", "task_data", "project_code", "contact_name", "contact_phone", "other_info"]), "expense": ("expense_records", ["expense_type", "expense_month", "amount", "incurred_amount", "notes", "status", "tenant"]), - "planFinances": ("plan_finances", ["project_id", "tenant", "business_type", "customer_name", "client_name", "sign_amount", "sign_month", "sales_person", "owner", "total_rev", "total_gross", "total_payment", "total_cost", "total_paid", "budget_data", "expense_data", "start_date", "end_date", "task_type", "task_count", "service_fee_standard", "project_manager", "task_data", "project_code", "contact_name", "contact_phone", "other_info", "client_name", "project_type", "weight"]), + "planFinances": ("plan_finances", ["project_id", "tenant", "business_type", "customer_name", "client_name", "sign_amount", "sign_month", "sales_person", "owner", "total_rev", "total_gross", "total_payment", "total_cost", "total_paid", "budget_data", "expense_data", "start_date", "end_date", "task_type", "task_count", "service_fee_standard", "project_manager", "task_data", "project_code", "contact_name", "contact_phone", "other_info", "project_type", "weight"]), "planExpense": ("plan_expense_records", ["expense_type", "expense_month", "amount", "incurred_amount", "notes", "status", "tenant"]), } diff --git a/static/modules/plan.js b/static/modules/plan.js index 3c29218..e162e66 100644 --- a/static/modules/plan.js +++ b/static/modules/plan.js @@ -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"); } }; diff --git a/templates/index.html b/templates/index.html index f394156..88cd957 100644 --- a/templates/index.html +++ b/templates/index.html @@ -80,7 +80,7 @@
-

OPC Manager v1.0.0.31

+

OPC Manager v1.0.0.32

科普 OPC 工作台