64 lines
2.5 KiB
Markdown
64 lines
2.5 KiB
Markdown
# 危化品证「证书齐备」人工确认 — 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:** 在危化品证上传页增加计划级「证书齐备」人工确认;安排运输只校验该标志,不再强制双证 URL;零附件可确认,确认后可继续补传附件。
|
||
|
||
**Architecture:** `pl_plan` 新增 `hazard_cert_ready` + 审计字段;PATCH API 标记/取消;`validate_hazard_cert_ready_for_transport` 校验 plan 标志;计划危化品产品集合变更时自动撤销;前端 plan-cert 列表列 + 工具栏按钮,安排运输弹窗改提示。
|
||
|
||
**Tech Stack:** FastAPI + SQLAlchemy + Pydantic v2;Vue 3 + Element Plus
|
||
|
||
**Spec:** `docs/superpowers/specs/2026-07-04-pl-hazard-cert-ready-design.md`
|
||
|
||
**Status:** ✅ 已实现(2026-07-04)
|
||
|
||
---
|
||
|
||
## 文件结构
|
||
|
||
| 文件 | 职责 |
|
||
|------|------|
|
||
| `docs/sql/migrations/2026-07-04_pl_plan_hazard_cert_ready.sql` | 增量 DDL |
|
||
| `docs/sql/shanxia2.0.sql` | CREATE TABLE 同步 |
|
||
| `backend/app/models/pl_models.py` | PlPlan 三字段 |
|
||
| `backend/app/schemas/pl/plan.py` | PlanRead 字段 + HazardCertReadyBody |
|
||
| `backend/app/services/pl_plan_service.py` | 校验/设置/撤销齐备 |
|
||
| `backend/app/api/pl/plan.py` | PATCH endpoint + update_plan 撤销 |
|
||
| `backend/app/api/pl/transport.py` | 双 URL 校验改为齐备标志 |
|
||
| `web-admin/src/api/pl/index.ts` | Plan 类型 + setHazardCertReady |
|
||
| `web-admin/src/composables/usePlToxicProductCertCheck.ts` | planHasHazardProducts + 齐备校验 helper |
|
||
| `web-admin/src/views/pl/plan-cert/index.vue` | 列 + 按钮 |
|
||
| `web-admin/src/components/business/pl-plan-cert-upload-dialog/index.vue` | 放宽保存校验 |
|
||
| `web-admin/src/components/business/pl-plan-arrange-dialog/index.vue` | 改齐备校验 |
|
||
|
||
---
|
||
|
||
### Task 1: 数据库与 Model ✅
|
||
|
||
- [x] 迁移 SQL + shanxia2.0.sql + PlPlan model
|
||
|
||
### Task 2: Schema + Service ✅
|
||
|
||
- [x] PlanRead / HazardCertReadyBody
|
||
- [x] validate_hazard_cert_ready_for_transport / set_hazard_cert_ready / collect_hazard_product_ids
|
||
|
||
### Task 3: API ✅
|
||
|
||
- [x] PATCH `/{id}/hazard-cert-ready`
|
||
- [x] update_plan 危化品产品集合变更撤销齐备
|
||
- [x] transport.py 校验替换
|
||
|
||
### Task 4–6: 前端 ✅
|
||
|
||
- [x] API + composable + plan-cert 页 + 上传弹窗 + 安排运输弹窗
|
||
|
||
---
|
||
|
||
## 部署注意
|
||
|
||
上线前在目标库执行:
|
||
|
||
```bash
|
||
mysql ... < docs/sql/migrations/2026-07-04_pl_plan_hazard_cert_ready.sql
|
||
```
|