feat: 亮灯表30天滚动窗口 + 相关人员文案统一 + 周报数据补全

- light_board.classify: 自然月 → 30/60天滚动窗口 (≤30天🟢, 31-60天🟡, 61+天🔴)
- LightBoard.vue: 4处文案同步 (近30天已拜访 / 上次 / 个周期)
- dashboard.get_weekly_report: 补全 companion_names_resolved + visitor_name + visitor_phone + edit_log
- 导入/导出模板 + VisitForm + ManagerWorkspace: 同访人员 → 相关人员
This commit is contained in:
2026-07-02 16:58:29 +08:00
parent 3285e22142
commit cd47d1aed5
8 changed files with 33 additions and 28 deletions
+8
View File
@@ -138,6 +138,9 @@ async def get_weekly_report(
visits_data = []
for v in visits:
# Resolve companion names: system users → names, external → direct
companion_names_resolved = [user_map.get(c, str(c)) for c in (v.companions or [])]
companion_names_resolved.extend(v.companion_names or [])
visits_data.append({
"id": str(v.id),
"customer_id": str(v.customer_id),
@@ -145,12 +148,17 @@ async def get_weekly_report(
"visit_date": str(v.visit_date),
"visit_method": v.visit_method,
"time_range": v.time_range,
"visitor_name": v.visitor_name or "",
"visitor_phone": v.visitor_phone or "",
"communication_content": v.communication_content,
"customer_demand": v.customer_demand,
"companions": [str(c) for c in (v.companions or [])],
"companion_names": v.companion_names or [],
"companion_names_resolved": companion_names_resolved,
"photos": v.photos or [],
"manager_id": str(v.manager_id),
"manager_name": user_map.get(v.manager_id, ""),
"edit_log": v.edit_log or [],
"created_at": str(v.created_at),
})