feat: 删除部门模块 + 任务系统重构 + 布局修复

- 删除部门(Home)侧边栏入口、面板及相关代码
- 删除 home.js,chartOptions 等图表工具迁移到 utils.js
- 清理 render()、togglePhase、filterPhaseTasks 等死代码
- 任务列表改为平铺(取消阶段分组),支持拖拽排序
- 任务表单加开始时间字段,重组字段布局为三列
- 任务展开面板改为竖排:时间、任务进展、卡点与备注
- 视图按钮和新增任务按钮移入任务卡片顶部
- 修复 index.html div 嵌套不平衡导致布局塌陷
- 修复 savedTab 校验和 switchTenant 侧边栏 active 同步
- 总览工作台只显示预算/发生总览入口
- 性能面板 id 去重
This commit is contained in:
mac
2026-07-15 14:49:12 +08:00
parent 39513c0a7b
commit ec457e9d40
9 changed files with 227 additions and 371 deletions

View File

@@ -525,6 +525,39 @@ def finance_yearly():
conn.close()
@bp.route("/api/finance/copy-to-plan/<int:source_id>", methods=["POST"])
@login_required
def copy_finance_to_plan(source_id):
"""将已发生模块的项目复制到预算模块"""
table, cols = TABLES["planFinances"]
conn = db()
try:
src = one(conn, "SELECT * FROM project_finances WHERE id=?", [source_id])
if not src:
return jsonify({"error": "源项目不存在"}), 404
# 构建目标数据customer_name 前加"副本-"
data = {}
for col in cols:
if col == "customer_name":
data[col] = "副本-" + (src.get("customer_name") or "")
elif col == "project_type":
data[col] = "待签约"
elif col == "weight":
data[col] = "20%"
elif col == "created_at" or col == "updated_at":
data[col] = ""
else:
data[col] = src.get(col, "")
values = [data.get(col, "") for col in cols]
cur = _exec(conn,
f"INSERT INTO {table} ({','.join(cols)}) VALUES ({','.join(['?']*len(cols))})",
values)
conn.commit()
return jsonify({"ok": True, "id": cur.lastrowid})
finally:
conn.close()
# ---------- 通用 CRUD ----------
@bp.route("/api/<resource>/list", methods=["GET"])