Files
zkxw/web-admin/src/views/pilot-service/infusion-schedule-management/ScheduleViewDialog.vue
T
zlwuandCursor e85645a649 refactor: 将基础实验展示名统一改为临床科研
保留 basic_experiment 等内部编码与业务逻辑,全量替换用户可见及源码中文;新增 sys_menu REPLACE 迁移(不改 perms/path)。Gitea 工单因凭据 401 待补关联。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-20 13:51:27 +08:00

602 lines
21 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 输注计划管理 — 查看弹窗(全链路关联信息) -->
<template>
<SystemViewDialog
v-model:visible="innerVisible"
:title="heroTitle"
:icon="Document"
:code="heroCode"
code-label="申请单号"
:sections="sections"
:loading="loading"
:grid-columns="4"
compact
width="1120px"
append-to-body
modal-class="infusion-schedule-view-dialog-mask"
>
<template #products>
<div class="list-body list-wrap view-inner-table-wrap">
<el-table
v-if="products.length"
:data="products"
stripe
class="list-table inner-table"
max-height="320"
>
<el-table-column type="index" label="序号" min-width="68" align="center" />
<el-table-column prop="projectName" label="项目名称" min-width="160" show-overflow-tooltip />
<el-table-column prop="cellTypeName" label="细胞类型" min-width="120" align="center" />
<el-table-column prop="specText" label="规格" min-width="100" align="center" />
<el-table-column label="协议价格(元)" min-width="120" align="right">
<template #default="{ row }">
{{ row.agreementPrice != null ? `¥${formatMoneyDisplay(row.agreementPrice)}` : '—' }}
</template>
</el-table-column>
<el-table-column label="实际价格(元)" min-width="120" align="right">
<template #default="{ row }">
{{ row.actualPrice != null ? `¥${formatMoneyDisplay(row.actualPrice)}` : '—' }}
</template>
</el-table-column>
<el-table-column prop="quantity" label="数量" min-width="80" align="center" />
</el-table>
<el-empty v-else description="暂无产品" :image-size="48" />
</div>
</template>
<template #production-info>
<SampleProductionInfoCards :production-info="detail?.productionInfo" />
</template>
<template #qc-info>
<SampleQcInfoGroupedPanel
:gate-qc-info="detail?.qcInfo"
:process-qc-info-list="detail?.processQcInfoList"
gate-section-label="计划质检(出库门禁)"
process-section-label="生产过程质检"
:show-section-label="false"
hide-sample-context
/>
</template>
<template #outbound-material>
<OutboundMaterialReadonlyPanel
:material="detail?.outboundMaterial"
:biz-type="scheduleBizType"
/>
</template>
<template #payment-info>
<div class="view-section-slot payment-info-view">
<ClinicalSchedulePaymentDetailView
v-if="detail?.payment"
:payment="detail.payment"
@preview="handleAttachmentPreview"
@download="handleAttachmentDownload"
/>
<el-empty v-else description="暂无缴费记录" :image-size="48" />
</div>
</template>
<template #review-attachments>
<div class="view-section-slot">
<ProtocolAttachmentReadonly
:files="reviewAttachmentFiles"
@preview="handleAttachmentPreview"
@download="handleAttachmentDownload"
/>
</div>
</template>
<template #handover-attachments>
<div class="view-section-slot">
<ProtocolAttachmentReadonly
:files="handoverAttachmentFiles"
@preview="handleAttachmentPreview"
@download="handleAttachmentDownload"
/>
</div>
</template>
</SystemViewDialog>
</template>
<script setup lang="ts">
import { ref, computed, watch } from 'vue'
import { Document } from '@element-plus/icons-vue'
import SystemViewDialog, {
type ViewSection,
type TagType
} from '@/components/business/system-view-dialog/index.vue'
import OutboundMaterialReadonlyPanel from '@/components/business/outbound-material-readonly-panel/index.vue'
import SampleProductionInfoCards from '@/components/business/sample-production-info-cards/index.vue'
import SampleQcInfoGroupedPanel from '@/components/business/sample-qc-info-grouped-panel/index.vue'
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
import ClinicalSchedulePaymentDetailView from '@/components/business/clinical-schedule-payment-detail/index.vue'
import { fetchInfusionScheduleMgmtDetail } from '@/api/admin'
import {
applicationStatusLabel,
applicationStatusTagType,
channelServiceOrderTypeLabel,
channelServiceOrderTypeTagType,
storageReleaseConclusionLabel,
storageReleaseConclusionTagType,
scheduleStatusLabel,
scheduleStatusTagType,
infusionStatusLabel,
infusionStatusTagType,
qcStatusLabel,
qcStatusTagType,
infusionMethodLabel,
sexLabel
} from '@/utils/status-tag-registry'
import { formatMoneyDisplay } from '@/utils/money-format'
import { maskIdCard } from '@/utils/mask-sensitive'
import { downloadAttachmentFile } from '@/utils/download-attachment'
import { getPilotBizConfig } from '@/config/pilot-biz-type'
import { resolveOutboundViewVariant } from '@/utils/outbound-qc-pilot-view-sections'
defineOptions({ name: 'ScheduleViewDialog' })
const props = defineProps<{
modelValue: boolean
scheduleRow: Record<string, any> | null
}>()
const emit = defineEmits(['update:modelValue'])
const innerVisible = computed({
get: () => props.modelValue,
set: (v: boolean) => emit('update:modelValue', v)
})
const loading = ref(false)
const detail = ref<Record<string, any> | null>(null)
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
const heroTitle = computed(() => {
const patient = detail.value?.patient || {}
const cfg = getPilotBizConfig(
detail.value?.application?.bizType || detail.value?.bizType
)
return patient.patientName || detail.value?.patientName || `${cfg.scheduleLabel}详情`
})
const heroCode = computed(() => {
const app = detail.value?.application || {}
return app.applicationNo || detail.value?.applicationNo || ''
})
const products = computed(() => detail.value?.products || [])
const isClinicalApplication = computed(
() =>
detail.value?.application?.bizType === 'clinical_application' ||
detail.value?.bizType === 'clinical_application'
)
const scheduleBizConfig = computed(() =>
getPilotBizConfig(detail.value?.application?.bizType || detail.value?.bizType)
)
const isBasicExperiment = computed(
() =>
detail.value?.application?.bizType === 'basic_experiment' ||
detail.value?.bizType === 'basic_experiment'
)
const scheduleBizType = computed(() =>
resolveOutboundViewVariant(detail.value?.application?.bizType || detail.value?.bizType)
)
const reviewAttachmentFiles = computed(() => {
const urls = detail.value?.reviewInfo?.reviewAttachments || ''
if (!urls.trim()) return []
return urls
.split(',')
.map((u: string) => u.trim())
.filter(Boolean)
.map((fileUrl: string, i: number) => ({
id: `att_${i}`,
fileUrl,
fileName: fileUrl.split('/').pop() || ''
}))
})
const handoverAttachmentFiles = computed(() => {
const urls = detail.value?.outboundHandover?.attachments || ''
if (!urls.trim()) return []
return urls
.split(',')
.map((u: string) => u.trim())
.filter(Boolean)
.map((fileUrl: string, i: number) => ({
id: `handover_att_${i}`,
fileUrl,
fileName: fileUrl.split('/').pop() || ''
}))
})
function formatCourseNo(schedule: Record<string, any>) {
const sortNo = schedule?.sortNo ?? detail.value?.sortNo
const total = schedule?.totalCourseCount ?? detail.value?.totalCourseCount
if (sortNo != null && total != null) {
return `第 ${sortNo} 次 / 共 ${total} 次`
}
if (sortNo != null) return `第 ${sortNo} 次`
return '—'
}
function formatNeedCheckup(v: unknown) {
if (v === 1 || v === '1') return '需要'
if (v === 0 || v === '0') return '不需要'
return '—'
}
function formatCellType(plan: Record<string, any>, schedule: Record<string, any>) {
return schedule.cellType || plan.cellType || detail.value?.cellType || '—'
}
function hasInfusionConfirm(confirm: Record<string, any>) {
return !!(confirm?.id || confirm?.confirmTime || confirm?.confirmUserName)
}
const sections = computed((): ViewSection[] => {
const d = detail.value
if (!d?.id) return []
const app = d.application || {}
const patient = d.patient || {}
const plan = d.infusionPlan || {}
const schedule = d.infusionSchedule || {}
const review = d.reviewInfo || {}
const oh = d.outboundHandover || {}
const confirm = d.infusionConfirm || {}
const reviewConclusionValue = review.reviewConclusion || ''
const reviewConclusionDisplay = reviewConclusionValue
? storageReleaseConclusionLabel(reviewConclusionValue)
: '待审核'
const reviewConclusionTag = reviewConclusionValue
? storageReleaseConclusionTagType(reviewConclusionValue)
: 'info'
const cfg = scheduleBizConfig.value
const basic = isBasicExperiment.value
const confirmFields: ViewSection['fields'] = hasInfusionConfirm(confirm)
? [
{ label: '确认人', value: confirm.confirmUserName || '—' },
{ label: '确认时间', value: confirm.confirmTime || '—' },
{ label: '确认说明', value: confirm.confirmDesc || '—', span: true },
{ label: '备注', value: confirm.remark || '—', span: true }
]
: schedule.infusionStatus === 'yrqr' || d.infusionStatus === 'yrqr'
? [
{
label: '确认状态',
value: infusionStatusLabel('yrqr'),
tagType: infusionStatusTagType('yrqr') as TagType
},
{
label: '说明',
value: `已在${cfg.scheduleLabel}管理中确认,暂无独立应用确认记录`,
span: true
}
]
: [{ label: '确认状态', value: '未确认', tagType: 'info' }]
const orderType = app.orderType || d.orderType || ''
const contextSections: ViewSection[] = basic
? [
{
title: '临床科研申请信息',
fields: [
{ label: '申请单号', value: app.applicationNo || d.applicationNo || '—' },
{ label: '课题名称', value: app.projectTitle || d.projectTitle || '—' },
{ label: '客户名称', value: app.customerName || d.customerName || '—' },
{
label: '申请单状态',
value: applicationStatusLabel(app.applicationStatus || d.applicationStatus || ''),
tagType: applicationStatusTagType(app.applicationStatus || d.applicationStatus || '')
}
]
}
]
: [
{
title: '中试申请 / 渠道 / 服务订单',
fields: [
{ label: '申请单号', value: app.applicationNo || d.applicationNo || '—' },
{ label: '申请单名称', value: app.applicationName || d.applicationName || '—' },
{
label: '申请单状态',
value: applicationStatusLabel(app.applicationStatus || d.applicationStatus || ''),
tagType: applicationStatusTagType(app.applicationStatus || d.applicationStatus || '')
},
{ label: '渠道名称', value: app.channelName || d.channelName || '—' },
{
label: '服务订单',
value: app.channelServiceOrderName || d.channelServiceOrderName || '—'
},
{
label: '订单类型',
value: orderType ? channelServiceOrderTypeLabel(orderType) : '—',
tagType: orderType ? channelServiceOrderTypeTagType(orderType) : undefined
}
]
},
{
title: '患者信息',
fields: [
{ label: '患者姓名', value: patient.patientName || d.patientName || '—' },
{ label: '性别', value: sexLabel(patient.sex || d.patientSex) || '—' },
{
label: '年龄',
value:
patient.age != null && patient.age !== ''
? String(patient.age)
: d.patientAge != null
? String(d.patientAge)
: '—'
},
{ label: '联系电话', value: patient.phoneNo || '—' },
{
label: '身份证号',
value: patient.idCardNo ? maskIdCard(patient.idCardNo) : '—'
},
{ label: '紧急联系人', value: patient.emergencyContact || '—' },
{ label: '紧急联系电话', value: patient.emergencyPhone || '—' },
{ label: '是否需要体检', value: formatNeedCheckup(patient.needCheckup) },
{ label: '临床诊断', value: patient.clinicalDiagnosis || '—', span: true }
]
},
{
title: cfg.planLabel,
fields: [
{ label: '细胞类型', value: formatCellType(plan, schedule) },
{ label: '规格', value: plan.specText || schedule.specText || d.specText || '—' },
{
label: '总疗程数',
value:
plan.totalCourseCount != null
? String(plan.totalCourseCount)
: schedule.totalCourseCount != null
? String(schedule.totalCourseCount)
: d.totalCourseCount != null
? String(d.totalCourseCount)
: '—'
},
{ label: '疗程间隔', value: plan.courseInterval || '—' },
{ label: '输注开始日期', value: plan.infusionStartDate || '—' }
]
}
]
const scheduleFields: ViewSection['fields'] = basic
? [
{ label: '细胞类型', value: formatCellType(plan, schedule) },
{ label: '规格', value: schedule.specText || d.specText || '—' },
{ label: cfg.pickupTimeLabel, value: schedule.infusionTime || d.infusionTime || '—' },
{
label: '售卖金额',
value:
schedule.amount != null && schedule.amount !== ''
? `¥${Number(schedule.amount).toLocaleString('zh-CN', { minimumFractionDigits: 2 })}`
: d.amount != null && d.amount !== ''
? `¥${Number(d.amount).toLocaleString('zh-CN', { minimumFractionDigits: 2 })}`
: '—'
},
{
label: '生产状态',
value: scheduleStatusLabel(schedule.scheduleStatus || d.scheduleStatus || ''),
tagType: scheduleStatusTagType(schedule.scheduleStatus || d.scheduleStatus || '') as TagType
},
{
label: '质检状态',
value: qcStatusLabel(schedule.qcStatus || d.qcStatus || ''),
tagType: qcStatusTagType(schedule.qcStatus || d.qcStatus || '') as TagType
},
{
label: '取消原因',
value: schedule.cancelReason || d.cancelReason || '—',
span: true
},
{ label: '备注', value: schedule.remark || d.remark || '—', span: true }
]
: [
{ label: '疗程进度', value: formatCourseNo(schedule) },
{ label: '细胞类型', value: formatCellType(plan, schedule) },
{ label: '规格', value: schedule.specText || d.specText || '—' },
{ label: cfg.pickupTimeLabel, value: schedule.infusionTime || d.infusionTime || '—' },
{ label: cfg.locationLabel, value: schedule.infusionLocation || d.infusionLocation || '—' },
{
label: cfg.methodLabel,
value: infusionMethodLabel(schedule.infusionMethod || d.infusionMethod || '')
},
{
label: '生产状态',
value: scheduleStatusLabel(schedule.scheduleStatus || d.scheduleStatus || ''),
tagType: scheduleStatusTagType(schedule.scheduleStatus || d.scheduleStatus || '') as TagType
},
{
label: cfg.statusLabel,
value: infusionStatusLabel(schedule.infusionStatus || d.infusionStatus || ''),
tagType: infusionStatusTagType(schedule.infusionStatus || d.infusionStatus || '') as TagType
},
{
label: '质检状态',
value: qcStatusLabel(schedule.qcStatus || d.qcStatus || ''),
tagType: qcStatusTagType(schedule.qcStatus || d.qcStatus || '') as TagType
},
{
label: '取消原因',
value: schedule.cancelReason || d.cancelReason || '—',
span: true
},
{ label: '备注', value: schedule.remark || d.remark || '—', span: true }
]
return [
...contextSections,
{
title: basic ? `本次${cfg.scheduleLabel}` : '本次输注计划',
fields: scheduleFields
},
{
title: '产品列表',
fields: [],
slot: 'products'
},
...(isClinicalApplication.value
? [
{
title: '缴费明细',
fields: [],
slot: 'payment-info'
}
]
: []),
{
title: '出库生产工单 + 任务',
slot: 'production-info',
fields: []
},
{
title: '出库质检工单 + 任务',
slot: 'qc-info',
fields: []
},
{
title: '出库物料准备',
slot: 'outbound-material',
fields: []
},
{
title: '出库放行审核',
slot: 'review-attachments',
fields: [
{
label: '审核结论',
value: reviewConclusionDisplay,
tagType: reviewConclusionTag
},
{ label: '审核人', value: review.reviewByName || '—' },
{ label: '审核时间', value: review.reviewTime || '—' },
{ label: '审核备注', value: review.reviewRemark || '—', span: true }
]
},
{
title: '出库交接',
slot: 'handover-attachments',
fields: [
{ label: '交接人', value: oh.handoverPerson || '—' },
{ label: '交接时间', value: oh.handoverTime || '—' },
{ label: '交接地点', value: oh.handoverLocation || '—' },
{ label: '接收人', value: oh.receiverPerson || '—' },
{ label: '细胞用途', value: oh.cellPurpose || '—', span: true },
{ label: '备注', value: oh.remark || '—', span: true }
]
},
{
title: '应用确认',
fields: confirmFields
}
]
})
function attachmentFullUrl(url: string) {
const u = String(url || '').trim()
if (!u) return ''
if (/^https?:\/\//i.test(u)) return u
return minioBaseUrl ? `${minioBaseUrl}/${u.replace(/^\//, '')}` : u
}
function handleAttachmentPreview(file: Record<string, unknown>) {
const url = attachmentFullUrl(String(file.fileUrl || ''))
if (url) window.open(url, '_blank')
}
function handleAttachmentDownload(file: Record<string, unknown>) {
downloadAttachmentFile(file, { fullFileUrl: attachmentFullUrl })
}
const loadDetail = async () => {
const id = props.scheduleRow?.id
if (!id) return
detail.value = { ...(props.scheduleRow || {}) }
loading.value = true
try {
const res: any = await fetchInfusionScheduleMgmtDetail({ scheduleId: id })
const data =
res && typeof res === 'object' && !Array.isArray(res)
? (res as Record<string, any>)
: ((res as any)?.data ?? {})
detail.value = { ...detail.value, ...data }
} catch {
// keep initial data from row
} finally {
loading.value = false
}
}
watch(
() => props.modelValue,
(val) => {
if (val && props.scheduleRow?.id) {
loadDetail()
} else if (!val) {
detail.value = null
}
}
)
</script>
<style lang="scss" scoped>
.payment-info-view {
width: 100%;
}
.view-inner-table-wrap.list-body.list-wrap {
margin-top: 4px;
border: 1px solid var(--mint-border, #e2e8f0);
border-radius: var(--mint-radius, 10px);
overflow: hidden;
background: #fff;
:deep(.el-table) {
--el-table-header-bg-color: var(--mint-table-head, #f8fafc);
--el-table-border-color: var(--mint-border, #e2e8f0);
--el-table-row-hover-bg-color: var(--mint-row-hover, #f0fdf4);
--el-table-text-color: var(--mint-text, #0f172a);
--el-table-header-text-color: var(--mint-text-muted, #64748b);
font-size: 14px;
}
:deep(.el-table th.el-table__cell) {
font-size: 12px;
font-weight: 600;
color: var(--mint-text-muted, #64748b);
}
:deep(.el-table td.el-table__cell) {
font-size: 14px;
font-weight: 500;
color: var(--mint-text, #0f172a);
}
:deep(.el-empty) {
padding: 24px 0;
}
}
.view-section-slot :deep(.sample-card__section-label) {
display: none;
}
.view-section-slot :deep(.sample-card__section--qc),
.view-section-slot :deep(.sample-card__section--production) {
margin-top: 0;
padding-top: 0;
border-top: none;
}
</style>