This commit is contained in:
zlwu committed 2026-06-30 20:40:22 +08:00
1 parent 17b699b900
commit 28f233c922
27 files changed
+18073 -16837

No files matched your search

@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "label": "useTaskStepEditor.ts", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L1"}, {"id": "production_work_order_usetaskstepeditor_parsetaskattachmentsfromurls", "label": "parseTaskAttachmentsFromUrls()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L67"}, {"id": "production_work_order_usetaskstepeditor_toapiflag", "label": "toApiFlag()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L77"}, {"id": "production_work_order_usetaskstepeditor_fromapiflag", "label": "fromApiFlag()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L81"}, {"id": "production_work_order_usetaskstepeditor_normalizestepsubtables", "label": "normalizeStepSubTables()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L84"}, {"id": "production_work_order_usetaskstepeditor_parseordernum", "label": "parseOrderNum()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L111"}, {"id": "production_work_order_usetaskstepeditor_usetaskstepeditor", "label": "useTaskStepEditor()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L118"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L1", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_production_step_assignee", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L20", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L21", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_admin", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L30", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_work_order", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L31", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_sample_reception", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L32", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_equipment_select", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L33", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_prodLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_types_import_components_d_ts", "label": "components.d.ts", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/types/import/components.d.ts", "source_location": "L1"}], "edges": [], "raw_calls": []}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_task_step_editor_persistence_ts", "label": "task-step-editor-persistence.ts", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L1"}, {"id": "production_work_order_task_step_editor_persistence_createemptysnapshots", "label": "createEmptySnapshots()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L17"}, {"id": "production_work_order_task_step_editor_persistence_serializeinputs", "label": "serializeInputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L27"}, {"id": "production_work_order_task_step_editor_persistence_serializeoutputs", "label": "serializeOutputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L39"}, {"id": "production_work_order_task_step_editor_persistence_serializeattachments", "label": "serializeAttachments()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L53"}, {"id": "production_work_order_task_step_editor_persistence_serializeequipmentids", "label": "serializeEquipmentIds()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L61"}, {"id": "production_work_order_task_step_editor_persistence_normalizereagents", "label": "normalizeReagents()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L65"}, {"id": "production_work_order_task_step_editor_persistence_normalizeconsumables", "label": "normalizeConsumables()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L79"}, {"id": "production_work_order_task_step_editor_persistence_normalizeconfiguredreagents", "label": "normalizeConfiguredReagents()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L93"}, {"id": "production_work_order_task_step_editor_persistence_normalizestepoutputs", "label": "normalizeStepOutputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L106"}, {"id": "production_work_order_task_step_editor_persistence_normalizedatacollections", "label": "normalizeDataCollections()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L115"}, {"id": "production_work_order_task_step_editor_persistence_serializestep", "label": "serializeStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L124"}, {"id": "production_work_order_task_step_editor_persistence_scopetostepid", "label": "scopeToStepId()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L141"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_task_step_editor_persistence_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_components_business_protocol_finance_confirm_fields_finance_attachments", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L1", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_task_step_editor_persistence_ts", "target": "production_work_order_task_step_editor_persistence_createemptysnapshots", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L17", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_orderLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_task_step_editor_persistence_ts", "label": "task-step-editor-persistence.ts", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L1"}, {"id": "production_work_order_task_step_editor_persistence_createemptysnapshots", "label": "createEmptySnapshots()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L15"}, {"id": "production_work_order_task_step_editor_persistence_serializeinputs", "label": "serializeInputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L25"}, {"id": "production_work_order_task_step_editor_persistence_serializeoutputs", "label": "serializeOutputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L37"}, {"id": "production_work_order_task_step_editor_persistence_serializeattachments", "label": "serializeAttachments()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L51"}, {"id": "production_work_order_task_step_editor_persistence_serializeequipmentids", "label": "serializeEquipmentIds()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L59"}, {"id": "production_work_order_task_step_editor_persistence_normalizereagents", "label": "normalizeReagents()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L63"}, {"id": "production_work_order_task_step_editor_persistence_normalizeconsumables", "label": "normalizeConsumables()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L77"}, {"id": "production_work_order_task_step_editor_persistence_normalizeconfiguredreagents", "label": "normalizeConfiguredReagents()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L91"}, {"id": "production_work_order_task_step_editor_persistence_normalizestepoutputs", "label": "normalizeStepOutputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L104"}, {"id": "production_work_order_task_step_editor_persistence_normalizedatacollections", "label": "normalizeDataCollections()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L113"}, {"id": "production_work_order_task_step_editor_persistence_serializestep", "label": "serializeStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L122"}, {"id": "production_work_order_task_step_editor_persistence_scopetostepid", "label": "scopeToStepId()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L139"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_task_step_editor_persistence_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_components_business_protocol_finance_confirm_fields_finance_attachments", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L1", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_task_step_editor_persistence_ts", "target": "production_work_order_task_step_editor_persistence_createemptysnapshots", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/task-step-editor-persistence.ts", "source_location": "L15", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_orderLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "label": "TaskExecutionDialog.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L1"}, {"id": "production_work_order_taskexecutiondialog_onsteplistdrop", "label": "onStepListDrop()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L628"}, {"id": "production_work_order_taskexecutiondialog_handleforwardsuccess", "label": "handleForwardSuccess()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L633"}, {"id": "production_work_order_taskexecutiondialog_openforwarddialog", "label": "openForwardDialog()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L639"}, {"id": "production_work_order_taskexecutiondialog_savetaskoutputsmanual", "label": "saveTaskOutputsManual()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L644"}, {"id": "production_work_order_taskexecutiondialog_savetaskattachmentsmanual", "label": "saveTaskAttachmentsManual()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L648"}, {"id": "production_work_order_taskexecutiondialog_savetaskequipmentmanual", "label": "saveTaskEquipmentManual()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L652"}, {"id": "production_work_order_taskexecutiondialog_if", "label": "if()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L657"}, {"id": "production_work_order_taskexecutiondialog_stepseqclass", "label": "stepSeqClass()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L676"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_onsteplistdrop", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L628", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_handleforwardsuccess", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L633", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_openforwarddialog", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L639", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_savetaskoutputsmanual", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L644", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_savetaskattachmentsmanual", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L648", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_savetaskequipmentmanual", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/vLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_stepdetailactionbar_vue", "label": "StepDetailActionBar.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/StepDetailActionBar.vue", "source_location": "L1"}], "edges": [], "raw_calls": []}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "label": "useTaskStepEditor.ts", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L1"}, {"id": "production_work_order_usetaskstepeditor_parsetaskattachmentsfromurls", "label": "parseTaskAttachmentsFromUrls()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L67"}, {"id": "production_work_order_usetaskstepeditor_toapiflag", "label": "toApiFlag()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L77"}, {"id": "production_work_order_usetaskstepeditor_fromapiflag", "label": "fromApiFlag()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L81"}, {"id": "production_work_order_usetaskstepeditor_normalizestepsubtables", "label": "normalizeStepSubTables()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L84"}, {"id": "production_work_order_usetaskstepeditor_parseordernum", "label": "parseOrderNum()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L111"}, {"id": "production_work_order_usetaskstepeditor_usetaskstepeditor", "label": "useTaskStepEditor()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L118"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L1", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_production_step_assignee", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L20", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L21", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_admin", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L30", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_work_order", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L31", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_sample_reception", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L32", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_usetaskstepeditor_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_equipment_select", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L33", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_prodLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "label": "TaskExecutionDialog.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L1"}, {"id": "production_work_order_taskexecutiondialog_onsteplistdrop", "label": "onStepListDrop()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L631"}, {"id": "production_work_order_taskexecutiondialog_handleforwardsuccess", "label": "handleForwardSuccess()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L636"}, {"id": "production_work_order_taskexecutiondialog_openforwarddialog", "label": "openForwardDialog()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L642"}, {"id": "production_work_order_taskexecutiondialog_savetaskoutputsmanual", "label": "saveTaskOutputsManual()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L647"}, {"id": "production_work_order_taskexecutiondialog_savetaskattachmentsmanual", "label": "saveTaskAttachmentsManual()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L651"}, {"id": "production_work_order_taskexecutiondialog_savetaskequipmentmanual", "label": "saveTaskEquipmentManual()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L655"}, {"id": "production_work_order_taskexecutiondialog_if", "label": "if()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L660"}, {"id": "production_work_order_taskexecutiondialog_stepseqclass", "label": "stepSeqClass()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L679"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_onsteplistdrop", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L631", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_handleforwardsuccess", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L636", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_openforwarddialog", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L642", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_savetaskoutputsmanual", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L647", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_savetaskattachmentsmanual", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskExecutionDialog.vue", "source_location": "L651", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskexecutiondialog_vue", "target": "production_work_order_taskexecutiondialog_savetaskequipmentmanual", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/vLine truncated
@@ -43,7 +43,7 @@
(editor.canEditStepDispatch() && !readonly))
"
class="task-exec-toolbar-btn task-exec-save-btn"
type="danger"
:type="editor.isCurrentScopeDirty() ? 'primary' : 'danger'"
:loading="editor.manualSaveLoading.value"
:disabled="editor.stepActionLoading.value"
@click="editor.handleManualSave"
@@ -10,14 +10,13 @@
destroy-on-close
:close-on-click-modal="false"
:append-to-body="appendToBody"
:before-close="handleBeforeClose"
@close="handleClose"
>
<!-- 顶部:任务基本信息一行展示 -->
<div v-if="editor.taskDetail.value" class="execution-header">
<div class="execution-header-row">
<span
v-if="showHeaderLabStorageCode"
class="execution-header-item"
<span v-if="showHeaderLabStorageCode" class="execution-header-item"
>实验室入库编码:<b>{{ headerLabStorageCode }}</b></span
>
<span v-if="!showHeaderLabStorageCode" class="execution-header-item"
@@ -43,12 +42,21 @@
</el-tag>
<template v-else>—</template>
</span>
<span
v-if="!readonly && editor.isExecutionSaving.value"
class="execution-header-saving-hint"
>
<el-icon class="execution-header-saving-icon is-loading"><Loading /></el-icon>
保存中…
</span>
<span
v-else-if="!readonly && editor.dirtyScopeCount.value > 0"
class="execution-header-dirty-hint"
>
有 {{ editor.dirtyScopeCount.value }} 处未保存
</span>
<div v-if="!readonly" class="execution-header-actions">
<el-button
v-if="allowForward"
class="btn-op-item"
@click="forwardVisible = true"
>
<el-button v-if="allowForward" class="btn-op-item" @click="openForwardDialog">
<el-icon><Share /></el-icon>转发任务
</el-button>
<el-button
@@ -80,7 +88,12 @@
</div>
<!-- 主体:可折叠工艺库 + 步骤列表 + 详情面板 -->
<div class="execution-main">
<div
class="execution-main"
v-loading="!readonly && editor.isExecutionSaving.value"
element-loading-text="保存中…"
element-loading-background="rgba(255, 255, 255, 0.72)"
>
<!-- 可折叠工艺库侧栏(只读时不展示;我的任务执行只读展示,不可拖拽) -->
<template v-if="!readonly">
<transition name="slide-lib">
@@ -133,7 +146,9 @@
</el-collapse-item>
</el-collapse>
<el-empty
v-if="!editor.filteredProcessLibrary.value.length && !editor.processLibraryLoading.value"
v-if="
!editor.filteredProcessLibrary.value.length && !editor.processLibraryLoading.value
"
description="暂无工艺数据"
:image-size="48"
/>
@@ -160,7 +175,9 @@
<div class="execution-step-list-header">
<h3>工序步骤</h3>
<span class="execution-progress-badge"
>{{ editor.completedStepCount.value }}/{{ editor.executionStepList.value.length }}</span
>{{ editor.completedStepCount.value }}/{{
editor.executionStepList.value.length
}}</span
>
</div>
<div class="execution-step-list-body">
@@ -174,8 +191,11 @@
<div class="virtual-step-info">
<div class="virtual-step-name">原材料(样本/细胞产品)</div>
</div>
<el-tag v-if="editor.isScopeDirty('input')" type="warning" size="small"
>未保存</el-tag
>
<el-tag
v-if="editor.virtualInputStatus.value === 'filled'"
v-else-if="editor.virtualInputStatus.value === 'filled'"
type="success"
size="small"
>已填写 {{ editor.taskInputs.value.length }} 项</el-tag
@@ -193,8 +213,11 @@
<div class="virtual-step-info">
<div class="virtual-step-name">产出(细胞产品)</div>
</div>
<el-tag v-if="editor.isScopeDirty('output')" type="warning" size="small"
>未保存</el-tag
>
<el-tag
v-if="editor.virtualOutputStatus.value === 'filled'"
v-else-if="editor.virtualOutputStatus.value === 'filled'"
type="success"
size="small"
>已填写 {{ editor.taskOutputs.value.length }} 项</el-tag
@@ -206,7 +229,10 @@
>
{{ editor.outputsMissingStorageSlotCount.value }} 项未分配库位
</el-tag>
<el-tag v-else-if="editor.virtualOutputStatus.value !== 'filled'" type="info" size="small"
<el-tag
v-else-if="editor.virtualOutputStatus.value !== 'filled'"
type="info"
size="small"
>暂无</el-tag
>
</div>
@@ -221,8 +247,11 @@
<div class="virtual-step-info">
<div class="virtual-step-name">线下纸质文档</div>
</div>
<el-tag v-if="editor.isScopeDirty('paper')" type="warning" size="small"
>未保存</el-tag
>
<el-tag
v-if="editor.virtualPaperStatus.value === 'filled'"
v-else-if="editor.virtualPaperStatus.value === 'filled'"
type="success"
size="small"
>已上传 {{ editor.virtualPaperCount.value }} 份</el-tag
@@ -240,8 +269,11 @@
<div class="virtual-step-info">
<div class="virtual-step-name">设备</div>
</div>
<el-tag v-if="editor.isScopeDirty('equipment')" type="warning" size="small"
>未保存</el-tag
>
<el-tag
v-if="editor.virtualEquipmentStatus.value === 'filled'"
v-else-if="editor.virtualEquipmentStatus.value === 'filled'"
type="success"
size="small"
>已选 {{ editor.virtualEquipmentCount.value }} 台</el-tag
@@ -301,7 +333,13 @@
</div>
<div class="route-config-step-actions">
<el-tag
v-if="element.stepStatus"
v-if="editor.isScopeDirty(`step:${element.id}`)"
type="warning"
size="small"
>未保存</el-tag
>
<el-tag
v-else-if="element.stepStatus"
:type="editor.stepStatusTag(element.stepStatus).type"
size="small"
>{{ editor.stepStatusTag(element.stepStatus).label }}</el-tag
@@ -331,11 +369,7 @@
<div v-if="!editor.executionStepList.value.length" class="execution-step-list-empty">
<el-icon :size="32" color="#a8d4c4"><Plus /></el-icon>
<p>{{
isMineScope
? '暂无工艺步骤'
: '从左侧拖拽工序到此处,添加任务步骤'
}}</p>
<p>{{ isMineScope ? '暂无工艺步骤' : '从左侧拖拽工序到此处,添加任务步骤' }}</p>
</div>
</div>
</div>
@@ -395,9 +429,9 @@
<div v-if="!readonly" class="execution-detail-step-footer">
<el-button
class="task-exec-toolbar-btn task-exec-save-btn"
type="danger"
:type="editor.isScopeDirty('output') ? 'primary' : 'danger'"
:loading="editor.outputSaving.value"
@click="editor.saveTaskOutputs"
@click="saveTaskOutputsManual"
>
<el-icon><Check /></el-icon>
保存
@@ -421,9 +455,9 @@
<div v-if="!readonly" class="execution-detail-step-footer">
<el-button
class="task-exec-toolbar-btn task-exec-save-btn"
type="danger"
:type="editor.isScopeDirty('paper') ? 'primary' : 'danger'"
:loading="editor.attachmentSaving.value"
@click="editor.saveTaskAttachments"
@click="saveTaskAttachmentsManual"
>
<el-icon><Check /></el-icon>
保存
@@ -448,9 +482,9 @@
<div v-if="!readonly" class="execution-detail-step-footer">
<el-button
class="task-exec-toolbar-btn task-exec-save-btn"
type="danger"
:type="editor.isScopeDirty('equipment') ? 'primary' : 'danger'"
:loading="editor.equipmentSaving.value"
@click="editor.saveTaskEquipment"
@click="saveTaskEquipmentManual"
>
<el-icon><Check /></el-icon>
保存
@@ -476,10 +510,7 @@
<div class="execution-detail-body execution-detail-body--step">
<StepDetailPanel :editor="editor" :readonly="readonly" hide-header />
</div>
<div
v-if="editor.selectedStep.value && !readonly"
class="execution-detail-step-footer"
>
<div v-if="editor.selectedStep.value && !readonly" class="execution-detail-step-footer">
<StepDetailActionBar :editor="editor" :readonly="readonly" />
</div>
</template>
@@ -507,7 +538,16 @@
</template>
<script setup lang="ts">
import { Rank, Plus, Check, VideoPlay, CopyDocument, Delete, Share } from '@element-plus/icons-vue'
import {
Rank,
Plus,
Check,
VideoPlay,
CopyDocument,
Delete,
Share,
Loading
} from '@element-plus/icons-vue'
import { VueDraggable as draggable } from 'vue-draggable-plus'
import { useTaskStepEditor } from './useTaskStepEditor'
import StepDetailPanel from './StepDetailPanel.vue'
@@ -599,6 +639,32 @@
emit('success')
}
async function openForwardDialog() {
if (!(await editor.guardBeforeLeaveCurrentScope())) return
forwardVisible.value = true
}
function saveTaskOutputsManual() {
void editor.saveTaskOutputs()
}
function saveTaskAttachmentsManual() {
void editor.saveTaskAttachments()
}
function saveTaskEquipmentManual() {
void editor.saveTaskEquipment()
}
async function handleBeforeClose(done: () => void) {
if (props.readonly) {
done()
return
}
const ok = await editor.guardBeforeLeaveCurrentScope()
if (ok) done()
}
function handleClose() {
emit('success')
}
@@ -629,13 +695,14 @@
if (props.taskId) {
await editor.initEditor(props.taskId, {
mode: 'execution',
operateScope: props.readonly ? undefined : props.operateScope
operateScope: props.readonly ? undefined : props.operateScope,
readonly: props.readonly
})
const stepId = (props.initialStepId || '').trim()
if (stepId) {
const step = editor.stepList.value.find((s) => s.id === stepId)
if (step) {
editor.selectStep(step)
await editor.selectStep(step)
}
}
}
@@ -668,6 +735,22 @@
.execution-header-item {
white-space: nowrap;
}
.execution-header-dirty-hint {
font-size: 12px;
color: #d97706;
white-space: nowrap;
}
.execution-header-saving-hint {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: var(--primary, #10b981);
white-space: nowrap;
}
.execution-header-saving-icon {
font-size: 14px;
}
.execution-header-actions {
display: flex;
gap: 8px;
@@ -959,6 +1042,9 @@
color: var(--mint-text-muted, #64748b);
}
.execution-detail-step-footer {
position: sticky;
bottom: 0;
z-index: 2;
flex-shrink: 0;
display: flex;
align-items: center;
@@ -0,0 +1,142 @@
import type { FinanceAttachmentItem } from '@/components/business/protocol-finance-confirm-fields/finance-attachments'
export type DirtyScope = 'input' | 'output' | 'paper' | 'equipment' | `step:${string}`
export type FlushResult = { ok: true } | { ok: false; message: string; blocking: true }
export type EditorSnapshots = {
inputs: string
outputs: string
attachments: string
equipmentIds: string
steps: Record<string, string>
}
export function createEmptySnapshots(): EditorSnapshots {
return {
inputs: serializeInputs([]),
outputs: serializeOutputs([]),
attachments: serializeAttachments([]),
equipmentIds: serializeEquipmentIds([]),
steps: {}
}
}
export function serializeInputs(rows: Record<string, any>[]): string {
return JSON.stringify(
rows.map((r) => ({
inputType: r.inputType,
inputId: r.inputId,
inputCode: r.inputCode,
inputName: r.inputName,
remark: r.remark
}))
)
}
export function serializeOutputs(rows: Record<string, any>[]): string {
return JSON.stringify(
rows.map((r) => ({
cellProductId: r.cellProductId,
storageSlotId: r.storageSlotId,
outputName: r.outputName,
outputBarcode: r.outputBarcode,
quantity: r.quantity,
unit: r.unit,
remark: r.remark
}))
)
}
export function serializeAttachments(items: FinanceAttachmentItem[]): string {
return JSON.stringify(
items
.filter((f) => f.fileUrl && !f._uploading)
.map((f) => ({ fileUrl: f.fileUrl, fileName: f.fileName }))
)
}
export function serializeEquipmentIds(ids: string[]): string {
return JSON.stringify([...ids].sort())
}
function normalizeReagents(rows: Record<string, any>[] | undefined) {
return (rows || []).map((r) => ({
reagentCode: r.reagentCode,
reagentName: r.reagentName,
spec: r.spec,
standardUsage: r.standardUsage,
actualUsage: r.actualUsage || '',
unit: r.unit,
requisitionUsageId: r.requisitionUsageId || '',
isKeyMaterial: r.isKeyMaterial,
remark: r.remark || ''
}))
}
function normalizeConsumables(rows: Record<string, any>[] | undefined) {
return (rows || []).map((c) => ({
consumableCode: c.consumableCode,
consumableName: c.consumableName,
specModel: c.specModel,
standardUsage: c.standardUsage,
actualUsage: c.actualUsage || '',
unit: c.unit,
requisitionUsageId: c.requisitionUsageId || '',
isRequired: c.isRequired,
remark: c.remark || ''
}))
}
function normalizeConfiguredReagents(rows: Record<string, any>[] | undefined) {
return (rows || []).map((r) => ({
configuredReagentCode: r.configuredReagentCode,
configuredReagentName: r.configuredReagentName,
spec: r.spec,
standardUsage: r.standardUsage,
actualUsage: r.actualUsage || '',
unit: r.unit,
requisitionUsageId: r.requisitionUsageId || '',
remark: r.remark || ''
}))
}
function normalizeStepOutputs(rows: Record<string, any>[] | undefined) {
return (rows || []).map((o) => ({
outputTypeId: o.outputTypeId,
outputName: o.outputName,
outputBarcode: o.outputBarcode,
remark: o.remark || ''
}))
}
function normalizeDataCollections(rows: Record<string, any>[] | undefined) {
return (rows || []).map((d) => ({
collectionName: d.collectionName,
unit: d.unit,
collectionValue: d.collectionValue || '',
remark: d.remark || ''
}))
}
export function serializeStep(step: Record<string, any>): string {
return JSON.stringify({
processName: step.processName,
categoryId: step.categoryId,
description: step.description,
estimatedDuration: step.estimatedDuration,
sopIds: step.sopIds,
assigneeUserIds: [...(step.assigneeUserIds || [])].sort(),
plannedStartTime: step.plannedStartTime || '',
reagents: normalizeReagents(step.reagents),
consumables: normalizeConsumables(step.consumables),
configuredReagents: normalizeConfiguredReagents(step.configuredReagents),
outputs: normalizeStepOutputs(step.outputs),
dataCollections: normalizeDataCollections(step.dataCollections)
})
}
export function scopeToStepId(scope: DirtyScope): string | null {
if (!scope.startsWith('step:')) return null
return scope.slice(5)
}
@@ -50,6 +50,18 @@ import { useUserStore } from '@/store/modules/user'
import { normalizePlannedStartDate, extractProductionTaskSteps } from '@/utils/production-labels'
import { resolveCellProductSpecDisplay } from '@/utils/cell-product-spec'
import { countOutputsMissingStorageSlot } from '@/utils/storage-slot-options'
import {
createEmptySnapshots,
serializeAttachments,
serializeEquipmentIds,
serializeInputs,
serializeOutputs,
serializeStep,
scopeToStepId,
type DirtyScope,
type EditorSnapshots,
type FlushResult
} from './task-step-editor-persistence'
// ── helpers ──────────────────────────────────────────────────────────
function parseTaskAttachmentsFromUrls(urls: string): FinanceAttachmentItem[] {
@@ -141,6 +153,9 @@ export function useTaskStepEditor() {
const activeSubTab = ref(PROCESS_ROUTE_DEFAULT_SUB_TAB)
const processSearchKeyword = ref('')
const configSuppressSave = ref(false)
const executionReadonly = ref(false)
const snapshots = ref<EditorSnapshots>(createEmptySnapshots())
const flushInProgress = ref(false)
// ── execution-mode state ────────────────────────────────────────────
const mode = ref<'edit' | 'execution'>('edit')
@@ -597,7 +612,8 @@ export function useTaskStepEditor() {
const code = (s.inputCode || '').trim()
const id = (s.inputId || '').trim()
if (!code) continue
if (sampleCodeOptions.value.some((x) => x.sampleCode === code || (id && x.id === id))) continue
if (sampleCodeOptions.value.some((x) => x.sampleCode === code || (id && x.id === id)))
continue
mergeSampleCodeOption({
id: id || code,
sampleCode: code,
@@ -642,7 +658,11 @@ export function useTaskStepEditor() {
/* 样本编码池查询失败时继续尝试接收记录 */
}
try {
const recRes = await fetchSampleReceptionReceivedList({ page: 1, pageSize: 10, keyword: code })
const recRes = await fetchSampleReceptionReceivedList({
page: 1,
pageSize: 10,
keyword: code
})
for (const item of recRes.list || []) {
const sc = String(item.sampleCode || '').trim()
const lc = String(item.labStorageCode || '').trim()
@@ -759,6 +779,86 @@ export function useTaskStepEditor() {
const completedStepCount = computed(
() => stepList.value.filter((s) => s.stepStatus === 'ywc').length
)
function refreshStepSnapshot(stepId: string) {
const step = stepList.value.find((s) => s.id === stepId)
if (!step) return
snapshots.value.steps[stepId] = serializeStep(step)
}
function refreshSnapshots() {
snapshots.value = {
inputs: serializeInputs(taskInputs.value),
outputs: serializeOutputs(taskOutputs.value),
attachments: serializeAttachments(taskAttachments.value),
equipmentIds: serializeEquipmentIds(taskEquipmentIds.value),
steps: Object.fromEntries(stepList.value.map((s) => [s.id, serializeStep(s)]))
}
}
function getCurrentScope(): DirtyScope | null {
if (selectedVirtualStep.value) return selectedVirtualStep.value
if (selectedStepId.value) return `step:${selectedStepId.value}`
return null
}
function shouldGuardNavigation(): boolean {
return (
mode.value === 'execution' &&
!executionReadonly.value &&
!configSuppressSave.value &&
!flushInProgress.value
)
}
function isScopeDirty(scope: DirtyScope): boolean {
switch (scope) {
case 'input':
return serializeInputs(taskInputs.value) !== snapshots.value.inputs
case 'output':
return serializeOutputs(taskOutputs.value) !== snapshots.value.outputs
case 'paper':
return serializeAttachments(taskAttachments.value) !== snapshots.value.attachments
case 'equipment':
return serializeEquipmentIds(taskEquipmentIds.value) !== snapshots.value.equipmentIds
default: {
const stepId = scopeToStepId(scope)
if (!stepId) return false
const step = stepList.value.find((s) => s.id === stepId)
if (!step) return false
return serializeStep(step) !== (snapshots.value.steps[stepId] || '')
}
}
}
function isCurrentScopeDirty(): boolean {
const scope = getCurrentScope()
return scope ? isScopeDirty(scope) : false
}
const dirtyScopeCount = computed(() => {
let count = 0
const virtualScopes: DirtyScope[] = ['input', 'output', 'paper', 'equipment']
for (const scope of virtualScopes) {
if (isScopeDirty(scope)) count++
}
for (const step of stepList.value) {
if (isScopeDirty(`step:${step.id}`)) count++
}
return count
})
/** 任务执行弹窗:手动保存与导航自动保存期间的统一 loading */
const isExecutionSaving = computed(
() =>
flushInProgress.value ||
inputSaving.value ||
outputSaving.value ||
attachmentSaving.value ||
equipmentSaving.value ||
manualSaveLoading.value
)
const sopIdsArr = computed({
get() {
if (!selectedStep.value) return []
@@ -882,15 +982,16 @@ export function useTaskStepEditor() {
const workOrderId = String(executionDetail.workOrderId || '').trim()
if (!workOrderId) return executionDetail
const needsWo =
!(executionDetail.labStorageCode || '').trim() || !executionDetail.workOrderType
const needsWo = !(executionDetail.labStorageCode || '').trim() || !executionDetail.workOrderType
if (!needsWo) return executionDetail
try {
const wo = await fetchProductionWorkOrderDetail(workOrderId)
const patch: Record<string, any> = {}
const lc = String(
wo?.labStorageCode || (wo?.reception as Record<string, any> | undefined)?.labStorageCode || ''
wo?.labStorageCode ||
(wo?.reception as Record<string, any> | undefined)?.labStorageCode ||
''
).trim()
if (lc && !(executionDetail.labStorageCode || '').trim()) {
patch.labStorageCode = lc
@@ -925,7 +1026,9 @@ export function useTaskStepEditor() {
let executionDetail = detail
executionDetail = await enrichExecutionDetailFromWorkOrder(executionDetail)
taskDetail.value = executionDetail
taskInputs.value = (executionDetail.inputs || []).map((i: Record<string, any>) => ({ ...i }))
taskInputs.value = (executionDetail.inputs || []).map((i: Record<string, any>) => ({
...i
}))
taskOutputs.value = (detail.outputs || []).map((o: Record<string, any>) =>
enrichTaskOutputRow(o)
)
@@ -948,6 +1051,7 @@ export function useTaskStepEditor() {
}
ensureSampleCodesInOptions(taskInputs.value.filter((r) => r.inputType === 'sample'))
await hydrateSampleLabStorageCodes()
refreshSnapshots()
}
return stepList.value.length
} catch {
@@ -965,7 +1069,11 @@ export function useTaskStepEditor() {
if (!processId || !taskId.value) return
stepListLoading.value = true
try {
const newStep = await fetchAddTaskStep(taskId.value, { process_id: processId }, operateScope.value)
const newStep = await fetchAddTaskStep(
taskId.value,
{ process_id: processId },
operateScope.value
)
await loadTaskDetail()
if (newStep?.id) selectedStepId.value = newStep.id
ElMessage.success('步骤添加成功')
@@ -993,13 +1101,19 @@ export function useTaskStepEditor() {
stepListLoading.value = false
}
}
function selectStep(step: Record<string, any>) {
async function selectStep(step: Record<string, any>) {
if (selectedStepId.value === step.id && !selectedVirtualStep.value) return
if (!(await guardBeforeLeaveCurrentScope())) return
ensureStepAssigneeFields(step)
selectedStepId.value = step.id
selectedVirtualStep.value = null
void ensureStepMaterialOptionsLoaded()
}
function selectVirtualStep(type: 'input' | 'output' | 'paper' | 'equipment') {
async function selectVirtualStep(type: 'input' | 'output' | 'paper' | 'equipment') {
if (selectedVirtualStep.value === type) return
if (!(await guardBeforeLeaveCurrentScope())) return
selectedVirtualStep.value = type
selectedStepId.value = ''
if (type === 'input' || type === 'output') {
@@ -1010,7 +1124,10 @@ export function useTaskStepEditor() {
stepListLoading.value = true
configSuppressSave.value = true
try {
const ns = await fetchCopyTaskStep({ taskId: taskId.value, stepId: step.id }, operateScope.value)
const ns = await fetchCopyTaskStep(
{ taskId: taskId.value, stepId: step.id },
operateScope.value
)
await loadTaskDetail()
if (ns?.id) selectedStepId.value = ns.id
ElMessage.success('步骤已复制')
@@ -1161,6 +1278,7 @@ export function useTaskStepEditor() {
step._snapshotPlannedStartTime = step.plannedStartTime || ''
touchStepList()
}
refreshStepSnapshot(step.id)
}
async function saveStepBasic() {
@@ -1283,31 +1401,60 @@ export function useTaskStepEditor() {
void saveConsumables()
}
function validateExecutionReagents() {
if (mode.value !== 'execution' || !selectedStep.value?.reagents) return true
function getExecutionReagentsError(): string | null {
if (mode.value !== 'execution' || !selectedStep.value?.reagents) return null
for (const r of selectedStep.value.reagents) {
const actual = String(r.actualUsage ?? '').trim()
const code = String(r.reagentCode ?? '').trim()
const reqId = String(r.requisitionUsageId ?? '').trim()
if (actual && code && !reqId) {
ElMessage.warning(`试剂「${r.reagentName || code}」需选择领用记录`)
return false
return `试剂「${r.reagentName || code}」需选择领用记录`
}
}
return true
return null
}
function validateExecutionConsumables() {
if (mode.value !== 'execution' || !selectedStep.value?.consumables) return true
function getExecutionConsumablesError(): string | null {
if (mode.value !== 'execution' || !selectedStep.value?.consumables) return null
for (const c of selectedStep.value.consumables) {
const actual = String(c.actualUsage ?? '').trim()
const code = String(c.consumableCode ?? '').trim()
const reqId = String(c.requisitionUsageId ?? '').trim()
if (actual && code && !reqId) {
ElMessage.warning(`耗材「${c.consumableName || code}」需选择领用记录`)
return false
return `耗材「${c.consumableName || code}」需选择领用记录`
}
}
return null
}
function getExecutionConfiguredReagentsError(): string | null {
if (mode.value !== 'execution' || !selectedStep.value?.configuredReagents) return null
for (const r of selectedStep.value.configuredReagents) {
const actual = String(r.actualUsage ?? '').trim()
const code = String(r.configuredReagentCode ?? '').trim()
const reqId = String(r.requisitionUsageId ?? '').trim()
if (actual && code && !reqId) {
return `配置试剂「${r.configuredReagentName || code}」需选择领用记录`
}
}
return null
}
function validateExecutionReagents() {
const err = getExecutionReagentsError()
if (err) {
ElMessage.warning(err)
return false
}
return true
}
function validateExecutionConsumables() {
const err = getExecutionConsumablesError()
if (err) {
ElMessage.warning(err)
return false
}
return true
}
@@ -1327,6 +1474,7 @@ export function useTaskStepEditor() {
remark: r.remark || ''
}))
await fetchReplaceStepReagents(taskId.value, selectedStep.value.id, items, operateScope.value)
refreshStepSnapshot(selectedStep.value.id)
} catch {
/* ignore */
}
@@ -1366,7 +1514,13 @@ export function useTaskStepEditor() {
is_required: toApiFlag(c.isRequired),
remark: c.remark || ''
}))
await fetchReplaceStepConsumables(taskId.value, selectedStep.value.id, items, operateScope.value)
await fetchReplaceStepConsumables(
taskId.value,
selectedStep.value.id,
items,
operateScope.value
)
refreshStepSnapshot(selectedStep.value.id)
} catch {
/* ignore */
}
@@ -1448,10 +1602,11 @@ export function useTaskStepEditor() {
]
}
function ensureAllStepConfiguredReagentOptions() {
for (const step of stepList.value)
for (const step of stepList.value) {
;(step.configuredReagents || []).forEach((r: Record<string, any>) =>
ensureConfiguredReagentOption(r)
)
}
}
function onConfiguredReagentRowSelect(row: Record<string, any>, materialId: string) {
if (!materialId) {
@@ -1498,7 +1653,10 @@ export function useTaskStepEditor() {
function removeConfiguredReagentRow(i: number) {
selectedStep.value?.configuredReagents?.splice(i, 1)
}
function isConfiguredReagentRequisitionDisabled(requisitionUsageId: string, currentIndex: number) {
function isConfiguredReagentRequisitionDisabled(
requisitionUsageId: string,
currentIndex: number
) {
if (!requisitionUsageId || !selectedStep.value?.configuredReagents) return false
return selectedStep.value.configuredReagents.some(
(r: Record<string, any>, i: number) =>
@@ -1534,15 +1692,10 @@ export function useTaskStepEditor() {
void saveConfiguredReagents()
}
function validateExecutionConfiguredReagents() {
if (mode.value !== 'execution' || !selectedStep.value?.configuredReagents) return true
for (const r of selectedStep.value.configuredReagents) {
const actual = String(r.actualUsage ?? '').trim()
const code = String(r.configuredReagentCode ?? '').trim()
const reqId = String(r.requisitionUsageId ?? '').trim()
if (actual && code && !reqId) {
ElMessage.warning(`配置试剂「${r.configuredReagentName || code}」需选择领用记录`)
return false
}
const err = getExecutionConfiguredReagentsError()
if (err) {
ElMessage.warning(err)
return false
}
return true
}
@@ -1566,6 +1719,7 @@ export function useTaskStepEditor() {
items,
operateScope.value
)
refreshStepSnapshot(selectedStep.value.id)
} catch {
/* ignore */
}
@@ -1594,6 +1748,7 @@ export function useTaskStepEditor() {
remark: o.remark || ''
}))
await fetchReplaceStepOutputs(taskId.value, selectedStep.value.id, items, operateScope.value)
refreshStepSnapshot(selectedStep.value.id)
} catch {
/* ignore */
}
@@ -1621,7 +1776,13 @@ export function useTaskStepEditor() {
collection_value: d.collectionValue || '',
remark: d.remark || ''
}))
await fetchReplaceStepDataCollection(taskId.value, selectedStep.value.id, items, operateScope.value)
await fetchReplaceStepDataCollection(
taskId.value,
selectedStep.value.id,
items,
operateScope.value
)
refreshStepSnapshot(selectedStep.value.id)
} catch {
/* ignore */
}
@@ -1630,41 +1791,400 @@ export function useTaskStepEditor() {
const manualSaveLoading = ref(false)
const stepActionLoading = ref(false)
const taskActionLoading = ref(false)
async function handleManualSave() {
if (!selectedStep.value || manualSaveLoading.value) return
const step = selectedStep.value
function validateTaskInputs(): string | null {
const invalid = taskInputs.value.find(
(row) =>
!row.inputType ||
(!(row.inputId || '').trim() &&
!(row.inputCode || '').trim() &&
!(row.inputName || '').trim())
)
if (invalid) {
return '请补全每行原材料的类型与编码/名称'
}
return null
}
function validateTaskOutputs(): string | null {
const invalid = taskOutputs.value.find(
(row) => !(row.outputName || '').trim() || !(row.outputBarcode || '').trim()
)
if (invalid) {
return '请补全每行产出的输出名称与条码'
}
return null
}
function validateTaskAttachments(): string | null {
if (taskAttachments.value.some((f) => f._uploading)) {
return '文档正在上传,请稍候再保存'
}
return null
}
async function saveTaskInputs(options?: { silent?: boolean }): Promise<FlushResult> {
if (!taskDetail.value?.id) return { ok: true }
const err = validateTaskInputs()
if (err) {
if (!options?.silent) ElMessage.warning(err)
return { ok: false, message: err, blocking: true }
}
inputSaving.value = true
try {
await fetchSetTaskInputs(taskDetail.value.id, taskInputs.value, operateScope.value)
if (!options?.silent) ElMessage.success('输入已保存')
await loadTaskDetail()
refreshSnapshots()
return { ok: true }
} catch (e: any) {
const message = e?.message || '保存失败,请重试'
if (!options?.silent) ElMessage.warning(message)
return { ok: false, message, blocking: true }
} finally {
inputSaving.value = false
}
}
async function saveTaskOutputs(options?: { silent?: boolean }): Promise<FlushResult> {
if (!taskDetail.value?.id) return { ok: true }
const err = validateTaskOutputs()
if (err) {
if (!options?.silent) ElMessage.warning(err)
return { ok: false, message: err, blocking: true }
}
outputSaving.value = true
try {
const payload = taskOutputs.value.map((row) => {
const specName =
'specName' in row || 'specText' in row
? String(row.specName ?? row.specText ?? '').trim()
: resolveCellProductSpecDisplay(row)
return { ...row, specName, specText: specName }
})
await fetchSetTaskOutputs(taskDetail.value.id, payload, operateScope.value)
if (!options?.silent) ElMessage.success('产出已保存')
await loadTaskDetail()
refreshSnapshots()
return { ok: true }
} catch (e: any) {
const message = e?.message || '保存失败,请重试'
if (!options?.silent) ElMessage.warning(message)
return { ok: false, message, blocking: true }
} finally {
outputSaving.value = false
}
}
async function saveTaskAttachments(options?: { silent?: boolean }): Promise<FlushResult> {
if (!taskDetail.value?.id) return { ok: true }
const err = validateTaskAttachments()
if (err) {
if (!options?.silent) ElMessage.warning(err)
return { ok: false, message: err, blocking: true }
}
attachmentSaving.value = true
try {
await fetchUpdateProductionTask(taskDetail.value.id, {
attachments: financeAttachmentsToUrlString(taskAttachments.value) || undefined
})
if (!options?.silent) ElMessage.success('纸质文档已保存')
await loadTaskDetail()
refreshSnapshots()
return { ok: true }
} catch (e: any) {
const message = e?.message || '保存失败,请重试'
if (!options?.silent) ElMessage.warning(message)
return { ok: false, message, blocking: true }
} finally {
attachmentSaving.value = false
}
}
async function saveTaskEquipment(options?: { silent?: boolean }): Promise<FlushResult> {
const id = taskDetail.value?.id || taskId.value
if (!id) return { ok: true }
equipmentSaving.value = true
try {
await fetchUpdateProductionTask(id, {
equipmentIds: taskEquipmentIds.value.length ? taskEquipmentIds.value : null
})
if (!options?.silent) ElMessage.success('设备列表已保存')
await loadTaskDetail()
refreshSnapshots()
return { ok: true }
} catch (e: any) {
const message = e?.message || '保存失败,请重试'
if (!options?.silent) ElMessage.warning(message)
return { ok: false, message, blocking: true }
} finally {
equipmentSaving.value = false
}
}
function getStepSubTablesSaveErrorFor(step: Record<string, any>): string | null {
if (mode.value !== 'execution') return null
for (const r of step.reagents || []) {
const actual = String(r.actualUsage ?? '').trim()
const code = String(r.reagentCode ?? '').trim()
const reqId = String(r.requisitionUsageId ?? '').trim()
if (actual && code && !reqId) {
return `试剂「${r.reagentName || code}」需选择领用记录`
}
}
for (const c of step.consumables || []) {
const actual = String(c.actualUsage ?? '').trim()
const code = String(c.consumableCode ?? '').trim()
const reqId = String(c.requisitionUsageId ?? '').trim()
if (actual && code && !reqId) {
return `耗材「${c.consumableName || code}」需选择领用记录`
}
}
for (const r of step.configuredReagents || []) {
const actual = String(r.actualUsage ?? '').trim()
const code = String(r.configuredReagentCode ?? '').trim()
const reqId = String(r.requisitionUsageId ?? '').trim()
if (actual && code && !reqId) {
return `配置试剂「${r.configuredReagentName || code}」需选择领用记录`
}
}
return null
}
function canEditStepDispatchFor(step: Record<string, any> | null | undefined): boolean {
if (operateScope.value === 'mine') {
return canEditStep(step)
}
return true
}
async function saveStepRecord(step: Record<string, any>): Promise<FlushResult> {
const canBasic = canEditStep(step)
const canDispatch = canEditStepDispatch() && stepDispatchChanged(step)
if (!canBasic && !canDispatch) return
manualSaveLoading.value = true
const canDispatch = canEditStepDispatchFor(step) && stepDispatchChanged(step)
if (!canBasic && !canDispatch) return { ok: true }
if (canBasic) {
const subErr = getStepSubTablesSaveErrorFor(step)
if (subErr) return { ok: false, message: subErr, blocking: true }
}
try {
if (canBasic) {
await Promise.all([
saveStepBasic(),
saveReagents(),
saveConsumables(),
saveConfiguredReagents(),
saveOutputs(),
saveDataCollections()
])
await fetchUpdateTaskStep(
taskId.value,
step.id,
{
process_name: step.processName,
category_id: step.categoryId,
description: step.description,
estimated_duration: step.estimatedDuration,
sop_ids: step.sopIds
},
operateScope.value
)
const items = (step.reagents || []).map((r: Record<string, any>) => ({
material_code: r.reagentCode,
material_name: r.reagentName,
spec: r.spec,
standard_usage: r.standardUsage,
actual_usage: r.actualUsage || '',
unit: r.unit,
requisition_usage_id: r.requisitionUsageId || '',
is_key_material: toApiFlag(r.isKeyMaterial),
remark: r.remark || ''
}))
await fetchReplaceStepReagents(taskId.value, step.id, items, operateScope.value)
const consumableItems = (step.consumables || []).map((c: Record<string, any>) => ({
material_code: c.consumableCode,
material_name: c.consumableName,
spec_model: c.specModel,
standard_usage: c.standardUsage,
actual_usage: c.actualUsage || '',
unit: c.unit,
requisition_usage_id: c.requisitionUsageId || '',
is_required: toApiFlag(c.isRequired),
remark: c.remark || ''
}))
await fetchReplaceStepConsumables(
taskId.value,
step.id,
consumableItems,
operateScope.value
)
const configuredItems = (step.configuredReagents || []).map((r: Record<string, any>) => ({
material_code: r.configuredReagentCode,
material_name: r.configuredReagentName,
spec: r.spec,
standard_usage: r.standardUsage,
actual_usage: r.actualUsage || '',
unit: r.unit,
requisition_usage_id: r.requisitionUsageId || '',
remark: r.remark || ''
}))
await fetchReplaceStepConfiguredReagents(
taskId.value,
step.id,
configuredItems,
operateScope.value
)
const outputItems = (step.outputs || []).map((o: Record<string, any>) => ({
output_type_id: o.outputTypeId,
output_name: o.outputName,
output_barcode: o.outputBarcode,
remark: o.remark || ''
}))
await fetchReplaceStepOutputs(taskId.value, step.id, outputItems, operateScope.value)
const dataItems = (step.dataCollections || []).map((d: Record<string, any>) => ({
collection_name: d.collectionName,
unit: d.unit,
collection_value: d.collectionValue || '',
remark: d.remark || ''
}))
await fetchReplaceStepDataCollection(taskId.value, step.id, dataItems, operateScope.value)
}
if (canDispatch) {
await saveStepDispatch()
const assigneeUserIds = [...(step.assigneeUserIds || [])]
const result = await fetchDispatchProductionTaskSteps(
taskId.value,
{
steps: [
{
stepId: step.id,
assigneeUserIds,
plannedStartTime: step.plannedStartTime || null
}
]
},
operateScope.value
)
const steps = extractProductionTaskSteps(result)
if (steps.length) {
mergeStepDispatchSummaries(steps)
} else {
syncStepAssigneeDisplay(step)
step._snapshotAssigneeUserIds = [...assigneeUserIds]
step._snapshotPlannedStartTime = step.plannedStartTime || ''
touchStepList()
}
}
ElMessage.success('保存成功')
} catch {
ElMessage.error('保存失败,请重试')
refreshStepSnapshot(step.id)
return { ok: true }
} catch (e: any) {
return { ok: false, message: e?.message || '保存失败,请重试', blocking: true }
}
}
async function saveCurrentStep(options?: { silent?: boolean }): Promise<FlushResult> {
if (!selectedStep.value || manualSaveLoading.value) return { ok: true }
manualSaveLoading.value = true
try {
const result = await saveStepRecord(selectedStep.value)
if (result.ok && !options?.silent) {
ElMessage.success('保存成功')
}
return result
} finally {
manualSaveLoading.value = false
}
}
async function flushScope(
scope: DirtyScope,
options?: { silent?: boolean }
): Promise<FlushResult> {
switch (scope) {
case 'input':
return saveTaskInputs(options)
case 'output':
return saveTaskOutputs(options)
case 'paper':
return saveTaskAttachments(options)
case 'equipment':
return saveTaskEquipment(options)
default: {
const stepId = scopeToStepId(scope)
const step = stepList.value.find((s) => s.id === stepId)
if (!step) return { ok: true }
return saveStepRecord(step)
}
}
}
async function flushAllDirtyScopes(options?: { silent?: boolean }): Promise<FlushResult> {
if (!shouldGuardNavigation()) return { ok: true }
const scopes: DirtyScope[] = [
'input',
'output',
'paper',
'equipment',
...stepList.value.map((s) => `step:${s.id}` as DirtyScope)
]
if (flushInProgress.value) {
return { ok: false, message: '正在保存,请稍候', blocking: true }
}
flushInProgress.value = true
try {
for (const scope of scopes) {
if (!isScopeDirty(scope)) continue
const result = await flushScope(scope, options)
if (!result.ok) {
if (result.blocking) ElMessage.warning(result.message)
return result
}
}
return { ok: true }
} finally {
flushInProgress.value = false
}
}
async function flushCurrentScope(options?: { silent?: boolean }): Promise<FlushResult> {
if (!shouldGuardNavigation()) return { ok: true }
const scope = getCurrentScope()
if (!scope || !isScopeDirty(scope)) return { ok: true }
if (flushInProgress.value) {
return { ok: false, message: '正在保存,请稍候', blocking: true }
}
flushInProgress.value = true
try {
const result = await flushScope(scope, options)
if (!result.ok && result.blocking) {
ElMessage.warning(result.message)
}
return result
} finally {
flushInProgress.value = false
}
}
async function guardBeforeLeaveCurrentScope(): Promise<boolean> {
const result = await flushCurrentScope({ silent: true })
return result.ok
}
async function handleManualSave() {
const result = await saveCurrentStep({ silent: false })
if (!result.ok && result.blocking) {
ElMessage.warning(result.message)
}
}
async function handleStartStep(step: Record<string, any>) {
if (!taskId.value || !step.id || stepActionLoading.value) return
if (!canEditStep(step)) {
ElMessage.warning('非当前步骤负责人,无法操作')
return
}
if (!(await guardBeforeLeaveCurrentScope())) return
stepActionLoading.value = true
try {
await fetchUpdateTaskStep(taskId.value, step.id, { step_status: 'jxz' }, operateScope.value)
@@ -1688,6 +2208,7 @@ export function useTaskStepEditor() {
} catch {
return
}
if (!(await guardBeforeLeaveCurrentScope())) return
stepActionLoading.value = true
try {
await fetchUpdateTaskStep(taskId.value, step.id, { step_status: 'ywc' }, operateScope.value)
@@ -1702,6 +2223,8 @@ export function useTaskStepEditor() {
async function handleStartTask() {
if (!taskDetail.value?.id || taskActionLoading.value) return
const flushResult = await flushAllDirtyScopes({ silent: true })
if (!flushResult.ok) return
try {
await ElMessageBox.confirm('确定开始执行该任务吗?', '提示', { type: 'warning' })
} catch {
@@ -1709,7 +2232,11 @@ export function useTaskStepEditor() {
}
taskActionLoading.value = true
try {
await fetchUpdateProductionTaskStatus(taskDetail.value.id, { taskStatus: 'jxz' }, operateScope.value)
await fetchUpdateProductionTaskStatus(
taskDetail.value.id,
{ taskStatus: 'jxz' },
operateScope.value
)
ElMessage.success('任务已开始执行')
await loadTaskDetail(taskDetail.value.id)
} catch {
@@ -1757,6 +2284,9 @@ export function useTaskStepEditor() {
async function handleCompleteTask() {
if (!taskDetail.value?.id || taskActionLoading.value) return
const flushResult = await flushAllDirtyScopes({ silent: true })
if (!flushResult.ok) return
const isCompleted = taskDetail.value.taskStatus === 'ywc'
completeConclusionIsEdit.value = isCompleted
completeConclusionInitial.conclusion =
@@ -1831,30 +2361,6 @@ export function useTaskStepEditor() {
function removeTaskInputRow(i: number) {
taskInputs.value.splice(i, 1)
}
async function saveTaskInputs() {
if (!taskDetail.value?.id) return
const invalid = taskInputs.value.find(
(row) =>
!row.inputType ||
(!(row.inputId || '').trim() &&
!(row.inputCode || '').trim() &&
!(row.inputName || '').trim())
)
if (invalid) {
ElMessage.warning('请补全每行原材料的类型与编码/名称')
return
}
inputSaving.value = true
try {
await fetchSetTaskInputs(taskDetail.value.id, taskInputs.value, operateScope.value)
ElMessage.success('输入已保存')
await loadTaskDetail()
} catch {
/* global error handling */
} finally {
inputSaving.value = false
}
}
function addTaskOutputRow() {
taskOutputs.value.push({
@@ -1870,70 +2376,6 @@ export function useTaskStepEditor() {
function removeTaskOutputRow(i: number) {
taskOutputs.value.splice(i, 1)
}
async function saveTaskOutputs() {
if (!taskDetail.value?.id) return
const invalid = taskOutputs.value.find(
(row) => !(row.outputName || '').trim() || !(row.outputBarcode || '').trim()
)
if (invalid) {
ElMessage.warning('请补全每行产出的输出名称与条码')
return
}
outputSaving.value = true
try {
const payload = taskOutputs.value.map((row) => {
const specName =
'specName' in row || 'specText' in row
? String(row.specName ?? row.specText ?? '').trim()
: resolveCellProductSpecDisplay(row)
return { ...row, specName, specText: specName }
})
await fetchSetTaskOutputs(taskDetail.value.id, payload, operateScope.value)
ElMessage.success('产出已保存')
await loadTaskDetail()
} catch {
/* global error handling */
} finally {
outputSaving.value = false
}
}
async function saveTaskAttachments() {
if (!taskDetail.value?.id) return
if (taskAttachments.value.some((f) => f._uploading)) {
ElMessage.warning('文档正在上传,请稍候再保存')
return
}
attachmentSaving.value = true
try {
await fetchUpdateProductionTask(taskDetail.value.id, {
attachments: financeAttachmentsToUrlString(taskAttachments.value) || undefined
})
ElMessage.success('纸质文档已保存')
await loadTaskDetail()
} catch {
/* global error handling */
} finally {
attachmentSaving.value = false
}
}
async function saveTaskEquipment() {
const id = taskDetail.value?.id || taskId.value
if (!id) return
equipmentSaving.value = true
try {
await fetchUpdateProductionTask(id, {
equipmentIds: taskEquipmentIds.value.length ? taskEquipmentIds.value : null
})
ElMessage.success('设备列表已保存')
await loadTaskDetail()
} catch {
/* global error handling */
} finally {
equipmentSaving.value = false
}
}
function taskStatusTag(status: string) {
const map: Record<string, { label: string; type: string }> = {
@@ -1997,11 +2439,13 @@ export function useTaskStepEditor() {
options?: {
mode?: 'edit' | 'execution'
operateScope?: import('@/api/production-task').ProductionTaskOperateScope
readonly?: boolean
expectSteps?: boolean
initialSteps?: Record<string, any>[]
}
): Promise<number> {
operateScope.value = options?.operateScope
executionReadonly.value = Boolean(options?.readonly)
mode.value = options?.mode || 'edit'
taskId.value = id
selectedStepId.value = ''
@@ -2041,7 +2485,9 @@ export function useTaskStepEditor() {
let executionDetail = detail
executionDetail = await enrichExecutionDetailFromWorkOrder(executionDetail)
taskDetail.value = executionDetail
taskInputs.value = (executionDetail.inputs || []).map((i: Record<string, any>) => ({ ...i }))
taskInputs.value = (executionDetail.inputs || []).map((i: Record<string, any>) => ({
...i
}))
taskOutputs.value = (executionDetail.outputs || []).map((o: Record<string, any>) =>
enrichTaskOutputRow(o)
)
@@ -2087,6 +2533,9 @@ export function useTaskStepEditor() {
processLibraryLoading.value = false
await nextTick()
configSuppressSave.value = false
if (mode.value === 'execution') {
refreshSnapshots()
}
}
return stepCount
}
@@ -2105,6 +2554,16 @@ export function useTaskStepEditor() {
activeSubTab,
processSearchKeyword,
configSuppressSave,
executionReadonly,
isScopeDirty,
isCurrentScopeDirty,
dirtyScopeCount,
isExecutionSaving,
flushCurrentScope,
flushAllDirtyScopes,
guardBeforeLeaveCurrentScope,
refreshSnapshots,
getCurrentScope,
mode,
taskDetail,
taskInputs,