质检域 生产域(本期目标)
──────── ────────────────
【质检物料库】 【生产物料库】
biz_qc_material biz_production_material (+ material_type)
└ stock_batch └ stock_batch
└ usage (流水) └ usage (流水)
└ stock_check └ stock_check
【我的物料领用记录】 【我的物料领用记录】
material_type 枚举(租户内字典或固定码表):
| 值 | 含义 | 原表 |
|---|---|---|
reagent |
试剂 | biz_reagent |
consumable |
耗材 | biz_consumable |
biz_qc_material 与 biz_production_material 为一张表Goals:
Non-Goals:
step_reagent / step_consumable 可保留,仅目录统一)biz_production_material*选择:新建 production_material 系列表,结构 拷贝 QC 表设计 + material_type 字段。
理由:与 qc_material.py 一一对应,后端可复用 CRUD 模式;避免继续维护 consumable/reagent 双份 batch/check。
| 层级 | material_type |
|---|---|
物资目录 biz_production_material |
必填 |
| 批次 / 流水 / 盘点快照 | 冗余快照 material_type(便于列表筛选,与 material_code 一并复制) |
编码唯一性:租户 + material_type + material_code(允许试剂与耗材编码相同但类型不同)。
| 旧 | 新 |
|---|---|
| 耗材管理、试剂管理 | 【生产物料库】 → 挂在 【生产基础信息】(已确认;替换原耗材/试剂管理入口,parent_id=PRB00000000000000000000000000001) |
| 我的耗材领用 + 我的试剂领用 | 【我的物料领用记录】 → 挂在 【生产管理】(与「我的生产任务」同级,执行侧查阅) |
页面三 Tab:批次列表 | 变动记录 | 库存盘点(复制 qc-material/index.vue 结构)。
选择:保留 试剂 Tab / 耗材 Tab(工艺步骤已有分列习惯),但:
GET /production-material-requisition-options?materialType=reagent|consumablebiz_production_material_usage(step_save)替代方案:合并为单「物料」Tab — 放弃,改动工艺对照成本高。
库存仅在 manual_out(按 batch)扣减;step_save 关联 parent_usage_id,不扣 stock_qty。
biz_production_material FROM consumable(type=consumable)+ reagent(type=reagent)production_material_usage 或保留旧表只读(实现时 新流水只写新表)reagent_code / consumable_code 通过 material_type + code 关联新目录GET /consumables、GET /reagents:只读兼容 1 个版本(内部转查 production_material + type 过滤),POST/PUT/DELETE 返回 410 并提示使用生产物料库。
同前:UI/API 下线;原因同批次管理。
| 风险 | 缓解 |
|---|---|
| 迁移编码冲突(同码异型) | 唯一键含 material_type;冲突则迁移脚本加前缀 |
| 范围大(融合+批次+盘点+领用) | tasks 分 Phase;先 library+migration,再 batch,再 requisition,再 check |
| 步骤双 Tab 与统一库认知 | UI 文案说明「类型由 Tab 决定,领用记录已过滤」 |
| # | 问题 | 建议 |
|---|---|---|
| Q1 | 【生产物料库】挂「生产管理」还是「生产基础信息」 | 已确认:生产基础信息 |
| Q2 | material_type 是否走数据字典 | 是,dict_type=production_material_type |
| Q3 | 旧 consumable/reagent 菜单是否保留隐藏入口 | 否,直接隐藏,仅保留路由 redirect 可选 |