This commit is contained in:
zlwu committed 2026-05-26 21:27:48 +08:00
1 parent edf88dc016
commit 3f122da803
55 files changed
+13486 -8504

No files matched your search

@@ -0,0 +1,120 @@
import type { OutboundQcDetail } from '@/api/qc-work-order'
import type { ViewField, ViewSection } from '@/components/business/system-view-dialog/index.vue'
import { maskIdCard } from '@/utils/mask-sensitive'
import {
applicationStatusLabel,
applicationStatusTagType,
infusionMethodLabel,
infusionStatusLabel,
infusionStatusTagType,
qcStatusLabel,
qcStatusTagType,
scheduleStatusLabel,
scheduleStatusTagType
} from '@/utils/status-tag-registry'
/** 出库质检 + 中试服务:申请单 / 患者 / 输注方案 / 输注计划 / 产品明细 */
export function buildOutboundPilotContextSections(detail: OutboundQcDetail): ViewSection[] {
const app = detail.application
const patient = detail.patient
const plan = detail.infusionPlan
const schedule = detail.infusionSchedule
const products = detail.products || []
const result: ViewSection[] = []
if (app) {
result.push({
title: '中试服务申请单信息',
fields: [
{ label: '申请单号', value: app.applicationNo || '—' },
{ label: '申请单名称', value: app.applicationName || '—' },
{
label: '申请单状态',
value: applicationStatusLabel(app.applicationStatus || ''),
tagType: applicationStatusTagType(app.applicationStatus || '') as ViewField['tagType']
},
{ label: '渠道名称', value: app.channelName || '—' }
]
})
}
if (patient) {
result.push({
title: '患者信息',
fields: [
{ label: '患者姓名', value: patient.patientName || '—' },
{ label: '性别', value: patient.sex || '—' },
{ label: '年龄', value: patient.age || '—' },
{ label: '联系电话', value: patient.phoneNo || '—' },
{
label: '身份证号',
value: patient.idCardNo ? maskIdCard(patient.idCardNo) : '—'
},
{ label: '紧急联系人', value: patient.emergencyContact || '—' },
{ label: '紧急联系电话', value: patient.emergencyPhone || '—' },
{ label: '临床诊断', value: patient.clinicalDiagnosis || '—', span: true }
],
slotTitle: '诊断附件',
slotTitleStyle: 'field',
slot: 'diagnosis-attachments'
})
}
if (plan) {
result.push({
title: '输注方案信息',
fields: [
{
label: '总疗程数',
value: plan.totalCourseCount != null ? String(plan.totalCourseCount) : '—'
},
{ label: '疗程间隔', value: plan.courseInterval || '—' },
{ label: '输注开始日期', value: plan.infusionStartDate || '—' }
]
})
}
if (schedule) {
const scheduleFields: ViewField[] = [
{ label: '输注时间', value: schedule.infusionTime || '—' },
{ label: '输注地点', value: schedule.infusionLocation || '—' },
{ label: '输注方式', value: infusionMethodLabel(schedule.infusionMethod || '') },
{
label: '计划状态',
value: scheduleStatusLabel(schedule.scheduleStatus || ''),
tagType: scheduleStatusTagType(schedule.scheduleStatus || '') as ViewField['tagType']
},
{
label: '输注状态',
value: infusionStatusLabel(schedule.infusionStatus || ''),
tagType: infusionStatusTagType(schedule.infusionStatus || '') as ViewField['tagType']
},
{
label: '质检状态',
value: qcStatusLabel(schedule.qcStatus || ''),
tagType: qcStatusTagType(schedule.qcStatus || '') as ViewField['tagType']
}
]
if (schedule.cancelReason) {
scheduleFields.push({ label: '取消原因', value: schedule.cancelReason, span: true })
}
result.push({ title: '本次输注计划信息', fields: scheduleFields })
}
if (products.length) {
result.push({
title: '产品明细',
fields: [],
slot: 'product-table'
})
}
return result
}
export function isOutboundPilotServiceQcTask(d?: {
qcBizType?: string
receptionSource?: string
} | null): boolean {
return d?.qcBizType === 'outbound' && d?.receptionSource === 'pilot_service'
}
+33
View File
@@ -14,3 +14,36 @@ export function productionConclusionTagType(code?: string | null): TagType | und
if (c === 'sb') return 'danger'
return undefined
}
/** 生产任务来源:inbound / temporary / outbound */
export function productionOrderSourceTag(orderSource?: string | null): {
label: string
type: TagType
} {
const s = (orderSource || '').trim() || 'inbound'
if (s === 'temporary') return { label: '临时', type: 'warning' }
if (s === 'outbound') return { label: '出库', type: 'primary' }
return { label: '入库', type: 'success' }
}
/** 生产任务类型(临时单看 orderSource,入库/出库看 taskType) */
export function productionTaskTypeTag(
taskType?: string | null,
orderSource?: string | null
): { label: string; type: TagType } {
if ((orderSource || '').trim() === 'temporary') {
return { label: '临时生产单', type: 'warning' }
}
const t = (taskType || '').trim() || 'cell_storage'
const map: Record<string, { label: string; type: TagType }> = {
cell_storage: { label: '入库生产单', type: 'primary' },
outbound: { label: '出库生产单', type: 'warning' }
}
return map[t] || { label: t, type: 'info' }
}
/** 按工单类型派生创建任务时的 task_type */
export function productionTaskTypeForWorkOrder(workOrderType?: string | null): string {
if (workOrderType === 'outbound') return 'outbound'
return 'cell_storage'
}
+15 -1
View File
@@ -109,7 +109,10 @@ export const transportTypeTagType = createTagTypeGetter(transportType)
export const receptionSource: StatusRegistry = {
cell_storage: { label: '细胞存储', tagType: 'primary' },
research_donation: { label: '科研捐赠', tagType: 'warning' }
research_donation: { label: '科研捐赠', tagType: 'warning' },
outbound: { label: '出库', tagType: 'primary' },
pilot_service: { label: '中试服务', tagType: 'primary' },
clinical_application: { label: '临床应用', tagType: 'warning' }
}
export const receptionSourceLabel = createLabelGetter(receptionSource)
export const receptionSourceTagType = createTagTypeGetter(receptionSource)
@@ -508,6 +511,17 @@ export function infusionStatusTagType(status: string): string {
return map[status] || 'info'
}
// ========== 中试服务 - 输注方式(字典 szfs) ==========
export function infusionMethodLabel(method: string): string {
const map: Record<string, string> = {
jmsz: '静脉输注',
pxzs: '皮下注射',
jbzs: '局部注射',
qt: '其他'
}
return map[method] || method || '—'
}
// ========== 中试服务 - 质检状态 ==========
export function qcStatusLabel(status: string): string {
const map: Record<string, string> = { dzc: '待质检', yzj: '已质检', yqx: '已取消' }