提交“
This commit is contained in:
1 parent
69ee0f505c
commit
9b88581450
614 files changed
+90318
-689022
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { fetchAttachmentDownloadUrl } from '@/api/business'
|
||||
import { fetchAttachmentDownloadUrl } from '@/api/admin'
|
||||
|
||||
export type AttachmentDownloadItem = {
|
||||
fileUrl?: string
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
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,
|
||||
sexLabel
|
||||
} from '@/utils/status-tag-registry'
|
||||
|
||||
export type OutboundViewContextVariant = 'pilot_service' | 'clinical_application'
|
||||
|
||||
const SECTION_TITLES: Record<
|
||||
OutboundViewContextVariant,
|
||||
{ application: string; schedule: string }
|
||||
> = {
|
||||
pilot_service: {
|
||||
application: '中试服务申请单信息',
|
||||
schedule: '本次输注计划信息'
|
||||
},
|
||||
clinical_application: {
|
||||
application: '临床应用申请信息',
|
||||
schedule: '临床应用输注计划信息'
|
||||
}
|
||||
}
|
||||
|
||||
/** 出库工单/质检:申请单 / 患者 / 输注方案 / 输注计划 / 产品明细(码值转中文标签) */
|
||||
export function buildOutboundPilotContextSections(
|
||||
detail: OutboundQcDetail,
|
||||
variant: OutboundViewContextVariant = 'pilot_service'
|
||||
): ViewSection[] {
|
||||
const app = detail.application
|
||||
const patient = detail.patient
|
||||
const plan = detail.infusionPlan
|
||||
const schedule = detail.infusionSchedule
|
||||
const products = detail.products || []
|
||||
const titles = SECTION_TITLES[variant]
|
||||
const result: ViewSection[] = []
|
||||
|
||||
if (app) {
|
||||
result.push({
|
||||
title: titles.application,
|
||||
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: sexLabel(String(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: titles.schedule, 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'
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
import type { TagType } from '@/utils/status-tag-registry'
|
||||
|
||||
/** 生产结论 cg=成功 sb=失败 */
|
||||
export function productionConclusionLabel(code?: string | null): string {
|
||||
const c = (code || '').trim()
|
||||
if (c === 'cg') return '成功'
|
||||
if (c === 'sb') return '失败'
|
||||
return c || '—'
|
||||
}
|
||||
|
||||
export function productionConclusionTagType(code?: string | null): TagType | undefined {
|
||||
const c = (code || '').trim()
|
||||
if (c === 'cg') return 'success'
|
||||
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'
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
export {
|
||||
protocolStatusLabel,
|
||||
protocolStatusTagType,
|
||||
payStatusLabel,
|
||||
payStatusTagType,
|
||||
payModeLabel,
|
||||
payModeTagType,
|
||||
transferTypeLabel,
|
||||
transferTypeTagType
|
||||
} from './status-tag-registry'
|
||||
|
||||
export function formatPaymentDueDate(d: unknown) {
|
||||
const s = String(d || '')
|
||||
if (!s) return '-'
|
||||
if (s.length === 8) return `${s.slice(0, 4)}-${s.slice(4, 6)}-${s.slice(6, 8)}`
|
||||
return s
|
||||
}
|
||||
|
||||
export const PAYMENT_DUE_WARN_DAYS = 15
|
||||
|
||||
function parsePaymentDueYmd(ymd: unknown): Date | null {
|
||||
const raw = String(ymd || '').replace(/\D/g, '')
|
||||
if (raw.length !== 8) return null
|
||||
const y = Number(raw.slice(0, 4))
|
||||
const m = Number(raw.slice(4, 6)) - 1
|
||||
const d = Number(raw.slice(6, 8))
|
||||
const dt = new Date(y, m, d)
|
||||
if (dt.getFullYear() !== y || dt.getMonth() !== m || dt.getDate() !== d) return null
|
||||
return dt
|
||||
}
|
||||
|
||||
function startOfLocalDay(d: Date) {
|
||||
return new Date(d.getFullYear(), d.getMonth(), d.getDate())
|
||||
}
|
||||
|
||||
export function isPaymentDueWithinWarnWindow(
|
||||
installmentDueDate: unknown,
|
||||
warnDays = PAYMENT_DUE_WARN_DAYS
|
||||
) {
|
||||
const due = parsePaymentDueYmd(installmentDueDate)
|
||||
if (!due) return false
|
||||
const today = startOfLocalDay(new Date())
|
||||
const limit = new Date(today)
|
||||
limit.setDate(limit.getDate() + warnDays)
|
||||
return due.getTime() <= limit.getTime()
|
||||
}
|
||||
|
||||
export function formatPaymentAmount(v: unknown) {
|
||||
if (v == null || v === '') return '-'
|
||||
const n = Number(v)
|
||||
if (Number.isNaN(n)) return String(v)
|
||||
return '¥' + n.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
export {
|
||||
qcBizTypeLabel,
|
||||
qcBizTypeTagType,
|
||||
receptionSourceLabel,
|
||||
receptionSourceTagType,
|
||||
acceptConclusionLabel,
|
||||
acceptConclusionTagType,
|
||||
transportTypeLabel,
|
||||
transportTypeTagType,
|
||||
workOrderStatusLabel,
|
||||
workOrderStatusTagType,
|
||||
taskTypeLabel,
|
||||
taskTypeTagType,
|
||||
qcTaskConclusionLabel,
|
||||
qcTaskConclusionTagType,
|
||||
taskStatusLabel,
|
||||
taskStatusTagType
|
||||
} from './status-tag-registry'
|
||||
@@ -1,603 +0,0 @@
|
||||
/**
|
||||
* 状态标签注册表 — 全局集中定义所有枚举字段的 label + tagType
|
||||
*
|
||||
* 使用方式:
|
||||
* import { protocolStatusLabel, protocolStatusTagType } from '@/utils/status-tag-registry'
|
||||
* <el-tag :type="protocolStatusTagType(row.status)">{{ protocolStatusLabel(row.status) }}</el-tag>
|
||||
*
|
||||
* 规范:同一枚举值在任何地方(表格、查看弹窗、导出)颜色必须一致。
|
||||
* tagType 语义色:success=正常/已完成, warning=进行中/已过期, danger=异常/已作废,
|
||||
* info=待执行/停用, primary=特殊分类/转出, ''=默认
|
||||
*/
|
||||
|
||||
// ── 类型定义 ──────────────────────────────────────────────────────────────────
|
||||
|
||||
/** el-tag 的 type 属性值 */
|
||||
export type TagType = 'success' | 'warning' | 'danger' | 'info' | '' | 'primary'
|
||||
|
||||
/** 单条枚举映射 */
|
||||
export interface StatusItem {
|
||||
label: string
|
||||
tagType: TagType
|
||||
}
|
||||
|
||||
/** 注册表类型 */
|
||||
export type StatusRegistry = Record<string, StatusItem>
|
||||
|
||||
// ── 工厂函数 ──────────────────────────────────────────────────────────────────
|
||||
|
||||
function createLabelGetter(registry: StatusRegistry) {
|
||||
return (code: string): string => registry[code]?.label ?? code ?? '—'
|
||||
}
|
||||
|
||||
function createTagTypeGetter(registry: StatusRegistry) {
|
||||
return (code: string): TagType => registry[code]?.tagType ?? 'info'
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 协议 / 存储 域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
export const protocolStatus: StatusRegistry = {
|
||||
dsx: { label: '待生效', tagType: 'info' },
|
||||
sxz: { label: '生效中', tagType: 'success' },
|
||||
ygq: { label: '已过期', tagType: 'warning' },
|
||||
yzf: { label: '已作废', tagType: 'danger' },
|
||||
zky: { label: '转科研', tagType: 'primary' }
|
||||
}
|
||||
export const protocolStatusLabel = createLabelGetter(protocolStatus)
|
||||
export const protocolStatusTagType = createTagTypeGetter(protocolStatus)
|
||||
|
||||
export const donationStatus: StatusRegistry = {
|
||||
dsx: { label: '待生效', tagType: 'info' },
|
||||
sxz: { label: '生效中', tagType: 'success' },
|
||||
ygq: { label: '已过期', tagType: 'warning' },
|
||||
yzf: { label: '已作废', tagType: 'danger' },
|
||||
zckc: { label: '转细胞存储', tagType: 'primary' }
|
||||
}
|
||||
export const donationStatusLabel = createLabelGetter(donationStatus)
|
||||
export const donationStatusTagType = createTagTypeGetter(donationStatus)
|
||||
|
||||
export const sampleStatus: StatusRegistry = {
|
||||
ycj: { label: '已采集', tagType: 'primary' },
|
||||
jcz: { label: '检测中', tagType: 'warning' },
|
||||
yrk: { label: '已入库', tagType: 'success' },
|
||||
yzf: { label: '已作废', tagType: 'danger' }
|
||||
}
|
||||
export const sampleStatusLabel = createLabelGetter(sampleStatus)
|
||||
export const sampleStatusTagType = createTagTypeGetter(sampleStatus)
|
||||
|
||||
export const payStatus: StatusRegistry = {
|
||||
dfj: { label: '待缴费', tagType: 'info' },
|
||||
jfqrz: { label: '缴费确认中', tagType: 'warning' },
|
||||
yjf: { label: '已缴费', tagType: 'success' },
|
||||
tfqrz: { label: '退费确认中', tagType: 'warning' },
|
||||
ytf: { label: '已退费', tagType: 'danger' }
|
||||
}
|
||||
export const payStatusLabel = createLabelGetter(payStatus)
|
||||
export const payStatusTagType = createTagTypeGetter(payStatus)
|
||||
|
||||
export const auditStatus: StatusRegistry = {
|
||||
shtg: { label: '审核通过', tagType: 'success' },
|
||||
shth: { label: '审核退回', tagType: 'danger' }
|
||||
}
|
||||
export const auditStatusLabel = createLabelGetter(auditStatus)
|
||||
export const auditStatusTagType = createTagTypeGetter(auditStatus)
|
||||
|
||||
export const payMode: StatusRegistry = {
|
||||
dj: { label: '趸交', tagType: 'info' },
|
||||
fq: { label: '分期', tagType: 'warning' }
|
||||
}
|
||||
export const payModeLabel = createLabelGetter(payMode)
|
||||
export const payModeTagType = createTagTypeGetter(payMode)
|
||||
|
||||
export const transferType: StatusRegistry = {
|
||||
wxzz: { label: '微信转账', tagType: 'success' },
|
||||
zzbzz: { label: '支付宝转账', tagType: 'primary' },
|
||||
yhkzz: { label: '银行卡转账', tagType: 'info' },
|
||||
xj: { label: '现金', tagType: 'warning' }
|
||||
}
|
||||
export const transferTypeLabel = createLabelGetter(transferType)
|
||||
export const transferTypeTagType = createTagTypeGetter(transferType)
|
||||
|
||||
export const transportType: StatusRegistry = {
|
||||
kdys: { label: '快递运输', tagType: 'info' },
|
||||
ryxd: { label: '人员携带', tagType: 'success' }
|
||||
}
|
||||
export const transportTypeLabel = createLabelGetter(transportType)
|
||||
export const transportTypeTagType = createTagTypeGetter(transportType)
|
||||
|
||||
export const receptionSource: StatusRegistry = {
|
||||
cell_storage: { label: '细胞存储', tagType: 'primary' },
|
||||
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)
|
||||
|
||||
export const newbornSex: StatusRegistry = {
|
||||
'1': { label: '男', tagType: 'primary' },
|
||||
'0': { label: '女', tagType: 'success' }
|
||||
}
|
||||
export const newbornSexLabel = createLabelGetter(newbornSex)
|
||||
export const newbornSexTagType = createTagTypeGetter(newbornSex)
|
||||
|
||||
export const deliveryMode: StatusRegistry = {
|
||||
sc: { label: '顺产', tagType: 'info' },
|
||||
pgc: { label: '剖宫产', tagType: 'warning' }
|
||||
}
|
||||
export const deliveryModeLabel = createLabelGetter(deliveryMode)
|
||||
export const deliveryModeTagType = createTagTypeGetter(deliveryMode)
|
||||
|
||||
export const sourceType: StatusRegistry = {
|
||||
direct: { label: '独立新建', tagType: 'info' },
|
||||
from_storage: { label: '从存储转来', tagType: 'primary' }
|
||||
}
|
||||
export const sourceTypeLabel = createLabelGetter(sourceType)
|
||||
export const sourceTypeTagType = createTagTypeGetter(sourceType)
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 质检域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
export const qcBizType: StatusRegistry = {
|
||||
inbound: { label: '入库质检', tagType: 'success' },
|
||||
outbound: { label: '出库质检', tagType: 'primary' },
|
||||
temporary: { label: '临时质检', tagType: 'warning' }
|
||||
}
|
||||
export const qcBizTypeLabel = createLabelGetter(qcBizType)
|
||||
export const qcBizTypeTagType = createTagTypeGetter(qcBizType)
|
||||
|
||||
export const workOrderStatus: StatusRegistry = {
|
||||
dpz: { label: '待配置', tagType: 'info' },
|
||||
ypz: { label: '已配置', tagType: 'success' },
|
||||
ywc: { label: '已完成', tagType: 'success' },
|
||||
yzf: { label: '已作废', tagType: 'danger' }
|
||||
}
|
||||
export const workOrderStatusLabel = createLabelGetter(workOrderStatus)
|
||||
export const workOrderStatusTagType = createTagTypeGetter(workOrderStatus)
|
||||
|
||||
export const taskType: StatusRegistry = {
|
||||
sysz: { label: '实验室自检', tagType: 'info' },
|
||||
dsfjc: { label: '第三方检测', tagType: 'primary' }
|
||||
}
|
||||
export const taskTypeLabel = createLabelGetter(taskType)
|
||||
export const taskTypeTagType = createTagTypeGetter(taskType)
|
||||
|
||||
export const qcConclusion: StatusRegistry = {
|
||||
tg: { label: '通过', tagType: 'success' },
|
||||
btg: { label: '不通过', tagType: 'danger' }
|
||||
}
|
||||
export const qcTaskConclusionLabel = createLabelGetter(qcConclusion)
|
||||
export const qcTaskConclusionTagType = createTagTypeGetter(qcConclusion)
|
||||
|
||||
export const taskStatus: StatusRegistry = {
|
||||
dzx: { label: '待执行', tagType: 'info' },
|
||||
jxz: { label: '进行中', tagType: 'warning' },
|
||||
ywc: { label: '已完成', tagType: 'success' }
|
||||
}
|
||||
export const taskStatusLabel = createLabelGetter(taskStatus)
|
||||
export const taskStatusTagType = createTagTypeGetter(taskStatus)
|
||||
|
||||
export const acceptConclusion: StatusRegistry = {
|
||||
js: { label: '接收', tagType: 'success' },
|
||||
bj: { label: '拒收', tagType: 'danger' }
|
||||
}
|
||||
export const acceptConclusionLabel = createLabelGetter(acceptConclusion)
|
||||
export const acceptConclusionTagType = createTagTypeGetter(acceptConclusion)
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 渠道域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
export const channelType: StatusRegistry = {
|
||||
yy: { label: '医院', tagType: 'primary' },
|
||||
hzjg: { label: '合作机构', tagType: 'success' },
|
||||
zs: { label: '诊所', tagType: 'warning' },
|
||||
zfjg: { label: '政府机构', tagType: 'danger' },
|
||||
qt: { label: '其他', tagType: 'info' }
|
||||
}
|
||||
export const channelTypeLabel = createLabelGetter(channelType)
|
||||
export const channelTypeTagType = createTagTypeGetter(channelType)
|
||||
|
||||
export const agreementType: StatusRegistry = {
|
||||
kyxy: { label: '框架协议', tagType: 'primary' },
|
||||
zsxy: { label: '中试协议', tagType: 'success' },
|
||||
lcxy: { label: '临床协议', tagType: 'warning' }
|
||||
}
|
||||
export const agreementTypeLabel = createLabelGetter(agreementType)
|
||||
export const agreementTypeTagType = createTagTypeGetter(agreementType)
|
||||
|
||||
export const agreementStatus: StatusRegistry = {
|
||||
dsx: { label: '待生效', tagType: 'info' },
|
||||
sxz: { label: '生效中', tagType: 'success' },
|
||||
yzf: { label: '已作废', tagType: 'danger' }
|
||||
}
|
||||
export const agreementStatusLabel = createLabelGetter(agreementStatus)
|
||||
export const agreementStatusTagType = createTagTypeGetter(agreementStatus)
|
||||
|
||||
export const settlementType: StatusRegistry = {
|
||||
yj: { label: '月结', tagType: '' },
|
||||
jj: { label: '季结', tagType: 'success' },
|
||||
nj: { label: '年结', tagType: 'warning' },
|
||||
dcjs: { label: '单次结算', tagType: 'danger' }
|
||||
}
|
||||
export const settlementTypeLabel = createLabelGetter(settlementType)
|
||||
export const settlementTypeTagType = createTagTypeGetter(settlementType)
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 订单域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
export const orderStatus: StatusRegistry = {
|
||||
pending_payment: { label: '待支付', tagType: 'warning' },
|
||||
pending_confirm: { label: '待收货', tagType: 'info' },
|
||||
completed: { label: '已完成', tagType: 'success' },
|
||||
cancelled: { label: '已取消', tagType: 'danger' }
|
||||
}
|
||||
export const orderStatusLabel = createLabelGetter(orderStatus)
|
||||
export const orderStatusTagType = createTagTypeGetter(orderStatus)
|
||||
|
||||
export const deliveryStatusMap: StatusRegistry = {
|
||||
pending_dispatch: { label: '待分配配送', tagType: 'info' },
|
||||
delivering: { label: '配送中', tagType: 'warning' },
|
||||
delivered: { label: '配送完成', tagType: 'success' }
|
||||
}
|
||||
export const deliveryStatusLabel = createLabelGetter(deliveryStatusMap)
|
||||
export const deliveryStatusTagType = createTagTypeGetter(deliveryStatusMap)
|
||||
|
||||
export const paymentMethod: StatusRegistry = {
|
||||
online: { label: '线上支付', tagType: 'success' },
|
||||
offline: { label: '线下支付', tagType: 'info' }
|
||||
}
|
||||
export const paymentMethodLabel = createLabelGetter(paymentMethod)
|
||||
export const paymentMethodTagType = createTagTypeGetter(paymentMethod)
|
||||
|
||||
export const orderPayStatus: StatusRegistry = {
|
||||
pending_payment: { label: '待支付', tagType: 'warning' },
|
||||
paid: { label: '已支付', tagType: 'success' }
|
||||
}
|
||||
export const orderPayStatusLabel = createLabelGetter(orderPayStatus)
|
||||
export const orderPayStatusTagType = createTagTypeGetter(orderPayStatus)
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 系统 / 通用域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/** 通用启用/停用(数据库 status 字段 1/0) */
|
||||
export const enableStatus: StatusRegistry = {
|
||||
'1': { label: '正常', tagType: 'success' },
|
||||
'0': { label: '停用', tagType: 'danger' }
|
||||
}
|
||||
export const enableStatusLabel = createLabelGetter(enableStatus)
|
||||
export const enableStatusTagType = createTagTypeGetter(enableStatus)
|
||||
|
||||
/** 性别(客户等业务表) */
|
||||
export const sex: StatusRegistry = {
|
||||
'0': { label: '男', tagType: 'primary' },
|
||||
'1': { label: '女', tagType: 'success' }
|
||||
}
|
||||
export const sexLabel = createLabelGetter(sex)
|
||||
export const sexTagType = createTagTypeGetter(sex)
|
||||
|
||||
/** 请假状态 */
|
||||
export const leaveStatus: StatusRegistry = {
|
||||
draft: { label: '草稿', tagType: 'info' },
|
||||
pending: { label: '审批中', tagType: 'warning' },
|
||||
approved: { label: '已通过', tagType: 'success' },
|
||||
rejected: { label: '已驳回', tagType: 'danger' },
|
||||
cancelled: { label: '已取消', tagType: 'info' }
|
||||
}
|
||||
export const leaveStatusLabel = createLabelGetter(leaveStatus)
|
||||
export const leaveStatusTagType = createTagTypeGetter(leaveStatus)
|
||||
|
||||
/** 数据权限范围 */
|
||||
export const dataScope: StatusRegistry = {
|
||||
'1': { label: '全部数据', tagType: '' },
|
||||
'2': { label: '本部门数据', tagType: 'info' },
|
||||
'3': { label: '本部门及以下', tagType: 'info' },
|
||||
'4': { label: '仅本人', tagType: 'warning' },
|
||||
'5': { label: '自定义', tagType: 'primary' }
|
||||
}
|
||||
export const dataScopeLabel = createLabelGetter(dataScope)
|
||||
export const dataScopeTagType = createTagTypeGetter(dataScope)
|
||||
|
||||
/** 洁净室等级 */
|
||||
export const cleanRoomGrade: StatusRegistry = {
|
||||
A: { label: 'A级', tagType: 'warning' },
|
||||
B: { label: 'B级', tagType: '' },
|
||||
C: { label: 'C级', tagType: 'info' },
|
||||
D: { label: 'D级', tagType: 'info' }
|
||||
}
|
||||
export const cleanRoomGradeLabel = createLabelGetter(cleanRoomGrade)
|
||||
export const cleanRoomGradeTagType = createTagTypeGetter(cleanRoomGrade)
|
||||
|
||||
/** 样本编码类型 */
|
||||
export const sampleCodeType: StatusRegistry = {
|
||||
zxbm: { label: '造血编码', tagType: 'info' },
|
||||
qdbm: { label: '脐带编码', tagType: 'primary' }
|
||||
}
|
||||
export const sampleCodeTypeLabel = createLabelGetter(sampleCodeType)
|
||||
export const sampleCodeTypeTagType = createTagTypeGetter(sampleCodeType)
|
||||
|
||||
/** 耗材包类型 */
|
||||
export const packType: StatusRegistry = {
|
||||
bzhcb: { label: '标准耗材包', tagType: 'primary' },
|
||||
zdyhcb: { label: '自定义耗材包', tagType: 'warning' }
|
||||
}
|
||||
export const packTypeLabel = createLabelGetter(packType)
|
||||
export const packTypeTagType = createTagTypeGetter(packType)
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 入库放行审核域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
export const storageReleaseConclusion: StatusRegistry = {
|
||||
tg: { label: '通过', tagType: 'success' },
|
||||
btg: { label: '不通过', tagType: 'danger' }
|
||||
}
|
||||
export const storageReleaseConclusionLabel = createLabelGetter(storageReleaseConclusion)
|
||||
export const storageReleaseConclusionTagType = createTagTypeGetter(storageReleaseConclusion)
|
||||
|
||||
export const storageStatus: StatusRegistry = {
|
||||
drk: { label: '待入库', tagType: 'warning' },
|
||||
yrk: { label: '已入库', tagType: 'success' }
|
||||
}
|
||||
export const storageStatusLabel = createLabelGetter(storageStatus)
|
||||
export const storageStatusTagType = createTagTypeGetter(storageStatus)
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 渠道服务订单域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
/** 渠道服务订单类型 */
|
||||
export const channelServiceOrderType: StatusRegistry = {
|
||||
yfk: { label: '预付款充值', tagType: 'primary' },
|
||||
gmcp: { label: '购买产品份数', tagType: 'success' }
|
||||
}
|
||||
export const channelServiceOrderTypeLabel = createLabelGetter(channelServiceOrderType)
|
||||
export const channelServiceOrderTypeTagType = createTagTypeGetter(channelServiceOrderType)
|
||||
|
||||
/** 渠道服务订单状态 */
|
||||
export const channelServiceOrderStatus: StatusRegistry = {
|
||||
dsx: { label: '待生效', tagType: 'info' },
|
||||
dqr: { label: '待确认', tagType: 'warning' },
|
||||
yqr: { label: '已确认', tagType: 'success' },
|
||||
sxz: { label: '生效中', tagType: 'success' },
|
||||
tfqrz: { label: '退款确认中', tagType: 'danger' },
|
||||
ytf: { label: '已退款', tagType: 'info' },
|
||||
yzf: { label: '已作废', tagType: 'info' }
|
||||
}
|
||||
export const channelServiceOrderStatusLabel = createLabelGetter(channelServiceOrderStatus)
|
||||
export const channelServiceOrderStatusTagType = createTagTypeGetter(channelServiceOrderStatus)
|
||||
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
// 流水域
|
||||
// ══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
// 流水类型
|
||||
export const txnTypeLabel = (type: string): string => {
|
||||
const map: Record<string, string> = {
|
||||
recharge: '充值',
|
||||
refund: '退款',
|
||||
purchase: '购买产品',
|
||||
unsubscribe: '退订产品',
|
||||
settlement: '输注结算'
|
||||
}
|
||||
return map[type] || type
|
||||
}
|
||||
|
||||
export const txnTypeTagType = (type: string): string => {
|
||||
const map: Record<string, string> = {
|
||||
recharge: '',
|
||||
refund: 'danger',
|
||||
purchase: 'success',
|
||||
unsubscribe: 'warning',
|
||||
settlement: 'primary'
|
||||
}
|
||||
return map[type] || 'info'
|
||||
}
|
||||
|
||||
// 流水状态
|
||||
export const txnStatusLabel = (status: string): string => {
|
||||
const map: Record<string, string> = {
|
||||
dsx: '待生效',
|
||||
dqr: '待财务确认',
|
||||
yqr: '已确认',
|
||||
yzf: '已作废'
|
||||
}
|
||||
return map[status] || status
|
||||
}
|
||||
|
||||
export const txnStatusTagType = (status: string): string => {
|
||||
const map: Record<string, string> = {
|
||||
dsx: 'info',
|
||||
dqr: 'warning',
|
||||
yqr: 'success',
|
||||
yzf: 'danger'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
/** 中试申请单状态 */
|
||||
export function applicationStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = { dks: '待开始', jxz: '进行中', ywc: '已完成', yzf: '已作废' }
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function applicationStatusTagType(
|
||||
status: string
|
||||
): '' | 'success' | 'warning' | 'danger' | 'info' {
|
||||
const map: Record<string, '' | 'success' | 'warning' | 'danger' | 'info'> = {
|
||||
dks: 'info',
|
||||
jxz: 'warning',
|
||||
ywc: 'success',
|
||||
yzf: 'danger'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务体检状态 ==========
|
||||
export function checkupStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtj: '待体检',
|
||||
ytj: '已体检'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
|
||||
export function checkupStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtj: 'warning',
|
||||
ytj: 'success'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
export function feeStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
wjs: '未结算',
|
||||
yjs: '已结算'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
|
||||
export function feeStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
wjs: 'info',
|
||||
yjs: 'success'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 输注计划状态 ==========
|
||||
export function scheduleStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dsc: '待生产',
|
||||
ysc: '已生产',
|
||||
yjf: '已交付',
|
||||
yqx: '已取消'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function scheduleStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dsc: 'info',
|
||||
ysc: 'primary',
|
||||
yjf: 'success',
|
||||
yqx: 'danger'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 输注状态 ==========
|
||||
export function infusionStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: '待输注',
|
||||
yrqr: '已用户确认',
|
||||
yqx: '已取消',
|
||||
ywc: '已完成'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function infusionStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: 'info',
|
||||
yrqr: 'warning',
|
||||
yqx: 'danger',
|
||||
ywc: 'success'
|
||||
}
|
||||
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: '已取消' }
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function qcStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = { dzc: 'info', yzj: 'success', yqx: 'danger' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 放行审核结论 ==========
|
||||
export function releaseReviewConclusionLabel(conclusion: string): string {
|
||||
const map: Record<string, string> = { tg: '通过', btg: '不通过' }
|
||||
return map[conclusion] || conclusion || '-'
|
||||
}
|
||||
export function releaseReviewConclusionTagType(conclusion: string): string {
|
||||
const map: Record<string, string> = { tg: 'success', btg: 'danger' }
|
||||
return map[conclusion] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 业务类型 ==========
|
||||
export function bizTypeLabel(type: string): string {
|
||||
const map: Record<string, string> = {
|
||||
pilot_service: '中试服务',
|
||||
clinical_application: '临床应用'
|
||||
}
|
||||
return map[type] || type || '-'
|
||||
}
|
||||
export function bizTypeTagType(type: string): string {
|
||||
const map: Record<string, string> = {
|
||||
pilot_service: 'primary',
|
||||
clinical_application: 'warning'
|
||||
}
|
||||
return map[type] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 产品状态 ==========
|
||||
export function productStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: '待输注',
|
||||
yrqr: '已用户确认',
|
||||
yqx: '已取消',
|
||||
ywc: '已完成'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function productStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: 'info',
|
||||
yrqr: 'warning',
|
||||
yqx: 'danger',
|
||||
ywc: 'success'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 细胞产品库 - 产品状态 ==========
|
||||
export function cellProductStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
frozen: '已冻存',
|
||||
in_production: '生产中',
|
||||
sold: '已售卖',
|
||||
used: '已使用',
|
||||
voided: '已作废',
|
||||
thawed: '已复苏'
|
||||
}
|
||||
return map[status] || status || '—'
|
||||
}
|
||||
export function cellProductStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
frozen: 'success',
|
||||
in_production: 'warning',
|
||||
sold: 'warning',
|
||||
used: 'info',
|
||||
voided: 'danger',
|
||||
thawed: 'info'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
Reference in new issue
Block a user