提交
This commit is contained in:
1 parent
a1c2511eb7
commit
eaf7d490ec
382 files changed
+44146
-34245
No files matched your search
@@ -0,0 +1,37 @@
|
||||
/** 设备 ID 列表与逗号字符串互转(与 sopIds 一致,不含空格) */
|
||||
export function parseEquipmentIds(value: string | string[] | null | undefined): string[] {
|
||||
if (!value) return []
|
||||
if (Array.isArray(value)) return value.filter(Boolean)
|
||||
return String(value)
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
export function joinEquipmentIds(ids: string[] | null | undefined): string {
|
||||
return (ids || []).filter(Boolean).join(',')
|
||||
}
|
||||
|
||||
export function equipmentOptionLabel(row: {
|
||||
equipmentCode?: string
|
||||
equipmentName?: string
|
||||
}) {
|
||||
const code = row.equipmentCode || ''
|
||||
const name = row.equipmentName || ''
|
||||
return code && name ? `${code} / ${name}` : name || code || '-'
|
||||
}
|
||||
|
||||
/** 根据所选 ID 列表,从选项中拼出名称快照(逗号分隔) */
|
||||
export function syncEquipmentNamesFromOptions(
|
||||
equipmentIds: string[] | null | undefined,
|
||||
options: Array<{ id?: string; equipmentName?: string; equipmentCode?: string }>
|
||||
) {
|
||||
return parseEquipmentIds(equipmentIds || [])
|
||||
.map((id) => {
|
||||
const eq = options.find((item) => item.id === id)
|
||||
if (!eq) return ''
|
||||
return (eq.equipmentName || '').trim() || eq.equipmentCode || ''
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join(',')
|
||||
}
|
||||
@@ -33,7 +33,7 @@ const SECTION_TITLES: Record<
|
||||
},
|
||||
basic_experiment: {
|
||||
application: '基础实验申请信息',
|
||||
schedule: '售卖计划信息'
|
||||
schedule: '交付计划信息'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ export function buildOutboundPilotContextSections(
|
||||
}
|
||||
|
||||
if (schedule) {
|
||||
const pickupLabel = variant === 'basic_experiment' ? '提货时间' : '输注时间'
|
||||
const pickupLabel = variant === 'basic_experiment' ? '交付时间' : '输注时间'
|
||||
const scheduleFields: ViewField[] = [
|
||||
{ label: pickupLabel, value: schedule.infusionTime || '—' }
|
||||
]
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/** 是否在工艺相关界面展示试剂、耗材关联(暂时隐藏) */
|
||||
export const SHOW_PROCESS_REAGENT_CONSUMABLE = false
|
||||
|
||||
/** 工艺路线步骤详情:试剂/耗材 Tab 默认选中(产出物、数据采集为上下区块展示) */
|
||||
export const PROCESS_ROUTE_DEFAULT_SUB_TAB = 'reagent'
|
||||
@@ -0,0 +1,2 @@
|
||||
/** 是否在质检任务相关界面展示物料使用(暂时隐藏) */
|
||||
export const SHOW_QC_TASK_MATERIAL_USAGE = false
|
||||
@@ -263,6 +263,20 @@ export function ensureStorageSlotsInOptions(
|
||||
return next
|
||||
}
|
||||
|
||||
/** 下拉选项中排除已占用/已选格子,保留当前行已选格便于展示 */
|
||||
export function filterStorageSlotSelectOptions(
|
||||
options: StorageSlotSelectOption[],
|
||||
excludeSlotIds: Array<string | undefined | null>,
|
||||
keepSlotId?: string
|
||||
): StorageSlotSelectOption[] {
|
||||
const exclude = new Set(
|
||||
excludeSlotIds.map((id) => String(id ?? '').trim()).filter(Boolean)
|
||||
)
|
||||
const keep = String(keepSlotId ?? '').trim()
|
||||
if (keep) exclude.delete(keep)
|
||||
return options.filter((opt) => !exclude.has(opt.id))
|
||||
}
|
||||
|
||||
/** 校验表单内储物格不可重复(一格一物) */
|
||||
export function validateUniqueStorageSlotIds(
|
||||
slotIds: Array<string | undefined | null>,
|
||||
|
||||
Reference in new issue
Block a user