status-tag-registry.ts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /**
  2. * 状态标签注册表 — 全局集中定义所有枚举字段的 label + tagType
  3. *
  4. * 使用方式:
  5. * import { protocolStatusLabel, protocolStatusTagType } from '@/utils/status-tag-registry'
  6. * <el-tag :type="protocolStatusTagType(row.status)">{{ protocolStatusLabel(row.status) }}</el-tag>
  7. *
  8. * 规范:同一枚举值在任何地方(表格、查看弹窗、导出)颜色必须一致。
  9. * tagType 语义色:success=正常/已完成, warning=进行中/已过期, danger=异常/已作废,
  10. * info=待执行/停用, primary=特殊分类/转出, ''=默认
  11. */
  12. // ── 类型定义 ──────────────────────────────────────────────────────────────────
  13. /** el-tag 的 type 属性值 */
  14. export type TagType = 'success' | 'warning' | 'danger' | 'info' | '' | 'primary'
  15. /** 单条枚举映射 */
  16. export interface StatusItem {
  17. label: string
  18. tagType: TagType
  19. }
  20. /** 注册表类型 */
  21. export type StatusRegistry = Record<string, StatusItem>
  22. // ── 工厂函数 ──────────────────────────────────────────────────────────────────
  23. function createLabelGetter(registry: StatusRegistry) {
  24. return (code: string): string => registry[code]?.label ?? code ?? '—'
  25. }
  26. function createTagTypeGetter(registry: StatusRegistry) {
  27. return (code: string): TagType => registry[code]?.tagType ?? 'info'
  28. }
  29. // ══════════════════════════════════════════════════════════════════════════════
  30. // 协议 / 存储 域
  31. // ══════════════════════════════════════════════════════════════════════════════
  32. export const protocolStatus: StatusRegistry = {
  33. dsx: { label: '待生效', tagType: 'info' },
  34. sxz: { label: '生效中', tagType: 'success' },
  35. ygq: { label: '已过期', tagType: 'warning' },
  36. yzf: { label: '已作废', tagType: 'danger' },
  37. zky: { label: '转科研', tagType: 'primary' }
  38. }
  39. export const protocolStatusLabel = createLabelGetter(protocolStatus)
  40. export const protocolStatusTagType = createTagTypeGetter(protocolStatus)
  41. export const donationStatus: StatusRegistry = {
  42. dsx: { label: '待生效', tagType: 'info' },
  43. sxz: { label: '生效中', tagType: 'success' },
  44. ygq: { label: '已过期', tagType: 'warning' },
  45. yzf: { label: '已作废', tagType: 'danger' },
  46. zckc: { label: '转细胞存储', tagType: 'primary' }
  47. }
  48. export const donationStatusLabel = createLabelGetter(donationStatus)
  49. export const donationStatusTagType = createTagTypeGetter(donationStatus)
  50. export const sampleStatus: StatusRegistry = {
  51. ycj: { label: '已采集', tagType: 'primary' },
  52. jcz: { label: '检测中', tagType: 'warning' },
  53. yrk: { label: '已入库', tagType: 'success' },
  54. yzf: { label: '已作废', tagType: 'danger' }
  55. }
  56. export const sampleStatusLabel = createLabelGetter(sampleStatus)
  57. export const sampleStatusTagType = createTagTypeGetter(sampleStatus)
  58. export const payStatus: StatusRegistry = {
  59. dfj: { label: '待缴费', tagType: 'info' },
  60. jfqrz: { label: '缴费确认中', tagType: 'warning' },
  61. yjf: { label: '已缴费', tagType: 'success' },
  62. tfqrz: { label: '退费确认中', tagType: 'warning' },
  63. ytf: { label: '已退费', tagType: 'danger' }
  64. }
  65. export const payStatusLabel = createLabelGetter(payStatus)
  66. export const payStatusTagType = createTagTypeGetter(payStatus)
  67. export const auditStatus: StatusRegistry = {
  68. shtg: { label: '审核通过', tagType: 'success' },
  69. shth: { label: '审核退回', tagType: 'danger' }
  70. }
  71. export const auditStatusLabel = createLabelGetter(auditStatus)
  72. export const auditStatusTagType = createTagTypeGetter(auditStatus)
  73. export const payMode: StatusRegistry = {
  74. dj: { label: '趸交', tagType: 'info' },
  75. fq: { label: '分期', tagType: 'warning' }
  76. }
  77. export const payModeLabel = createLabelGetter(payMode)
  78. export const payModeTagType = createTagTypeGetter(payMode)
  79. export const transferType: StatusRegistry = {
  80. wxzz: { label: '微信转账', tagType: 'success' },
  81. zzbzz: { label: '支付宝转账', tagType: 'primary' },
  82. yhkzz: { label: '银行卡转账', tagType: 'info' },
  83. xj: { label: '现金', tagType: 'warning' }
  84. }
  85. export const transferTypeLabel = createLabelGetter(transferType)
  86. export const transferTypeTagType = createTagTypeGetter(transferType)
  87. export const transportType: StatusRegistry = {
  88. kdys: { label: '快递运输', tagType: 'info' },
  89. ryxd: { label: '人员携带', tagType: 'success' }
  90. }
  91. export const transportTypeLabel = createLabelGetter(transportType)
  92. export const transportTypeTagType = createTagTypeGetter(transportType)
  93. export const receptionSource: StatusRegistry = {
  94. cell_storage: { label: '细胞存储', tagType: 'primary' },
  95. research_donation: { label: '科研捐赠', tagType: 'warning' },
  96. outbound: { label: '出库', tagType: 'primary' },
  97. pilot_service: { label: '中试服务', tagType: 'primary' },
  98. clinical_application: { label: '临床应用', tagType: 'warning' }
  99. }
  100. export const receptionSourceLabel = createLabelGetter(receptionSource)
  101. export const receptionSourceTagType = createTagTypeGetter(receptionSource)
  102. export const newbornSex: StatusRegistry = {
  103. '1': { label: '男', tagType: 'primary' },
  104. '0': { label: '女', tagType: 'success' }
  105. }
  106. export const newbornSexLabel = createLabelGetter(newbornSex)
  107. export const newbornSexTagType = createTagTypeGetter(newbornSex)
  108. export const deliveryMode: StatusRegistry = {
  109. sc: { label: '顺产', tagType: 'info' },
  110. pgc: { label: '剖宫产', tagType: 'warning' }
  111. }
  112. export const deliveryModeLabel = createLabelGetter(deliveryMode)
  113. export const deliveryModeTagType = createTagTypeGetter(deliveryMode)
  114. export const sourceType: StatusRegistry = {
  115. direct: { label: '独立新建', tagType: 'info' },
  116. from_storage: { label: '从存储转来', tagType: 'primary' }
  117. }
  118. export const sourceTypeLabel = createLabelGetter(sourceType)
  119. export const sourceTypeTagType = createTagTypeGetter(sourceType)
  120. // ══════════════════════════════════════════════════════════════════════════════
  121. // 质检域
  122. // ══════════════════════════════════════════════════════════════════════════════
  123. export const qcBizType: StatusRegistry = {
  124. inbound: { label: '入库质检', tagType: 'success' },
  125. outbound: { label: '出库质检', tagType: 'primary' },
  126. temporary: { label: '临时质检', tagType: 'warning' }
  127. }
  128. export const qcBizTypeLabel = createLabelGetter(qcBizType)
  129. export const qcBizTypeTagType = createTagTypeGetter(qcBizType)
  130. export const workOrderStatus: StatusRegistry = {
  131. dpz: { label: '待配置', tagType: 'info' },
  132. ypz: { label: '已配置', tagType: 'success' },
  133. ywc: { label: '已完成', tagType: 'success' },
  134. yzf: { label: '已作废', tagType: 'danger' }
  135. }
  136. export const workOrderStatusLabel = createLabelGetter(workOrderStatus)
  137. export const workOrderStatusTagType = createTagTypeGetter(workOrderStatus)
  138. export const taskType: StatusRegistry = {
  139. sysz: { label: '实验室自检', tagType: 'info' },
  140. dsfjc: { label: '第三方检测', tagType: 'primary' }
  141. }
  142. export const taskTypeLabel = createLabelGetter(taskType)
  143. export const taskTypeTagType = createTagTypeGetter(taskType)
  144. export const qcConclusion: StatusRegistry = {
  145. tg: { label: '通过', tagType: 'success' },
  146. btg: { label: '不通过', tagType: 'danger' }
  147. }
  148. export const qcTaskConclusionLabel = createLabelGetter(qcConclusion)
  149. export const qcTaskConclusionTagType = createTagTypeGetter(qcConclusion)
  150. export const taskStatus: StatusRegistry = {
  151. dzx: { label: '待执行', tagType: 'info' },
  152. jxz: { label: '进行中', tagType: 'warning' },
  153. ywc: { label: '已完成', tagType: 'success' }
  154. }
  155. export const taskStatusLabel = createLabelGetter(taskStatus)
  156. export const taskStatusTagType = createTagTypeGetter(taskStatus)
  157. export const acceptConclusion: StatusRegistry = {
  158. js: { label: '接收', tagType: 'success' },
  159. bj: { label: '拒收', tagType: 'danger' }
  160. }
  161. export const acceptConclusionLabel = createLabelGetter(acceptConclusion)
  162. export const acceptConclusionTagType = createTagTypeGetter(acceptConclusion)
  163. // ══════════════════════════════════════════════════════════════════════════════
  164. // 渠道域
  165. // ══════════════════════════════════════════════════════════════════════════════
  166. export const channelType: StatusRegistry = {
  167. yy: { label: '医院', tagType: 'primary' },
  168. hzjg: { label: '合作机构', tagType: 'success' },
  169. zs: { label: '诊所', tagType: 'warning' },
  170. zfjg: { label: '政府机构', tagType: 'danger' },
  171. qt: { label: '其他', tagType: 'info' }
  172. }
  173. export const channelTypeLabel = createLabelGetter(channelType)
  174. export const channelTypeTagType = createTagTypeGetter(channelType)
  175. export const agreementType: StatusRegistry = {
  176. kyxy: { label: '框架协议', tagType: 'primary' },
  177. zsxy: { label: '中试协议', tagType: 'success' },
  178. lcxy: { label: '临床协议', tagType: 'warning' }
  179. }
  180. export const agreementTypeLabel = createLabelGetter(agreementType)
  181. export const agreementTypeTagType = createTagTypeGetter(agreementType)
  182. export const agreementStatus: StatusRegistry = {
  183. dsx: { label: '待生效', tagType: 'info' },
  184. sxz: { label: '生效中', tagType: 'success' },
  185. yzf: { label: '已作废', tagType: 'danger' }
  186. }
  187. export const agreementStatusLabel = createLabelGetter(agreementStatus)
  188. export const agreementStatusTagType = createTagTypeGetter(agreementStatus)
  189. export const settlementType: StatusRegistry = {
  190. yj: { label: '月结', tagType: '' },
  191. jj: { label: '季结', tagType: 'success' },
  192. nj: { label: '年结', tagType: 'warning' },
  193. dcjs: { label: '单次结算', tagType: 'danger' }
  194. }
  195. export const settlementTypeLabel = createLabelGetter(settlementType)
  196. export const settlementTypeTagType = createTagTypeGetter(settlementType)
  197. // ══════════════════════════════════════════════════════════════════════════════
  198. // 订单域
  199. // ══════════════════════════════════════════════════════════════════════════════
  200. export const orderStatus: StatusRegistry = {
  201. pending_payment: { label: '待支付', tagType: 'warning' },
  202. pending_confirm: { label: '待收货', tagType: 'info' },
  203. completed: { label: '已完成', tagType: 'success' },
  204. cancelled: { label: '已取消', tagType: 'danger' }
  205. }
  206. export const orderStatusLabel = createLabelGetter(orderStatus)
  207. export const orderStatusTagType = createTagTypeGetter(orderStatus)
  208. export const deliveryStatusMap: StatusRegistry = {
  209. pending_dispatch: { label: '待分配配送', tagType: 'info' },
  210. delivering: { label: '配送中', tagType: 'warning' },
  211. delivered: { label: '配送完成', tagType: 'success' }
  212. }
  213. export const deliveryStatusLabel = createLabelGetter(deliveryStatusMap)
  214. export const deliveryStatusTagType = createTagTypeGetter(deliveryStatusMap)
  215. export const paymentMethod: StatusRegistry = {
  216. online: { label: '线上支付', tagType: 'success' },
  217. offline: { label: '线下支付', tagType: 'info' }
  218. }
  219. export const paymentMethodLabel = createLabelGetter(paymentMethod)
  220. export const paymentMethodTagType = createTagTypeGetter(paymentMethod)
  221. export const orderPayStatus: StatusRegistry = {
  222. pending_payment: { label: '待支付', tagType: 'warning' },
  223. paid: { label: '已支付', tagType: 'success' }
  224. }
  225. export const orderPayStatusLabel = createLabelGetter(orderPayStatus)
  226. export const orderPayStatusTagType = createTagTypeGetter(orderPayStatus)
  227. // ══════════════════════════════════════════════════════════════════════════════
  228. // 系统 / 通用域
  229. // ══════════════════════════════════════════════════════════════════════════════
  230. /** 通用启用/停用(数据库 status 字段 1/0) */
  231. export const enableStatus: StatusRegistry = {
  232. '1': { label: '正常', tagType: 'success' },
  233. '0': { label: '停用', tagType: 'danger' }
  234. }
  235. export const enableStatusLabel = createLabelGetter(enableStatus)
  236. export const enableStatusTagType = createTagTypeGetter(enableStatus)
  237. /** 性别(客户等业务表) */
  238. export const sex: StatusRegistry = {
  239. '0': { label: '男', tagType: 'primary' },
  240. '1': { label: '女', tagType: 'success' }
  241. }
  242. export const sexLabel = createLabelGetter(sex)
  243. export const sexTagType = createTagTypeGetter(sex)
  244. /** 请假状态 */
  245. export const leaveStatus: StatusRegistry = {
  246. draft: { label: '草稿', tagType: 'info' },
  247. pending: { label: '审批中', tagType: 'warning' },
  248. approved: { label: '已通过', tagType: 'success' },
  249. rejected: { label: '已驳回', tagType: 'danger' },
  250. cancelled: { label: '已取消', tagType: 'info' }
  251. }
  252. export const leaveStatusLabel = createLabelGetter(leaveStatus)
  253. export const leaveStatusTagType = createTagTypeGetter(leaveStatus)
  254. /** 数据权限范围 */
  255. export const dataScope: StatusRegistry = {
  256. '1': { label: '全部数据', tagType: '' },
  257. '2': { label: '本部门数据', tagType: 'info' },
  258. '3': { label: '本部门及以下', tagType: 'info' },
  259. '4': { label: '仅本人', tagType: 'warning' },
  260. '5': { label: '自定义', tagType: 'primary' }
  261. }
  262. export const dataScopeLabel = createLabelGetter(dataScope)
  263. export const dataScopeTagType = createTagTypeGetter(dataScope)
  264. /** 洁净室等级 */
  265. export const cleanRoomGrade: StatusRegistry = {
  266. A: { label: 'A级', tagType: 'warning' },
  267. B: { label: 'B级', tagType: '' },
  268. C: { label: 'C级', tagType: 'info' },
  269. D: { label: 'D级', tagType: 'info' }
  270. }
  271. export const cleanRoomGradeLabel = createLabelGetter(cleanRoomGrade)
  272. export const cleanRoomGradeTagType = createTagTypeGetter(cleanRoomGrade)
  273. /** 样本编码类型 */
  274. export const sampleCodeType: StatusRegistry = {
  275. zxbm: { label: '造血编码', tagType: 'info' },
  276. qdbm: { label: '脐带编码', tagType: 'primary' }
  277. }
  278. export const sampleCodeTypeLabel = createLabelGetter(sampleCodeType)
  279. export const sampleCodeTypeTagType = createTagTypeGetter(sampleCodeType)
  280. /** 耗材包类型 */
  281. export const packType: StatusRegistry = {
  282. bzhcb: { label: '标准耗材包', tagType: 'primary' },
  283. zdyhcb: { label: '自定义耗材包', tagType: 'warning' }
  284. }
  285. export const packTypeLabel = createLabelGetter(packType)
  286. export const packTypeTagType = createTagTypeGetter(packType)
  287. // ══════════════════════════════════════════════════════════════════════════════
  288. // 入库放行审核域
  289. // ══════════════════════════════════════════════════════════════════════════════
  290. export const storageReleaseConclusion: StatusRegistry = {
  291. tg: { label: '通过', tagType: 'success' },
  292. btg: { label: '不通过', tagType: 'danger' }
  293. }
  294. export const storageReleaseConclusionLabel = createLabelGetter(storageReleaseConclusion)
  295. export const storageReleaseConclusionTagType = createTagTypeGetter(storageReleaseConclusion)
  296. export const storageStatus: StatusRegistry = {
  297. drk: { label: '待入库', tagType: 'warning' },
  298. yrk: { label: '已入库', tagType: 'success' }
  299. }
  300. export const storageStatusLabel = createLabelGetter(storageStatus)
  301. export const storageStatusTagType = createTagTypeGetter(storageStatus)
  302. // ══════════════════════════════════════════════════════════════════════════════
  303. // 渠道服务订单域
  304. // ══════════════════════════════════════════════════════════════════════════════
  305. /** 渠道服务订单类型 */
  306. export const channelServiceOrderType: StatusRegistry = {
  307. yfk: { label: '预付款充值', tagType: 'primary' },
  308. gmcp: { label: '购买产品份数', tagType: 'success' }
  309. }
  310. export const channelServiceOrderTypeLabel = createLabelGetter(channelServiceOrderType)
  311. export const channelServiceOrderTypeTagType = createTagTypeGetter(channelServiceOrderType)
  312. /** 渠道服务订单状态 */
  313. export const channelServiceOrderStatus: StatusRegistry = {
  314. dsx: { label: '待生效', tagType: 'info' },
  315. dqr: { label: '待确认', tagType: 'warning' },
  316. yqr: { label: '已确认', tagType: 'success' },
  317. sxz: { label: '生效中', tagType: 'success' },
  318. tfqrz: { label: '退款确认中', tagType: 'danger' },
  319. ytf: { label: '已退款', tagType: 'info' },
  320. yzf: { label: '已作废', tagType: 'info' }
  321. }
  322. export const channelServiceOrderStatusLabel = createLabelGetter(channelServiceOrderStatus)
  323. export const channelServiceOrderStatusTagType = createTagTypeGetter(channelServiceOrderStatus)
  324. // ══════════════════════════════════════════════════════════════════════════════
  325. // 流水域
  326. // ══════════════════════════════════════════════════════════════════════════════
  327. // 流水类型
  328. export const txnTypeLabel = (type: string): string => {
  329. const map: Record<string, string> = {
  330. recharge: '充值',
  331. refund: '退款',
  332. purchase: '购买产品',
  333. unsubscribe: '退订产品',
  334. settlement: '输注结算'
  335. }
  336. return map[type] || type
  337. }
  338. export const txnTypeTagType = (type: string): string => {
  339. const map: Record<string, string> = {
  340. recharge: '',
  341. refund: 'danger',
  342. purchase: 'success',
  343. unsubscribe: 'warning',
  344. settlement: 'primary'
  345. }
  346. return map[type] || 'info'
  347. }
  348. // 流水状态
  349. export const txnStatusLabel = (status: string): string => {
  350. const map: Record<string, string> = {
  351. dsx: '待生效',
  352. dqr: '待财务确认',
  353. yqr: '已确认',
  354. yzf: '已作废'
  355. }
  356. return map[status] || status
  357. }
  358. export const txnStatusTagType = (status: string): string => {
  359. const map: Record<string, string> = {
  360. dsx: 'info',
  361. dqr: 'warning',
  362. yqr: 'success',
  363. yzf: 'danger'
  364. }
  365. return map[status] || 'info'
  366. }
  367. /** 中试申请单状态 */
  368. export function applicationStatusLabel(status: string): string {
  369. const map: Record<string, string> = { dks: '待开始', jxz: '进行中', ywc: '已完成', yzf: '已作废' }
  370. return map[status] || status || '-'
  371. }
  372. export function applicationStatusTagType(
  373. status: string
  374. ): '' | 'success' | 'warning' | 'danger' | 'info' {
  375. const map: Record<string, '' | 'success' | 'warning' | 'danger' | 'info'> = {
  376. dks: 'info',
  377. jxz: 'warning',
  378. ywc: 'success',
  379. yzf: 'danger'
  380. }
  381. return map[status] || 'info'
  382. }
  383. // ========== 中试服务体检状态 ==========
  384. export function checkupStatusLabel(status: string): string {
  385. const map: Record<string, string> = {
  386. dtj: '待体检',
  387. ytj: '已体检'
  388. }
  389. return map[status] || status || '-'
  390. }
  391. export function checkupStatusTagType(status: string): string {
  392. const map: Record<string, string> = {
  393. dtj: 'warning',
  394. ytj: 'success'
  395. }
  396. return map[status] || 'info'
  397. }
  398. export function feeStatusLabel(status: string): string {
  399. const map: Record<string, string> = {
  400. wjs: '未结算',
  401. yjs: '已结算'
  402. }
  403. return map[status] || status || '-'
  404. }
  405. export function feeStatusTagType(status: string): string {
  406. const map: Record<string, string> = {
  407. wjs: 'info',
  408. yjs: 'success'
  409. }
  410. return map[status] || 'info'
  411. }
  412. // ========== 中试服务 - 输注计划状态 ==========
  413. export function scheduleStatusLabel(status: string): string {
  414. const map: Record<string, string> = {
  415. dsc: '待生产',
  416. ysc: '已生产',
  417. yjf: '已交付',
  418. yqx: '已取消'
  419. }
  420. return map[status] || status || '-'
  421. }
  422. export function scheduleStatusTagType(status: string): string {
  423. const map: Record<string, string> = {
  424. dsc: 'info',
  425. ysc: 'primary',
  426. yjf: 'success',
  427. yqx: 'danger'
  428. }
  429. return map[status] || 'info'
  430. }
  431. // ========== 中试服务 - 输注状态 ==========
  432. export function infusionStatusLabel(status: string): string {
  433. const map: Record<string, string> = {
  434. dtz: '待输注',
  435. yrqr: '已用户确认',
  436. yqx: '已取消',
  437. ywc: '已完成'
  438. }
  439. return map[status] || status || '-'
  440. }
  441. export function infusionStatusTagType(status: string): string {
  442. const map: Record<string, string> = {
  443. dtz: 'info',
  444. yrqr: 'warning',
  445. yqx: 'danger',
  446. ywc: 'success'
  447. }
  448. return map[status] || 'info'
  449. }
  450. // ========== 中试服务 - 输注方式(字典 szfs) ==========
  451. export function infusionMethodLabel(method: string): string {
  452. const map: Record<string, string> = {
  453. jmsz: '静脉输注',
  454. pxzs: '皮下注射',
  455. jbzs: '局部注射',
  456. qt: '其他'
  457. }
  458. return map[method] || method || '—'
  459. }
  460. // ========== 中试服务 - 质检状态 ==========
  461. export function qcStatusLabel(status: string): string {
  462. const map: Record<string, string> = { dzc: '待质检', yzj: '已质检', yqx: '已取消' }
  463. return map[status] || status || '-'
  464. }
  465. export function qcStatusTagType(status: string): string {
  466. const map: Record<string, string> = { dzc: 'info', yzj: 'success', yqx: 'danger' }
  467. return map[status] || 'info'
  468. }
  469. // ========== 中试服务 - 放行审核结论 ==========
  470. export function releaseReviewConclusionLabel(conclusion: string): string {
  471. const map: Record<string, string> = { tg: '通过', btg: '不通过' }
  472. return map[conclusion] || conclusion || '-'
  473. }
  474. export function releaseReviewConclusionTagType(conclusion: string): string {
  475. const map: Record<string, string> = { tg: 'success', btg: 'danger' }
  476. return map[conclusion] || 'info'
  477. }
  478. // ========== 中试服务 - 业务类型 ==========
  479. export function bizTypeLabel(type: string): string {
  480. const map: Record<string, string> = {
  481. pilot_service: '中试服务',
  482. clinical_application: '临床应用'
  483. }
  484. return map[type] || type || '-'
  485. }
  486. export function bizTypeTagType(type: string): string {
  487. const map: Record<string, string> = {
  488. pilot_service: 'primary',
  489. clinical_application: 'warning'
  490. }
  491. return map[type] || 'info'
  492. }
  493. // ========== 中试服务 - 产品状态 ==========
  494. export function productStatusLabel(status: string): string {
  495. const map: Record<string, string> = {
  496. dtz: '待输注',
  497. yrqr: '已用户确认',
  498. yqx: '已取消',
  499. ywc: '已完成'
  500. }
  501. return map[status] || status || '-'
  502. }
  503. export function productStatusTagType(status: string): string {
  504. const map: Record<string, string> = {
  505. dtz: 'info',
  506. yrqr: 'warning',
  507. yqx: 'danger',
  508. ywc: 'success'
  509. }
  510. return map[status] || 'info'
  511. }