zlwu 3 mēneši atpakaļ
vecāks
revīzija
21e772db3a

+ 13 - 1
backend/app/api/production.py

@@ -2066,7 +2066,9 @@ async def list_active_production_task_sets(
 @router.post("/production-task-sets/from-work-order")
 async def create_production_task_set_from_work_order(
     body: ProductionTaskSetFromWorkOrderBody,
-    user: dict = Depends(require_menu_code("production:task-set:add")),
+    user: dict = Depends(
+        require_any_menu_code("production:work-order:list", "production:task-set:add")
+    ),
     db: Session = Depends(get_db),
 ):
     try:
@@ -2078,6 +2080,11 @@ async def create_production_task_set_from_work_order(
             work_order_id=body.work_order_id,
             set_name=body.set_name,
             remark=body.remark,
+            items=(
+                [x.model_dump(by_alias=False) for x in body.items]
+                if body.items is not None
+                else None
+            ),
         )
         db.commit()
         return success_response(detail, message="保存成功")
@@ -2213,6 +2220,11 @@ async def create_production_tasks_from_set(
             create_dept_id="",
             work_order_id=body.work_order_id,
             set_id=body.set_id,
+            items=(
+                [x.model_dump(by_alias=False) for x in body.items]
+                if body.items is not None
+                else None
+            ),
         )
         db.commit()
         return success_response(result, message="创建成功")

+ 56 - 48
backend/app/crud/production_task_set.py

@@ -456,6 +456,7 @@ def create_set_from_work_order(
     work_order_id: str,
     set_name: str,
     remark: Optional[str] = None,
+    items: Optional[List[Dict[str, Any]]] = None,
 ) -> Dict[str, Any]:
     wo_id = (work_order_id or "").strip()
     wo = (
@@ -469,25 +470,28 @@ def create_set_from_work_order(
     )
     if not wo:
         raise ValueError("工单不存在")
-    tasks = (
-        db.query(BizProductionTask)
-        .filter(
-            BizProductionTask.work_order_id == wo_id,
-            BizProductionTask.tenant_no == tenant_no,
-            BizProductionTask.del_flag == 0,
+    if items is not None:
+        raw = items
+    else:
+        tasks = (
+            db.query(BizProductionTask)
+            .filter(
+                BizProductionTask.work_order_id == wo_id,
+                BizProductionTask.tenant_no == tenant_no,
+                BizProductionTask.del_flag == 0,
+            )
+            .order_by(BizProductionTask.create_time.asc(), BizProductionTask.id.asc())
+            .all()
         )
-        .order_by(BizProductionTask.create_time.asc(), BizProductionTask.id.asc())
-        .all()
-    )
-    raw = [
-        {
-            "task_name": t.task_name,
-            "route_id": t.route_id,
-            "description": t.description,
-            "remark": t.remark,
-        }
-        for t in tasks
-    ]
+        raw = [
+            {
+                "task_name": t.task_name,
+                "route_id": t.route_id,
+                "description": t.description,
+                "remark": t.remark,
+            }
+            for t in tasks
+        ]
     kept, skipped = skip_empty_named_tasks(raw)
     if not kept:
         raise ValueError("无可保存的生产任务(任务名称均为空)")
@@ -527,6 +531,7 @@ def create_tasks_from_set(
     create_dept_id: str = "",
     work_order_id: str,
     set_id: str,
+    items: Optional[List[Dict[str, Any]]] = None,
 ) -> Dict[str, Any]:
     from app.crud import production_task as production_task_svc
 
@@ -555,33 +560,36 @@ def create_tasks_from_set(
         .first()
     )
     if not header:
-        raise ValueError("集合不存在")
+        raise ValueError("任务组合模版不存在")
     if (header.status or "1") != "1":
-        raise ValueError("集合已停用")
-    items = (
-        db.query(BizProductionTaskSetItem)
-        .filter(
-            BizProductionTaskSetItem.set_id == header.id,
-            BizProductionTaskSetItem.tenant_no == tenant_no,
-            BizProductionTaskSetItem.del_flag == 0,
-        )
-        .order_by(
-            BizProductionTaskSetItem.order_num.asc(),
-            BizProductionTaskSetItem.create_time.asc(),
+        raise ValueError("任务组合模版已停用")
+    if items is not None:
+        payloads = _normalize_items_or_raise(items)
+    else:
+        rows = (
+            db.query(BizProductionTaskSetItem)
+            .filter(
+                BizProductionTaskSetItem.set_id == header.id,
+                BizProductionTaskSetItem.tenant_no == tenant_no,
+                BizProductionTaskSetItem.del_flag == 0,
+            )
+            .order_by(
+                BizProductionTaskSetItem.order_num.asc(),
+                BizProductionTaskSetItem.create_time.asc(),
+            )
+            .all()
         )
-        .all()
-    )
-    if not items:
-        raise ValueError("集合没有可派发的任务")
-    payloads = [
-        {
-            "route_id": row.route_id,
-            "task_name": row.task_name,
-            "description": row.description,
-            "remark": row.remark,
-        }
-        for row in items
-    ]
+        if not rows:
+            raise ValueError("任务组合模版没有可派发的任务")
+        payloads = [
+            {
+                "route_id": row.route_id,
+                "task_name": row.task_name,
+                "description": row.description,
+                "remark": row.remark,
+            }
+            for row in rows
+        ]
     name_map = _load_route_name_map(
         db, tenant_no, [p["route_id"] for p in payloads if p.get("route_id")]
     )
@@ -589,7 +597,7 @@ def create_tasks_from_set(
     if missing:
         raise ValueError("工艺路线已删除,无法派发:" + "、".join(missing))
     created = []
-    for row in items:
+    for row in payloads:
         task = production_task_svc.create_production_task(
             db,
             tenant_no=tenant_no,
@@ -597,10 +605,10 @@ def create_tasks_from_set(
             create_dept_id=create_dept_id,
             data={
                 "work_order_id": wo_id,
-                "task_name": row.task_name,
-                "route_id": row.route_id,
-                "description": row.description,
-                "remark": row.remark,
+                "task_name": row["task_name"],
+                "route_id": row.get("route_id"),
+                "description": row.get("description"),
+                "remark": row.get("remark"),
             },
         )
         created.append(production_task_svc._task_to_dict(task))

+ 2 - 0
backend/app/schemas/production_task_set.py

@@ -32,9 +32,11 @@ class ProductionTaskSetFromWorkOrderBody(BaseModel):
     work_order_id: str = Field(..., alias="workOrderId")
     set_name: str = Field(..., alias="setName")
     remark: Optional[str] = None
+    items: Optional[List[ProductionTaskSetItemBody]] = None
 
 
 class ProductionTasksFromSetBody(BaseModel):
     model_config = ConfigDict(populate_by_name=True)
     work_order_id: str = Field(..., alias="workOrderId")
     set_id: str = Field(..., alias="setId")
+    items: Optional[List[ProductionTaskSetItemBody]] = None

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 227 - 686
backend/graphify-out/.graphify_analysis.json


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 128 - 119
backend/graphify-out/.graphify_extract.json


+ 69 - 64
backend/graphify-out/GRAPH_REPORT.md

@@ -1,10 +1,10 @@
 # Graph Report - app  (2026-08-18)
 
 ## Corpus Check
-- Large corpus: 259 files · ~310,337 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
+- Large corpus: 259 files · ~310,404 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
 
 ## Summary
-- 5374 nodes · 29363 edges · 42 communities detected
+- 5374 nodes · 29364 edges · 43 communities detected
 - Extraction: 32% EXTRACTED · 68% INFERRED · 0% AMBIGUOUS · INFERRED: 20080 edges (avg confidence: 0.6)
 - Token cost: 0 input · 0 output
 
@@ -45,12 +45,13 @@
 - [[_COMMUNITY_Community 33|Community 33]]
 - [[_COMMUNITY_Community 34|Community 34]]
 - [[_COMMUNITY_Community 35|Community 35]]
-- [[_COMMUNITY_Community 38|Community 38]]
+- [[_COMMUNITY_Community 36|Community 36]]
 - [[_COMMUNITY_Community 39|Community 39]]
 - [[_COMMUNITY_Community 40|Community 40]]
 - [[_COMMUNITY_Community 41|Community 41]]
 - [[_COMMUNITY_Community 42|Community 42]]
 - [[_COMMUNITY_Community 43|Community 43]]
+- [[_COMMUNITY_Community 44|Community 44]]
 
 ## God Nodes (most connected - your core abstractions)
 1. `success_response()` - 753 edges
@@ -80,23 +81,23 @@
 
 ### Community 0 - "Community 0"
 Cohesion: 0.01
-Nodes (1047): attachment_download_url(), create_dept(), create_dict_data(), create_dict_type(), create_express_company(), create_item_unit(), create_menu(), create_post() (+1039 more)
+Nodes (1081): attachment_download_url(), create_dept(), create_dict_data(), create_dict_type(), create_express_company(), create_item_unit(), create_menu(), create_post() (+1073 more)
 
 ### Community 1 - "Community 1"
 Cohesion: 0.01
-Nodes (668): generate_uuid(), create_cell_sample_type(), get_cell_sample_type(), list_cell_sample_types(), 细胞样本类型 CRUD(biz_cell_sample_type), _row_to_dict(), soft_delete_cell_sample_type(), type_code_exists() (+660 more)
+Nodes (702): generate_uuid(), ApiRequestLogCRUD, delete(), get_multi_with_filters(), create_cell_sample_type(), get_cell_sample_type(), list_cell_sample_types(), 细胞样本类型 CRUD(biz_cell_sample_type) (+694 more)
 
 ### Community 2 - "Community 2"
 Cohesion: 0.01
-Nodes (589): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, ExpressCompanyCreateBody (+581 more)
+Nodes (652): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, ExpressCompanyCreateBody (+644 more)
 
 ### Community 3 - "Community 3"
 Cohesion: 0.05
 Nodes (609): CellSampleTypeCreateBody, CellSampleTypeUpdateBody, CollectionRegionCreateBody, CollectionRegionUpdateBody, CustomerCreateBody, CustomerUpdateBody, HospitalCreateBody, HospitalUpdateBody (+601 more)
 
 ### Community 4 - "Community 4"
-Cohesion: 0.02
-Nodes (286): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci(), ApiRequestLogCRUD, delete() (+278 more)
+Cohesion: 0.01
+Nodes (347): _normalize_date_bound(), _persist_protocol_sub_resources(), list_ethnics_for_select(), apply_data_scope(), _get_child_dept_ids(), get_user_dept_id(), _resolve_user_role_scopes(), format_date() (+339 more)
 
 ### Community 5 - "Community 5"
 Cohesion: 0.02
@@ -104,186 +105,190 @@ Nodes (269): 截止日期:仅日期时扩到当天 23:59:59。, 发起前预
 
 ### Community 6 - "Community 6"
 Cohesion: 0.02
-Nodes (242): _normalize_date_bound(), _persist_protocol_sub_resources(), format_date(), generate_id(), optional_date(), parse_date(), 将字符串 / date / datetime 转为 date 或 None, camel_to_snake() (+234 more)
+Nodes (141): get_designer_data(), _error_json(), lifespan(), 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, sqlalchemy_exception_handler(), unhandled_exception_handler(), BaseHTTPMiddleware (+133 more)
 
 ### Community 7 - "Community 7"
 Cohesion: 0.02
-Nodes (137): mp_bind(), mp_bind_status(), 小程序鉴权:微信登录 / 绑定 openid。, 当前用户是否已绑定微信服务号 openid。, 服务号网页授权 code 绑定当前用户(需 Bearer)。, 微信登录:openid 已绑定时可静默换票;否则须授权手机号且与账号 phone_no 一致。, 密码登录后绑定当前微信 openid(需 Bearer)。, _resolve_user_id() (+129 more)
+Nodes (195): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci(), batch_review(), _dec() (+187 more)
 
 ### Community 8 - "Community 8"
-Cohesion: 0.02
-Nodes (140): list_ethnics_for_select(), get_designer_data(), apply_data_scope(), _get_child_dept_ids(), get_user_dept_id(), _resolve_user_role_scopes(), _build_tree(), _cascade_soft_delete() (+132 more)
+Cohesion: 0.03
+Nodes (140): api_save_application(), get_protocol_nos_used_in_protocols(), _fmt_dt(), get_handover_by_schedule(), get_outbound_handover(), get_outbound_handover_view(), _handover_row_to_dict(), _handover_view_dict() (+132 more)
 
 ### Community 9 - "Community 9"
 Cohesion: 0.03
-Nodes (154): _batch_line_to_dict(), cancel_check(), _check_header_to_dict(), complete_check(), _get_check(), get_check_detail(), _line_counts(), list_checks() (+146 more)
+Nodes (144): _batch_line_to_dict(), _unused_amount(), _unused_line_to_dict(), _filter_material_type(), _batch_map_for_prep_lines(), cancel_prep(), complete_prep(), _create_auto_stock_out() (+136 more)
 
 ### Community 10 - "Community 10"
 Cohesion: 0.03
 Nodes (141): build_void_type_label_map(), format_protocol_status_label(), resolve_void_type_label(), _ancestor_link_from_cell_product_input(), _ancestor_sample_chain_link(), _apply_cell_product_status_change(), _build_ancestor_chain(), _build_descendant_chain() (+133 more)
 
 ### Community 11 - "Community 11"
-Cohesion: 0.03
-Nodes (115): api_save_application(), get_protocol_nos_used_in_protocols(), _cell_row_to_dict(), _enrich_cell_dicts_with_live_status(), _find_outbound_cell_row(), _find_outbound_qc_material_row(), _fmt_dt(), get_outbound_material() (+107 more)
-
-### Community 12 - "Community 12"
 Cohesion: 0.05
 Nodes (117): AccessLogCreateBody, AccessLogUpdateBody, CleanRoomCreateBody, CleanRoomUpdateBody, ExhibitionAppointmentCreateBody, ExhibitionAppointmentUpdateBody, list_storage_slot_stats(), OccupancyCreateBody (+109 more)
 
-### Community 13 - "Community 13"
+### Community 12 - "Community 12"
 Cohesion: 0.04
 Nodes (98): _body_to_payload(), _get_current_user_id(), get_production_reception_detail(), _get_tenant_no(), post_production_reception(), put_production_reception(), _resolve_reception_id(), _lookup_attachment_by_url() (+90 more)
 
-### Community 14 - "Community 14"
+### Community 13 - "Community 13"
 Cohesion: 0.04
 Nodes (71): _collect_descendants(), _current_user(), _find_mobile_root(), list_my_mobile_menus(), _mobile_menu_icon(), _mobile_menu_icon_colors(), 小程序菜单:当前用户在「移动端菜单」树下有权限的入口。, 宫格图标底色/图形色(可按入口自定义,不强制品牌绿)。 (+63 more)
 
-### Community 15 - "Community 15"
-Cohesion: 0.44
-Nodes (75): BatchStockInBody, BatchStockInItem, BatchStockOutBody, BatchStockOutItem, ConsumableCreateBody, ConsumablePackCreateBody, ConsumablePackUpdateBody, ConsumableUpdateBody (+67 more)
+### Community 14 - "Community 14"
+Cohesion: 0.08
+Nodes (38): mp_bind(), mp_bind_status(), 小程序鉴权:微信登录 / 绑定 openid。, 当前用户是否已绑定微信服务号 openid。, 服务号网页授权 code 绑定当前用户(需 Bearer)。, 微信登录:openid 已绑定时可静默换票;否则须授权手机号且与账号 phone_no 一致。, 密码登录后绑定当前微信 openid(需 Bearer)。, _resolve_user_id() (+30 more)
 
-### Community 16 - "Community 16"
+### Community 15 - "Community 15"
 Cohesion: 0.12
 Nodes (11): get_wechat_pay_client(), get_wechat_pay_v2(), 微信支付工具模块  支持微信支付 V3 API 文档参考: https://pay.weixin.qq.com/docs/v3/apis/index.ht, 统一下单接口 (V3)          Args:             out_trade_no: 商户订单号             total, 申请退款          Args:             out_trade_no: 商户订单号             total_amount, 小程序调起支付的二次签名参数(与公众号 JSAPI 规则一致), 统一下单 (V2 API)          Args:             out_trade_no: 商户订单号             tot, 生成签名 V3 (SHA256 with RSA) (+3 more)
 
-### Community 17 - "Community 17"
+### Community 16 - "Community 16"
 Cohesion: 0.16
 Nodes (22): _code_exists(), create_material(), _dec(), _fmt_dt(), get_material(), get_material_entity(), get_my_usages(), _is_enabled_status() (+14 more)
 
-### Community 18 - "Community 18"
+### Community 17 - "Community 17"
 Cohesion: 0.19
 Nodes (21): apply_overtime_kit_hours(), _build_rest_day_segments(), _build_workday_windows(), calc_overtime_hours(), _day_at_minutes(), _day_start_ms(), _extract_rules(), _format_ymd() (+13 more)
 
-### Community 19 - "Community 19"
+### Community 18 - "Community 18"
 Cohesion: 0.21
 Nodes (19): _consumable_row_to_dict(), create_process(), _create_sub_consumable(), _create_sub_data_collection(), _create_sub_output(), _create_sub_reagent(), _data_collection_row_to_dict(), get_process() (+11 more)
 
-### Community 20 - "Community 20"
+### Community 19 - "Community 19"
 Cohesion: 0.19
 Nodes (17): apply_trip_kit_days(), calc_trip_leg_days(), _day_index(), _end_offset(), _extract_rules(), is_half_day_multiple(), _kit_trip_fields(), 出差套件:半日制行程时长(与前端 oa-trip-days.ts 对齐) (+9 more)
 
-### Community 21 - "Community 21"
-Cohesion: 0.24
-Nodes (9): 微信消息通知服务  支持微信小程序模板消息推送  使用方式:     from app.core.wechat_message import Wech, 发送模板消息                  Args:             openid: 用户openid             templ, send_delivery_notice(), send_delivery_warning(), send_order_status(), send_payment_success(), send_refund_result(), send_urge_notification() (+1 more)
+### Community 20 - "Community 20"
+Cohesion: 0.23
+Nodes (12): Config, ProductBase, ProductCategoryBase, ProductCategoryCreate, ProductCategoryResponse, ProductCreate, ProductResponse, ProductUnitBase (+4 more)
 
-### Community 22 - "Community 22"
+### Community 21 - "Community 21"
 Cohesion: 0.27
 Nodes (12): _field_label(), _is_empty(), _is_required(), _parse_money(), OA 表单设计器:金额控件 form_data 校验, 校验 form_data 中金额控件的值格式,返回中文错误列表(空表示通过)。, 解析金额值。成功返回 (number, None);失败返回 (None, error_key)。, _rule_props() (+4 more)
 
-### Community 23 - "Community 23"
+### Community 22 - "Community 22"
 Cohesion: 0.24
 Nodes (11): deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 试剂变动记录 CRUD(biz_reagent_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减试剂库存并生成变动记录。调用方控制事务,本函数不 commit。, _resolve_receiver_purpose() (+3 more)
 
-### Community 24 - "Community 24"
+### Community 23 - "Community 23"
 Cohesion: 0.24
 Nodes (11): deduct_for_step(), _display_remark(), list_stock_logs(), _parse_receiver_purpose_from_remark(), 耗材变动记录 CRUD(biz_consumable_stock_log), 撤销步骤此前 step_save 扣减,便于重新填报。, 扣减耗材库存并生成变动记录。调用方控制事务,本函数不 commit。, _resolve_receiver_purpose() (+3 more)
 
-### Community 25 - "Community 25"
+### Community 24 - "Community 24"
 Cohesion: 0.31
 Nodes (10): create_account(), _filtered_query(), get_account(), list_accounts(), list_options(), OA 收款账户 CRUD(oa_receive_account), row_to_dict(), soft_delete_account() (+2 more)
 
-### Community 26 - "Community 26"
+### Community 25 - "Community 25"
 Cohesion: 0.29
 Nodes (2): BaseModel, SoftDeleteModel
 
+### Community 26 - "Community 26"
+Cohesion: 0.39
+Nodes (5): _fmt_dt(), list_production_waste_outputs(), _normalize_date_bound(), pick_waste_output_type_ids(), resolve_waste_output_type_ids()
+
 ### Community 27 - "Community 27"
 Cohesion: 0.38
 Nodes (6): derive_legacy_status_from_three(), derive_three_status_from_legacy(), 阶段A兼容:从旧 status 推导三字段。     约束:旧 status 本身混合了支付/配送/订单生命周期,因此只能尽力推断;     若业务侧已有更精确, 阶段A兼容:从三字段反推旧 status(用于旧前端/旧筛选参数兼容)。, ThreeStatus, _to_decimal()
 
 ### Community 28 - "Community 28"
+Cohesion: 0.6
+Nodes (5): _dec(), _fmt_dt(), list_stock_logs(), _row_to_dict(), _user_nick_name_map()
+
+### Community 29 - "Community 29"
 Cohesion: 0.4
 Nodes (5): batch_matches_stock_status(), normalize_batch_stock_status(), 质检物料入库批次:按剩余数量过滤的语义辅助。, 纯函数判定(供单测);list_batches 用 SQL 等价条件。, 返回 'available' | 'exhausted';全部 / 空 / 非法 → None(不加剩余数量条件)。
 
-### Community 29 - "Community 29"
+### Community 30 - "Community 30"
 Cohesion: 0.5
 Nodes (3): BaseSettings, Config, Settings
 
-### Community 30 - "Community 30"
+### Community 31 - "Community 31"
 Cohesion: 0.5
 Nodes (2): _auto_fill_create_dept_id(), ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID
 
-### Community 31 - "Community 31"
+### Community 32 - "Community 32"
 Cohesion: 0.67
 Nodes (2): get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)
 
-### Community 32 - "Community 32"
+### Community 33 - "Community 33"
 Cohesion: 0.67
 Nodes (1): 转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。
 
-### Community 33 - "Community 33"
+### Community 34 - "Community 34"
 Cohesion: 1.0
 Nodes (1): 质检物料金额查看授权:专用角色与菜单权限常量。
 
-### Community 34 - "Community 34"
+### Community 35 - "Community 35"
 Cohesion: 1.0
 Nodes (1): 请求级别的用户上下文变量  通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传
 
-### Community 35 - "Community 35"
+### Community 36 - "Community 36"
 Cohesion: 1.0
 Nodes (1): API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)
 
-### Community 38 - "Community 38"
+### Community 39 - "Community 39"
 Cohesion: 1.0
 Nodes (1): 发送订单状态通知                  Args:             openid: 用户openid             ord
 
-### Community 39 - "Community 39"
+### Community 40 - "Community 40"
 Cohesion: 1.0
 Nodes (1): 发送支付成功通知                  Args:             openid: 用户openid             ord
 
-### Community 40 - "Community 40"
+### Community 41 - "Community 41"
 Cohesion: 1.0
 Nodes (1): 发送配送通知                  Args:             openid: 配送员openid             task
 
-### Community 41 - "Community 41"
+### Community 42 - "Community 42"
 Cohesion: 1.0
 Nodes (1): 发送配送时效预警                  Args:             openid: 配送员openid             ta
 
-### Community 42 - "Community 42"
+### Community 43 - "Community 43"
 Cohesion: 1.0
 Nodes (1): 发送退款结果通知                  Args:             openid: 用户openid             ord
 
-### Community 43 - "Community 43"
+### Community 44 - "Community 44"
 Cohesion: 1.0
 Nodes (1): 发送催单通知给配送员                  Args:             deliver_openid: 配送员openid
 
 ## Knowledge Gaps
 - **176 isolated node(s):** `刷新会话 TTL(refreshToken 续期;已登录用户每次 API 校验通过后滑动续期)`, `写入 refreshToken(用于 one-time 使用/吊销)`, `根据 token 获取当前用户(包含 Redis 会话校验;会话滑动续期)`, `登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。`, `加载 RSA 密钥对:优先环境变量,否则使用内置固定默认密钥。` (+171 more)
   These have ≤1 connection - possible missing edges or undocumented components.
-- **Thin community `Community 26`** (8 nodes): `BaseModel`, `.to_dict()`, `get_active()`, `base.py`, `SoftDeleteModel`, `.restore()`, `.soft_delete()`, `__tablename__()`
+- **Thin community `Community 25`** (8 nodes): `BaseModel`, `.to_dict()`, `get_active()`, `base.py`, `SoftDeleteModel`, `.restore()`, `.soft_delete()`, `__tablename__()`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 30`** (4 nodes): `_auto_fill_create_dept_id()`, `get_db()`, `database.py`, `ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID`
+- **Thin community `Community 31`** (4 nodes): `_auto_fill_create_dept_id()`, `get_db()`, `database.py`, `ORM before_insert 钩子:当 create_dept_id 为空时,自动从请求上下文填充当前用户部门 ID`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 31`** (3 nodes): `get_menu_list()`, `menu.py`, `运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)`
+- **Thin community `Community 32`** (3 nodes): `get_menu_list()`, `menu.py`, `运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,5 个一级菜单分组)`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 32`** (3 nodes): `add_months_ymd()`, `oa_confirmation_date.py`, `转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。`
+- **Thin community `Community 33`** (3 nodes): `add_months_ymd()`, `oa_confirmation_date.py`, `转正套件:入职日 + 试用期月数 → 建议转正日(YYYY-MM-DD)。`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 33`** (2 nodes): `qc_material_amount_auth_constants.py`, `质检物料金额查看授权:专用角色与菜单权限常量。`
+- **Thin community `Community 34`** (2 nodes): `qc_material_amount_auth_constants.py`, `质检物料金额查看授权:专用角色与菜单权限常量。`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 34`** (2 nodes): `context.py`, `请求级别的用户上下文变量  通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传`
+- **Thin community `Community 35`** (2 nodes): `context.py`, `请求级别的用户上下文变量  通过 contextvars 在请求处理链路中传递当前用户信息, 供 SQLAlchemy 事件监听器等底层机制使用,避免逐层手动传`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 35`** (2 nodes): `__init__.py`, `API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)`
+- **Thin community `Community 36`** (2 nodes): `__init__.py`, `API 路由包(骨架:公共鉴权 + 静态菜单 + 运营端占位)`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 38`** (1 nodes): `发送订单状态通知                  Args:             openid: 用户openid             ord`
+- **Thin community `Community 39`** (1 nodes): `发送订单状态通知                  Args:             openid: 用户openid             ord`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 39`** (1 nodes): `发送支付成功通知                  Args:             openid: 用户openid             ord`
+- **Thin community `Community 40`** (1 nodes): `发送支付成功通知                  Args:             openid: 用户openid             ord`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 40`** (1 nodes): `发送配送通知                  Args:             openid: 配送员openid             task`
+- **Thin community `Community 41`** (1 nodes): `发送配送通知                  Args:             openid: 配送员openid             task`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 41`** (1 nodes): `发送配送时效预警                  Args:             openid: 配送员openid             ta`
+- **Thin community `Community 42`** (1 nodes): `发送配送时效预警                  Args:             openid: 配送员openid             ta`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 42`** (1 nodes): `发送退款结果通知                  Args:             openid: 用户openid             ord`
+- **Thin community `Community 43`** (1 nodes): `发送退款结果通知                  Args:             openid: 用户openid             ord`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 43`** (1 nodes): `发送催单通知给配送员                  Args:             deliver_openid: 配送员openid`
+- **Thin community `Community 44`** (1 nodes): `发送催单通知给配送员                  Args:             deliver_openid: 配送员openid`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
 
 ## Suggested Questions
 _Questions this graph is uniquely positioned to answer:_
 
-- **Why does `SysUser` connect `Community 2` to `Community 0`, `Community 1`, `Community 3`, `Community 4`, `Community 5`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 12`, `Community 14`, `Community 15`, `Community 17`, `Community 23`, `Community 24`?**
+- **Why does `SysUser` connect `Community 2` to `Community 0`, `Community 1`, `Community 3`, `Community 4`, `Community 5`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 13`, `Community 14`, `Community 16`, `Community 22`, `Community 23`?**
   _High betweenness centrality (0.104) - this node is a cross-community bridge._
-- **Why does `success_response()` connect `Community 0` to `Community 2`, `Community 7`, `Community 8`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 31`?**
+- **Why does `success_response()` connect `Community 0` to `Community 32`, `Community 2`, `Community 4`, `Community 6`, `Community 8`, `Community 11`, `Community 12`, `Community 13`, `Community 14`?**
   _High betweenness centrality (0.040) - this node is a cross-community bridge._
-- **Why does `generate_uuid()` connect `Community 1` to `Community 0`, `Community 4`, `Community 5`, `Community 6`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 17`, `Community 19`, `Community 23`, `Community 24`, `Community 25`?**
+- **Why does `generate_uuid()` connect `Community 1` to `Community 0`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 16`, `Community 18`, `Community 22`, `Community 23`, `Community 24`?**
   _High betweenness centrality (0.028) - this node is a cross-community bridge._
 - **Are the 902 inferred relationships involving `str` (e.g. with `unhandled_exception_handler()` and `get_current_user_by_token()`) actually correct?**
   _`str` has 902 INFERRED edges - model-reasoned connections that need verification._

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 112 - 112
backend/graphify-out/graph.json


+ 3 - 3
backend/graphify-out/manifest.json

@@ -69,7 +69,7 @@
   "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/common.py": 1778578258.094703,
   "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/unit.py": 1778578258.0996897,
   "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/qc_work_order.py": 1785207107.4160411,
-  "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/production_task_set.py": 1787038856.9662395,
+  "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/production_task_set.py": 1787043809.4506257,
   "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/outbound_release_material.py": 1779827058.9935315,
   "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/product.py": 1778578258.0968297,
   "/Users/wuzilong/work/00code/zkxw/backend/app/schemas/workflow.py": 1778633845.5937889,
@@ -155,7 +155,7 @@
   "/Users/wuzilong/work/00code/zkxw/backend/app/crud/qc_work_order.py": 1786958264.8161333,
   "/Users/wuzilong/work/00code/zkxw/backend/app/crud/outbound_handover_inventory.py": 1781598316.476379,
   "/Users/wuzilong/work/00code/zkxw/backend/app/crud/env_detect_record.py": 1786945487.5517714,
-  "/Users/wuzilong/work/00code/zkxw/backend/app/crud/production_task_set.py": 1787038832.049441,
+  "/Users/wuzilong/work/00code/zkxw/backend/app/crud/production_task_set.py": 1787043810.5603542,
   "/Users/wuzilong/work/00code/zkxw/backend/app/crud/outbound_release_material.py": 1781612877.0137436,
   "/Users/wuzilong/work/00code/zkxw/backend/app/crud/process.py": 1782717482.6707804,
   "/Users/wuzilong/work/00code/zkxw/backend/app/crud/pilot_service.py": 1781599314.0124536,
@@ -220,7 +220,7 @@
   "/Users/wuzilong/work/00code/zkxw/backend/app/api/sample_sms_notification.py": 1780325524.907156,
   "/Users/wuzilong/work/00code/zkxw/backend/app/api/sample_reception.py": 1782719108.3741593,
   "/Users/wuzilong/work/00code/zkxw/backend/app/api/insurance_company.py": 1781410837.9443986,
-  "/Users/wuzilong/work/00code/zkxw/backend/app/api/production.py": 1787038974.5837915,
+  "/Users/wuzilong/work/00code/zkxw/backend/app/api/production.py": 1787043811.8923764,
   "/Users/wuzilong/work/00code/zkxw/backend/app/api/protocol_sample_collection.py": 1780457788.2093296,
   "/Users/wuzilong/work/00code/zkxw/backend/app/api/leave.py": 1779266168.8693042,
   "/Users/wuzilong/work/00code/zkxw/backend/app/api/clinical_payment.py": 1781750841.074568,

+ 4 - 4
docs/sql/alter_biz_production_task_set.sql

@@ -55,14 +55,14 @@ INSERT INTO sys_menu (
 )
 SELECT
   @menu_c,
-  '生产任务集合',
+  '生产任务组合模版',
   @prb_id,
   'C',
   'production-task-set',
   '/production/production-task-set/index',
   'production:task-set:list',
   1, '1', '1', @tenant_no, 12,
-  '生产基础信息:生产任务集合主数据',
+  '生产基础信息:生产任务组合模版主数据',
   NULL, '', NOW(), NULL, NOW(), 0
 FROM DUAL
 WHERE NOT EXISTS (
@@ -72,7 +72,7 @@ WHERE NOT EXISTS (
 
 UPDATE sys_menu
 SET
-  menu_name = '生产任务集合',
+  menu_name = '生产任务组合模版',
   parent_id = @prb_id,
   menu_type = 'C',
   path = 'production-task-set',
@@ -81,7 +81,7 @@ SET
   visible = '1',
   status = '1',
   order_num = 12,
-  remark = '生产基础信息:生产任务集合主数据',
+  remark = '生产基础信息:生产任务组合模版主数据',
   del_flag = 0,
   update_time = NOW()
 WHERE id COLLATE utf8mb4_unicode_ci = @menu_c;

+ 10 - 0
docs/sql/alter_sys_menu_rename_production_task_set.sql

@@ -0,0 +1,10 @@
+-- 侧栏菜单:生产任务集合 → 生产任务组合模版(幂等)
+SET @menu_c = CONVERT('95400000000000000000000000000001' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
+
+UPDATE sys_menu
+SET
+  menu_name = '生产任务组合模版',
+  remark = '生产基础信息:生产任务组合模版主数据',
+  update_time = NOW()
+WHERE id COLLATE utf8mb4_unicode_ci = @menu_c
+  AND del_flag = 0;

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
docs/sql/zkxw.sql


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 369 - 518
web-admin/graphify-out/.graphify_analysis.json


+ 254 - 74
web-admin/graphify-out/.graphify_extract.json

@@ -15629,175 +15629,175 @@
       "label": "fetchProductionTaskList()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L20"
+      "source_location": "L29"
     },
     {
       "id": "api_production_task_fetchproductiontasksbyworkorderids",
       "label": "fetchProductionTasksByWorkOrderIds()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L40"
+      "source_location": "L49"
     },
     {
       "id": "api_production_task_groupproductiontasksbyworkorderid",
       "label": "groupProductionTasksByWorkOrderId()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L61"
+      "source_location": "L70"
     },
     {
       "id": "api_production_task_fetchmyproductiontasks",
       "label": "fetchMyProductionTasks()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L74"
+      "source_location": "L83"
     },
     {
       "id": "api_production_task_fetchforwardproductiontask",
       "label": "fetchForwardProductionTask()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L97"
+      "source_location": "L106"
     },
     {
       "id": "api_production_task_fetchreassignproductiontask",
       "label": "fetchReassignProductionTask()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L109"
+      "source_location": "L118"
     },
     {
       "id": "api_production_task_fetchdispatchproductiontasksteps",
       "label": "fetchDispatchProductionTaskSteps()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L119"
+      "source_location": "L128"
     },
     {
       "id": "api_production_task_fetchproductiontaskdetail",
       "label": "fetchProductionTaskDetail()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L137"
+      "source_location": "L146"
     },
     {
       "id": "api_production_task_fetchproductiontaskeditorinit",
       "label": "fetchProductionTaskEditorInit()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L161"
+      "source_location": "L170"
     },
     {
       "id": "api_production_task_fetchupdateproductiontask",
       "label": "fetchUpdateProductionTask()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L172"
+      "source_location": "L181"
     },
     {
       "id": "api_production_task_fetchupdateproductiontaskstatus",
       "label": "fetchUpdateProductionTaskStatus()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L176"
+      "source_location": "L185"
     },
     {
       "id": "api_production_task_fetchdeleteproductiontask",
       "label": "fetchDeleteProductionTask()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L188"
+      "source_location": "L197"
     },
     {
       "id": "api_production_task_fetchaddtaskstep",
       "label": "fetchAddTaskStep()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L192"
+      "source_location": "L201"
     },
     {
       "id": "api_production_task_fetchupdatetaskstep",
       "label": "fetchUpdateTaskStep()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L204"
+      "source_location": "L213"
     },
     {
       "id": "api_production_task_fetchdeletetaskstep",
       "label": "fetchDeleteTaskStep()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L217"
+      "source_location": "L226"
     },
     {
       "id": "api_production_task_fetchreplacestepreagents",
       "label": "fetchReplaceStepReagents()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L228"
+      "source_location": "L237"
     },
     {
       "id": "api_production_task_fetchreplacestepconsumables",
       "label": "fetchReplaceStepConsumables()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L241"
+      "source_location": "L250"
     },
     {
       "id": "api_production_task_fetchreplacestepconfiguredreagents",
       "label": "fetchReplaceStepConfiguredReagents()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L254"
+      "source_location": "L263"
     },
     {
       "id": "api_production_task_fetchreplacestepdatacollection",
       "label": "fetchReplaceStepDataCollection()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L267"
+      "source_location": "L276"
     },
     {
       "id": "api_production_task_fetchsettaskinputs",
       "label": "fetchSetTaskInputs()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L280"
+      "source_location": "L289"
     },
     {
       "id": "api_production_task_fetchspawntemporaryworkorderfromtask",
       "label": "fetchSpawnTemporaryWorkOrderFromTask()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L310"
+      "source_location": "L319"
     },
     {
       "id": "api_production_task_fetchsettaskoutputs",
       "label": "fetchSetTaskOutputs()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L322"
+      "source_location": "L331"
     },
     {
       "id": "api_production_task_fetchreordertasksteps",
       "label": "fetchReorderTaskSteps()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L334"
+      "source_location": "L343"
     },
     {
       "id": "api_production_task_fetchcopytaskstep",
       "label": "fetchCopyTaskStep()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L345"
+      "source_location": "L354"
     },
     {
       "id": "api_production_task_fetchreplacestepoutputs",
       "label": "fetchReplaceStepOutputs()",
       "file_type": "code",
       "source_file": "api/production-task.ts",
-      "source_location": "L356"
+      "source_location": "L365"
     },
     {
       "id": "api_qc_inspection_item_template_ts",
@@ -18618,7 +18618,7 @@
       "label": "validateItems()",
       "file_type": "code",
       "source_file": "views/production/production-task-set/index.vue",
-      "source_location": "L351"
+      "source_location": "L479"
     },
     {
       "id": "views_production_waste_output_index_vue",
@@ -19222,12 +19222,47 @@
       "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
       "source_location": "L1"
     },
+    {
+      "id": "production_work_order_dispatchtaskdialog_createdispatchitem",
+      "label": "createDispatchItem()",
+      "file_type": "code",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L479"
+    },
+    {
+      "id": "production_work_order_dispatchtaskdialog_dispatchitemrowkey",
+      "label": "dispatchItemRowKey()",
+      "file_type": "code",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L491"
+    },
+    {
+      "id": "production_work_order_dispatchtaskdialog_adddispatchitem",
+      "label": "addDispatchItem()",
+      "file_type": "code",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L495"
+    },
+    {
+      "id": "production_work_order_dispatchtaskdialog_removedispatchitem",
+      "label": "removeDispatchItem()",
+      "file_type": "code",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L499"
+    },
+    {
+      "id": "production_work_order_dispatchtaskdialog_seedrouteoptionsfromitems",
+      "label": "seedRouteOptionsFromItems()",
+      "file_type": "code",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L503"
+    },
     {
       "id": "production_work_order_dispatchtaskdialog_resolvecreatedtaskid",
       "label": "resolveCreatedTaskId()",
       "file_type": "code",
       "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
-      "source_location": "L410"
+      "source_location": "L542"
     },
     {
       "id": "views_production_production_work_order_taskpaperattachmentspanel_vue",
@@ -19355,6 +19390,13 @@
       "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
       "source_location": "L1"
     },
+    {
+      "id": "production_work_order_saveproductiontasksetdialog_validateitems",
+      "label": "validateItems()",
+      "file_type": "code",
+      "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
+      "source_location": "L197"
+    },
     {
       "id": "views_production_production_work_order_productionworkordertabbar_vue",
       "label": "ProductionWorkOrderTabBar.vue",
@@ -52340,7 +52382,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L20",
+      "source_location": "L29",
       "weight": 1.0
     },
     {
@@ -52349,7 +52391,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L40",
+      "source_location": "L49",
       "weight": 1.0
     },
     {
@@ -52358,7 +52400,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L61",
+      "source_location": "L70",
       "weight": 1.0
     },
     {
@@ -52367,7 +52409,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L74",
+      "source_location": "L83",
       "weight": 1.0
     },
     {
@@ -52376,7 +52418,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L97",
+      "source_location": "L106",
       "weight": 1.0
     },
     {
@@ -52385,7 +52427,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L109",
+      "source_location": "L118",
       "weight": 1.0
     },
     {
@@ -52394,7 +52436,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L119",
+      "source_location": "L128",
       "weight": 1.0
     },
     {
@@ -52403,7 +52445,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L137",
+      "source_location": "L146",
       "weight": 1.0
     },
     {
@@ -52412,7 +52454,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L161",
+      "source_location": "L170",
       "weight": 1.0
     },
     {
@@ -52421,7 +52463,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L172",
+      "source_location": "L181",
       "weight": 1.0
     },
     {
@@ -52430,7 +52472,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L176",
+      "source_location": "L185",
       "weight": 1.0
     },
     {
@@ -52439,7 +52481,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L188",
+      "source_location": "L197",
       "weight": 1.0
     },
     {
@@ -52448,7 +52490,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L192",
+      "source_location": "L201",
       "weight": 1.0
     },
     {
@@ -52457,7 +52499,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L204",
+      "source_location": "L213",
       "weight": 1.0
     },
     {
@@ -52466,7 +52508,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L217",
+      "source_location": "L226",
       "weight": 1.0
     },
     {
@@ -52475,7 +52517,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L228",
+      "source_location": "L237",
       "weight": 1.0
     },
     {
@@ -52484,7 +52526,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L241",
+      "source_location": "L250",
       "weight": 1.0
     },
     {
@@ -52493,7 +52535,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L254",
+      "source_location": "L263",
       "weight": 1.0
     },
     {
@@ -52502,7 +52544,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L267",
+      "source_location": "L276",
       "weight": 1.0
     },
     {
@@ -52511,7 +52553,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L280",
+      "source_location": "L289",
       "weight": 1.0
     },
     {
@@ -52520,7 +52562,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L310",
+      "source_location": "L319",
       "weight": 1.0
     },
     {
@@ -52529,7 +52571,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L322",
+      "source_location": "L331",
       "weight": 1.0
     },
     {
@@ -52538,7 +52580,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L334",
+      "source_location": "L343",
       "weight": 1.0
     },
     {
@@ -52547,7 +52589,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L345",
+      "source_location": "L354",
       "weight": 1.0
     },
     {
@@ -52556,7 +52598,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L356",
+      "source_location": "L365",
       "weight": 1.0
     },
     {
@@ -52565,7 +52607,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L133",
+      "source_location": "L142",
       "weight": 1.0
     },
     {
@@ -52574,7 +52616,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L184",
+      "source_location": "L193",
       "weight": 1.0
     },
     {
@@ -52583,7 +52625,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L200",
+      "source_location": "L209",
       "weight": 1.0
     },
     {
@@ -52592,7 +52634,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L213",
+      "source_location": "L222",
       "weight": 1.0
     },
     {
@@ -52601,7 +52643,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L224",
+      "source_location": "L233",
       "weight": 1.0
     },
     {
@@ -52610,7 +52652,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L237",
+      "source_location": "L246",
       "weight": 1.0
     },
     {
@@ -52619,7 +52661,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L250",
+      "source_location": "L259",
       "weight": 1.0
     },
     {
@@ -52628,7 +52670,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L263",
+      "source_location": "L272",
       "weight": 1.0
     },
     {
@@ -52637,7 +52679,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L276",
+      "source_location": "L285",
       "weight": 1.0
     },
     {
@@ -52646,7 +52688,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L288",
+      "source_location": "L297",
       "weight": 1.0
     },
     {
@@ -52655,7 +52697,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L318",
+      "source_location": "L327",
       "weight": 1.0
     },
     {
@@ -52664,7 +52706,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L330",
+      "source_location": "L339",
       "weight": 1.0
     },
     {
@@ -52673,7 +52715,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L341",
+      "source_location": "L350",
       "weight": 1.0
     },
     {
@@ -52682,7 +52724,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L352",
+      "source_location": "L361",
       "weight": 1.0
     },
     {
@@ -52691,7 +52733,7 @@
       "relation": "calls",
       "confidence": "EXTRACTED",
       "source_file": "api/production-task.ts",
-      "source_location": "L365",
+      "source_location": "L374",
       "weight": 1.0
     },
     {
@@ -58010,7 +58052,7 @@
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "views/production/production-task-set/index.vue",
-      "source_location": "L351",
+      "source_location": "L479",
       "weight": 1.0
     },
     {
@@ -59336,13 +59378,67 @@
       "source_location": "L115",
       "weight": 1.0
     },
+    {
+      "source": "views_production_production_work_order_dispatchtaskdialog_vue",
+      "target": "production_work_order_dispatchtaskdialog_createdispatchitem",
+      "relation": "contains",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L479",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_dispatchtaskdialog_vue",
+      "target": "production_work_order_dispatchtaskdialog_dispatchitemrowkey",
+      "relation": "contains",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L491",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_dispatchtaskdialog_vue",
+      "target": "production_work_order_dispatchtaskdialog_adddispatchitem",
+      "relation": "contains",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L495",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_dispatchtaskdialog_vue",
+      "target": "production_work_order_dispatchtaskdialog_removedispatchitem",
+      "relation": "contains",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L499",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_dispatchtaskdialog_vue",
+      "target": "production_work_order_dispatchtaskdialog_seedrouteoptionsfromitems",
+      "relation": "contains",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L503",
+      "weight": 1.0
+    },
     {
       "source": "views_production_production_work_order_dispatchtaskdialog_vue",
       "target": "production_work_order_dispatchtaskdialog_resolvecreatedtaskid",
       "relation": "contains",
       "confidence": "EXTRACTED",
       "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
-      "source_location": "L410",
+      "source_location": "L542",
+      "weight": 1.0
+    },
+    {
+      "source": "production_work_order_dispatchtaskdialog_adddispatchitem",
+      "target": "production_work_order_dispatchtaskdialog_createdispatchitem",
+      "relation": "calls",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L496",
       "weight": 1.0
     },
     {
@@ -59579,6 +59675,60 @@
       "source_location": "L134",
       "weight": 1.0
     },
+    {
+      "source": "views_production_production_work_order_saveproductiontasksetdialog_vue",
+      "target": "icons_vue",
+      "relation": "imports_from",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
+      "source_location": "L158",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_saveproductiontasksetdialog_vue",
+      "target": "element_plus",
+      "relation": "imports_from",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
+      "source_location": "L159",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_saveproductiontasksetdialog_vue",
+      "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production",
+      "relation": "imports_from",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
+      "source_location": "L160",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_saveproductiontasksetdialog_vue",
+      "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task_set",
+      "relation": "imports_from",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
+      "source_location": "L161",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_saveproductiontasksetdialog_vue",
+      "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_production_task_set",
+      "relation": "imports_from",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
+      "source_location": "L165",
+      "weight": 1.0
+    },
+    {
+      "source": "views_production_production_work_order_saveproductiontasksetdialog_vue",
+      "target": "production_work_order_saveproductiontasksetdialog_validateitems",
+      "relation": "contains",
+      "confidence": "EXTRACTED",
+      "source_file": "views/production/production-work-order/SaveProductionTaskSetDialog.vue",
+      "source_location": "L197",
+      "weight": 1.0
+    },
     {
       "source": "views_production_production_work_order_productionworkordertabbar_vue",
       "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_production_work_order_tabs",
@@ -78037,7 +78187,7 @@
       "confidence": "INFERRED",
       "confidence_score": 0.8,
       "source_file": "api/production-task.ts",
-      "source_location": "L30",
+      "source_location": "L39",
       "weight": 1.0
     },
     {
@@ -78047,7 +78197,7 @@
       "confidence": "INFERRED",
       "confidence_score": 0.8,
       "source_file": "api/production-task.ts",
-      "source_location": "L69",
+      "source_location": "L78",
       "weight": 1.0
     },
     {
@@ -78057,7 +78207,7 @@
       "confidence": "INFERRED",
       "confidence_score": 0.8,
       "source_file": "api/production-task.ts",
-      "source_location": "L88",
+      "source_location": "L97",
       "weight": 1.0
     },
     {
@@ -78067,7 +78217,7 @@
       "confidence": "INFERRED",
       "confidence_score": 0.8,
       "source_file": "api/production-task.ts",
-      "source_location": "L143",
+      "source_location": "L152",
       "weight": 1.0
     },
     {
@@ -78077,7 +78227,7 @@
       "confidence": "INFERRED",
       "confidence_score": 0.8,
       "source_file": "api/production-task.ts",
-      "source_location": "L166",
+      "source_location": "L175",
       "weight": 1.0
     },
     {
@@ -79870,6 +80020,36 @@
       "source_location": "L114",
       "weight": 1.0
     },
+    {
+      "source": "production_work_order_dispatchtaskdialog_adddispatchitem",
+      "target": "storage_facility_index_push",
+      "relation": "calls",
+      "confidence": "INFERRED",
+      "confidence_score": 0.8,
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L496",
+      "weight": 1.0
+    },
+    {
+      "source": "production_work_order_dispatchtaskdialog_seedrouteoptionsfromitems",
+      "target": "core_iframeroutemanager_iframeroutemanager_add",
+      "relation": "calls",
+      "confidence": "INFERRED",
+      "confidence_score": 0.8,
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L508",
+      "weight": 1.0
+    },
+    {
+      "source": "production_work_order_dispatchtaskdialog_seedrouteoptionsfromitems",
+      "target": "storage_facility_index_push",
+      "relation": "calls",
+      "confidence": "INFERRED",
+      "confidence_score": 0.8,
+      "source_file": "views/production/production-work-order/DispatchTaskDialog.vue",
+      "source_location": "L509",
+      "weight": 1.0
+    },
     {
       "source": "production_work_order_forwardtaskdialog_remotesearchusers",
       "target": "api_admin_fetchuserlist",

+ 135 - 153
web-admin/graphify-out/GRAPH_REPORT.md

@@ -1,11 +1,11 @@
 # Graph Report - src  (2026-08-18)
 
 ## Corpus Check
-- Large corpus: 986 files · ~643,077 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
+- Large corpus: 986 files · ~644,157 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
 
 ## Summary
-- 3516 nodes · 5012 edges · 71 communities detected
-- Extraction: 78% EXTRACTED · 22% INFERRED · 0% AMBIGUOUS · INFERRED: 1109 edges (avg confidence: 0.8)
+- 3522 nodes · 5022 edges · 69 communities detected
+- Extraction: 78% EXTRACTED · 22% INFERRED · 0% AMBIGUOUS · INFERRED: 1112 edges (avg confidence: 0.8)
 - Token cost: 0 input · 0 output
 
 ## Community Hubs (Navigation)
@@ -55,35 +55,33 @@
 - [[_COMMUNITY_Community 43|Community 43]]
 - [[_COMMUNITY_Community 45|Community 45]]
 - [[_COMMUNITY_Community 46|Community 46]]
-- [[_COMMUNITY_Community 50|Community 50]]
-- [[_COMMUNITY_Community 51|Community 51]]
+- [[_COMMUNITY_Community 47|Community 47]]
+- [[_COMMUNITY_Community 48|Community 48]]
+- [[_COMMUNITY_Community 52|Community 52]]
 - [[_COMMUNITY_Community 53|Community 53]]
 - [[_COMMUNITY_Community 54|Community 54]]
-- [[_COMMUNITY_Community 55|Community 55]]
 - [[_COMMUNITY_Community 56|Community 56]]
 - [[_COMMUNITY_Community 57|Community 57]]
 - [[_COMMUNITY_Community 58|Community 58]]
 - [[_COMMUNITY_Community 59|Community 59]]
+- [[_COMMUNITY_Community 60|Community 60]]
 - [[_COMMUNITY_Community 61|Community 61]]
-- [[_COMMUNITY_Community 62|Community 62]]
-- [[_COMMUNITY_Community 66|Community 66]]
-- [[_COMMUNITY_Community 68|Community 68]]
-- [[_COMMUNITY_Community 69|Community 69]]
-- [[_COMMUNITY_Community 70|Community 70]]
-- [[_COMMUNITY_Community 75|Community 75]]
-- [[_COMMUNITY_Community 78|Community 78]]
+- [[_COMMUNITY_Community 63|Community 63]]
+- [[_COMMUNITY_Community 67|Community 67]]
+- [[_COMMUNITY_Community 73|Community 73]]
+- [[_COMMUNITY_Community 76|Community 76]]
+- [[_COMMUNITY_Community 77|Community 77]]
 - [[_COMMUNITY_Community 79|Community 79]]
+- [[_COMMUNITY_Community 80|Community 80]]
 - [[_COMMUNITY_Community 81|Community 81]]
-- [[_COMMUNITY_Community 82|Community 82]]
 - [[_COMMUNITY_Community 83|Community 83]]
-- [[_COMMUNITY_Community 85|Community 85]]
+- [[_COMMUNITY_Community 96|Community 96]]
 - [[_COMMUNITY_Community 98|Community 98]]
-- [[_COMMUNITY_Community 100|Community 100]]
-- [[_COMMUNITY_Community 101|Community 101]]
+- [[_COMMUNITY_Community 99|Community 99]]
 
 ## God Nodes (most connected - your core abstractions)
 1. `get()` - 313 edges
-2. `push()` - 122 edges
+2. `push()` - 124 edges
 3. `emit()` - 30 edges
 4. `WebSocketClient` - 26 edges
 5. `set()` - 21 edges
@@ -96,76 +94,76 @@
 ## Surprising Connections (you probably didn't know these)
 - `formatReceiveAccountLine()` --calls--> `push()`  [INFERRED]
   utils/oa-receive-account-value.ts → views/operations/storage-facility/index.vue
-- `dash()` --calls--> `formatDisplayOrDash()`  [INFERRED]
-  components/business/infusion-schedule-outbound-chain-view/index.vue → utils/datetime-display.ts
-- `dash()` --calls--> `formatDisplayOrDash()`  [INFERRED]
-  components/business/clinical-schedule-payment-detail/index.vue → utils/datetime-display.ts
 - `displayCell()` --calls--> `formatDisplayOrDash()`  [INFERRED]
   views/production/waste-output/index.vue → utils/datetime-display.ts
 - `fmtMoney()` --calls--> `formatMoneyDisplay()`  [INFERRED]
   components/business/clinical-schedule-payment-detail/index.vue → utils/money-format.ts
+- `onPick()` --calls--> `ensureOaUploadRuleProps()`  [INFERRED]
+  components/oa-approval/OaStartFormDialog.vue → utils/oa-form-create-upload.ts
+- `defaultInstallmentRatios()` --calls--> `push()`  [INFERRED]
+  utils/protocol-payment-installment.ts → views/operations/storage-facility/index.vue
 
 ## Communities
 
 ### Community 0 - "Community 0"
-Cohesion: 0.0
-Nodes (207): fetchAccessLogList(), fetchActiveRegions(), fetchCategoryList(), fetchCategoryParameters(), fetchCellProductPriceList(), fetchCellProductSpecList(), fetchCellProductTypeList(), fetchChannelAccount() (+199 more)
+Cohesion: 0.01
+Nodes (187): fetchAccessLogList(), fetchActiveRegions(), fetchCategoryList(), fetchCategoryParameters(), fetchCellProductPriceList(), fetchCellProductSpecList(), fetchCellProductTypeList(), fetchChannelAccount() (+179 more)
 
 ### Community 1 - "Community 1"
-Cohesion: 0.03
-Nodes (91): batchSavePilotCheckup(), deletePilotCheckupActualItem(), fetchCheckupInstitutionList(), fetchCheckupInstitutionPackageDetail(), fetchCheckupInstitutionPackages(), fetchPilotCheckupActualItems(), fetchPilotCheckupDetail(), fetchPilotCheckupList() (+83 more)
+Cohesion: 0.02
+Nodes (98): fetchUploadAttachment(), fetchMyQcTaskList(), fetchQcTaskDetail(), fetchQcTaskList(), handleReportUpload(), handleReportUpload(), walk(), fetchMineTasksForWorkOrders() (+90 more)
 
 ### Community 2 - "Community 2"
 Cohesion: 0.03
-Nodes (74): fetchUploadAttachment(), FireworkSystem, handleReportUpload(), handleReportUpload(), walk(), if(), async(), for() (+66 more)
+Nodes (88): batchSavePilotCheckup(), deletePilotCheckupActualItem(), fetchCheckupInstitutionList(), fetchCheckupInstitutionPackageDetail(), fetchCheckupInstitutionPackages(), fetchPilotCheckupDetail(), fetchPilotCheckupList(), markPilotCheckupChecked() (+80 more)
 
 ### Community 3 - "Community 3"
 Cohesion: 0.03
-Nodes (78): fetchEthnicList(), applyDonationBundleToForm(), createEmptyTransport(), ensureEthnicOptionInList(), handleOpenForAdd(), if(), loadEthnicOptions(), normalizeSampleRow() (+70 more)
+Nodes (77): fetchEthnicList(), applyDonationBundleToForm(), createEmptyTransport(), ensureEthnicOptionInList(), handleOpenForAdd(), if(), loadEthnicOptions(), normalizeSampleRow() (+69 more)
 
 ### Community 4 - "Community 4"
 Cohesion: 0.03
-Nodes (64): fetchCheckupInstitutionInvoices(), fetchCheckupInstitutionProjects(), fetchCreateCheckupInstitution(), fetchCreateCheckupInstitutionInvoice(), fetchCreateCheckupInstitutionProject(), fetchUpdateCheckupInstitution(), fetchUpdateCheckupInstitutionInvoice(), fetchUpdateCheckupInstitutionProject() (+56 more)
+Nodes (61): fetchBatchDeleteOaReceiveAccounts(), fetchBatchMarkOaCcTasksRead(), fetchCreateOaReceiveAccount(), fetchDeleteOaReceiveAccount(), fetchMarkOaCcTaskRead(), fetchOaAppDraft(), fetchOaCcUnreadCount(), fetchOaInstanceDetail() (+53 more)
 
 ### Community 5 - "Community 5"
 Cohesion: 0.03
-Nodes (61): fetchBatchDeleteOaReceiveAccounts(), fetchBatchMarkOaCcTasksRead(), fetchCreateOaReceiveAccount(), fetchDeleteOaReceiveAccount(), fetchMarkOaCcTaskRead(), fetchOaAppDraft(), fetchOaCcUnreadCount(), fetchOaInstanceDetail() (+53 more)
+Nodes (64): fetchCheckupInstitutionInvoices(), fetchCheckupInstitutionProjects(), fetchCreateCheckupInstitution(), fetchCreateCheckupInstitutionInvoice(), fetchCreateCheckupInstitutionProject(), fetchUpdateCheckupInstitution(), fetchUpdateCheckupInstitutionInvoice(), fetchUpdateCheckupInstitutionProject() (+56 more)
 
 ### Community 6 - "Community 6"
 Cohesion: 0.03
-Nodes (66): fetchFullmoonTodoList(), fetchUpdateFullmoonTodoInsurance(), fetchCollectionProtocolAuditList(), fetchCollectionProtocolDetail(), fetchCollectionProtocolList(), fetchCreateProtocolInvoiceRequest(), fetchInvoiceEligiblePayments(), fetchPaymentDetailList() (+58 more)
+Nodes (34): fetchGetMenuList(), ComponentLoader, IframeRouteManager, MenuProcessor, RoutePermissionValidator, RouteRegistry, RouteTransformer, useAppMode() (+26 more)
 
 ### Community 7 - "Community 7"
-Cohesion: 0.03
-Nodes (34): fetchGetMenuList(), ComponentLoader, IframeRouteManager, MenuProcessor, RoutePermissionValidator, RouteRegistry, RouteTransformer, useAppMode() (+26 more)
+Cohesion: 0.02
+Nodes (29): fetchAllConsumablePacks(), fetchAllConsumables(), fetchAllConsumableStockLogs(), fetchAllEquipments(), fetchAllOutputTypes(), fetchAllProcessCategories(), fetchAllProcesses(), fetchAllReagents() (+21 more)
 
 ### Community 8 - "Community 8"
-Cohesion: 0.04
-Nodes (55): buildInboundBasicSection(), buildInboundCellStorageViewSections(), buildInboundResearchDonationViewSections(), buildReceptionSection(), buildTransportSection(), resolveInboundProtocolStatus(), buildBaseFields(), buildInboundBasicSection() (+47 more)
+Cohesion: 0.03
+Nodes (60): useSettingsHandlers(), useSettingsPanel(), useSettingsState(), useCeremony(), useTheme(), if(), branchConditionLines(), nodeSummary() (+52 more)
 
 ### Community 9 - "Community 9"
 Cohesion: 0.03
-Nodes (60): useSettingsHandlers(), useSettingsPanel(), useSettingsState(), useCeremony(), useTheme(), if(), branchConditionLines(), nodeSummary() (+52 more)
+Nodes (59): fetchFullmoonTodoList(), fetchUpdateFullmoonTodoInsurance(), fetchCollectionProtocolAuditList(), fetchCollectionProtocolDetail(), fetchCollectionProtocolList(), fetchCreateProtocolInvoiceRequest(), fetchInvoiceEligiblePayments(), fetchPaymentDetailList() (+51 more)
 
 ### Community 10 - "Community 10"
-Cohesion: 0.03
-Nodes (56): fetchMyProductionTasks(), fetchMyQcTaskList(), fetchQcTaskDetail(), fetchQcTaskList(), fetchMineTasksForWorkOrders(), useInboundSiblingNavigation(), shouldApplyTriggerSourceFilter(), useQcWorkOrderTabPage() (+48 more)
+Cohesion: 0.04
+Nodes (50): buildInboundBasicSection(), buildInboundCellStorageViewSections(), buildInboundResearchDonationViewSections(), buildReceptionSection(), buildTransportSection(), resolveInboundProtocolStatus(), buildBaseFields(), buildInboundBasicSection() (+42 more)
 
 ### Community 11 - "Community 11"
-Cohesion: 0.04
-Nodes (67): fetchDeptTree(), fetchUserList(), fetchOaFlowPreview(), fetchOaTemplateDetail(), formatHandoverUserLabel(), formatNowDatetime(), fullFileUrl(), handlePreviewAttachment() (+59 more)
+Cohesion: 0.03
+Nodes (54): buildTemporaryViewSections(), buildInsertedSiblingCard(), resolveShowProtocolPaymentAtGroup(), useInboundSiblingNavigation(), shouldApplyTriggerSourceFilter(), useQcWorkOrderTabPage(), appendTaskResultSections(), batchTasksForPanelSlot() (+46 more)
 
 ### Community 12 - "Community 12"
 Cohesion: 0.04
-Nodes (51): buildTemporaryViewSections(), buildInsertedSiblingCard(), resolveShowProtocolPaymentAtGroup(), appendTaskResultSections(), batchTasksForPanelSlot(), buildConfiguredOnlySection(), for(), for() (+43 more)
+Nodes (67): fetchDeptTree(), fetchUserList(), fetchOaFlowPreview(), fetchOaTemplateDetail(), formatHandoverUserLabel(), formatNowDatetime(), fullFileUrl(), handlePreviewAttachment() (+59 more)
 
 ### Community 13 - "Community 13"
 Cohesion: 0.04
-Nodes (48): fetchCreateCustomer(), fetchCustomerList(), fetchDeleteCustomer(), fetchUpdateCustomer(), updateInfusionScheduleStatus(), handleDialogClose(), handleAdd(), handleDelete() (+40 more)
+Nodes (48): dash(), fmtMoney(), attachmentFullUrl(), dash(), handleAttachmentDownload(), handleAttachmentPreview(), auditorDisplay(), dash() (+40 more)
 
 ### Community 14 - "Community 14"
 Cohesion: 0.04
-Nodes (39): fetchCreateMenu(), fetchDeleteMenu(), fetchMenuTree(), fetchUpdateMenu(), fetchUpdatePostBoundRoles(), fetchMarkQcMaterialUsageFullyUsed(), collectIds(), postorder() (+31 more)
+Nodes (48): fetchCreateCustomer(), fetchCustomerList(), fetchDeleteCustomer(), fetchUpdateCustomer(), updateInfusionScheduleStatus(), handleDialogClose(), handleAdd(), handleDelete() (+40 more)
 
 ### Community 15 - "Community 15"
 Cohesion: 0.05
@@ -173,7 +171,7 @@ Nodes (53): fetchGetMenuCodes(), fetchGetUserInfo(), fetchLogin(), fetchRefreshT
 
 ### Community 16 - "Community 16"
 Cohesion: 0.04
-Nodes (21): fetchProductionWorkOrderQcInfo(), fetchQcMaterialBatchDetail(), fetchQcMaterialBatchList(), fetchQcMaterialBatchOptions(), fetchQcMaterialList(), fetchQcMaterialOptions(), fetchUpdateQcMaterialBatch(), dash() (+13 more)
+Nodes (25): fetchCreateMenu(), fetchDeleteMenu(), fetchMenuTree(), fetchUpdateMenu(), fetchUpdatePostBoundRoles(), collectIds(), postorder(), preorder() (+17 more)
 
 ### Community 17 - "Community 17"
 Cohesion: 0.05
@@ -188,88 +186,88 @@ Cohesion: 0.07
 Nodes (44): fetchOaRelatedSummaries(), buildFormRows(), buildOaPrintFilename(), buildOaPrintModel(), canvasToPdf(), ensurePlainObject(), exportOaApprovalPdf(), extractUrls() (+36 more)
 
 ### Community 20 - "Community 20"
-Cohesion: 0.06
-Nodes (41): completePilotApplication(), deletePilotApplication(), fetchPilotApplicationList(), startPilotApplication(), voidPilotApplication(), fetchClinicalRefundConfirmed(), buildConfirmedParams(), buildPendingParams() (+33 more)
-
-### Community 21 - "Community 21"
 Cohesion: 0.05
 Nodes (24): handleBlur(), handleFocus(), handleInput(), fetchClinicalReceiptConfirmed(), buildConfirmedParams(), buildPendingParams(), formatAmount(), handleConfirmedReset() (+16 more)
 
+### Community 21 - "Community 21"
+Cohesion: 0.06
+Nodes (40): completePilotApplication(), deletePilotApplication(), fetchPilotApplicationList(), startPilotApplication(), voidPilotApplication(), fetchClinicalRefundConfirmed(), buildConfirmedParams(), buildPendingParams() (+32 more)
+
 ### Community 22 - "Community 22"
+Cohesion: 0.05
+Nodes (25): fetchQcMaterialBatchDetail(), fetchQcMaterialBatchList(), fetchQcMaterialBatchOptions(), fetchQcMaterialList(), fetchQcMaterialOptions(), fetchUpdateQcMaterialBatch(), fetchMarkQcMaterialUsageFullyUsed(), handleAttachmentChange() (+17 more)
+
+### Community 23 - "Community 23"
 Cohesion: 0.08
 Nodes (37): formatDatetimeToMinute(), handleChineseDatetimePaste(), parseChineseDatetimeText(), parseBirthOrder(), parseChineseNumeral(), addSampleHint(), earliestCollectTime(), isMaternalBloodEmpty() (+29 more)
 
-### Community 23 - "Community 23"
+### Community 24 - "Community 24"
 Cohesion: 0.1
 Nodes (2): WebSocketClient, TableCache
 
-### Community 24 - "Community 24"
-Cohesion: 0.08
-Nodes (19): fetchProductionReceptionBySampleCode(), fetchProductionReceptionSubmit(), fetchProductionReceptionUpdate(), onUserSelectVisible(), remoteSearchUsers(), buildPayload(), ensureDefaultHandler(), initDialog() (+11 more)
-
 ### Community 25 - "Community 25"
-Cohesion: 0.09
-Nodes (8): getDefaultLanguage(), checkStorageCompatibility(), StorageConfig, getSystemStorage(), getSysVersion(), StorageKeyManager, StorageCompatibilityManager, validateStorageData()
+Cohesion: 0.07
+Nodes (24): fetchMineProductionWorkOrderTabStepCounts(), fetchMineProductionWorkOrderTabStepCountsDeduped(), fetchProductionWorkOrderCellProductOptions(), fetchProductionWorkOrderDetail(), fetchProductionWorkOrderList(), fetchProductionWorkOrderQcDispatchOptions(), fetchProductionWorkOrderQcInfo(), fetchProductionWorkOrderTabStepCounts() (+16 more)
 
 ### Community 26 - "Community 26"
-Cohesion: 0.08
-Nodes (20): createEmptySnapshots(), normalizeConfiguredReagents(), normalizeConsumables(), normalizeDataCollections(), normalizeReagents(), normalizeStepOutputs(), serializeAttachments(), serializeEquipmentIds() (+12 more)
+Cohesion: 0.09
+Nodes (8): getDefaultLanguage(), checkStorageCompatibility(), StorageConfig, getSystemStorage(), getSysVersion(), StorageKeyManager, StorageCompatibilityManager, validateStorageData()
 
 ### Community 27 - "Community 27"
 Cohesion: 0.07
-Nodes (19): fetchDeleteMaterialBatch(), fetchMaterialBatchList(), fetchMaterialBatchOptions(), fetchMaterialList(), fetchMaterialOptions(), fetchUpdateMaterialBatch(), fetchMaterialUsageList(), fetchMyMaterialUsageList() (+11 more)
+Nodes (20): fetchDeleteMaterialBatch(), fetchMaterialBatchList(), fetchMaterialBatchOptions(), fetchMaterialList(), fetchMaterialOptions(), fetchUpdateMaterialBatch(), fetchMaterialUsageList(), fetchMyMaterialUsageList() (+12 more)
 
 ### Community 28 - "Community 28"
-Cohesion: 0.09
-Nodes (22): fetchMineProductionWorkOrderTabStepCounts(), fetchMineProductionWorkOrderTabStepCountsDeduped(), fetchProductionWorkOrderCellProductOptions(), fetchProductionWorkOrderDetail(), fetchProductionWorkOrderList(), fetchProductionWorkOrderQcDispatchOptions(), fetchProductionWorkOrderTabStepCounts(), fetchProductionWorkOrderTabStepCountsDeduped() (+14 more)
+Cohesion: 0.08
+Nodes (20): createEmptySnapshots(), normalizeConfiguredReagents(), normalizeConsumables(), normalizeDataCollections(), normalizeReagents(), normalizeStepOutputs(), serializeAttachments(), serializeEquipmentIds() (+12 more)
 
 ### Community 29 - "Community 29"
 Cohesion: 0.09
-Nodes (22): fetchOaAppList(), fetchOaGroupList(), fetchPublishOaApp(), loadData(), loadGroups(), resetForm(), onSuccess(), goBack() (+14 more)
+Nodes (18): fetchProductionReceptionBySampleCode(), fetchProductionReceptionSubmit(), fetchProductionReceptionUpdate(), onUserSelectVisible(), remoteSearchUsers(), buildPayload(), ensureDefaultHandler(), initDialog() (+10 more)
 
 ### Community 30 - "Community 30"
-Cohesion: 0.1
-Nodes (21): displayPeople(), nodeStatusText(), personLines(), personStatusHint(), personTitle(), showNodeComment(), signBadge(), signBadgeText() (+13 more)
+Cohesion: 0.09
+Nodes (22): fetchOaAppList(), fetchOaGroupList(), fetchPublishOaApp(), loadData(), loadGroups(), resetForm(), onSuccess(), goBack() (+14 more)
 
 ### Community 31 - "Community 31"
 Cohesion: 0.09
-Nodes (12): fetchMineQcWorkOrderTabUnfinishedCounts(), fetchOutboundQcDetail(), fetchQcWorkOrderDetail(), fetchQcWorkOrderList(), fetchQcWorkOrdersBySample(), fetchQcWorkOrderTabUnfinishedCounts(), reload(), reloadTabCounts() (+4 more)
+Nodes (21): fetchMyProductionTasks(), buildMineTableRows(), buildPresetTasksMap(), buildWorkOrderFromTasks(), fetchAllMineProductionTasks(), fetchMineTasksByScope(), groupMineTasksByWorkOrder(), keywordMatchesWorkOrder() (+13 more)
 
 ### Community 32 - "Community 32"
-Cohesion: 0.18
-Nodes (22): buildPaymentFlowSteps(), dash(), formatAmount(), hasFinanceReceipt(), hasFinanceRefund(), hasReceiptSubmit(), hasRefundSubmit(), receiptSubmitTime() (+14 more)
+Cohesion: 0.1
+Nodes (21): displayPeople(), nodeStatusText(), personLines(), personStatusHint(), personTitle(), showNodeComment(), signBadge(), signBadgeText() (+13 more)
 
 ### Community 33 - "Community 33"
+Cohesion: 0.09
+Nodes (12): fetchMineQcWorkOrderTabUnfinishedCounts(), fetchOutboundQcDetail(), fetchQcWorkOrderDetail(), fetchQcWorkOrderList(), fetchQcWorkOrdersBySample(), fetchQcWorkOrderTabUnfinishedCounts(), reload(), reloadTabCounts() (+4 more)
+
+### Community 34 - "Community 34"
 Cohesion: 0.1
 Nodes (12): fetchOutboundReleaseMaterial(), fetchOutboundReleaseReviewDetail(), fetchOutboundReleaseReviewList(), fetchReleaseReviewList(), handleReset(), handleSearch(), handleTabChange(), handleToggleSelect() (+4 more)
 
-### Community 34 - "Community 34"
+### Community 35 - "Community 35"
 Cohesion: 0.12
 Nodes (15): addCopyButton(), highlightCode(), insertLineNumbers(), isBlockProcessed(), markBlockAsProcessed(), processBlock(), setupHighlightDirective(), setupRippleDirective() (+7 more)
 
-### Community 35 - "Community 35"
+### Community 36 - "Community 36"
 Cohesion: 0.13
 Nodes (18): fetchCellSampleTypeList(), fetchCreateCellSampleType(), fetchDeleteCellSampleType(), fetchUpdateCellSampleType(), handleAdd(), handleDelete(), handleDropdownCommand(), handleEdit() (+10 more)
 
-### Community 36 - "Community 36"
+### Community 37 - "Community 37"
 Cohesion: 0.19
 Nodes (15): fetchAttachmentDownloadUrl(), attachmentFullUrl(), ensureUniqueZipEntryName(), fetchAttachmentBlob(), getAttachmentExtension(), resolveAttachmentFileName(), sanitizeZipPathSegment(), applyInboundLabStorageCodePrefix() (+7 more)
 
-### Community 37 - "Community 37"
+### Community 38 - "Community 38"
 Cohesion: 0.13
 Nodes (8): chipTitle(), confirmPicker(), memberOptionLabel(), removeUser(), resolveUser(), signBadge(), signBadgeText(), updateSelect()
 
-### Community 38 - "Community 38"
+### Community 39 - "Community 39"
 Cohesion: 0.2
 Nodes (14): applyFlagToRule(), applySchema(), countRules(), getActiveRule(), getDesigner(), getSetupState(), onMessage(), readFlag() (+6 more)
 
-### Community 39 - "Community 39"
-Cohesion: 0.12
-Nodes (6): setupOaConfirmationKit(), ensureOaKitMenu(), setupOaLeaveKit(), setupOaOvertimeKit(), setupOaResignationKit(), setupOaTripKit()
-
 ### Community 40 - "Community 40"
 Cohesion: 0.12
-Nodes (6): attachmentFullUrl(), dash(), handleAttachmentDownload(), handleAttachmentPreview(), ensureOaUploadRuleProps(), resolveUploadResponseUrl()
+Nodes (6): setupOaConfirmationKit(), ensureOaKitMenu(), setupOaLeaveKit(), setupOaOvertimeKit(), setupOaResignationKit(), setupOaTripKit()
 
 ### Community 41 - "Community 41"
 Cohesion: 0.16
@@ -284,176 +282,160 @@ Cohesion: 0.19
 Nodes (6): fetchServiceOrderTxnList(), handleReset(), handleSearch(), handleTabChange(), loadData(), switchTab()
 
 ### Community 45 - "Community 45"
+Cohesion: 0.24
+Nodes (8): fullFileUrl(), handlePreviewAttachment(), isVideoFile(), normalizeDisplayValue(), resolveReviewCellType(), resolveReviewQuantity(), resolveReviewSpecText(), uniqueJoined()
+
+### Community 46 - "Community 46"
 Cohesion: 0.31
 Nodes (4): isSlotAvailable(), resolveStorageSlotRangeFill(), slotFacilityNodeId(), sortBoxSlots()
 
-### Community 46 - "Community 46"
+### Community 47 - "Community 47"
 Cohesion: 0.25
 Nodes (2): handleTouchEnd(), setTransition()
 
-### Community 50 - "Community 50"
+### Community 48 - "Community 48"
+Cohesion: 0.28
+Nodes (1): FireworkSystem
+
+### Community 52 - "Community 52"
+Cohesion: 0.29
+Nodes (4): if(), emptyTripLeg(), buildTripKitChildren(), uniqueId()
+
+### Community 53 - "Community 53"
 Cohesion: 0.39
 Nodes (6): isIgnorableScriptError(), normalizeErrorMessage(), registerPromiseErrorHandler(), registerResourceErrorHandler(), scriptErrorHandler(), setupErrorHandle()
 
-### Community 51 - "Community 51"
+### Community 54 - "Community 54"
 Cohesion: 0.36
 Nodes (1): TableHeightCalculator
 
-### Community 53 - "Community 53"
+### Community 56 - "Community 56"
 Cohesion: 0.33
 Nodes (2): logApiCryptoBootInfo(), maskSecret()
 
-### Community 54 - "Community 54"
+### Community 57 - "Community 57"
 Cohesion: 0.38
 Nodes (4): handleFocus(), handleInput(), parseDecimalToNumber(), sanitizeDecimalInput()
 
-### Community 55 - "Community 55"
-Cohesion: 0.29
-Nodes (2): fetchLeaveDetail(), fetchLeaveList()
-
-### Community 56 - "Community 56"
+### Community 58 - "Community 58"
 Cohesion: 0.4
 Nodes (2): isUnfinishedQcWorkOrder(), resolveQcWorkOrderUnfinishedBadgeCount()
 
-### Community 57 - "Community 57"
+### Community 59 - "Community 59"
 Cohesion: 0.47
 Nodes (3): isPaymentDueWithinWarnWindow(), parsePaymentDueYmd(), startOfLocalDay()
 
-### Community 58 - "Community 58"
+### Community 60 - "Community 60"
 Cohesion: 0.5
 Nodes (2): formatProtocolDocDeleteConfirm(), formatProtocolDocSubject()
 
-### Community 59 - "Community 59"
+### Community 61 - "Community 61"
 Cohesion: 0.5
 Nodes (2): parseEquipmentIds(), syncEquipmentNamesFromOptions()
 
-### Community 61 - "Community 61"
+### Community 63 - "Community 63"
 Cohesion: 0.5
 Nodes (2): focusInput(), handleKeydown()
 
-### Community 62 - "Community 62"
-Cohesion: 0.4
-Nodes (1): fetchQcMaterialAmountAuthUsers()
-
-### Community 66 - "Community 66"
+### Community 67 - "Community 67"
 Cohesion: 0.67
 Nodes (2): if(), logSidebarMenu()
 
-### Community 68 - "Community 68"
-Cohesion: 0.5
-Nodes (1): fetchStorageEntrySmsList()
-
-### Community 69 - "Community 69"
-Cohesion: 0.5
-Nodes (1): fetchSampleSmsNotificationList()
-
-### Community 70 - "Community 70"
-Cohesion: 0.5
-Nodes (1): fetchQcSmsList()
-
-### Community 75 - "Community 75"
+### Community 73 - "Community 73"
 Cohesion: 1.0
 Nodes (2): getSettingDefaults(), resetToDefaults()
 
-### Community 78 - "Community 78"
+### Community 76 - "Community 76"
 Cohesion: 1.0
 Nodes (2): buildOvertimeKitChildren(), uniqueId()
 
-### Community 79 - "Community 79"
+### Community 77 - "Community 77"
 Cohesion: 1.0
 Nodes (2): buildLeaveKitChildren(), uniqueId()
 
-### Community 81 - "Community 81"
+### Community 79 - "Community 79"
 Cohesion: 1.0
 Nodes (2): buildConfirmationKitChildren(), uniqueId()
 
-### Community 82 - "Community 82"
+### Community 80 - "Community 80"
 Cohesion: 1.0
 Nodes (2): buildResignationKitChildren(), uniqueId()
 
-### Community 83 - "Community 83"
+### Community 81 - "Community 81"
 Cohesion: 1.0
 Nodes (2): copyTextToClipboard(), copyTextWithFallback()
 
-### Community 85 - "Community 85"
+### Community 83 - "Community 83"
 Cohesion: 1.0
 Nodes (2): getSourceProtocolAttachment(), normalizeAttachmentFiles()
 
-### Community 98 - "Community 98"
+### Community 96 - "Community 96"
 Cohesion: 1.0
 Nodes (2): emptyTabCounts(), useProductionWorkOrderTabStepCounts()
 
-### Community 100 - "Community 100"
+### Community 98 - "Community 98"
 Cohesion: 1.0
 Nodes (2): initialProgress(), useQcWorkOrderAttachmentExport()
 
-### Community 101 - "Community 101"
+### Community 99 - "Community 99"
 Cohesion: 1.0
 Nodes (2): emptyTabCounts(), useQcWorkOrderTabUnfinishedCounts()
 
 ## Knowledge Gaps
-- **Thin community `Community 23`** (42 nodes): `WebSocketClient`, `.calculateReconnectDelay()`, `.clearAllTimers()`, `.clearConnectionTimers()`, `.clearTimer()`, `.close()`, `.closeCurrentSocketForReconnect()`, `.connect()`, `.connectionStatusText()`, `.constructor()`, `.destroyInstance()`, `.flushMessageQueue()`, `.getInstance()`, `.getReadyStateText()`, `.handleClose()`, `.handleConnectionTimeout()`, `.handleError()`, `.handleMessage()`, `.handleOpen()`, `.init()`, `.isWebSocketConnected()`, `.reconnect()`, `.resetHeartbeat()`, `.send()`, `.startHeartbeat()`, `.startPing()`, `TableCache`, `.cleanupExpired()`, `.clear()`, `.clearByTags()`, `.clearCurrentSearch()`, `.clearPagination()`, `.constructor()`, `.evictLRU()`, `.generateKey()`, `.generateTags()`, `.get()`, `.getStats()`, `.log()`, `.set()`, `index.ts`, `tableCache.ts`
-  Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 46`** (9 nodes): `cleanupEventListeners()`, `handleTouchEnd()`, `handleTouchMove()`, `handleTouchStart()`, `handleWheelScroll()`, `if()`, `setTransition()`, `setupEventListeners()`, `index.vue`
-  Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 51`** (8 nodes): `TableHeightCalculator`, `.calculate()`, `.calculateOffset()`, `.calculatePaginationOffset()`, `.constructor()`, `.getHeaderHeight()`, `useTableHeight()`, `useTableHeight.ts`
-  Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 53`** (7 nodes): `App.vue`, `main.ts`, `refreshButtonAutoIcons()`, `refreshPanelTitleIcons()`, `logApiCryptoBootInfo()`, `maskSecret()`, `console.ts`
-  Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 55`** (7 nodes): `fetchCreateLeave()`, `fetchDeleteLeave()`, `fetchLeaveDetail()`, `fetchLeaveList()`, `fetchSubmitLeave()`, `fetchUpdateLeave()`, `leave.ts`
+- **Thin community `Community 24`** (42 nodes): `WebSocketClient`, `.calculateReconnectDelay()`, `.clearAllTimers()`, `.clearConnectionTimers()`, `.clearTimer()`, `.close()`, `.closeCurrentSocketForReconnect()`, `.connect()`, `.connectionStatusText()`, `.constructor()`, `.destroyInstance()`, `.flushMessageQueue()`, `.getInstance()`, `.getReadyStateText()`, `.handleClose()`, `.handleConnectionTimeout()`, `.handleError()`, `.handleMessage()`, `.handleOpen()`, `.init()`, `.isWebSocketConnected()`, `.reconnect()`, `.resetHeartbeat()`, `.send()`, `.startHeartbeat()`, `.startPing()`, `TableCache`, `.cleanupExpired()`, `.clear()`, `.clearByTags()`, `.clearCurrentSearch()`, `.clearPagination()`, `.constructor()`, `.evictLRU()`, `.generateKey()`, `.generateTags()`, `.get()`, `.getStats()`, `.log()`, `.set()`, `index.ts`, `tableCache.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 56`** (6 nodes): `formatQcWorkOrderUnfinishedBadgeCount()`, `isUnfinishedQcWorkOrder()`, `qcWorkOrderUnfinishedBadgeTitle()`, `resolveQcWorkOrderUnfinishedBadgeCount()`, `sumQcWorkOrderGroupUnfinishedBadgeCount()`, `qc-work-order-unfinished-badge.ts`
+- **Thin community `Community 47`** (9 nodes): `cleanupEventListeners()`, `handleTouchEnd()`, `handleTouchMove()`, `handleTouchStart()`, `handleWheelScroll()`, `if()`, `setTransition()`, `setupEventListeners()`, `index.vue`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 58`** (5 nodes): `formatProtocolDocBatchDeleteConfirm()`, `formatProtocolDocDeleteConfirm()`, `formatProtocolDocSubject()`, `getProtocolDocTypeLabel()`, `protocol-doc-label.ts`
+- **Thin community `Community 48`** (9 nodes): `FireworkSystem`, `.constructor()`, `.createFirework()`, `.createParticle()`, `.getAvailableParticle()`, `.initializePool()`, `.preloadAllImages()`, `.preloadImage()`, `index.vue`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 59`** (5 nodes): `equipmentOptionLabel()`, `joinEquipmentIds()`, `parseEquipmentIds()`, `syncEquipmentNamesFromOptions()`, `equipment-select.ts`
+- **Thin community `Community 54`** (8 nodes): `TableHeightCalculator`, `.calculate()`, `.calculateOffset()`, `.calculatePaginationOffset()`, `.constructor()`, `.getHeaderHeight()`, `useTableHeight()`, `useTableHeight.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 61`** (5 nodes): `focusInput()`, `handleKeydown()`, `if()`, `search()`, `index.vue`
+- **Thin community `Community 56`** (7 nodes): `App.vue`, `main.ts`, `refreshButtonAutoIcons()`, `refreshPanelTitleIcons()`, `logApiCryptoBootInfo()`, `maskSecret()`, `console.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 62`** (5 nodes): `fetchBatchRevokeQcMaterialAmountAuth()`, `fetchGrantQcMaterialAmountAuth()`, `fetchQcMaterialAmountAuthUsers()`, `fetchRevokeQcMaterialAmountAuth()`, `qc-material-amount-auth.ts`
+- **Thin community `Community 58`** (6 nodes): `formatQcWorkOrderUnfinishedBadgeCount()`, `isUnfinishedQcWorkOrder()`, `qcWorkOrderUnfinishedBadgeTitle()`, `resolveQcWorkOrderUnfinishedBadgeCount()`, `sumQcWorkOrderGroupUnfinishedBadgeCount()`, `qc-work-order-unfinished-badge.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 66`** (4 nodes): `if()`, `logSidebarMenu()`, `index.vue`, `SidebarSubmenu.vue`
+- **Thin community `Community 60`** (5 nodes): `formatProtocolDocBatchDeleteConfirm()`, `formatProtocolDocDeleteConfirm()`, `formatProtocolDocSubject()`, `getProtocolDocTypeLabel()`, `protocol-doc-label.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 68`** (4 nodes): `fetchGenerateStorageEntrySms()`, `fetchStorageEntrySmsList()`, `fetchToggleStorageEntrySmsNotified()`, `storage-entry-sms-notification.ts`
+- **Thin community `Community 61`** (5 nodes): `equipmentOptionLabel()`, `joinEquipmentIds()`, `parseEquipmentIds()`, `syncEquipmentNamesFromOptions()`, `equipment-select.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 69`** (4 nodes): `fetchGenerateSms()`, `fetchSampleSmsNotificationList()`, `fetchToggleSmsNotified()`, `sample-sms-notification.ts`
+- **Thin community `Community 63`** (5 nodes): `focusInput()`, `handleKeydown()`, `if()`, `search()`, `index.vue`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 70`** (4 nodes): `fetchGenerateQcSms()`, `fetchQcSmsList()`, `fetchToggleQcSmsNotified()`, `qc-sms-notification.ts`
+- **Thin community `Community 67`** (4 nodes): `if()`, `logSidebarMenu()`, `index.vue`, `SidebarSubmenu.vue`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 75`** (3 nodes): `getSettingDefaults()`, `resetToDefaults()`, `setting.ts`
+- **Thin community `Community 73`** (3 nodes): `getSettingDefaults()`, `resetToDefaults()`, `setting.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 78`** (3 nodes): `buildOvertimeKitChildren()`, `oa-overtime-kit-rule.ts`, `uniqueId()`
+- **Thin community `Community 76`** (3 nodes): `buildOvertimeKitChildren()`, `oa-overtime-kit-rule.ts`, `uniqueId()`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 79`** (3 nodes): `buildLeaveKitChildren()`, `oa-leave-kit-rule.ts`, `uniqueId()`
+- **Thin community `Community 77`** (3 nodes): `buildLeaveKitChildren()`, `oa-leave-kit-rule.ts`, `uniqueId()`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 81`** (3 nodes): `buildConfirmationKitChildren()`, `oa-confirmation-kit-rule.ts`, `uniqueId()`
+- **Thin community `Community 79`** (3 nodes): `buildConfirmationKitChildren()`, `oa-confirmation-kit-rule.ts`, `uniqueId()`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 82`** (3 nodes): `buildResignationKitChildren()`, `oa-resignation-kit-rule.ts`, `uniqueId()`
+- **Thin community `Community 80`** (3 nodes): `buildResignationKitChildren()`, `oa-resignation-kit-rule.ts`, `uniqueId()`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 83`** (3 nodes): `copyTextToClipboard()`, `copyTextWithFallback()`, `copy-text.ts`
+- **Thin community `Community 81`** (3 nodes): `copyTextToClipboard()`, `copyTextWithFallback()`, `copy-text.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 85`** (3 nodes): `getSourceProtocolAttachment()`, `normalizeAttachmentFiles()`, `protocol-source-attachment.ts`
+- **Thin community `Community 83`** (3 nodes): `getSourceProtocolAttachment()`, `normalizeAttachmentFiles()`, `protocol-source-attachment.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 98`** (3 nodes): `emptyTabCounts()`, `useProductionWorkOrderTabStepCounts()`, `useProductionWorkOrderTabStepCounts.ts`
+- **Thin community `Community 96`** (3 nodes): `emptyTabCounts()`, `useProductionWorkOrderTabStepCounts()`, `useProductionWorkOrderTabStepCounts.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 100`** (3 nodes): `initialProgress()`, `useQcWorkOrderAttachmentExport()`, `useQcWorkOrderAttachmentExport.ts`
+- **Thin community `Community 98`** (3 nodes): `initialProgress()`, `useQcWorkOrderAttachmentExport()`, `useQcWorkOrderAttachmentExport.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
-- **Thin community `Community 101`** (3 nodes): `emptyTabCounts()`, `useQcWorkOrderTabUnfinishedCounts()`, `useQcWorkOrderTabUnfinishedCounts.ts`
+- **Thin community `Community 99`** (3 nodes): `emptyTabCounts()`, `useQcWorkOrderTabUnfinishedCounts()`, `useQcWorkOrderTabUnfinishedCounts.ts`
   Too small to be a meaningful cluster - may be noise or needs more connections extracted.
 
 ## Suggested Questions
 _Questions this graph is uniquely positioned to answer:_
 
-- **Why does `push()` connect `Community 2` to `Community 0`, `Community 1`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 22`, `Community 23`, `Community 26`, `Community 28`, `Community 29`, `Community 30`, `Community 31`, `Community 36`, `Community 37`?**
-  _High betweenness centrality (0.354) - this node is a cross-community bridge._
-- **Why does `get()` connect `Community 0` to `Community 1`, `Community 3`, `Community 4`, `Community 5`, `Community 6`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 24`, `Community 27`, `Community 28`, `Community 29`, `Community 31`, `Community 33`, `Community 35`, `Community 43`, `Community 45`, `Community 55`, `Community 62`, `Community 68`, `Community 69`, `Community 70`?**
-  _High betweenness centrality (0.254) - this node is a cross-community bridge._
-- **Why does `handleDynamicRoutes()` connect `Community 7` to `Community 5`, `Community 31`, `Community 28`, `Community 15`?**
-  _High betweenness centrality (0.049) - this node is a cross-community bridge._
+- **Why does `push()` connect `Community 1` to `Community 0`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 8`, `Community 9`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 21`, `Community 22`, `Community 23`, `Community 24`, `Community 25`, `Community 28`, `Community 30`, `Community 31`, `Community 32`, `Community 33`, `Community 37`, `Community 38`, `Community 48`?**
+  _High betweenness centrality (0.341) - this node is a cross-community bridge._
+- **Why does `get()` connect `Community 0` to `Community 1`, `Community 2`, `Community 3`, `Community 4`, `Community 5`, `Community 7`, `Community 8`, `Community 9`, `Community 11`, `Community 12`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 22`, `Community 25`, `Community 27`, `Community 29`, `Community 30`, `Community 31`, `Community 33`, `Community 34`, `Community 36`, `Community 43`, `Community 46`?**
+  _High betweenness centrality (0.243) - this node is a cross-community bridge._
+- **Why does `handleDynamicRoutes()` connect `Community 6` to `Community 33`, `Community 4`, `Community 15`, `Community 19`, `Community 25`?**
+  _High betweenness centrality (0.044) - this node is a cross-community bridge._
 - **Are the 312 inferred relationships involving `get()` (e.g. with `resolveStorageSlotRangeFill()` and `buildNodeCodePathFromFlat()`) actually correct?**
   _`get()` has 312 INFERRED edges - model-reasoned connections that need verification._
-- **Are the 121 inferred relationships involving `push()` (e.g. with `refreshQcMenuBadges()` and `collectLeafFacilityNodesInTreeOrder()`) actually correct?**
-  _`push()` has 121 INFERRED edges - model-reasoned connections that need verification._
+- **Are the 123 inferred relationships involving `push()` (e.g. with `refreshQcMenuBadges()` and `collectLeafFacilityNodesInTreeOrder()`) actually correct?**
+  _`push()` has 123 INFERRED edges - model-reasoned connections that need verification._
 - **Are the 29 inferred relationships involving `emit()` (e.g. with `handleSubmit()` and `handleDialogClose()`) actually correct?**
   _`emit()` has 29 INFERRED edges - model-reasoned connections that need verification._
 - **Are the 20 inferred relationships involving `set()` (e.g. with `buildNodeCodePathFromFlat()` and `collectLeafFacilityNodesInTreeOrder()`) actually correct?**

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
web-admin/graphify-out/graph.html


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 112 - 112
web-admin/graphify-out/graph.json


+ 9 - 9
web-admin/graphify-out/manifest.json

@@ -17,8 +17,8 @@
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/common/index.ts": 1781272556.3597305,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/directive/directive.d.ts": 1781272556.3601494,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/api/api.d.ts": 1781272556.3606477,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/components.d.ts": 1787040946.361369,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/auto-imports.d.ts": 1787040940.407554,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/components.d.ts": 1787042506.6568909,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/auto-imports.d.ts": 1787042491.5119462,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/store/index.ts": 1781272556.364766,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/router/index.ts": 1782394569.8806834,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/composables/useAttachmentActions.ts": 1783921717.4015942,
@@ -379,7 +379,7 @@
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/leave.ts": 1781272556.654047,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/sample-reception-check-item.ts": 1781272556.654672,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production.ts": 1785145511.6866825,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task-set.ts": 1787039061.3617992,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task-set.ts": 1787043810.5603614,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/infusion-schedule-handover.ts": 1781272556.6558568,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/outbound-release-review.ts": 1785303420.050366,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-third-party-item.ts": 1781272556.6567156,
@@ -414,7 +414,7 @@
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-task.ts": 1783327864.9737554,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-item-param.ts": 1782446790.5508618,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/env-detect-item.ts": 1781272556.668322,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts": 1787039070.2406821,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts": 1787042321.6183035,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-inspection-item-template.ts": 1786941804.968096,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-material-stock-check.ts": 1781424012.5471919,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/qc-material-usage.ts": 1781424013.8349903,
@@ -505,7 +505,7 @@
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/oa-approval/cc/index.vue": 1786416869.1902819,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/oa-approval/apps/index.vue": 1785993209.2907894,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/oa-approval/pending/index.vue": 1786416827.4376934,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-task-set/index.vue": 1787040834.6643767,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-task-set/index.vue": 1787042051.429468,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/waste-output/index.vue": 1787024617.8768702,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/output-type/index.vue": 1782893852.8585393,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/cell-product/index.vue": 1786945269.999362,
@@ -536,16 +536,16 @@
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue": 1783403211.24666,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/EditTaskInfoDialog.vue": 1782893853.6561613,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskOutputList.vue": 1783395073.7065923,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/DispatchTaskDialog.vue": 1787040894.705951,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/DispatchTaskDialog.vue": 1787042445.3518429,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskPaperAttachmentsPanel.vue": 1782893853.2361045,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/WorkOrderTaskSubList.vue": 1785209092.1710618,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskOutputProductDialog.vue": 1786945270.5325274,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/ProductionWorkOrderCardList.vue": 1787040834.664387,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/ProductionWorkOrderCardList.vue": 1787043602.256393,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/ForwardTaskDialog.vue": 1782893852.8302743,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/ProductionWorkOrderQcViewDialog.vue": 1782893852.7941833,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/WorkOrderTaskStepSubList.vue": 1782893852.736343,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/StepDetailActionBar.vue": 1782893852.7041657,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SaveProductionTaskSetDialog.vue": 1787040868.6299484,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SaveProductionTaskSetDialog.vue": 1787043857.3893995,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/ProductionWorkOrderTabBar.vue": 1783307222.9653108,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts": 1782811944.10899,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/DispatchStepDialog.vue": 1782893852.5906737,
@@ -731,7 +731,7 @@
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/core/RoutePermissionValidator.ts": 1781272559.4235668,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/core/index.ts": 1781272559.424284,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/core/IframeRouteManager.ts": 1781272559.425215,
-  "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/modules/sqxp.ts": 1787039071.0486112,
+  "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/modules/sqxp.ts": 1787041862.9855387,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/modules/index.ts": 1781272559.5419338,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/modules/exception.ts": 1781272559.549901,
   "/Users/wuzilong/work/00code/zkxw/web-admin/src/router/routes/staticRoutes.ts": 1781272559.596198,

+ 6 - 0
web-admin/src/api/production-task-set.ts

@@ -87,6 +87,12 @@ export function fetchCreateProductionTaskSetFromWorkOrder(data: {
   workOrderId: string
   setName: string
   remark?: string
+  items?: Array<{
+    taskName: string
+    routeId?: string
+    description?: string
+    remark?: string
+  }>
 }) {
   return request.post<ProductionTaskSet>({
     url: '/web/admin/production-task-sets/from-work-order',

+ 10 - 1
web-admin/src/api/production-task.ts

@@ -10,7 +10,16 @@ export function fetchCreateProductionTask(data: Record<string, any>) {
   return request.post({ url: '/web/admin/production-tasks', params: data })
 }
 
-export function fetchCreateProductionTasksFromSet(data: { workOrderId: string; setId: string }) {
+export function fetchCreateProductionTasksFromSet(data: {
+  workOrderId: string
+  setId: string
+  items?: Array<{
+    taskName: string
+    routeId?: string
+    description?: string
+    remark?: string
+  }>
+}) {
   return request.post<{ createdCount: number; list: any[] }>({
     url: '/web/admin/production-tasks/from-set',
     params: data

+ 1 - 1
web-admin/src/router/modules/sqxp.ts

@@ -929,7 +929,7 @@ export const sqxpAdminRoutes: AppRouteRecord[] = [
             path: 'production-task-set',
             component: '/production/production-task-set/index',
             meta: {
-              title: '生产任务集合',
+              title: '生产任务组合模版',
               keepAlive: true,
               menuCode: 'production:task-set:list'
             }

+ 243 - 108
web-admin/src/views/production/production-task-set/index.vue

@@ -140,7 +140,7 @@
       <el-dialog
         v-model="dialogVisible"
         :title="dialogTitle"
-        width="860px"
+        width="1200px"
         class="dialog-form-layout"
         align-center
         append-to-body
@@ -151,7 +151,7 @@
         <el-form
           ref="formRef"
           :model="formData"
-          :rules="isView ? {} : formRules"
+          :rules="formRules"
           label-position="top"
           class="biz-dialog-form"
           scroll-to-error
@@ -163,11 +163,10 @@
                 v-model="formData.setName"
                 placeholder="请输入集合名称"
                 maxlength="200"
-                :disabled="isView"
               />
             </el-form-item>
             <el-form-item label="状态" prop="status">
-              <el-radio-group v-model="formData.status" :disabled="isView">
+              <el-radio-group v-model="formData.status">
                 <el-radio value="1">启用</el-radio>
                 <el-radio value="0">停用</el-radio>
               </el-radio-group>
@@ -179,93 +178,132 @@
                 :rows="2"
                 placeholder="可选"
                 maxlength="512"
-                :disabled="isView"
               />
             </el-form-item>
-            <el-form-item class="form-col-span-2" prop="items">
-              <div class="set-items-toolbar">
-                <span class="set-items-title">任务条目</span>
-                <el-button v-if="!isView" class="btn-ghost" @click="addItem">
-                  <el-icon><Plus /></el-icon>添加条目
-                </el-button>
-              </div>
-              <el-table class="list-table" :data="formData.items" stripe :row-key="itemRowKey">
-                <el-table-column label="任务名称" min-width="160">
-                  <template #default="{ row }">
-                    <el-input
-                      v-model="row.taskName"
-                      placeholder="请输入任务名称"
-                      maxlength="200"
-                      :disabled="isView"
+            <el-form-item class="form-col-span-2 set-items-field" prop="items" label="任务条目">
+              <div class="set-items-block">
+                <div class="list-toolbar">
+                  <div class="list-toolbar-row">
+                    <el-button class="btn-main" type="primary" @click="addItem">
+                      <el-icon><Plus /></el-icon>添加条目
+                    </el-button>
+                  </div>
+                </div>
+                <div class="list-body list-wrap inner-table-wrap">
+                  <el-table
+                    class="list-table"
+                    :data="formData.items"
+                    stripe
+                    :row-key="itemRowKey"
+                  >
+                    <el-table-column
+                      type="index"
+                      label="序号"
+                      min-width="68"
+                      align="center"
+                      header-align="center"
+                      :index="(index) => index + 1"
                     />
-                  </template>
-                </el-table-column>
-                <el-table-column label="工艺路线" min-width="200">
-                  <template #default="{ row }">
-                    <el-select
-                      v-model="row.routeId"
-                      placeholder="输入路线名称检索(可选)"
-                      filterable
-                      remote
-                      reserve-keyword
-                      clearable
-                      style="width: 100%"
-                      :disabled="isView"
-                      :loading="routeLoading"
-                      :remote-method="remoteSearchRoutes"
-                      @visible-change="onRouteSelectVisible"
+                    <el-table-column
+                      label="任务名称"
+                      min-width="180"
+                      align="center"
+                      header-align="center"
                     >
-                      <el-option
-                        v-for="route in routeOptions"
-                        :key="route.id"
-                        :label="`${route.routeName}(${route.routeCode})`"
-                        :value="route.id"
-                      />
-                    </el-select>
-                  </template>
-                </el-table-column>
-                <el-table-column label="描述" min-width="160">
-                  <template #default="{ row }">
-                    <el-input
-                      v-model="row.description"
-                      placeholder="可选"
-                      maxlength="500"
-                      :disabled="isView"
-                    />
-                  </template>
-                </el-table-column>
-                <el-table-column label="备注" min-width="140">
-                  <template #default="{ row }">
-                    <el-input
-                      v-model="row.remark"
-                      placeholder="可选"
-                      maxlength="512"
-                      :disabled="isView"
-                    />
-                  </template>
-                </el-table-column>
-                <el-table-column v-if="!isView" label="操作" min-width="200" fixed="right">
-                  <template #default="{ $index }">
-                    <el-button
-                      class="btn-op-item"
-                      :disabled="$index === 0"
-                      @click="moveItem($index, -1)"
+                      <template #default="{ row }">
+                        <el-input
+                          v-model="row.taskName"
+                          placeholder="请输入任务名称"
+                          maxlength="200"
+                        />
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      label="工艺路线"
+                      min-width="220"
+                      align="center"
+                      header-align="center"
                     >
-                      <el-icon><Top /></el-icon>上移
-                    </el-button>
-                    <el-button
-                      class="btn-op-item"
-                      :disabled="$index === formData.items.length - 1"
-                      @click="moveItem($index, 1)"
+                      <template #default="{ row }">
+                        <el-select
+                          v-model="row.routeId"
+                          placeholder="输入路线名称检索(可选)"
+                          filterable
+                          remote
+                          reserve-keyword
+                          clearable
+                          style="width: 100%"
+                          :loading="routeLoading"
+                          :remote-method="remoteSearchRoutes"
+                          @visible-change="onRouteSelectVisible"
+                        >
+                          <el-option
+                            v-for="route in routeOptions"
+                            :key="route.id"
+                            :label="`${route.routeName}(${route.routeCode})`"
+                            :value="route.id"
+                          />
+                        </el-select>
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      label="描述"
+                      min-width="180"
+                      align="center"
+                      header-align="center"
                     >
-                      <el-icon><Bottom /></el-icon>下移
-                    </el-button>
-                    <el-button class="btn-op-item" @click="removeItem($index)">
-                      <el-icon><Delete /></el-icon>删除
-                    </el-button>
-                  </template>
-                </el-table-column>
-              </el-table>
+                      <template #default="{ row }">
+                        <el-input
+                          v-model="row.description"
+                          placeholder="可选"
+                          maxlength="500"
+                        />
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      label="备注"
+                      min-width="160"
+                      align="center"
+                      header-align="center"
+                    >
+                      <template #default="{ row }">
+                        <el-input
+                          v-model="row.remark"
+                          placeholder="可选"
+                          maxlength="512"
+                        />
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      label="操作"
+                      min-width="280"
+                      fixed="right"
+                      align="center"
+                      header-align="center"
+                    >
+                      <template #default="{ $index }">
+                        <el-button
+                          class="btn-op-item"
+                          :disabled="$index === 0"
+                          @click="moveItem($index, -1)"
+                        >
+                          <el-icon><Top /></el-icon>上移
+                        </el-button>
+                        <el-button
+                          class="btn-op-item"
+                          :disabled="$index === formData.items.length - 1"
+                          @click="moveItem($index, 1)"
+                        >
+                          <el-icon><Bottom /></el-icon>下移
+                        </el-button>
+                        <el-button class="btn-op-item" @click="removeItem($index)">
+                          <el-icon><Delete /></el-icon>删除
+                        </el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </div>
+              </div>
             </el-form-item>
           </div>
         </el-form>
@@ -274,7 +312,6 @@
             <el-icon><Close /></el-icon>取消
           </el-button>
           <el-button
-            v-if="!isView"
             class="btn-main"
             type="primary"
             :loading="submitLoading"
@@ -284,6 +321,67 @@
           </el-button>
         </template>
       </el-dialog>
+
+      <SystemViewDialog
+        v-model:visible="viewVisible"
+        :title="viewRow?.setName || '集合详情'"
+        :icon="Collection"
+        :sections="viewSections"
+        :loading="viewLoading"
+        width="960px"
+        :grid-columns="3"
+      >
+        <template #set-items>
+          <div v-if="viewItems.length" class="view-subtable-wrap">
+            <el-table :data="viewItems" stripe class="list-table view-subtable">
+              <el-table-column
+                type="index"
+                label="序号"
+                min-width="68"
+                align="center"
+                header-align="center"
+              />
+              <el-table-column
+                label="任务名称"
+                min-width="160"
+                align="center"
+                header-align="center"
+                show-overflow-tooltip
+              >
+                <template #default="{ row }">{{ row.taskName || '—' }}</template>
+              </el-table-column>
+              <el-table-column
+                label="工艺路线"
+                min-width="160"
+                align="center"
+                header-align="center"
+                show-overflow-tooltip
+              >
+                <template #default="{ row }">{{ row.routeName || '—' }}</template>
+              </el-table-column>
+              <el-table-column
+                label="描述"
+                min-width="160"
+                align="center"
+                header-align="center"
+                show-overflow-tooltip
+              >
+                <template #default="{ row }">{{ row.description || '—' }}</template>
+              </el-table-column>
+              <el-table-column
+                label="备注"
+                min-width="140"
+                align="center"
+                header-align="center"
+                show-overflow-tooltip
+              >
+                <template #default="{ row }">{{ row.remark || '—' }}</template>
+              </el-table-column>
+            </el-table>
+          </div>
+          <p v-else class="view-empty-hint">暂无任务条目</p>
+        </template>
+      </SystemViewDialog>
     </section>
   </div>
 </template>
@@ -303,9 +401,11 @@
     Switch,
     View,
     Top,
-    Bottom
+    Bottom,
+    Collection
   } from '@element-plus/icons-vue'
   import { useMenuPerm } from '@/hooks/core/useMenuPerm'
+  import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
   import { fetchProcessRouteList } from '@/api/production'
   import {
     fetchProductionTaskSetList,
@@ -332,14 +432,42 @@
   const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
   const dialogVisible = ref(false)
   const dialogTitle = ref('新增集合')
-  const dialogMode = ref<'add' | 'edit' | 'view'>('add')
+  const dialogMode = ref<'add' | 'edit'>('add')
   const submitLoading = ref(false)
   const formRef = ref()
   const editingId = ref<string | null>(null)
   const routeOptions = ref<any[]>([])
   const routeLoading = ref(false)
-
-  const isView = computed(() => dialogMode.value === 'view')
+  const viewVisible = ref(false)
+  const viewLoading = ref(false)
+  const viewRow = ref<ProductionTaskSet | null>(null)
+
+  const viewItems = computed(() => viewRow.value?.items || [])
+  const viewSections = computed(() => {
+    const row = viewRow.value
+    if (!row) return []
+    return [
+      {
+        title: '基本信息',
+        fields: [
+          { label: '集合名称', value: row.setName },
+          {
+            label: '状态',
+            value: row.status === '1' ? '启用' : '停用',
+            tagType: row.status === '1' ? 'success' : 'info'
+          },
+          { label: '任务条数', value: row.itemCount ?? viewItems.value.length },
+          { label: '创建时间', value: formatDisplayOrDash(row.createTime) },
+          { label: '备注', value: row.remark }
+        ]
+      },
+      {
+        title: '任务条目',
+        slot: 'set-items',
+        fields: []
+      }
+    ]
+  })
 
   const formData = reactive({
     setName: '',
@@ -488,9 +616,9 @@
     void remoteSearchRoutes('')
   }
 
-  async function openDetailDialog(row: ProductionTaskSet, mode: 'edit' | 'view') {
-    dialogMode.value = mode
-    dialogTitle.value = mode === 'edit' ? '编辑集合' : '查看集合'
+  async function handleEdit(row: ProductionTaskSet) {
+    dialogMode.value = 'edit'
+    dialogTitle.value = '编辑集合'
     resetForm()
     editingId.value = row.id
     const detail = await fetchProductionTaskSetDetail(row.id)
@@ -499,12 +627,15 @@
     void remoteSearchRoutes('')
   }
 
-  function handleEdit(row: ProductionTaskSet) {
-    void openDetailDialog(row, 'edit')
-  }
-
-  function handleView(row: ProductionTaskSet) {
-    void openDetailDialog(row, 'view')
+  async function handleView(row: ProductionTaskSet) {
+    viewRow.value = row
+    viewVisible.value = true
+    viewLoading.value = true
+    try {
+      viewRow.value = await fetchProductionTaskSetDetail(row.id)
+    } finally {
+      viewLoading.value = false
+    }
   }
 
   function buildPayload() {
@@ -565,16 +696,20 @@
 </script>
 
 <style scoped lang="scss">
-  .set-items-toolbar {
-    display: flex;
-    align-items: center;
-    gap: 12px;
-    margin-bottom: 8px;
+  .set-items-field :deep(.el-form-item__content) {
+    display: block;
+    width: 100%;
+    max-width: 100%;
+  }
+
+  .set-items-block {
+    width: 100%;
+    min-width: 0;
   }
 
-  .set-items-title {
-    font-size: 13px;
-    font-weight: 600;
-    color: #1e293b;
+  .inner-table-wrap {
+    border-top: 1px solid var(--mint-border, #e2e8f0);
+    border-radius: 0;
+    overflow: hidden;
   }
 </style>

+ 210 - 35
web-admin/src/views/production/production-work-order/DispatchTaskDialog.vue

@@ -5,8 +5,14 @@
     :title="
       phase === 'form' ? '派发生产任务' : `编辑生产任务 — ${createdTaskName || editTaskName || ''}`
     "
-    :width="phase === 'form' ? (dispatchMode === 'set' ? '720px' : '560px') : '90vw'"
-    :class="phase === 'edit' ? 'dialog-form-layout dispatch-route-dialog' : 'dispatch-dialog'"
+    :width="phase === 'form' ? (dispatchMode === 'set' ? '1200px' : '560px') : '90vw'"
+    :class="
+      phase === 'edit'
+        ? 'dialog-form-layout dispatch-route-dialog'
+        : dispatchMode === 'set'
+          ? 'dialog-form-layout dispatch-dialog'
+          : 'dispatch-dialog'
+    "
     align-center
     modal-class="protocol-dialog-mask"
     append-to-body
@@ -39,7 +45,7 @@
         <el-form-item v-if="!editTaskId && canUseSet" label="派发方式" class="form-col-span-2">
           <el-radio-group v-model="dispatchMode" @change="onDispatchModeChange">
             <el-radio-button value="single">单条任务</el-radio-button>
-            <el-radio-button value="set">任务集合</el-radio-button>
+            <el-radio-button value="set">任务组合模版</el-radio-button>
           </el-radio-group>
         </el-form-item>
         <template v-if="dispatchMode !== 'set'">
@@ -90,10 +96,10 @@
           </el-form-item>
         </template>
         <template v-else>
-          <el-form-item label="任务集合" class="form-col-span-2">
+          <el-form-item label="任务组合模版" class="form-col-span-2">
             <el-select
               v-model="selectedSetId"
-              placeholder="请选择任务集合"
+              placeholder="请选择任务组合模版"
               filterable
               clearable
               style="width: 100%"
@@ -108,25 +114,112 @@
               />
             </el-select>
           </el-form-item>
-          <el-form-item v-if="selectedSetId" label="集合预览" class="form-col-span-2">
-            <el-table class="list-table" :data="setPreviewItems" stripe max-height="280">
-              <el-table-column
-                prop="taskName"
-                label="任务名称"
-                min-width="140"
-                show-overflow-tooltip
-              />
-              <el-table-column label="工艺路线" min-width="140" show-overflow-tooltip>
-                <template #default="{ row }">{{ row.routeName || '—' }}</template>
-              </el-table-column>
-              <el-table-column
-                prop="description"
-                label="描述"
-                min-width="140"
-                show-overflow-tooltip
-              />
-              <el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip />
-            </el-table>
+          <el-form-item
+            v-if="selectedSetId"
+            label="任务条目"
+            class="form-col-span-2 set-items-field"
+          >
+            <div class="set-items-block">
+              <div class="list-toolbar">
+                <div class="list-toolbar-row">
+                  <el-button class="btn-main" type="primary" @click="addDispatchItem">
+                    <el-icon><Plus /></el-icon>添加条目
+                  </el-button>
+                </div>
+              </div>
+              <div class="list-body list-wrap inner-table-wrap">
+                <el-table
+                  class="list-table"
+                  :data="setDispatchItems"
+                  stripe
+                  :row-key="dispatchItemRowKey"
+                >
+                  <el-table-column
+                    type="index"
+                    label="序号"
+                    min-width="68"
+                    align="center"
+                    header-align="center"
+                    :index="(index) => index + 1"
+                  />
+                  <el-table-column
+                    label="任务名称"
+                    min-width="180"
+                    align="center"
+                    header-align="center"
+                  >
+                    <template #default="{ row }">
+                      <el-input
+                        v-model="row.taskName"
+                        placeholder="请输入任务名称"
+                        maxlength="200"
+                      />
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="工艺路线"
+                    min-width="220"
+                    align="center"
+                    header-align="center"
+                  >
+                    <template #default="{ row }">
+                      <el-select
+                        v-model="row.routeId"
+                        placeholder="输入路线名称检索(可选)"
+                        filterable
+                        remote
+                        reserve-keyword
+                        clearable
+                        style="width: 100%"
+                        :loading="routeLoading"
+                        :remote-method="remoteSearchRoutes"
+                        @visible-change="onRouteSelectVisible"
+                      >
+                        <el-option
+                          v-for="route in routeOptions"
+                          :key="route.id"
+                          :label="`${route.routeName}(${route.routeCode})`"
+                          :value="route.id"
+                        />
+                      </el-select>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="描述"
+                    min-width="180"
+                    align="center"
+                    header-align="center"
+                  >
+                    <template #default="{ row }">
+                      <el-input v-model="row.description" placeholder="可选" maxlength="500" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="备注"
+                    min-width="160"
+                    align="center"
+                    header-align="center"
+                  >
+                    <template #default="{ row }">
+                      <el-input v-model="row.remark" placeholder="可选" maxlength="512" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="操作"
+                    min-width="120"
+                    fixed="right"
+                    align="center"
+                    header-align="center"
+                  >
+                    <template #default="{ $index }">
+                      <el-button class="btn-op-item" @click="removeDispatchItem($index)">
+                        <el-icon><Delete /></el-icon>删除
+                      </el-button>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
           </el-form-item>
         </template>
       </div>
@@ -379,8 +472,47 @@
   const dispatchMode = ref<'single' | 'set'>('single')
   const selectedSetId = ref('')
   const setOptions = ref<ProductionTaskSet[]>([])
-  const setPreviewItems = ref<ProductionTaskSetItem[]>([])
+  const setDispatchItems = ref<Array<ProductionTaskSetItem & { _key: string }>>([])
   const setLoading = ref(false)
+  let dispatchItemKeySeq = 0
+
+  function createDispatchItem(partial?: Partial<ProductionTaskSetItem>) {
+    dispatchItemKeySeq += 1
+    return {
+      _key: `dispatch-item-${dispatchItemKeySeq}`,
+      taskName: partial?.taskName || '',
+      routeId: partial?.routeId || '',
+      routeName: partial?.routeName || '',
+      description: partial?.description || '',
+      remark: partial?.remark || ''
+    }
+  }
+
+  function dispatchItemRowKey(row: { _key: string }) {
+    return row._key
+  }
+
+  function addDispatchItem() {
+    setDispatchItems.value.push(createDispatchItem())
+  }
+
+  function removeDispatchItem(index: number) {
+    setDispatchItems.value.splice(index, 1)
+  }
+
+  function seedRouteOptionsFromItems(items: ProductionTaskSetItem[]) {
+    const seen = new Set(routeOptions.value.map((r) => r.id))
+    for (const item of items) {
+      const id = String(item.routeId || '').trim()
+      if (!id || seen.has(id)) continue
+      seen.add(id)
+      routeOptions.value.push({
+        id,
+        routeName: item.routeName || id,
+        routeCode: ''
+      })
+    }
+  }
 
   const editor = useTaskStepEditor()
   const {
@@ -445,7 +577,7 @@
   function resetSetDispatchState() {
     dispatchMode.value = 'single'
     selectedSetId.value = ''
-    setPreviewItems.value = []
+    setDispatchItems.value = []
     setOptions.value = []
   }
 
@@ -463,21 +595,25 @@
 
   function onDispatchModeChange() {
     selectedSetId.value = ''
-    setPreviewItems.value = []
+    setDispatchItems.value = []
     if (dispatchMode.value === 'set') {
       void loadActiveSets()
+      void remoteSearchRoutes('')
     }
   }
 
   async function onSelectedSetChange(id: string) {
-    setPreviewItems.value = []
+    setDispatchItems.value = []
     const setId = String(id || '').trim()
     if (!setId) return
     try {
       const detail = await fetchProductionTaskSetDetail(setId)
-      setPreviewItems.value = detail?.items || []
+      const items = detail?.items || []
+      setDispatchItems.value = items.map((item) => createDispatchItem(item))
+      seedRouteOptionsFromItems(items)
+      void remoteSearchRoutes('')
     } catch {
-      setPreviewItems.value = []
+      setDispatchItems.value = []
     }
   }
 
@@ -501,17 +637,25 @@
     const setId = String(selectedSetId.value || '').trim()
     const workOrderId = String(props.workOrderRow?.id || '').trim()
     if (!setId) {
-      ElMessage.warning('请选择任务集合')
+      ElMessage.warning('请选择任务组合模版')
       return
     }
-    if (!setPreviewItems.value.length) {
-      ElMessage.warning('集合没有可派发的任务')
+    const items = setDispatchItems.value
+      .filter((item) => String(item.taskName || '').trim())
+      .map((item) => ({
+        taskName: String(item.taskName).trim(),
+        routeId: String(item.routeId || '').trim() || undefined,
+        description: String(item.description || '').trim() || undefined,
+        remark: String(item.remark || '').trim() || undefined
+      }))
+    if (!items.length) {
+      ElMessage.warning('请至少添加一条任务名称非空的条目')
       return
     }
     submitting.value = true
     try {
-      const result = await fetchCreateProductionTasksFromSet({ workOrderId, setId })
-      ElMessage.success(`已生成 ${result?.createdCount || setPreviewItems.value.length} 条生产任务`)
+      const result = await fetchCreateProductionTasksFromSet({ workOrderId, setId, items })
+      ElMessage.success(`已生成 ${result?.createdCount || items.length} 条生产任务`)
       pendingListRefresh.value = true
       handleClose()
     } catch {
@@ -698,4 +842,35 @@
       padding: 0 10px;
     }
   }
+
+  .set-items-field :deep(.el-form-item__content) {
+    display: block;
+    width: 100%;
+    max-width: 100%;
+  }
+
+  .set-items-block {
+    display: flex;
+    flex-direction: column;
+    gap: 12px;
+    width: 100%;
+    min-width: 0;
+
+    :deep(.list-toolbar) {
+      padding: 0;
+      margin: 0;
+      background: transparent;
+      border: none;
+    }
+
+    :deep(.list-toolbar-row) {
+      padding: 0;
+    }
+  }
+
+  .inner-table-wrap {
+    border-top: 1px solid var(--mint-border, #e2e8f0);
+    border-radius: 0;
+    overflow: hidden;
+  }
 </style>

+ 23 - 14
web-admin/src/views/production/production-work-order/ProductionWorkOrderCardList.vue

@@ -72,6 +72,13 @@
                 >
                   <el-icon><View /></el-icon>查看
                 </el-button>
+                <el-button
+                  v-if="canSaveTaskSet(row)"
+                  class="btn-op-item"
+                  @click="emit('command', 'save-set', row)"
+                >
+                  <el-icon><FolderAdd /></el-icon>保存为模版
+                </el-button>
                 <el-button class="btn-op-item" @click="emit('view-qc', row)">
                   <el-icon><DataLine /></el-icon>查看质检数据
                 </el-button>
@@ -118,9 +125,6 @@
                       <el-dropdown-item v-if="canDispatchTask(row)" command="view">
                         <el-icon><View /></el-icon>查看
                       </el-dropdown-item>
-                      <el-dropdown-item v-if="canSaveTaskSet(row)" command="save-set">
-                        <el-icon><FolderAdd /></el-icon>存为任务集合
-                      </el-dropdown-item>
                       <el-dropdown-item v-if="canEditWorkOrder(row)" command="edit">
                         <el-icon><EditPen /></el-icon>编辑
                       </el-dropdown-item>
@@ -318,7 +322,6 @@
   import type { TagType } from '@/utils/status-tag-registry'
   import { productStatusLabel, productStatusTagType } from '@/utils/status-tag-registry'
   import { useUserStore } from '@/store/modules/user'
-  import { useMenuPerm } from '@/hooks/core/useMenuPerm'
   import { sumProductionWorkOrderStepBadgeCount } from '@/utils/production-work-order-step-badge'
   import WorkOrderTaskSubList from './WorkOrderTaskSubList.vue'
   import ProductionStepBadge from './ProductionStepBadge.vue'
@@ -355,7 +358,6 @@
   )
 
   const userStore = useUserStore()
-  const { hasMenuPerm } = useMenuPerm()
   const isMineMode = computed(() => props.pageMode === 'mine')
 
   function resolveCurrentUserId() {
@@ -551,19 +553,12 @@
 
   function canSaveTaskSet(row: ProductionWorkOrderItem) {
     if (isMineMode.value) return false
-    if (!hasMenuPerm('production:task-set:add')) return false
     const tasks = resolvePresetTasks(row.id)
     return Array.isArray(tasks) && tasks.some((t) => String(t?.taskName || '').trim())
   }
 
   function hasMoreActions(row: ProductionWorkOrderItem) {
-    return (
-      canDispatchTask(row) ||
-      canSaveTaskSet(row) ||
-      canEditWorkOrder(row) ||
-      canDeleteWorkOrder(row) ||
-      true
-    )
+    return canDispatchTask(row) || canEditWorkOrder(row) || canDeleteWorkOrder(row) || true
   }
 </script>
 
@@ -817,9 +812,23 @@
     flex-wrap: wrap;
     align-items: center;
     justify-content: flex-end;
-    gap: 6px;
+    gap: 8px;
     flex-shrink: 0;
     margin-left: auto;
+
+    /* 统一用 gap 控制间距,去掉 Element Plus 相邻按钮默认 margin,避免夹 tooltip/dropdown 时疏密不一 */
+    :deep(.el-button),
+    :deep(.el-button + .el-button),
+    :deep(.el-button + .el-dropdown),
+    :deep(.el-dropdown) {
+      margin-left: 0;
+      margin-right: 0;
+    }
+
+    :deep(.el-tooltip__trigger),
+    :deep(.el-dropdown) {
+      display: inline-flex;
+    }
   }
 
   :deep(.production-work-order-card__fee-in-head) {

+ 268 - 40
web-admin/src/views/production/production-work-order/SaveProductionTaskSetDialog.vue

@@ -1,10 +1,10 @@
-<!-- 将当前工单已派发任务存为生产任务集合 -->
+<!-- 将当前工单已派发任务生成生产任务组合模版 -->
 <!-- eslint-disable vue/no-v-model-argument -->
 <template>
   <el-dialog
     v-model="dialogVisible"
-    title="存为任务集合"
-    width="720px"
+    title="保存为模版"
+    width="1200px"
     class="dialog-form-layout"
     align-center
     append-to-body
@@ -21,8 +21,8 @@
       class="biz-dialog-form"
     >
       <div class="form-grid-2">
-        <el-form-item label="集合名称" prop="setName" class="form-col-span-2">
-          <el-input v-model="form.setName" placeholder="请输入集合名称" maxlength="200" />
+        <el-form-item label="模版名称" prop="setName" class="form-col-span-2">
+          <el-input v-model="form.setName" placeholder="请输入模版名称" maxlength="200" />
         </el-form-item>
         <el-form-item label="备注" class="form-col-span-2">
           <el-input
@@ -33,29 +33,106 @@
             maxlength="512"
           />
         </el-form-item>
-        <el-form-item label="将保存的任务" class="form-col-span-2">
-          <p v-if="!preview.items.length" class="hint-muted">没有可保存的任务名称</p>
-          <p v-else-if="preview.skippedEmptyNameCount" class="hint-muted">
-            将跳过 {{ preview.skippedEmptyNameCount }} 条空名称任务
-          </p>
-          <el-table v-if="preview.items.length" class="list-table" :data="preview.items" stripe>
-            <el-table-column
-              prop="taskName"
-              label="任务名称"
-              min-width="140"
-              show-overflow-tooltip
-            />
-            <el-table-column label="工艺路线" min-width="140" show-overflow-tooltip>
-              <template #default="{ row }">{{ row.routeName || '—' }}</template>
-            </el-table-column>
-            <el-table-column
-              prop="description"
-              label="描述"
-              min-width="140"
-              show-overflow-tooltip
-            />
-            <el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip />
-          </el-table>
+        <el-form-item class="form-col-span-2 set-items-field" prop="items" label="将保存的任务">
+          <div class="set-items-block">
+            <div class="list-toolbar">
+              <div class="list-toolbar-row">
+                <el-button class="btn-main" type="primary" @click="addItem">
+                  <el-icon><Plus /></el-icon>添加条目
+                </el-button>
+              </div>
+            </div>
+            <p v-if="emptyNameCount" class="hint-muted">
+              将跳过 {{ emptyNameCount }} 条空名称任务
+            </p>
+            <div class="list-body list-wrap inner-table-wrap">
+              <el-table class="list-table" :data="form.items" stripe :row-key="itemRowKey">
+                <el-table-column
+                  type="index"
+                  label="序号"
+                  min-width="68"
+                  align="center"
+                  header-align="center"
+                  :index="(index) => index + 1"
+                />
+                <el-table-column
+                  label="任务名称"
+                  min-width="180"
+                  align="center"
+                  header-align="center"
+                >
+                  <template #default="{ row }">
+                    <el-input
+                      v-model="row.taskName"
+                      placeholder="请输入任务名称"
+                      maxlength="200"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="工艺路线"
+                  min-width="220"
+                  align="center"
+                  header-align="center"
+                >
+                  <template #default="{ row }">
+                    <el-select
+                      v-model="row.routeId"
+                      placeholder="输入路线名称检索(可选)"
+                      filterable
+                      remote
+                      reserve-keyword
+                      clearable
+                      style="width: 100%"
+                      :loading="routeLoading"
+                      :remote-method="remoteSearchRoutes"
+                      @visible-change="onRouteSelectVisible"
+                    >
+                      <el-option
+                        v-for="route in routeOptions"
+                        :key="route.id"
+                        :label="`${route.routeName}(${route.routeCode})`"
+                        :value="route.id"
+                      />
+                    </el-select>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="描述"
+                  min-width="180"
+                  align="center"
+                  header-align="center"
+                >
+                  <template #default="{ row }">
+                    <el-input v-model="row.description" placeholder="可选" maxlength="500" />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="备注"
+                  min-width="160"
+                  align="center"
+                  header-align="center"
+                >
+                  <template #default="{ row }">
+                    <el-input v-model="row.remark" placeholder="可选" maxlength="512" />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="操作"
+                  min-width="120"
+                  fixed="right"
+                  align="center"
+                  header-align="center"
+                >
+                  <template #default="{ $index }">
+                    <el-button class="btn-op-item" @click="removeItem($index)">
+                      <el-icon><Delete /></el-icon>删除
+                    </el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+          </div>
         </el-form-item>
       </div>
     </el-form>
@@ -67,7 +144,7 @@
         class="btn-main"
         type="primary"
         :loading="submitting"
-        :disabled="!preview.items.length"
+        :disabled="!validItems.length"
         @click="handleSubmit"
       >
         <el-icon><Check /></el-icon>确定
@@ -78,13 +155,19 @@
 
 <script setup lang="ts">
   import { ElMessage } from 'element-plus'
-  import { Close, Check } from '@element-plus/icons-vue'
+  import { Close, Check, Plus, Delete } from '@element-plus/icons-vue'
   import type { FormInstance, FormRules } from 'element-plus'
-  import { fetchCreateProductionTaskSetFromWorkOrder } from '@/api/production-task-set'
+  import { fetchProcessRouteList } from '@/api/production'
+  import {
+    fetchCreateProductionTaskSetFromWorkOrder,
+    type ProductionTaskSetItem
+  } from '@/api/production-task-set'
   import { mapWorkOrderTasksToSetItems } from '@/utils/production-task-set'
 
   defineOptions({ name: 'SaveProductionTaskSetDialog' })
 
+  type FormItem = ProductionTaskSetItem & { _key: string }
+
   const props = defineProps<{
     visible: boolean
     workOrderId: string
@@ -103,32 +186,146 @@
 
   const formRef = ref<FormInstance>()
   const submitting = ref(false)
-  const form = reactive({ setName: '', remark: '' })
+  const routeOptions = ref<any[]>([])
+  const routeLoading = ref(false)
+  const form = reactive({
+    setName: '',
+    remark: '',
+    items: [] as FormItem[]
+  })
+
+  const validateItems = (_rule: unknown, _value: unknown, callback: (e?: Error) => void) => {
+    if (!form.items.some((item) => String(item.taskName || '').trim())) {
+      callback(new Error('请至少添加一条任务名称非空的条目'))
+      return
+    }
+    callback()
+  }
+
   const rules: FormRules = {
-    setName: [{ required: true, message: '请输入集合名称', trigger: 'blur' }]
+    setName: [{ required: true, message: '请输入模版名称', trigger: 'blur' }],
+    items: [{ validator: validateItems, trigger: 'change' }]
   }
 
-  const preview = computed(() => mapWorkOrderTasksToSetItems(props.tasks))
+  const validItems = computed(() =>
+    form.items.filter((item) => String(item.taskName || '').trim())
+  )
+  const emptyNameCount = computed(() => form.items.length - validItems.value.length)
 
-  function handleClose() {
-    dialogVisible.value = false
+  let itemKeySeq = 0
+  function createItem(partial?: Partial<ProductionTaskSetItem>): FormItem {
+    itemKeySeq += 1
+    return {
+      _key: `save-set-item-${itemKeySeq}`,
+      taskName: partial?.taskName || '',
+      routeId: partial?.routeId || '',
+      routeName: partial?.routeName || '',
+      description: partial?.description || '',
+      remark: partial?.remark || ''
+    }
+  }
+
+  function itemRowKey(row: FormItem) {
+    return row._key
+  }
+
+  function addItem() {
+    form.items.push(createItem())
+  }
+
+  function removeItem(index: number) {
+    form.items.splice(index, 1)
+    if (!form.items.length) {
+      form.items.push(createItem())
+    }
+  }
+
+  async function remoteSearchRoutes(query: string) {
+    routeLoading.value = true
+    try {
+      const kw = query?.trim()
+      const res = await fetchProcessRouteList({
+        page: 1,
+        pageSize: 100,
+        routeName: kw || undefined
+      })
+      routeOptions.value = res.list || []
+      seedRouteOptionsFromItems(form.items)
+    } catch {
+      routeOptions.value = []
+      seedRouteOptionsFromItems(form.items)
+    } finally {
+      routeLoading.value = false
+    }
+  }
+
+  function onRouteSelectVisible(visible: boolean) {
+    if (visible) void remoteSearchRoutes('')
+  }
+
+  function seedRouteOptionsFromItems(items: ProductionTaskSetItem[]) {
+    const seen = new Set(routeOptions.value.map((r) => r.id))
+    for (const item of items) {
+      const id = String(item.routeId || '').trim()
+      if (!id || seen.has(id)) continue
+      seen.add(id)
+      routeOptions.value.push({
+        id,
+        routeName: item.routeName || id,
+        routeCode: ''
+      })
+    }
+  }
+
+  async function initForm() {
     form.setName = ''
     form.remark = ''
+    const mapped = mapWorkOrderTasksToSetItems(props.tasks)
+    form.items = mapped.items.length
+      ? mapped.items.map((item) => createItem(item))
+      : [createItem()]
+    await remoteSearchRoutes('')
+  }
+
+  function resetForm() {
+    form.setName = ''
+    form.remark = ''
+    form.items = []
+    routeOptions.value = []
+  }
+
+  function handleClose() {
+    dialogVisible.value = false
+    resetForm()
   }
 
+  watch(
+    () => props.visible,
+    (val) => {
+      if (val) void initForm()
+    }
+  )
+
   async function handleSubmit() {
-    if (!preview.value.items.length) {
-      ElMessage.warning('没有可保存的任务名称')
+    if (!validItems.value.length) {
+      ElMessage.warning('请至少添加一条任务名称非空的条目')
       return
     }
     const valid = await formRef.value?.validate?.().catch(() => false)
     if (!valid) return
     submitting.value = true
     try {
+      const items = validItems.value.map((item) => ({
+        taskName: String(item.taskName).trim(),
+        routeId: String(item.routeId || '').trim() || undefined,
+        description: String(item.description || '').trim() || undefined,
+        remark: String(item.remark || '').trim() || undefined
+      }))
       const result = await fetchCreateProductionTaskSetFromWorkOrder({
         workOrderId: props.workOrderId,
         setName: form.setName.trim(),
-        remark: form.remark || undefined
+        remark: form.remark || undefined,
+        items
       })
       const skipped = Number(result?.skippedEmptyNameCount || 0)
       ElMessage.success(skipped > 0 ? `保存成功,已跳过 ${skipped} 条空名称任务` : '保存成功')
@@ -144,8 +341,39 @@
 
 <style scoped lang="scss">
   .hint-muted {
-    margin: 0 0 8px;
+    margin: 0;
     font-size: 12px;
     color: var(--mint-text-muted, #94a3b8);
   }
+
+  .set-items-field :deep(.el-form-item__content) {
+    display: block;
+    width: 100%;
+    max-width: 100%;
+  }
+
+  .set-items-block {
+    display: flex;
+    flex-direction: column;
+    gap: 12px;
+    width: 100%;
+    min-width: 0;
+
+    :deep(.list-toolbar) {
+      padding: 0;
+      margin: 0;
+      background: transparent;
+      border: none;
+    }
+
+    :deep(.list-toolbar-row) {
+      padding: 0;
+    }
+  }
+
+  .inner-table-wrap {
+    border-top: 1px solid var(--mint-border, #e2e8f0);
+    border-radius: 0;
+    overflow: hidden;
+  }
 </style>

+ 0 - 1133
待同步到生产的sql脚本

@@ -1,1133 +0,0 @@
--- 员工微信服务号 openid / unionid 绑定字段(OA 审批通知)
--- MySQL 5.7:唯一索引允许多个 NULL
-
-ALTER TABLE `sys_user`
-  ADD COLUMN `wx_mp_openid` varchar(64) DEFAULT NULL COMMENT '微信服务号 openid' AFTER `wx_openid`,
-  ADD COLUMN `wx_unionid` varchar(64) DEFAULT NULL COMMENT '微信开放平台 unionid' AFTER `wx_mp_openid`,
-  ADD COLUMN `wx_mp_bind_time` datetime DEFAULT NULL COMMENT '服务号绑定时间' AFTER `wx_unionid`;
-
-ALTER TABLE `sys_user`
-  ADD UNIQUE INDEX `uk_sys_user_wx_mp_openid` (`wx_mp_openid`);
-
-ALTER TABLE `sys_user`
-  ADD INDEX `idx_sys_user_wx_unionid` (`wx_unionid`);
-
-
-  -- 将「开启微信通知」(OA007) 授予全部未删除角色
-  -- 前置:已执行 docs/sql/mobile_menu_oa_wechat_notify.sql(菜单须已存在)
-  -- 幂等:可重复执行;已有有效授权跳过;软删则恢复
-  -- 说明:
-  --   1) 用户变量显式 utf8mb4_unicode_ci,避免 collation 混用报错 1267
-  --   2) 主键用 MD5(role_id|menu_id),避免 INSERT…SELECT 中 UUID() 只算一次导致重复主键
-  
-  SET @menu_id = CONVERT('MINI000000000000000000000000OA007' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-  SET @tenant_no = CONVERT('zkxw' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-  
-  -- 1) 恢复历史上已软删的授权(按 role_id + menu_id)
-  UPDATE sys_role_menu rm
-  INNER JOIN sys_role r
-    ON r.id COLLATE utf8mb4_unicode_ci = rm.role_id COLLATE utf8mb4_unicode_ci
-   AND r.del_flag = 0
-   AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-  SET
-    rm.del_flag = 0,
-    rm.update_time = NOW(),
-    rm.remark = 'grant wechat-notify to all roles'
-  WHERE rm.menu_id COLLATE utf8mb4_unicode_ci = @menu_id
-    AND rm.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-    AND rm.del_flag = 1;
-  
-  -- 2) 为尚未关联该菜单的角色新增授权
-  INSERT INTO sys_role_menu (
-    id, role_id, menu_id, tenant_no, order_num, remark,
-    create_by, create_dept_id, create_time, update_by, update_time, del_flag
-  )
-  SELECT
-    UPPER(MD5(CONCAT(r.id, '|', @menu_id))),
-    r.id,
-    @menu_id,
-    @tenant_no,
-    0,
-    'grant wechat-notify to all roles',
-    'admin',
-    '',
-    NOW(),
-    NULL,
-    NOW(),
-    0
-  FROM sys_role r
-  WHERE r.del_flag = 0
-    AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-    AND EXISTS (
-      SELECT 1 FROM sys_menu m
-      WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_id
-        AND m.del_flag = 0
-    )
-    AND NOT EXISTS (
-      SELECT 1 FROM sys_role_menu rm
-      WHERE rm.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-        AND rm.menu_id COLLATE utf8mb4_unicode_ci = @menu_id
-        AND rm.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-        AND rm.del_flag = 0
-    );
-
-    
-    -- 小程序「发起审批」菜单种子(挂在「移动端菜单」根下)
--- 执行前请确认移动端根存在;角色授权请在 Web「角色管理」勾选本菜单。
-
-SET @mini_root = (
-  SELECT id FROM sys_menu
-  WHERE del_flag = 0 AND parent_id = '0' AND menu_name LIKE '%移动端%'
-  LIMIT 1
-);
-
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  'MINI000000000000000000000000OA001',
-  '发起审批',
-  @mini_root,
-  'C',
-  '/pages/oa/start/index',
-  NULL,
-  'mini:oa:start',
-  1,
-  '1',
-  '1',
-  'zkxw',
-  10,
-  '小程序发起审批',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM DUAL
-WHERE @mini_root IS NOT NULL
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_menu WHERE id = 'MINI000000000000000000000000OA001' AND del_flag = 0
-  );
-
-  -- 小程序 OA 五中心菜单种子(挂在「移动端菜单」根下)
--- 前置:docs/sql/mobile_menu_oa_start.sql(发起审批 OA001)可已执行
--- 角色授权请在 Web「角色管理」勾选本菜单。
-
-SET @mini_root = (
-  SELECT id FROM sys_menu
-  WHERE del_flag = 0 AND parent_id = '0' AND menu_name LIKE '%移动端%'
-  LIMIT 1
-);
-
--- 草稿箱
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  'MINI000000000000000000000000OA002',
-  '草稿箱',
-  @mini_root,
-  'C',
-  '/pages/oa/drafts/index',
-  NULL,
-  'mini:oa:drafts',
-  1,
-  '1',
-  '1',
-  'zkxw',
-  20,
-  '小程序草稿箱',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM DUAL
-WHERE @mini_root IS NOT NULL
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_menu WHERE id = 'MINI000000000000000000000000OA002' AND del_flag = 0
-  );
-
--- 待办中心
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  'MINI000000000000000000000000OA003',
-  '待办中心',
-  @mini_root,
-  'C',
-  '/pages/oa/pending/index',
-  NULL,
-  'mini:oa:pending',
-  1,
-  '1',
-  '1',
-  'zkxw',
-  30,
-  '小程序待办中心',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM DUAL
-WHERE @mini_root IS NOT NULL
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_menu WHERE id = 'MINI000000000000000000000000OA003' AND del_flag = 0
-  );
-
--- 已办中心
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  'MINI000000000000000000000000OA004',
-  '已办中心',
-  @mini_root,
-  'C',
-  '/pages/oa/done/index',
-  NULL,
-  'mini:oa:done',
-  1,
-  '1',
-  '1',
-  'zkxw',
-  40,
-  '小程序已办中心',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM DUAL
-WHERE @mini_root IS NOT NULL
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_menu WHERE id = 'MINI000000000000000000000000OA004' AND del_flag = 0
-  );
-
--- 我发起的
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  'MINI000000000000000000000000OA005',
-  '我发起的',
-  @mini_root,
-  'C',
-  '/pages/oa/mine/index',
-  NULL,
-  'mini:oa:mine',
-  1,
-  '1',
-  '1',
-  'zkxw',
-  50,
-  '小程序我发起的',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM DUAL
-WHERE @mini_root IS NOT NULL
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_menu WHERE id = 'MINI000000000000000000000000OA005' AND del_flag = 0
-  );
-
--- 抄送我的
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  'MINI000000000000000000000000OA006',
-  '抄送我的',
-  @mini_root,
-  'C',
-  '/pages/oa/cc/index',
-  NULL,
-  'mini:oa:cc',
-  1,
-  '1',
-  '1',
-  'zkxw',
-  60,
-  '小程序抄送我的',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM DUAL
-WHERE @mini_root IS NOT NULL
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_menu WHERE id = 'MINI000000000000000000000000OA006' AND del_flag = 0
-  );
-
-  -- 小程序「开启微信通知」菜单(抄送我的之后)
--- 前置:docs/sql/mobile_menu_oa_task_centers.sql(OA006)可已执行
--- 角色授权请在 Web「角色管理」勾选本菜单。
-
-SET @mini_root = (
-  SELECT id FROM sys_menu
-  WHERE del_flag = 0 AND parent_id = '0' AND menu_name LIKE '%移动端%'
-  LIMIT 1
-);
-
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  'MINI000000000000000000000000OA007',
-  '开启微信通知',
-  @mini_root,
-  'C',
-  '/pages/oa/wechat-notify/index',
-  NULL,
-  'mini:oa:wechat-notify',
-  1,
-  '1',
-  '1',
-  'zkxw',
-  70,
-  '小程序开启微信通知(关注+绑定)',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM DUAL
-WHERE @mini_root IS NOT NULL
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_menu WHERE id = 'MINI000000000000000000000000OA007' AND del_flag = 0
-  );
-
-
--- 将「移动端菜单」根及其全部子孙菜单,授予全部未删除角色
--- 前置:移动端根菜单已存在(parent_id=0 且名称含「移动端」)
--- 幂等:可重复执行;已有有效授权跳过;软删则恢复
--- 说明:
---   1) 用户变量显式 utf8mb4_unicode_ci,避免 collation 混用报错 1267
---   2) 主键用 MD5(role_id|menu_id),避免 INSERT…SELECT 中 UUID() 只算一次导致重复主键
---   3) MySQL 5.7 无递归 CTE,按最多 3 层子孙展开(根→一级→二级→三级)
-
-SET @tenant_no = CONVERT('zkxw' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-
-SET @mini_root = (
-  SELECT CONVERT(id USING utf8mb4) COLLATE utf8mb4_unicode_ci
-  FROM sys_menu
-  WHERE del_flag = 0
-    AND parent_id COLLATE utf8mb4_unicode_ci = CONVERT('0' USING utf8mb4) COLLATE utf8mb4_unicode_ci
-    AND menu_name LIKE '%移动端%'
-    AND tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-  LIMIT 1
-);
-
--- 1) 恢复历史上已软删的授权(菜单属于移动端树)
-UPDATE sys_role_menu rm
-INNER JOIN sys_role r
-  ON r.id COLLATE utf8mb4_unicode_ci = rm.role_id COLLATE utf8mb4_unicode_ci
- AND r.del_flag = 0
- AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-INNER JOIN sys_menu m
-  ON m.id COLLATE utf8mb4_unicode_ci = rm.menu_id COLLATE utf8mb4_unicode_ci
- AND m.del_flag = 0
- AND m.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
- AND (
-   m.id COLLATE utf8mb4_unicode_ci = @mini_root
-   OR m.parent_id COLLATE utf8mb4_unicode_ci = @mini_root
-   OR EXISTS (
-     SELECT 1 FROM sys_menu p1
-     WHERE p1.del_flag = 0
-       AND p1.id COLLATE utf8mb4_unicode_ci = m.parent_id COLLATE utf8mb4_unicode_ci
-       AND p1.parent_id COLLATE utf8mb4_unicode_ci = @mini_root
-   )
-   OR EXISTS (
-     SELECT 1 FROM sys_menu p1
-     INNER JOIN sys_menu p2
-       ON p2.del_flag = 0
-      AND p2.id COLLATE utf8mb4_unicode_ci = p1.parent_id COLLATE utf8mb4_unicode_ci
-     WHERE p1.del_flag = 0
-       AND p1.id COLLATE utf8mb4_unicode_ci = m.parent_id COLLATE utf8mb4_unicode_ci
-       AND p2.parent_id COLLATE utf8mb4_unicode_ci = @mini_root
-   )
- )
-SET
-  rm.del_flag = 0,
-  rm.update_time = NOW(),
-  rm.remark = 'grant all mobile menus to all roles'
-WHERE @mini_root IS NOT NULL
-  AND rm.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-  AND rm.del_flag = 1;
-
--- 2) 为尚未关联的「角色 × 移动端菜单」新增授权
-INSERT INTO sys_role_menu (
-  id, role_id, menu_id, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  UPPER(MD5(CONCAT(r.id, '|', m.id))),
-  r.id,
-  m.id,
-  @tenant_no,
-  0,
-  'grant all mobile menus to all roles',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM sys_role r
-INNER JOIN sys_menu m
-  ON m.del_flag = 0
- AND m.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
- AND (
-   m.id COLLATE utf8mb4_unicode_ci = @mini_root
-   OR m.parent_id COLLATE utf8mb4_unicode_ci = @mini_root
-   OR EXISTS (
-     SELECT 1 FROM sys_menu p1
-     WHERE p1.del_flag = 0
-       AND p1.id COLLATE utf8mb4_unicode_ci = m.parent_id COLLATE utf8mb4_unicode_ci
-       AND p1.parent_id COLLATE utf8mb4_unicode_ci = @mini_root
-   )
-   OR EXISTS (
-     SELECT 1 FROM sys_menu p1
-     INNER JOIN sys_menu p2
-       ON p2.del_flag = 0
-      AND p2.id COLLATE utf8mb4_unicode_ci = p1.parent_id COLLATE utf8mb4_unicode_ci
-     WHERE p1.del_flag = 0
-       AND p1.id COLLATE utf8mb4_unicode_ci = m.parent_id COLLATE utf8mb4_unicode_ci
-       AND p2.parent_id COLLATE utf8mb4_unicode_ci = @mini_root
-   )
- )
-WHERE @mini_root IS NOT NULL
-  AND r.del_flag = 0
-  AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-  AND NOT EXISTS (
-    SELECT 1 FROM sys_role_menu rm
-    WHERE rm.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-      AND rm.menu_id COLLATE utf8mb4_unicode_ci = m.id COLLATE utf8mb4_unicode_ci
-      AND rm.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-      AND rm.del_flag = 0
-  );
-
-
-
-commit;
-
--- ===== 生产管理:预产及在途样本菜单(独立权限码)=====
--- 权威脚本:docs/sql/alter_sys_menu_add_production_pre_transit_sample.sql
-
--- 生产管理:预产及在途样本(独立页面 + 独立权限码)
--- 幂等:可重复执行
--- 授权:已有【生产管理】PRM 下任一有效子菜单的角色 → 授予本 C/F,并补授 PRM 祖先
-
-SET @tenant_no = CONVERT('zkxw' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @prm_id = CONVERT('PRM00000000000000000000000000001' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_c = CONVERT('95200000000000000000000000000001' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_f = CONVERT('95200000000000000000000000000002' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-
--- 1) C 菜单
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_c,
-  '预产及在途样本',
-  @prm_id,
-  'C',
-  'pre-transit-sample',
-  '/production/pre-transit-sample/index',
-  'production:preTransitSample:list',
-  1, '1', '1', @tenant_no, 0,
-  '生产看板:在途样本与预产协议(协议单维度只读;与质检页代码独立)',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_c
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '预产及在途样本',
-  parent_id = @prm_id,
-  menu_type = 'C',
-  path = 'pre-transit-sample',
-  component = '/production/pre-transit-sample/index',
-  perms = 'production:preTransitSample:list',
-  visible = '1',
-  status = '1',
-  order_num = 0,
-  remark = '生产看板:在途样本与预产协议(协议单维度只读;与质检页代码独立)',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_c;
-
--- 2) F 按钮
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_f,
-  '预产及在途查询',
-  @menu_c,
-  'F',
-  '',
-  '',
-  'production:preTransitSample:list',
-  1, '0', '1', @tenant_no, 1,
-  '生产侧预产及在途样本列表查询',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_f
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '预产及在途查询',
-  parent_id = @menu_c,
-  menu_type = 'F',
-  path = '',
-  component = '',
-  perms = 'production:preTransitSample:list',
-  visible = '0',
-  status = '1',
-  order_num = 1,
-  remark = '生产侧预产及在途样本列表查询',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_f;
-
--- 3) 目标角色:已有 PRM 下任一有效子菜单授权
--- MySQL 5.7:UPDATE 目标表不可在同句 FROM/EXISTS 中直接引用自身,须用派生表
-
--- 3a) 恢复软删的 PRM / C / F 授权
-UPDATE sys_role_menu rm
-INNER JOIN sys_role r
-  ON r.id COLLATE utf8mb4_unicode_ci = rm.role_id COLLATE utf8mb4_unicode_ci
- AND r.del_flag = 0
- AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-INNER JOIN (
-  SELECT DISTINCT rm2.role_id AS role_id
-  FROM sys_role_menu rm2
-  INNER JOIN sys_menu m2
-    ON m2.id COLLATE utf8mb4_unicode_ci = rm2.menu_id COLLATE utf8mb4_unicode_ci
-   AND m2.del_flag = 0
-   AND m2.parent_id COLLATE utf8mb4_unicode_ci = @prm_id
-  WHERE rm2.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-    AND rm2.del_flag = 0
-) eligible
-  ON eligible.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-SET
-  rm.del_flag = 0,
-  rm.update_time = NOW(),
-  rm.remark = 'grant production pre-transit to PRM roles'
-WHERE rm.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-  AND rm.del_flag = 1
-  AND rm.menu_id COLLATE utf8mb4_unicode_ci IN (@prm_id, @menu_c, @menu_f);
-
--- 3b) 插入缺失授权(PRM + C + F)
-INSERT INTO sys_role_menu (
-  id, role_id, menu_id, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  UPPER(MD5(CONCAT(src.role_id, '|', src.menu_id))),
-  src.role_id,
-  src.menu_id,
-  @tenant_no,
-  0,
-  'grant production pre-transit to PRM roles',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM (
-  SELECT
-    r.id AS role_id,
-    x.menu_id AS menu_id
-  FROM sys_role r
-  INNER JOIN (
-    SELECT @prm_id AS menu_id
-    UNION ALL SELECT @menu_c
-    UNION ALL SELECT @menu_f
-  ) x
-  INNER JOIN (
-    SELECT DISTINCT rm2.role_id AS role_id
-    FROM sys_role_menu rm2
-    INNER JOIN sys_menu m2
-      ON m2.id COLLATE utf8mb4_unicode_ci = rm2.menu_id COLLATE utf8mb4_unicode_ci
-     AND m2.del_flag = 0
-     AND m2.parent_id COLLATE utf8mb4_unicode_ci = @prm_id
-    WHERE rm2.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-      AND rm2.del_flag = 0
-  ) eligible
-    ON eligible.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-  INNER JOIN sys_menu m
-    ON m.id COLLATE utf8mb4_unicode_ci = x.menu_id
-   AND m.del_flag = 0
-  WHERE r.del_flag = 0
-    AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-) src
-LEFT JOIN sys_role_menu existing
-  ON existing.role_id COLLATE utf8mb4_unicode_ci = src.role_id COLLATE utf8mb4_unicode_ci
- AND existing.menu_id COLLATE utf8mb4_unicode_ci = src.menu_id COLLATE utf8mb4_unicode_ci
- AND existing.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
- AND existing.del_flag = 0
-WHERE existing.id IS NULL;
-
-
-
--- ===== 质检:检测项目模版建表 + 菜单授权 =====
--- 权威脚本:docs/sql/alter_biz_qc_inspection_item_template.sql
-
-
--- ===== 废弃物管理菜单 =====
--- 幂等:可重复执行
--- 授权:已有【生产管理】PRM 下任一有效子菜单的角色 → 授予本 C/F,并补授 PRM 祖先
-
-SET @tenant_no = CONVERT('zkxw' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @prm_id = CONVERT('PRM00000000000000000000000000001' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_c = CONVERT('95300000000000000000000000000001' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_f = CONVERT('95300000000000000000000000000002' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-
--- 1) C 菜单
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_c,
-  '废弃物管理',
-  @prm_id,
-  'C',
-  'waste-output',
-  '/production/waste-output/index',
-  'production:waste-output:list',
-  1, '1', '1', @tenant_no, 8,
-  '生产看板:任务步骤废弃物产出只读汇总',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_c
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '废弃物管理',
-  parent_id = @prm_id,
-  menu_type = 'C',
-  path = 'waste-output',
-  component = '/production/waste-output/index',
-  perms = 'production:waste-output:list',
-  visible = '1',
-  status = '1',
-  order_num = 8,
-  remark = '生产看板:任务步骤废弃物产出只读汇总',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_c;
-
--- 2) F 按钮
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_f,
-  '废弃物查询',
-  @menu_c,
-  'F',
-  '',
-  '',
-  'production:waste-output:list',
-  1, '0', '1', @tenant_no, 1,
-  '生产侧废弃物列表查询',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_f
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '废弃物查询',
-  parent_id = @menu_c,
-  menu_type = 'F',
-  path = '',
-  component = '',
-  perms = 'production:waste-output:list',
-  visible = '0',
-  status = '1',
-  order_num = 1,
-  remark = '生产侧废弃物列表查询',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_f;
-
--- 3) 目标角色:已有 PRM 下任一有效子菜单授权
--- MySQL 5.7:UPDATE 目标表不可在同句 FROM/EXISTS 中直接引用自身,须用派生表
-
--- 3a) 恢复软删的 PRM / C / F 授权
-UPDATE sys_role_menu rm
-INNER JOIN sys_role r
-  ON r.id COLLATE utf8mb4_unicode_ci = rm.role_id COLLATE utf8mb4_unicode_ci
- AND r.del_flag = 0
- AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-INNER JOIN (
-  SELECT DISTINCT rm2.role_id AS role_id
-  FROM sys_role_menu rm2
-  INNER JOIN sys_menu m2
-    ON m2.id COLLATE utf8mb4_unicode_ci = rm2.menu_id COLLATE utf8mb4_unicode_ci
-   AND m2.del_flag = 0
-   AND m2.parent_id COLLATE utf8mb4_unicode_ci = @prm_id
-  WHERE rm2.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-    AND rm2.del_flag = 0
-) eligible
-  ON eligible.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-SET
-  rm.del_flag = 0,
-  rm.update_time = NOW(),
-  rm.remark = 'grant production waste-output to PRM roles'
-WHERE rm.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-  AND rm.del_flag = 1
-  AND rm.menu_id COLLATE utf8mb4_unicode_ci IN (@prm_id, @menu_c, @menu_f);
-
--- 3b) 插入缺失授权(PRM + C + F)
-INSERT INTO sys_role_menu (
-  id, role_id, menu_id, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  UPPER(MD5(CONCAT(src.role_id, '|', src.menu_id))),
-  src.role_id,
-  src.menu_id,
-  @tenant_no,
-  0,
-  'grant production waste-output to PRM roles',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM (
-  SELECT
-    r.id AS role_id,
-    x.menu_id AS menu_id
-  FROM sys_role r
-  INNER JOIN (
-    SELECT @prm_id AS menu_id
-    UNION ALL SELECT @menu_c
-    UNION ALL SELECT @menu_f
-  ) x
-  INNER JOIN (
-    SELECT DISTINCT rm2.role_id AS role_id
-    FROM sys_role_menu rm2
-    INNER JOIN sys_menu m2
-      ON m2.id COLLATE utf8mb4_unicode_ci = rm2.menu_id COLLATE utf8mb4_unicode_ci
-     AND m2.del_flag = 0
-     AND m2.parent_id COLLATE utf8mb4_unicode_ci = @prm_id
-    WHERE rm2.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-      AND rm2.del_flag = 0
-  ) eligible
-    ON eligible.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-  INNER JOIN sys_menu m
-    ON m.id COLLATE utf8mb4_unicode_ci = x.menu_id
-   AND m.del_flag = 0
-  WHERE r.del_flag = 0
-    AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-) src
-LEFT JOIN sys_role_menu existing
-  ON existing.role_id COLLATE utf8mb4_unicode_ci = src.role_id COLLATE utf8mb4_unicode_ci
- AND existing.menu_id COLLATE utf8mb4_unicode_ci = src.menu_id COLLATE utf8mb4_unicode_ci
- AND existing.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
- AND existing.del_flag = 0
-WHERE existing.id IS NULL;
-
--- 生产任务集合:docs/sql/alter_biz_production_task_set.sql
--- 生产任务集合:头表 + 条目 + 菜单授权(幂等)
--- 授权:已有【生产基础信息】PRB 下任一有效子菜单 或 已有生产工单菜单 的角色 → 授予 PRB + C + 四个 F
-
-SET @tenant_no = CONVERT('zkxw' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @prb_id = CONVERT('PRB00000000000000000000000000001' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @wo_menu_id = CONVERT('90000000000000000000000000000011' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_c = CONVERT('95400000000000000000000000000001' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_list = CONVERT('95400000000000000000000000000002' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_add = CONVERT('95400000000000000000000000000003' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_edit = CONVERT('95400000000000000000000000000004' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-SET @menu_remove = CONVERT('95400000000000000000000000000005' USING utf8mb4) COLLATE utf8mb4_unicode_ci;
-
-CREATE TABLE IF NOT EXISTS `biz_production_task_set` (
-  `id` varchar(64) NOT NULL COMMENT '主键ID',
-  `set_name` varchar(200) NOT NULL COMMENT '集合名称',
-  `status` char(1) NOT NULL DEFAULT '1' COMMENT '1启用 0停用',
-  `tenant_no` varchar(64) NOT NULL DEFAULT 'zkxw' COMMENT '租户编号',
-  `order_num` int(11) DEFAULT NULL COMMENT '排序号',
-  `remark` varchar(512) DEFAULT NULL COMMENT '备注',
-  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人id',
-  `create_dept_id` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人部门ID',
-  `create_time` datetime NOT NULL COMMENT '创建时间',
-  `update_by` varchar(64) DEFAULT NULL COMMENT '更新人id',
-  `update_time` datetime NOT NULL COMMENT '更新时间',
-  `del_flag` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标记',
-  PRIMARY KEY (`id`) USING BTREE,
-  KEY `idx_pts_tenant_status` (`tenant_no`,`del_flag`,`status`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产任务集合';
-
-CREATE TABLE IF NOT EXISTS `biz_production_task_set_item` (
-  `id` varchar(64) NOT NULL COMMENT '主键ID',
-  `set_id` varchar(64) NOT NULL COMMENT '集合ID',
-  `task_name` varchar(200) NOT NULL COMMENT '任务名称',
-  `route_id` varchar(64) DEFAULT NULL COMMENT '工艺路线ID',
-  `route_name` varchar(100) DEFAULT NULL COMMENT '路线名称快照',
-  `description` varchar(500) DEFAULT NULL COMMENT '描述',
-  `remark` varchar(512) DEFAULT NULL COMMENT '备注',
-  `tenant_no` varchar(64) NOT NULL DEFAULT 'zkxw' COMMENT '租户编号',
-  `order_num` int(11) DEFAULT NULL COMMENT '排序号',
-  `create_by` varchar(64) DEFAULT NULL COMMENT '创建人id',
-  `create_dept_id` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人部门ID',
-  `create_time` datetime NOT NULL COMMENT '创建时间',
-  `update_by` varchar(64) DEFAULT NULL COMMENT '更新人id',
-  `update_time` datetime NOT NULL COMMENT '更新时间',
-  `del_flag` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除标记',
-  PRIMARY KEY (`id`) USING BTREE,
-  KEY `idx_ptsi_set` (`set_id`,`del_flag`,`order_num`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产任务集合条目';
-
--- 1) C 菜单
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_c,
-  '生产任务集合',
-  @prb_id,
-  'C',
-  'production-task-set',
-  '/production/production-task-set/index',
-  'production:task-set:list',
-  1, '1', '1', @tenant_no, 12,
-  '生产基础信息:生产任务集合主数据',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_c
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '生产任务集合',
-  parent_id = @prb_id,
-  menu_type = 'C',
-  path = 'production-task-set',
-  component = '/production/production-task-set/index',
-  perms = 'production:task-set:list',
-  visible = '1',
-  status = '1',
-  order_num = 12,
-  remark = '生产基础信息:生产任务集合主数据',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_c;
-
--- 2) F 按钮:查询
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_list,
-  '查询',
-  @menu_c,
-  'F',
-  '',
-  '',
-  'production:task-set:list',
-  1, '0', '1', @tenant_no, 1,
-  '生产任务集合列表查询',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_list
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '查询',
-  parent_id = @menu_c,
-  menu_type = 'F',
-  path = '',
-  component = '',
-  perms = 'production:task-set:list',
-  visible = '0',
-  status = '1',
-  order_num = 1,
-  remark = '生产任务集合列表查询',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_list;
-
--- 2) F 按钮:新增
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_add,
-  '新增',
-  @menu_c,
-  'F',
-  '',
-  '',
-  'production:task-set:add',
-  1, '0', '1', @tenant_no, 2,
-  '生产任务集合新增',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_add
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '新增',
-  parent_id = @menu_c,
-  menu_type = 'F',
-  path = '',
-  component = '',
-  perms = 'production:task-set:add',
-  visible = '0',
-  status = '1',
-  order_num = 2,
-  remark = '生产任务集合新增',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_add;
-
--- 2) F 按钮:编辑
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_edit,
-  '编辑',
-  @menu_c,
-  'F',
-  '',
-  '',
-  'production:task-set:edit',
-  1, '0', '1', @tenant_no, 3,
-  '生产任务集合编辑',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_edit
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '编辑',
-  parent_id = @menu_c,
-  menu_type = 'F',
-  path = '',
-  component = '',
-  perms = 'production:task-set:edit',
-  visible = '0',
-  status = '1',
-  order_num = 3,
-  remark = '生产任务集合编辑',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_edit;
-
--- 2) F 按钮:删除
-INSERT INTO sys_menu (
-  id, menu_name, parent_id, menu_type, path, component, perms,
-  is_frame, visible, status, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  @menu_remove,
-  '删除',
-  @menu_c,
-  'F',
-  '',
-  '',
-  'production:task-set:remove',
-  1, '0', '1', @tenant_no, 4,
-  '生产任务集合删除',
-  NULL, '', NOW(), NULL, NOW(), 0
-FROM DUAL
-WHERE NOT EXISTS (
-  SELECT 1 FROM sys_menu m
-  WHERE m.id COLLATE utf8mb4_unicode_ci = @menu_remove
-);
-
-UPDATE sys_menu
-SET
-  menu_name = '删除',
-  parent_id = @menu_c,
-  menu_type = 'F',
-  path = '',
-  component = '',
-  perms = 'production:task-set:remove',
-  visible = '0',
-  status = '1',
-  order_num = 4,
-  remark = '生产任务集合删除',
-  del_flag = 0,
-  update_time = NOW()
-WHERE id COLLATE utf8mb4_unicode_ci = @menu_remove;
-
--- 3) 目标角色:PRB 下任一有效子菜单 或 已有生产工单菜单
--- MySQL 5.7:UPDATE 目标表不可在同句 FROM/EXISTS 中直接引用自身,须用派生表
-
--- 3a) 恢复软删的 PRB / C / F 授权
-UPDATE sys_role_menu rm
-INNER JOIN sys_role r
-  ON r.id COLLATE utf8mb4_unicode_ci = rm.role_id COLLATE utf8mb4_unicode_ci
- AND r.del_flag = 0
- AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-INNER JOIN (
-  SELECT DISTINCT role_id FROM (
-    SELECT DISTINCT rm2.role_id AS role_id
-    FROM sys_role_menu rm2
-    INNER JOIN sys_menu m2
-      ON m2.id COLLATE utf8mb4_unicode_ci = rm2.menu_id COLLATE utf8mb4_unicode_ci
-     AND m2.del_flag = 0
-     AND m2.parent_id COLLATE utf8mb4_unicode_ci = @prb_id
-    WHERE rm2.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-      AND rm2.del_flag = 0
-    UNION
-    SELECT DISTINCT rm3.role_id AS role_id
-    FROM sys_role_menu rm3
-    INNER JOIN sys_menu m3
-      ON m3.id COLLATE utf8mb4_unicode_ci = rm3.menu_id COLLATE utf8mb4_unicode_ci
-     AND m3.del_flag = 0
-    WHERE rm3.menu_id COLLATE utf8mb4_unicode_ci = @wo_menu_id
-      AND rm3.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-      AND rm3.del_flag = 0
-  ) eligible_roles
-) eligible
-  ON eligible.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-SET
-  rm.del_flag = 0,
-  rm.update_time = NOW(),
-  rm.remark = 'grant production task-set to PRB/work-order roles'
-WHERE rm.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-  AND rm.del_flag = 1
-  AND rm.menu_id COLLATE utf8mb4_unicode_ci IN (
-    @prb_id, @menu_c, @menu_list, @menu_add, @menu_edit, @menu_remove
-  );
-
--- 3b) 插入缺失授权(PRB + C + 四个 F)
-INSERT INTO sys_role_menu (
-  id, role_id, menu_id, tenant_no, order_num, remark,
-  create_by, create_dept_id, create_time, update_by, update_time, del_flag
-)
-SELECT
-  UPPER(MD5(CONCAT(src.role_id, '|', src.menu_id))),
-  src.role_id,
-  src.menu_id,
-  @tenant_no,
-  0,
-  'grant production task-set to PRB/work-order roles',
-  'admin',
-  '',
-  NOW(),
-  NULL,
-  NOW(),
-  0
-FROM (
-  SELECT
-    r.id AS role_id,
-    x.menu_id AS menu_id
-  FROM sys_role r
-  INNER JOIN (
-    SELECT @prb_id AS menu_id
-    UNION ALL SELECT @menu_c
-    UNION ALL SELECT @menu_list
-    UNION ALL SELECT @menu_add
-    UNION ALL SELECT @menu_edit
-    UNION ALL SELECT @menu_remove
-  ) x
-  INNER JOIN (
-    SELECT DISTINCT role_id FROM (
-      SELECT DISTINCT rm2.role_id AS role_id
-      FROM sys_role_menu rm2
-      INNER JOIN sys_menu m2
-        ON m2.id COLLATE utf8mb4_unicode_ci = rm2.menu_id COLLATE utf8mb4_unicode_ci
-       AND m2.del_flag = 0
-       AND m2.parent_id COLLATE utf8mb4_unicode_ci = @prb_id
-      WHERE rm2.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-        AND rm2.del_flag = 0
-      UNION
-      SELECT DISTINCT rm3.role_id AS role_id
-      FROM sys_role_menu rm3
-      INNER JOIN sys_menu m3
-        ON m3.id COLLATE utf8mb4_unicode_ci = rm3.menu_id COLLATE utf8mb4_unicode_ci
-       AND m3.del_flag = 0
-      WHERE rm3.menu_id COLLATE utf8mb4_unicode_ci = @wo_menu_id
-        AND rm3.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-        AND rm3.del_flag = 0
-    ) eligible_roles
-  ) eligible
-    ON eligible.role_id COLLATE utf8mb4_unicode_ci = r.id COLLATE utf8mb4_unicode_ci
-  INNER JOIN sys_menu m
-    ON m.id COLLATE utf8mb4_unicode_ci = x.menu_id
-   AND m.del_flag = 0
-  WHERE r.del_flag = 0
-    AND r.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
-) src
-LEFT JOIN sys_role_menu existing
-  ON existing.role_id COLLATE utf8mb4_unicode_ci = src.role_id COLLATE utf8mb4_unicode_ci
- AND existing.menu_id COLLATE utf8mb4_unicode_ci = src.menu_id COLLATE utf8mb4_unicode_ci
- AND existing.tenant_no COLLATE utf8mb4_unicode_ci = @tenant_no
- AND existing.del_flag = 0
-WHERE existing.id IS NULL;

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels