Files
zkxw/openspec/changes/qc-inspection-batch/design.md
T
2026-06-26 00:50:04 +08:00

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_batch
  • biz_qc_batch_assignee
  • biz_qc_work_order_lab_item.batch_id
  • biz_qc_work_order_third_item.batch_id
  • 可选 biz_qc_task.batch_id 冗余

API

  • POST /qc-work-orders/{id}/configure — body batches[];扁平 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。