Files
zkxw/openspec/changes/basic-info-management/tasks.md
T
2026-05-17 08:36:37 +08:00

36 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. 数据模型与 CRUD 基础
- [ ] 1.1 在 `backend/app/models` 中为 `biz_customer`、`biz_cell_sample_type`、`biz_collection_region`、`biz_collection_hospital`、`biz_collection_protocol_no`、`biz_sample_code` 增加 ORM 定义(字段顺序与公共字段对齐 `database-conventions`)
- [ ] 1.2 新增 `backend/app/crud/` 模块(按 design 拆分文件或包),实现各实体的 list/get/create/update/soft_delete,查询统一 `tenant_no` + `del_flag=0`,列表默认 `create_time DESC`
- [ ] 1.3 实现客户 `id_card_no` 非空时的租户内去重校验(创建与更新排除自身)
## 2. Pydantic Schema 与路由
- [ ] 2.1 在 `backend/app/schemas/` 为六类资源(含医院子资源)定义请求/响应模型
- [ ] 2.2 新增 API 路由(建议 `app/api/basic_info.py` 或等价拆分),挂载客户、样本类型、地区、医院、协议号池、样本编码池端点;注册到 `app/api/__init__.py` 与 `app/main.py`
- [ ] 2.3 为地区软删实现「同级联软删下属医院」事务逻辑(与 `collection-region-hospital-management` spec 一致)
- [ ] 2.4 唯一约束冲突(`type_code`、`protocol_no`、`sample_code`、客户身份证)映射为可读 HTTP 4xx 与业务 message
## 3. 菜单与 SQL
- [ ] 3.1 在 `docs/sql/` 增加 Web 端菜单初始化脚本(五项菜单 + 合理 `order_num` / `parent_id`),权限标识与路由 path 对齐现有 `sys_menu` 惯例
- [ ] 3.2 (可选)增加三种细胞样本类型初始数据的幂等 SQL,与需求 2.2.2 编码一致
## 4. Web 管理端 — API 与路由
- [ ] 4.1 在 `web-admin/src/api/` 增加封装上述端点的模块(如 `basicInfo.ts` 或分文件)
- [ ] 4.2 在 `web-admin/src/router/` 注册五个页面路由(hash 路径与菜单 component 一致)
## 5. Web 管理端 — 页面实现
- [ ] 5.1 客户管理页:列表 + 筛选 + 新增/编辑弹窗(`label-position="top"`、`.dialog-form-layout`),对齐 `unit` 模板与 Fresh Mint
- [ ] 5.2 细胞样本类型管理页:同上
- [ ] 5.3 采集地区管理页:主表 +「地区医院配置」弹窗(内嵌医院表分页与 CRUD)
- [ ] 5.4 采集协议号管理页:列表字段含协议号、`issued`、公共审计列
- [ ] 5.5 样本编码管理页:同上
## 6. 验证
- [ ] 6.1 本地启动后端,用 Swagger 或脚本验证各列表/创建/更新/软删与异常路径(身份证重复、编码重复、级联软删)
- [ ] 6.2 `pnpm build` 或 `pnpm build:typecheck` 通过;关键页面手测无控制台错误