提交
This commit is contained in:
1 parent
8ff159c251
commit
c1832f9d03
60 files changed
+13400
-10821
No files matched your search
@@ -581,9 +581,10 @@ export function bizTypeTagType(type: string): string {
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 产品状态 ==========
|
||||
export function productStatusLabel(status: string): string {
|
||||
export function productStatusLabel(status: string, bizType?: string): string {
|
||||
const isBasicExperiment = bizType === 'basic_experiment'
|
||||
const map: Record<string, string> = {
|
||||
dtz: '待输注',
|
||||
dtz: isBasicExperiment ? '待交付' : '待输注',
|
||||
yrqr: '已用户确认',
|
||||
yqx: '已取消',
|
||||
ywc: '已完成'
|
||||
@@ -639,3 +640,57 @@ export function cellProductStatusTagType(status: string): string {
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
/** 细胞产品库状态码(出库物料「出库细胞」台账快照) */
|
||||
const CELL_PRODUCT_STATUS_CODES = new Set([
|
||||
'frozen',
|
||||
'in_production',
|
||||
'sold',
|
||||
'used',
|
||||
'voided',
|
||||
'thawed'
|
||||
])
|
||||
|
||||
/** 输注/交付计划产品状态码 */
|
||||
const SCHEDULE_PRODUCT_STATUS_CODES = new Set(['dtz', 'yrqr', 'yqx', 'ywc'])
|
||||
|
||||
const LEGACY_SCHEDULE_PRODUCT_STATUS: Record<string, string> = {
|
||||
待输注: 'dtz',
|
||||
已用户确认: 'yrqr',
|
||||
已取消: 'yqx',
|
||||
已完成: 'ywc'
|
||||
}
|
||||
|
||||
function normalizeScheduleProductStatusCode(status: string): string {
|
||||
const code = (status || '').trim()
|
||||
return LEGACY_SCHEDULE_PRODUCT_STATUS[code] || code
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库物料「出库细胞」状态展示:优先细胞产品库状态,兼容计划产品状态码与历史中文值。
|
||||
*/
|
||||
export function outboundMaterialCellStatusLabel(status: string, bizType?: string): string {
|
||||
const code = (status || '').trim()
|
||||
if (!code) return '—'
|
||||
if (CELL_PRODUCT_STATUS_CODES.has(code)) {
|
||||
return cellProductStatusLabel(code)
|
||||
}
|
||||
const normalized = normalizeScheduleProductStatusCode(code)
|
||||
if (SCHEDULE_PRODUCT_STATUS_CODES.has(normalized)) {
|
||||
return productStatusLabel(normalized, bizType)
|
||||
}
|
||||
return cellProductStatusLabel(code)
|
||||
}
|
||||
|
||||
export function outboundMaterialCellStatusTagType(status: string, bizType?: string): TagType {
|
||||
const code = (status || '').trim()
|
||||
if (!code) return 'info'
|
||||
if (CELL_PRODUCT_STATUS_CODES.has(code)) {
|
||||
return cellProductStatusTagType(code) as TagType
|
||||
}
|
||||
const normalized = normalizeScheduleProductStatusCode(code)
|
||||
if (SCHEDULE_PRODUCT_STATUS_CODES.has(normalized)) {
|
||||
return productStatusTagType(normalized) as TagType
|
||||
}
|
||||
return cellProductStatusTagType(code) as TagType
|
||||
}
|
||||
Reference in new issue
Block a user