Files
xh-medical-sign-web/patient-h5/src/views/result/ResultView.vue
T

90 lines
3.1 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.
<script setup lang="ts">
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { clearPersistedSession, resetSignFlow, signingState } from '@/composables/useSignFlow'
const router = useRouter()
const resultTitle = computed(() => {
if (signingState.mode !== 'real') return '知情同意书已提交'
if (signingState.backendStatus === 'GENERATING') return '签名已提交,文书生成中'
if (signingState.backendStatus === 'WAITING_CONFIRM') return '签署已提交,等待科室确认'
return '知情同意书已提交'
})
const resultCopy = computed(() =>
signingState.mode === 'real' && signingState.backendStatus === 'GENERATING'
? '签名图片已安全提交,系统正在生成签署后文书。最终状态以医签通服务端为准。'
: signingState.mode === 'real' && signingState.backendStatus === 'WAITING_CONFIRM'
? '患者签名和签署文书已安全保存,等待医务人员完成科室确认。请勿重复签署。'
: '本次签署结果已提交至医签通。请按照医务人员指引完成后续诊疗安排。',
)
const statusLabel = computed(() => {
if (signingState.mode !== 'real') {
return '演示完成'
}
const labels: Record<string, string> = {
SIGNED: '已签署',
WAITING_CONFIRM: '待科室确认',
GENERATING: '生成中',
WAITING_SIGN: '待签署',
FAILED: '处理失败',
}
return labels[signingState.backendStatus] ?? (signingState.backendStatus || '已提交')
})
/** 签署人由医生在医护端填好,这里只展示 —— 两边取同一份数据,不各算一套 */
const signerLine = computed(() => {
const name = signingState.signerName || signingState.patientName
const relation = signingState.relation || '本人'
return `${name}(${relation})`
})
function returnToEntry() {
resetSignFlow()
// 连同本地会话一起清掉:本次已提交,不该再靠旧凭证回到签署页
clearPersistedSession()
void router.replace('/entry')
}
</script>
<template>
<main class="mobile-shell result-shell">
<div class="result-icon">✓</div>
<p class="eyebrow">签署完成</p>
<h1>{{ resultTitle }}</h1>
<p class="result-copy">{{ resultCopy }}</p>
<section class="mobile-card result-card">
<div>
<span>患者</span>
<strong>{{ signingState.patientName }}</strong>
</div>
<div>
<span>签署人</span>
<strong>{{ signerLine }}</strong>
</div>
<div>
<span>提交时间</span>
<strong>{{ signingState.submittedAt }}</strong>
</div>
<div v-if="signingState.mode === 'real'">
<span>服务端状态</span>
<strong>{{ statusLabel }}</strong>
</div>
<div v-if="signingState.mode === 'real'">
<span>任务编号</span>
<strong>{{ signingState.taskNo }}</strong>
</div>
</section>
<p class="secure-note">请不要重复提交。如需修改,请联系现场医务人员。</p>
<button class="mobile-text-button" type="button" @click="returnToEntry">返回首页</button>
</main>
</template>