feat: 支局长/分管领导可为任意客户经理代填记录

后端:
- 5个模块的 Create/Update schema 新增可选 manager_id 字段
- POST 端点: director/leader 可指定 manager_id,manager 角色自动用自身
- PUT 端点: director/leader 可修改 manager_id,manager 角色禁止修改

前端(移动端+桌面端共10个页面):
- 支局长/领导可见「客户经理」下拉选择框
- 创建和编辑时均可指定记录归属的客户经理
- 涵盖今日拜访、今日纪要、工作计划、商机跟单、要客拜访五个模块

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-12 18:19:05 +08:00
parent c489a8d6fd
commit 4453ee2ca0
19 changed files with 145 additions and 15 deletions
+3 -1
View File
@@ -60,7 +60,7 @@ async def create_mini_business(
amount=data.amount,
follow_up_detail=data.follow_up_detail,
status=data.status,
manager_id=uuid.UUID(current_user["user_id"]),
manager_id=data.manager_id if (current_user["role"] in ("director", "leader") and data.manager_id) else uuid.UUID(current_user["user_id"]),
expected_revenue_date=data.expected_revenue_date,
)
init_entry(m, current_user["name"])
@@ -85,6 +85,8 @@ async def update_mini_business(
old_snapshot = {"customer_id": str(m.customer_id), "product_type": m.product_type, "amount": m.amount, "follow_up_detail": m.follow_up_detail, "status": m.status, "expected_revenue_date": m.expected_revenue_date}
update_data = data.model_dump(exclude_unset=True)
if current_user["role"] not in ("director", "leader"):
update_data.pop("manager_id", None)
for k, v in update_data.items():
setattr(m, k, v)
new_snapshot = {"customer_id": str(m.customer_id), "product_type": m.product_type, "amount": m.amount, "follow_up_detail": m.follow_up_detail, "status": m.status, "expected_revenue_date": m.expected_revenue_date}