1.1 KiB
1.1 KiB
质检检测批次 — 技术设计
权威产品决策见 docs/superpowers/specs/2026-06-25-qc-inspection-batch-design.md。
架构
工单 → biz_qc_work_order_inspection_batch → lab/third 明细(batch_id)→ biz_qc_task → biz_qc_task_assignee(从 biz_qc_batch_assignee 同步)。
批次无状态字段;进度由任务聚合。
数据表
biz_qc_work_order_inspection_batchbiz_qc_batch_assigneebiz_qc_work_order_lab_item.batch_idbiz_qc_work_order_third_item.batch_id- 可选
biz_qc_task.batch_id冗余
API
POST /qc-work-orders/{id}/configure— bodybatches[];扁平labItemIds兼容为单批次GET /qc-work-orders/{id}/inspection-batches— 批次 + tasks 嵌套
同步策略
按批次 ID 比对:增删改 lab/third 行;任务 assignee 调用 sync_assignees_for_task 与批次负责人一致。
前端
index.vue配置弹窗:批次卡片QcWorkOrderBatchSubList.vue:折叠批次 + 内嵌任务卡片qc-mine-task-groups.ts:工单下按批次分组
迁移
SQL 脚本为每个已配置工单创建 B01 默认批次并回填 batch_id。