This commit is contained in:
zlwu committed 2026-08-30 18:33:13 +08:00
1 parent c8cec132bf
commit 19c5aaa8f5
95 files changed
+309129 -9838

No files matched your search

@@ -0,0 +1,54 @@
# 合同详情 · 运输计划联动 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 合同详情展示关联运输计划与产品安排数量,安排运输时自动将已审批合同开始执行。
**Architecture:** 后端按 `pl_plan_contract`(含遗留 `pl_plan.contract_id`)聚合计划列表与按产品 `plan_qty`;前端在 `ContractDetailDialog`/`detail.vue` 增加 Tab 与三列;`arrange_transport` 后幂等 `start_execute`。
**Tech Stack:** FastAPI + SQLAlchemy · Vue 3 + Element Plus · 现有 `flattenPlanListRows` / `PlPlanViewDialog`
---
### Task 1: Backend — product plan qty aggregation
**Files:**
- Create: `backend/app/services/pl_contract_plan_qty.py`
- Test: `backend/tests/test_pl_contract_plan_qty.py`
- Modify: contract detail serialization to attach qty fields on products
- [ ] Write unit tests for archived / unarchived-arranged / total
- [ ] Implement aggregation service
- [ ] Attach fields on contract detail products (`archivedQty`, `arrangedUnarchivedQty`, `arrangedTotalQty`)
### Task 2: Backend — list plans by contract
**Files:**
- Modify: `backend/app/api/pl/plan.py`, schemas as needed
- Modify: `web-admin/src/api/pl/index.ts`
- [ ] `GET /transport/plan/by-contract/{contractId}` page list reusing plan detail shaping
- [ ] Frontend API wrapper
### Task 3: Backend — arrange auto start_execute
**Files:**
- Modify: `backend/app/api/pl/transport.py` (or arrange service)
- Test: `backend/tests/test_pl_arrange_auto_start_execute.py`
- [ ] After successful arrange, start_execute all linked contracts with status `approved`
- [ ] Idempotent when already `executing`
### Task 4: Frontend — product columns + 运输计划 tab
**Files:**
- Modify: `ContractDetailDialog.vue`, `detail.vue`
- Possibly extract small helper for plan list span in dialog
- [ ] Three green columns after 税费
- [ ] New tab with merge-cell list + open PlPlanViewDialog on planNo click
### Task 5: Verify
- [ ] Run relevant pytest
- [ ] `./scripts/update-graph.sh` for touched projects
@@ -0,0 +1,39 @@
# 门户首页侧栏选中项会话记忆 — 实现计划
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
**Goal:** 会话内记住门户首页侧栏选中项;关标签页 / 退出登录后重置为「收藏」。
**Architecture:** `sessionStorage` 存 `activeModule` key;首页读写;登出与换用户时清除。
**Tech Stack:** Vue 3、sessionStorage、现有 `user.ts` 登出清理路径。
---
### Task 1: 读写工具
**Files:**
- Create: `web-admin/src/utils/navigation/portal-home-active-module.ts`
- [ ] 提供 `get` / `set` / `clear`,key 固定为 `portal-home-active-module`
### Task 2: 首页接入
**Files:**
- Modify: `web-admin/src/views/portal/home/index.vue`
- [ ] 初始化 `activeModule` 时读 session
- [ ] `watch(activeModule)` 写入 session
- [ ] 沿用 `ensureActiveModule` 失效回退「收藏」
### Task 3: 登出 / 换用户清理
**Files:**
- Modify: `web-admin/src/store/modules/user.ts`
- [ ] `logOut` 与 `checkAndClearWorktabs`(不同用户)调用 `clearPortalHomeActiveModule`
### Task 4: 手工验证
- [ ] 选中「CRM管理」→ 进入子页 → 回首页:仍为 CRM
- [ ] 退出登录再登录:默认「收藏」