提交
This commit is contained in:
1 parent
eaf7d490ec
commit
5679d7981c
52 files changed
+7606
-4839
No files matched your search
@@ -0,0 +1,517 @@
|
||||
<!-- 缴退费确认流程(纵向倒序时间线 + 独立操作区) -->
|
||||
<template>
|
||||
<div class="clinical-payment-confirm-timeline">
|
||||
<div v-if="showBasicSummary && isProtocolFlow" class="payment-basic-summary">
|
||||
<dl class="payment-basic-summary__grid">
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>协议状态</dt>
|
||||
<dd>
|
||||
<el-tag
|
||||
:type="protocolStatusTagType(String(detail?.protocolStatus || ''))"
|
||||
size="small"
|
||||
>
|
||||
{{ protocolStatusLabel(String(detail?.protocolStatus || '')) }}
|
||||
</el-tag>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>客户姓名</dt>
|
||||
<dd>{{ dash(detail?.motherName) }}</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>身份证号</dt>
|
||||
<dd>{{ maskIdCard(String(detail?.motherIdCard || '')) }}</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>新生儿姓名</dt>
|
||||
<dd>{{ dash(detail?.newbornName) }}</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>缴费方式</dt>
|
||||
<dd>{{ protocolPayModeLabel(String(detail?.payMode || '')) }}</dd>
|
||||
</div>
|
||||
<div v-if="detail?.payMode === 'fq'" class="payment-basic-summary__item">
|
||||
<dt>分期期序号</dt>
|
||||
<dd>{{ dash(detail?.installmentNo) }}</dd>
|
||||
</div>
|
||||
<div v-if="detail?.payMode === 'fq'" class="payment-basic-summary__item">
|
||||
<dt>应缴费时间</dt>
|
||||
<dd>{{ formatPaymentDueDate(detail?.installmentDueDate) }}</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>应缴金额(元)</dt>
|
||||
<dd>{{ formatProtocolAmount(detail?.dueAmount) }}</dd>
|
||||
</div>
|
||||
<div v-if="showPayStatus" class="payment-basic-summary__item">
|
||||
<dt>缴费状态</dt>
|
||||
<dd>
|
||||
<el-tag :type="protocolPayStatusTagType(String(detail?.payStatus || ''))" size="small">
|
||||
{{ protocolPayStatusLabel(String(detail?.payStatus || '')) }}
|
||||
</el-tag>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
<div v-else-if="showBasicSummary" class="payment-basic-summary">
|
||||
<dl class="payment-basic-summary__grid">
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>申请单号</dt>
|
||||
<dd>{{ dash(detail?.applicationNo) }}</dd>
|
||||
</div>
|
||||
<template v-if="isBasicExperiment">
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>课题名称</dt>
|
||||
<dd>{{ dash(detail?.projectTitle) }}</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>客户名称</dt>
|
||||
<dd>{{ dash(detail?.customerName) }}</dd>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>患者姓名</dt>
|
||||
<dd>{{ dash(detail?.patientName) }}</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>渠道名称</dt>
|
||||
<dd>{{ dash(detail?.channelName) }}</dd>
|
||||
</div>
|
||||
</template>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>细胞类型/规格</dt>
|
||||
<dd>{{ dash(detail?.cellTypeSpec) }}</dd>
|
||||
</div>
|
||||
<div class="payment-basic-summary__item">
|
||||
<dt>{{ pickupTimeLabel }}</dt>
|
||||
<dd>{{ dash(detail?.infusionTime) }}</dd>
|
||||
</div>
|
||||
<div v-if="showPayStatus" class="payment-basic-summary__item">
|
||||
<dt>缴费状态</dt>
|
||||
<dd>
|
||||
<el-tag :type="payStatusTagType(String(detail?.payStatus || ''))" size="small">
|
||||
{{ payStatusLabel(String(detail?.payStatus || '')) }}
|
||||
</el-tag>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="v-timeline">
|
||||
<div
|
||||
v-for="(step, index) in displaySteps"
|
||||
:key="step.key"
|
||||
class="v-timeline-item"
|
||||
:class="[
|
||||
`v-timeline-item--${step.state}`,
|
||||
{ 'v-timeline-item--last': index === displaySteps.length - 1 }
|
||||
]"
|
||||
>
|
||||
<div class="v-timeline-item__rail">
|
||||
<div class="v-timeline-item__dot">
|
||||
<span v-if="step.state === 'done'">✓</span>
|
||||
<span v-else-if="step.state === 'current'">●</span>
|
||||
<span v-else>○</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="index < displaySteps.length - 1"
|
||||
class="v-timeline-item__line"
|
||||
:class="{ 'v-timeline-item__line--done': step.state === 'done' }"
|
||||
/>
|
||||
</div>
|
||||
<div class="v-timeline-item__body">
|
||||
<div class="v-timeline-item__head">
|
||||
<h4 class="v-timeline-item__title">{{ step.title }}</h4>
|
||||
<el-tag v-if="step.state === 'current'" type="warning" size="small">进行中</el-tag>
|
||||
<el-tag v-else-if="step.state === 'done'" type="success" size="small">已完成</el-tag>
|
||||
<span v-else class="v-timeline-item__pending">待处理</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="step.state !== 'pending' && step.time && step.time !== '—'"
|
||||
class="v-timeline-item__time"
|
||||
>
|
||||
{{ step.time }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="showStepContent(step)"
|
||||
class="v-timeline-item__content"
|
||||
:class="{ 'v-timeline-item__content--current': step.state === 'current' }"
|
||||
>
|
||||
<dl class="v-timeline-fields">
|
||||
<div
|
||||
v-for="field in visibleFields(step)"
|
||||
:key="field.label"
|
||||
class="v-timeline-field"
|
||||
:class="{
|
||||
'v-timeline-field--full': field.multiline || field.slot === 'attachments'
|
||||
}"
|
||||
>
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd v-if="field.slot === 'attachments'">
|
||||
<ProtocolAttachmentReadonly
|
||||
:files="attachmentFiles(field.attachmentUrls)"
|
||||
@download="(f) => emit('download', f)"
|
||||
/>
|
||||
</dd>
|
||||
<dd v-else :class="{ 'v-timeline-field__multiline': field.multiline }">
|
||||
{{ field.value }}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
<p v-else-if="step.state === 'pending'" class="v-timeline-item__placeholder">
|
||||
尚未到达此环节
|
||||
</p>
|
||||
<p
|
||||
v-else-if="step.state === 'current' && hasActionPanel"
|
||||
class="v-timeline-item__placeholder v-timeline-item__placeholder--hint"
|
||||
>
|
||||
请在下方操作区填写确认信息
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="$slots['action-panel']" class="action-panel">
|
||||
<slot name="action-panel" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, useSlots } from 'vue'
|
||||
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
|
||||
import { getPilotBizConfig } from '@/config/pilot-biz-type'
|
||||
import { maskIdCard } from '@/utils/mask-sensitive'
|
||||
import { payStatusLabel, payStatusTagType } from '@/utils/status-tag-registry'
|
||||
import {
|
||||
buildPaymentFlowSteps,
|
||||
type PaymentFlowStep,
|
||||
type PaymentFlowStepKey
|
||||
} from '@/utils/clinical-payment-flow-steps'
|
||||
import { buildProtocolPaymentFlowSteps } from '@/utils/protocol-payment-flow-steps'
|
||||
import {
|
||||
formatPaymentDueDate,
|
||||
payModeLabel,
|
||||
payStatusLabel as protocolPayStatusLabel,
|
||||
payStatusTagType as protocolPayStatusTagType,
|
||||
protocolStatusLabel,
|
||||
protocolStatusTagType
|
||||
} from '@/utils/protocol-payment-labels'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
detail?: Record<string, unknown> | null
|
||||
activeStepKey?: PaymentFlowStepKey
|
||||
showBasicSummary?: boolean
|
||||
showPayStatus?: boolean
|
||||
flowVariant?: 'clinical' | 'protocol'
|
||||
}>(),
|
||||
{
|
||||
showBasicSummary: true,
|
||||
showPayStatus: false,
|
||||
flowVariant: 'clinical'
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'download', file: Record<string, unknown>): void
|
||||
}>()
|
||||
|
||||
const slots = useSlots()
|
||||
|
||||
const hasActionPanel = computed(() => Boolean(slots['action-panel']))
|
||||
|
||||
function dash(v: unknown) {
|
||||
if (v == null || v === '') return '—'
|
||||
return String(v)
|
||||
}
|
||||
|
||||
function attachmentFiles(urlField?: string) {
|
||||
const urls = String(urlField || '')
|
||||
if (!urls.trim()) return []
|
||||
return urls
|
||||
.split(',')
|
||||
.map((u, i) => {
|
||||
const url = u.trim()
|
||||
if (!url) return null
|
||||
const name = url.includes('/') ? url.split('/').pop() || `附件${i + 1}` : url
|
||||
return { id: `url_${i}`, fileUrl: url, fileName: name }
|
||||
})
|
||||
.filter(Boolean) as Array<Record<string, unknown>>
|
||||
}
|
||||
|
||||
function visibleFields(step: PaymentFlowStep) {
|
||||
return step.fields.filter(
|
||||
(field) => field.slot !== 'attachments' || attachmentFiles(field.attachmentUrls).length
|
||||
)
|
||||
}
|
||||
|
||||
function showStepContent(step: PaymentFlowStep) {
|
||||
if (step.state === 'pending') return false
|
||||
if (step.state === 'current' && hasActionPanel.value) return false
|
||||
return visibleFields(step).length > 0
|
||||
}
|
||||
|
||||
const isProtocolFlow = computed(() => props.flowVariant === 'protocol')
|
||||
|
||||
const isBasicExperiment = computed(
|
||||
() => String(props.detail?.bizType || '') === 'basic_experiment'
|
||||
)
|
||||
|
||||
const pickupTimeLabel = computed(() =>
|
||||
getPilotBizConfig(String(props.detail?.bizType || '')).pickupTimeLabel
|
||||
)
|
||||
|
||||
function protocolPayModeLabel(mode: string) {
|
||||
const label = payModeLabel(mode)
|
||||
return label || '—'
|
||||
}
|
||||
|
||||
function formatProtocolAmount(v: unknown) {
|
||||
if (v == null || v === '') return '—'
|
||||
return '¥' + formatMoneyDisplay(v)
|
||||
}
|
||||
|
||||
const steps = computed(() =>
|
||||
isProtocolFlow.value
|
||||
? buildProtocolPaymentFlowSteps(props.detail, props.activeStepKey)
|
||||
: buildPaymentFlowSteps(props.detail, props.activeStepKey)
|
||||
)
|
||||
|
||||
/** 倒序:最新环节在上,最早环节在下 */
|
||||
const displaySteps = computed(() => [...steps.value].reverse())
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.clinical-payment-confirm-timeline {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.payment-basic-summary {
|
||||
margin-bottom: 20px;
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 10px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.payment-basic-summary__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 20px;
|
||||
margin: 0;
|
||||
|
||||
@media (min-width: 720px) {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
.payment-basic-summary__item {
|
||||
min-width: 0;
|
||||
|
||||
dt {
|
||||
margin: 0 0 4px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: var(--mint-text, #334155);
|
||||
line-height: 1.5;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.v-timeline {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.v-timeline-item {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.v-timeline-item__rail {
|
||||
position: relative;
|
||||
width: 20px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.v-timeline-item__dot {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-top: 4px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #cbd5e1;
|
||||
background: #fff;
|
||||
flex-shrink: 0;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
.v-timeline-item__line {
|
||||
flex: 1;
|
||||
width: 2px;
|
||||
min-height: 20px;
|
||||
margin-top: 4px;
|
||||
background: #e2e8f0;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
.v-timeline-item--done .v-timeline-item__dot {
|
||||
border-color: var(--primary, #10b981);
|
||||
background: var(--primary, #10b981);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.v-timeline-item--done .v-timeline-item__line--done {
|
||||
background: #a7f3d0;
|
||||
}
|
||||
|
||||
.v-timeline-item--current .v-timeline-item__dot {
|
||||
border-color: #d97706;
|
||||
background: #fff;
|
||||
color: #d97706;
|
||||
box-shadow: 0 0 0 4px rgb(217 119 6 / 12%);
|
||||
}
|
||||
|
||||
.v-timeline-item__body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.v-timeline-item--last .v-timeline-item__body {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.v-timeline-item__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.v-timeline-item__title {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #334155);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.v-timeline-item--done .v-timeline-item__title {
|
||||
color: #065f46;
|
||||
}
|
||||
|
||||
.v-timeline-item--current .v-timeline-item__title {
|
||||
color: #b45309;
|
||||
}
|
||||
|
||||
.v-timeline-item__pending {
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.v-timeline-item__time {
|
||||
margin-bottom: 8px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.v-timeline-item__content {
|
||||
padding: 12px 14px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.v-timeline-item__content--current {
|
||||
border-color: #fde68a;
|
||||
background: #fffbeb;
|
||||
}
|
||||
|
||||
.v-timeline-item__placeholder {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
line-height: 1.5;
|
||||
|
||||
&--hint {
|
||||
color: #b45309;
|
||||
}
|
||||
}
|
||||
|
||||
.v-timeline-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px 16px;
|
||||
margin: 0;
|
||||
|
||||
@media (max-width: 560px) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.v-timeline-field {
|
||||
min-width: 0;
|
||||
|
||||
dt {
|
||||
margin: 0 0 4px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: var(--mint-text, #334155);
|
||||
line-height: 1.5;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.v-timeline-field--full {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.v-timeline-field__multiline {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.action-panel {
|
||||
margin-top: 16px;
|
||||
padding: 16px;
|
||||
border: 1px solid #fde68a;
|
||||
border-radius: 10px;
|
||||
background: #fffbeb;
|
||||
|
||||
:deep(.detail-section-title) {
|
||||
margin: 0 0 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #334155);
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user