This commit is contained in:
zlwu committed 2026-05-21 21:29:54 +08:00
1 parent b0eb80a2d4
commit 87dbbf1247
25 files changed
+6659 -5256

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_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": "L24"}, {"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": "L28"}, {"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": "L31"}, {"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": "L46"}, {"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": "L53"}, {"id": "production_work_order_usetaskstepeditor_ensureallstepunitoptions", "label": "ensureAllStepUnitOptions()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L253"}, {"id": "production_work_order_usetaskstepeditor_loadconfigreferencedata", "label": "loadConfigReferenceData()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L294"}, {"id": "production_work_order_usetaskstepeditor_loadtaskdetail", "label": "loadTaskDetail()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L318"}, {"id": "production_work_order_usetaskstepeditor_ondragstart", "label": "onDragStart()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L333"}, {"id": "production_work_order_usetaskstepeditor_ondroptocenter", "label": "onDropToCenter()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L337"}, {"id": "production_work_order_usetaskstepeditor_onstepdragend", "label": "onStepDragEnd()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L351"}, {"id": "production_work_order_usetaskstepeditor_selectstep", "label": "selectStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L360"}, {"id": "production_work_order_usetaskstepeditor_handlecopystep", "label": "handleCopyStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L361"}, {"id": "production_work_order_usetaskstepeditor_handledeletestep", "label": "handleDeleteStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L372"}, {"id": "production_work_order_usetaskstepeditor_savestepbasic", "label": "saveStepBasic()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L386"}, {"id": "production_work_order_usetaskstepeditor_onsopidschange", "label": "onSopIdsChange()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L399"}, {"id": "production_work_order_usetaskstepeditor_addreagentrow", "label": "addReagentRow()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/useTaskStepEditor.ts", "source_location": "L404"}, {"id": "production_work_order_usetaskstepeditor_removereagentrow", "label": "removeReagentLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task_ts", "label": "production-task.ts", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L1"}, {"id": "api_production_task_fetchcreateproductiontask", "label": "fetchCreateProductionTask()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L3"}, {"id": "api_production_task_fetchproductiontasklist", "label": "fetchProductionTaskList()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L7"}, {"id": "api_production_task_fetchproductiontaskdetail", "label": "fetchProductionTaskDetail()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L23"}, {"id": "api_production_task_fetchupdateproductiontask", "label": "fetchUpdateProductionTask()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L27"}, {"id": "api_production_task_fetchupdateproductiontaskstatus", "label": "fetchUpdateProductionTaskStatus()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L31"}, {"id": "api_production_task_fetchaddtaskstep", "label": "fetchAddTaskStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L35"}, {"id": "api_production_task_fetchupdatetaskstep", "label": "fetchUpdateTaskStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L39"}, {"id": "api_production_task_fetchdeletetaskstep", "label": "fetchDeleteTaskStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L43"}, {"id": "api_production_task_fetchreplacestepreagents", "label": "fetchReplaceStepReagents()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L47"}, {"id": "api_production_task_fetchreplacestepconsumables", "label": "fetchReplaceStepConsumables()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L54"}, {"id": "api_production_task_fetchreplacestepdatacollection", "label": "fetchReplaceStepDataCollection()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L61"}, {"id": "api_production_task_fetchsettaskinputs", "label": "fetchSetTaskInputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L68"}, {"id": "api_production_task_fetchsettaskoutputs", "label": "fetchSetTaskOutputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L72"}, {"id": "api_production_task_fetchreordertasksteps", "label": "fetchReorderTaskSteps()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L76"}, {"id": "api_production_task_fetchcopytaskstep", "label": "fetchCopyTaskStep()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L80"}, {"id": "api_production_task_fetchreplacestepoutputs", "label": "fetchReplaceStepOutputs()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L87"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task_ts", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_http", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L1", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task_ts", "target": "api_production_task_fetchcreateproductiontask", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L3", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task_ts", "target": "api_production_task_fetchproductiontasklist", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/api/production-task.ts", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_api_production_task_ts", "target": "api_production_task_fetchLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_process_route_index_vue", "label": "index.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1"}, {"id": "process_route_index_if", "label": "if()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1055"}, {"id": "process_route_index_get", "label": "get()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1255"}, {"id": "process_route_index_set", "label": "set()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1265"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_process_route_index_vue", "target": "process_route_index_if", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1055", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_process_route_index_vue", "target": "process_route_index_if", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1172", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_process_route_index_vue", "target": "process_route_index_get", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1255", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_process_route_index_vue", "target": "process_route_index_set", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1265", "weight": 1.0}], "raw_calls": [{"caller_nid": "process_route_index_if", "callee": "mapReagentOptionLabel", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1057"}, {"caller_nid": "process_route_index_if", "callee": "mapConsumableOptionLabel", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1174"}, {"caller_nid": "process_route_index_get", "callee": "isArray", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1259"}, {"caller_nid": "process_route_index_get", "callee": "filter", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1259"}, {"caller_nid": "process_route_index_get", "callee": "filter", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1260"}, {"caller_nid": "process_route_index_get", "callee": "map", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1260"}, {"caller_nid": "process_route_index_get", "callee": "split", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1260"}, {"caller_nid": "process_route_index_get", "callee": "String", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1260"}, {"caller_nid": "process_route_index_set", "callee": "join", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/process-route/index.vue", "source_location": "L1267"}]}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_stepdetailpanel_vue", "label": "StepDetailPanel.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/StepDetailPanel.vue", "source_location": "L1"}], "edges": [], "raw_calls": []}
@@ -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_index_vue", "label": "index.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/index.vue", "source_location": "L1"}], "edges": [], "raw_calls": []}
@@ -172,7 +172,8 @@
<el-table-column type="index" label="序号" width="56" align="center" :index="(i: number) => i + 1" />
<el-table-column label="产出类型" min-width="150" align="center">
<template #default="{ row }">
<el-select v-model="row.outputTypeId" placeholder="选择类型" filterable class="inner-cell-select">
<el-select v-model="row.outputTypeId" placeholder="选择类型" filterable class="inner-cell-select"
@change="editor.saveOutputs">
<el-option v-for="ot in editor.outputTypeOptions.value" :key="ot.id"
:label="ot.typeName || ot.name" :value="ot.id" />
</el-select>
@@ -180,17 +181,20 @@
</el-table-column>
<el-table-column label="名称" min-width="150" align="center">
<template #default="{ row }">
<el-input v-model="row.outputName" placeholder="名称" class="inner-cell-input" />
<el-input v-model="row.outputName" placeholder="名称" class="inner-cell-input"
@change="editor.saveOutputs" />
</template>
</el-table-column>
<el-table-column label="条码" min-width="150" align="center">
<template #default="{ row }">
<el-input v-model="row.outputBarcode" placeholder="条码" class="inner-cell-input" />
<el-input v-model="row.outputBarcode" placeholder="条码" class="inner-cell-input"
@change="editor.saveOutputs" />
</template>
</el-table-column>
<el-table-column label="备注" min-width="120" align="center">
<template #default="{ row }">
<el-input v-model="row.remark" placeholder="备注" class="inner-cell-input" />
<el-input v-model="row.remark" placeholder="备注" class="inner-cell-input"
@change="editor.saveOutputs" />
</template>
</el-table-column>
<el-table-column label="操作" width="80" align="center">
@@ -212,7 +216,8 @@
<el-table-column type="index" label="序号" width="56" align="center" :index="(i: number) => i + 1" />
<el-table-column label="采集名称" min-width="180" align="center">
<template #default="{ row }">
<el-input v-model="row.collectionName" placeholder="采集项名称" class="inner-cell-input" />
<el-input v-model="row.collectionName" placeholder="采集项名称" class="inner-cell-input"
@change="editor.saveDataCollections" />
</template>
</el-table-column>
<el-table-column label="单位" min-width="120" align="center">
@@ -220,19 +225,16 @@
<el-select v-model="row.unit" placeholder="请选择单位" clearable filterable remote
reserve-keyword class="inner-cell-select" :loading="editor.itemUnitOptionsLoading.value"
:remote-method="editor.searchItemUnitOptions"
@visible-change="(vis: boolean) => vis && editor.searchItemUnitOptions('')">
@visible-change="(vis: boolean) => vis && editor.searchItemUnitOptions('')"
@change="editor.saveDataCollections">
<el-option v-for="item in editor.itemUnitOptions.value" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="排序号" min-width="100" align="center">
<template #default="{ row }">
<el-input v-model="row.orderNum" placeholder="排序号" class="inner-cell-input" />
</template>
</el-table-column>
<el-table-column label="备注" min-width="120" align="center">
<template #default="{ row }">
<el-input v-model="row.remark" placeholder="备注" class="inner-cell-input" />
<el-input v-model="row.remark" placeholder="备注" class="inner-cell-input"
@change="editor.saveDataCollections" />
</template>
</el-table-column>
<el-table-column label="操作" width="80" align="center">
@@ -109,6 +109,17 @@ export function useTaskStepEditor() {
for (const r of list) if (r?.id) next[r.id] = r
reagentMasterById.value = next
}
/** 通过 reagentCode 在已缓存的主表数据中反查 masterId */
function resolveReagentMasterId(row: Record<string, any>): string | null {
const code = (row.reagentCode || '').trim()
if (!code) return null
for (const master of Object.values(reagentMasterById.value)) {
if ((master.reagentCode || '').trim() === code) return master.id
}
return null
}
async function searchReagentOptions(query: string) {
reagentOptionsLoading.value = true
try {
@@ -132,6 +143,14 @@ export function useTaskStepEditor() {
reagentOptions.value = [{ id: row.reagentId, label: mapReagentOptionLabel(row) }, ...reagentOptions.value]
return
}
// reagentId 为空(后端不存储该字段)— 通过 reagentCode 反查主表真实 ID
const masterId = resolveReagentMasterId(row)
if (masterId) {
row.reagentId = masterId
// 主表选项已在 searchReagentOptions 中加载,无需重复添加
return
}
// 实在找不到主表记录才走 legacy 兜底
const code = (row.reagentCode || '').trim()
const name = (row.reagentName || '').trim()
if (!code && !name) return
@@ -179,6 +198,17 @@ export function useTaskStepEditor() {
for (const c of list) if (c?.id) next[c.id] = c
consumableMasterById.value = next
}
/** 通过 consumableCode 在已缓存的主表数据中反查 masterId */
function resolveConsumableMasterId(row: Record<string, any>): string | null {
const code = (row.consumableCode || '').trim()
if (!code) return null
for (const master of Object.values(consumableMasterById.value)) {
if ((master.consumableCode || '').trim() === code) return master.id
}
return null
}
async function searchConsumableOptions(query: string) {
consumableOptionsLoading.value = true
try {
@@ -202,6 +232,14 @@ export function useTaskStepEditor() {
consumableOptions.value = [{ id: row.consumableId, label: mapConsumableOptionLabel(row) }, ...consumableOptions.value]
return
}
// consumableId 为空(后端不存储该字段)— 通过 consumableCode 反查主表真实 ID
const masterId = resolveConsumableMasterId(row)
if (masterId) {
row.consumableId = masterId
// 主表选项已在 searchConsumableOptions 中加载,无需重复添加
return
}
// 实在找不到主表记录才走 legacy 兜底
const code = (row.consumableCode || '').trim()
const name = (row.consumableName || '').trim()
if (!code && !name) return
@@ -237,18 +275,6 @@ export function useTaskStepEditor() {
})
ensureItemUnitOption(row.unit)
ensureConsumableOption(row)
}
const master = consumableMasterById.value[consumableId]
if (!master) { saveConsumables(); return }
Object.assign(row, {
consumableId: master.id, consumableCode: master.consumableCode || '',
consumableName: master.consumableName || '', specModel: master.specModel || '',
standardUsage: master.standardUsage ?? '', unit: master.unit || '',
remark: master.remark ?? master.description ?? ''
})
ensureItemUnitOption(row.unit)
ensureConsumableOption(row)
saveConsumables()
}
function ensureAllStepUnitOptions() {
for (const step of stepList.value) {