24 lines
1.9 KiB
Markdown
24 lines
1.9 KiB
Markdown
# 派车日历待派车实施计划
|
||
|
||
**Goal:** 两端车牌号首位可选待派车并可保存、回显、后续换车。
|
||
|
||
**Architecture:** 共享前端 hook 添加固定占位选项;后端快照解析识别保留值,复用既有 CRUD 与现场同步。
|
||
|
||
**Tech Stack:** Vue 3、Element Plus、Vant、FastAPI、SQLAlchemy、pytest、Playwright。
|
||
|
||
- [x] 在 backend/tests/test_pl_dispatch_calendar.py 添加待派车新增、双向换车、同步 ID 保留及非法产品拒绝回归,先运行失败验证。
|
||
- [x] 在 backend/app/services/pl_dispatch_calendar_service.py 识别 `__pending_vehicle__` 并写入“待派车”快照,其余车辆保持原校验。
|
||
- [x] 在 web-admin/src/views/pl/dispatch-calendar/useManualCalendar.ts 加载车辆后前置占位选项,两端直接复用。
|
||
- [x] 扩展 web-admin/scripts/test-manual-dispatch-calendar.mjs,检查首位选择、保存及回显,再切换真实车辆继续既有回归。
|
||
- [x] 运行后端日历和现场同步 pytest、前端模型测试、浏览器测试以及目标 ESLint,记录实际结果。
|
||
|
||
不提交工作区其他已有改动,不执行生产操作。
|
||
|
||
## 验证结果
|
||
|
||
- 后端在 backend 目录执行 `venv/bin/python -m pytest tests/test_pl_dispatch_calendar.py tests/test_pl_dispatch_calendar_site_sync.py -q`:105 passed;有既有依赖弃用及 LibreSSL 警告。
|
||
- 前端 `pnpm exec tsx --test scripts/manual-dispatch-calendar.test.ts`:11 passed。
|
||
- `node scripts/test-manual-dispatch-calendar.mjs`:6 组通过(Web 酸、碱、其他、现场;移动 H5 酸、现场)。覆盖待派车首项、新建保存、编辑回显、换车及既有 CRUD/权限流程。测试中的 HTTP 500 为脚本主动模拟的失败恢复场景。
|
||
- 目标文件 ESLint 和 `git diff --check` 通过。
|
||
- 未执行微信真机测试、全量构建或生产发布。浏览器测试使用模拟 API,后端逻辑由独立 pytest 覆盖。
|