提交
This commit is contained in:
1 parent
5b3edb1700
commit
74e5a0f0cf
30 files changed
+9036
-7974
No files matched your search
+1
@@ -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": []}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_samplereceptiondialog_vue", "label": "SampleReceptionDialog.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L1"}, {"id": "production_work_order_samplereceptiondialog_protocolstatuslabelbysource", "label": "protocolStatusLabelBySource()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L295"}, {"id": "production_work_order_samplereceptiondialog_protocolstatustagtypebysource", "label": "protocolStatusTagTypeBySource()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L301"}, {"id": "production_work_order_samplereceptiondialog_nowdatetime", "label": "nowDatetime()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L347"}, {"id": "production_work_order_samplereceptiondialog_resetprodform", "label": "resetProdForm()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L353"}, {"id": "production_work_order_samplereceptiondialog_populatefromproduction", "label": "populateFromProduction()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L363"}, {"id": "production_work_order_samplereceptiondialog_loadassignees", "label": "loadAssignees()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L373"}, {"id": "production_work_order_samplereceptiondialog_searchassignees", "label": "searchAssignees()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L378"}, {"id": "production_work_order_samplereceptiondialog_onhandlerchange", "label": "onHandlerChange()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L382"}, {"id": "production_work_order_samplereceptiondialog_ensuredefaulthandler", "label": "ensureDefaultHandler()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L387"}, {"id": "production_work_order_samplereceptiondialog_buildpayload", "label": "buildPayload()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L400"}, {"id": "production_work_order_samplereceptiondialog_initdialog", "label": "initDialog()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L417"}, {"id": "production_work_order_samplereceptiondialog_handleclosed", "label": "handleClosed()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L449"}, {"id": "production_work_order_samplereceptiondialog_submitproduction", "label": "submitProduction()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L457"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_samplereceptiondialog_vue", "target": "production_work_order_samplereceptiondialog_protocolstatuslabelbysource", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L295", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_samplereceptiondialog_vue", "target": "production_work_order_samplereceptiondialog_protocolstatustagtypebysource", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue", "source_location": "L301", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_samplerLine truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_production_production_work_order_taskoutputproductdialog_vue", "label": "TaskOutputProductDialog.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/production-work-order/TaskOutputProductDialog.vue", "source_location": "L1"}], "edges": [], "raw_calls": []}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_quality_inspection_sample_reception_index_vue", "label": "index.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/quality-inspection/sample-reception/index.vue", "source_location": "L1"}, {"id": "sample_reception_index_ensurecurrentuserinoptions", "label": "ensureCurrentUserInOptions()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/quality-inspection/sample-reception/index.vue", "source_location": "L1229"}, {"id": "sample_reception_index_if", "label": "if()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/quality-inspection/sample-reception/index.vue", "source_location": "L1487"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_quality_inspection_sample_reception_index_vue", "target": "sample_reception_index_ensurecurrentuserinoptions", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/quality-inspection/sample-reception/index.vue", "source_location": "L1229", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_quality_inspection_sample_reception_index_vue", "target": "sample_reception_index_if", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/quality-inspection/sample-reception/index.vue", "source_location": "L1487", "weight": 1.0}], "raw_calls": [{"caller_nid": "sample_reception_index_if", "callee": "warning", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/quality-inspection/sample-reception/index.vue", "source_location": "L1488"}]}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_storage_slot_options_ts", "label": "storage-slot-options.ts", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L1"}, {"id": "utils_storage_slot_options_mapremoteslotselectoption", "label": "mapRemoteSlotSelectOption()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L21"}, {"id": "utils_storage_slot_options_isstorageslotselectoptiondisabled", "label": "isStorageSlotSelectOptionDisabled()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L35"}, {"id": "utils_storage_slot_options_getlaststorageslotsearchquery", "label": "getLastStorageSlotSearchQuery()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L54"}, {"id": "utils_storage_slot_options_remotesearchstorageslotselectoptions", "label": "remoteSearchStorageSlotSelectOptions()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L58"}, {"id": "utils_storage_slot_options_getstoragefacilityordernum", "label": "getStorageFacilityOrderNum()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L90"}, {"id": "utils_storage_slot_options_getstorageslotordernum", "label": "getStorageSlotOrderNum()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L96"}, {"id": "utils_storage_slot_options_decodeslotlayoutorder", "label": "decodeSlotLayoutOrder()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L105"}, {"id": "utils_storage_slot_options_parselegacyrowcolslotcode", "label": "parseLegacyRowColSlotCode()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L114"}, {"id": "utils_storage_slot_options_parsestorageslotcode", "label": "parseStorageSlotCode()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L121"}, {"id": "utils_storage_slot_options_buildnodecodepathfromflat", "label": "buildNodeCodePathFromFlat()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L128"}, {"id": "utils_storage_slot_options_buildfullslotcodefromflat", "label": "buildFullSlotCodeFromFlat()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L152"}, {"id": "utils_storage_slot_options_comparestoragefacilityslots", "label": "compareStorageFacilitySlots()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L164"}, {"id": "utils_storage_slot_options_sortstoragefacilityslots", "label": "sortStorageFacilitySlots()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L192"}, {"id": "utils_storage_slot_options_isstorageslotavailable", "label": "isStorageSlotAvailable()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L196"}, {"id": "utils_storage_slot_options_collectleaffacilitynodesintreeorder", "label": "collectLeafFacilityNodesInTreeOrder()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L205"}, {"id": "utils_storage_slot_options_mapslotstoselectoptions", "label": "mapSlotsToSelectOptions()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L257"}, {"id": "utils_storage_slot_options_loadstorageslotselectoptions", "label": "loadStorageSlotSelectOptions()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L285"}, {"id": "utils_storage_slot_options_ensurestorageslotsinoptions", "label": "ensureStorageSlotsInOptions()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_location": "L323"}, {"id": "utils_storage_slot_options_filterstorageslotselectoptions", "label": "filterStorageSlotSelectOptions()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/utils/storage-slot-options.ts", "source_lLine truncated
|
||||
@@ -4,15 +4,43 @@
|
||||
import { buildTreePathLabelFromFlat } from '@/utils/tree-path'
|
||||
import { fetchStorageSlotSelectOptions } from '@/api/admin'
|
||||
|
||||
export type StorageSlotSelectOption = { id: string; name: string }
|
||||
export type StorageSlotSelectOption = {
|
||||
id: string
|
||||
name: string
|
||||
/** 是否可分配(空格子);已占用项仍展示但应置灰 */
|
||||
available?: boolean
|
||||
}
|
||||
|
||||
export type LoadStorageSlotSelectOptions = {
|
||||
/** 仅返回空格子(编辑时可配合 includeSlotIds 保留当前格) */
|
||||
/** 无关键词初始加载时仅返回空格子(默认 true) */
|
||||
availableOnly?: boolean
|
||||
/** 额外保留在选项中的格子 ID(如编辑态当前储物格) */
|
||||
includeSlotIds?: string[]
|
||||
}
|
||||
|
||||
function mapRemoteSlotSelectOption(item: Record<string, unknown>): StorageSlotSelectOption {
|
||||
const id = String(item.id || '')
|
||||
const baseName = String(item.name || item.fullSlotCode || item.slot_code || item.slotCode || id)
|
||||
const status = String(item.slotStatus ?? item.slot_status ?? '')
|
||||
const occupied = Number(item.occupiedCount ?? item.occupied_count ?? 0)
|
||||
const available = status === '空' || occupied === 0
|
||||
return {
|
||||
id,
|
||||
name: available ? baseName : `${baseName}(已占用)`,
|
||||
available
|
||||
}
|
||||
}
|
||||
|
||||
/** 下拉项是否应禁用(保留当前已选格便于编辑展示) */
|
||||
export function isStorageSlotSelectOptionDisabled(
|
||||
opt: StorageSlotSelectOption,
|
||||
keepSlotId?: string
|
||||
): boolean {
|
||||
const keep = String(keepSlotId ?? '').trim()
|
||||
if (keep && opt.id === keep) return false
|
||||
return opt.available === false
|
||||
}
|
||||
|
||||
/** 远程检索防抖(毫秒):用户停顿后再请求 */
|
||||
export const STORAGE_SLOT_REMOTE_SEARCH_DEBOUNCE_MS = 1000
|
||||
|
||||
@@ -39,18 +67,20 @@ export async function remoteSearchStorageSlotSelectOptions(
|
||||
.filter(Boolean)
|
||||
.join(',')
|
||||
try {
|
||||
const hasKeyword = !!trimmed
|
||||
const availableOnlyDefault = opts?.availableOnly !== false
|
||||
const res = await fetchStorageSlotSelectOptions({
|
||||
keyword: trimmed || undefined,
|
||||
availableOnly: opts?.availableOnly ? true : undefined,
|
||||
// 无关键词:只列空格子;有关键词:返回全部匹配编号,已占用由前端置灰
|
||||
availableOnly: availableOnlyDefault && !hasKeyword ? true : undefined,
|
||||
includeSlotIds: includeSlotIds || undefined,
|
||||
page: 1,
|
||||
pageSize: STORAGE_SLOT_SELECT_PAGE_SIZE
|
||||
})
|
||||
if (seq !== storageSlotRemoteSearchSeq) return null
|
||||
return (res?.list || []).map((item) => ({
|
||||
id: String(item.id || ''),
|
||||
name: String(item.name || item.fullSlotCode || item.slotCode || item.id || '')
|
||||
}))
|
||||
return (res?.list || []).map((item) =>
|
||||
mapRemoteSlotSelectOption(item as Record<string, unknown>)
|
||||
)
|
||||
} catch {
|
||||
if (seq !== storageSlotRemoteSearchSeq) return null
|
||||
return []
|
||||
@@ -302,7 +332,8 @@ export function ensureStorageSlotsInOptions(
|
||||
seen.add(id)
|
||||
next.unshift({
|
||||
id,
|
||||
name: String(stub.name || id)
|
||||
name: String(stub.name || id),
|
||||
available: true
|
||||
})
|
||||
}
|
||||
return next
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="isStorageSlotSelectOptionDisabled(item, formData.storageSlotId)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -260,6 +261,9 @@
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="
|
||||
isStorageSlotSelectOptionDisabled(item, productLines[$index]?.storageSlotId)
|
||||
"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@@ -299,8 +303,10 @@
|
||||
STORAGE_SLOT_REMOTE_SEARCH_DEBOUNCE_MS,
|
||||
ensureStorageSlotsInOptions,
|
||||
filterStorageSlotSelectOptions,
|
||||
isStorageSlotSelectOptionDisabled,
|
||||
validateUniqueStorageSlotIds
|
||||
} from '@/utils/storage-slot-options'
|
||||
import type { StorageSlotSelectOption } from '@/utils/storage-slot-options'
|
||||
|
||||
defineOptions({ name: 'TaskOutputProductDialog' })
|
||||
|
||||
@@ -343,7 +349,7 @@
|
||||
const productTypeOptions = ref<
|
||||
Array<{ id: string; productTypeName: string; productTypeCode?: string }>
|
||||
>([])
|
||||
const storageSlotOptions = ref<Array<{ id: string; name: string }>>([])
|
||||
const storageSlotOptions = ref<StorageSlotSelectOption[]>([])
|
||||
const productTypeOptionsLoading = ref(false)
|
||||
const storageSlotOptionsLoading = ref(false)
|
||||
let storageSlotSearchToken = 0
|
||||
|
||||
Reference in new issue
Block a user