feat(workbench): 扩展签署任务管理功能
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
<script setup lang="ts">
|
||||
import type { SigningTaskRecord } from '@/api/workbench/types'
|
||||
|
||||
import SigningDocumentPreview from './SigningDocumentPreview.vue'
|
||||
import TaskAuditTimeline from './TaskAuditTimeline.vue'
|
||||
import type { SigningTaskAction } from '../types'
|
||||
|
||||
defineProps<{
|
||||
task: SigningTaskRecord | null
|
||||
loading: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
action: [action: SigningTaskAction]
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="detail-panel">
|
||||
<div v-if="loading" class="detail-loading" aria-label="正在加载任务详情">
|
||||
<span class="detail-loading__actions" />
|
||||
<span class="detail-loading__paper" />
|
||||
</div>
|
||||
|
||||
<template v-else-if="task">
|
||||
<div class="task-actions">
|
||||
<span class="task-action-meta">任务 {{ task.id }} · {{ task.patientName }}</span>
|
||||
|
||||
<template v-if="task.status === 'pending' && task.method === 'pad'">
|
||||
<button type="button" class="action-button" @click="emit('action', 'pad-sign')">
|
||||
✍ 手写板签署
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="action-button action-button--ghost"
|
||||
@click="emit('action', 'switch-method')"
|
||||
>
|
||||
转为短信发送
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<template v-else-if="task.status === 'pending' && task.method === 'sms'">
|
||||
<button type="button" class="action-button" @click="emit('action', 'online-sign')">
|
||||
📱 查看线上签署
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="action-button action-button--ghost"
|
||||
@click="emit('action', 'switch-method')"
|
||||
>
|
||||
转手写板签署
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="action-button action-button--ghost"
|
||||
@click="emit('action', 'resend-sms')"
|
||||
>
|
||||
重发短信
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<template v-else-if="task.status === 'expired'">
|
||||
<button type="button" class="action-button" @click="emit('action', 'reopen')">
|
||||
↻ 重新发起
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<template v-else-if="task.status === 'signed'">
|
||||
<button
|
||||
type="button"
|
||||
class="action-button action-button--ghost"
|
||||
@click="emit('action', 'download-pdf')"
|
||||
>
|
||||
下载 PDF 原件
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="action-button action-button--ghost"
|
||||
@click="emit('action', 'download-signature')"
|
||||
>
|
||||
签名原图
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="action-button action-button--ghost"
|
||||
@click="emit('action', 'print')"
|
||||
>
|
||||
打印
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<button
|
||||
v-if="task.status === 'pending' || task.status === 'expired' || task.status === 'signing'"
|
||||
type="button"
|
||||
class="action-button action-button--danger"
|
||||
@click="emit('action', 'void')"
|
||||
>
|
||||
作废
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<SigningDocumentPreview :task="task" />
|
||||
<TaskAuditTimeline :task="task" />
|
||||
</template>
|
||||
|
||||
<div v-else class="detail-empty">
|
||||
<span aria-hidden="true">📋</span>
|
||||
<p>请从左侧列表选择一个签署任务</p>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.detail-panel {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.task-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.task-action-meta {
|
||||
align-self: center;
|
||||
margin-right: auto;
|
||||
color: var(--mut);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.action-button {
|
||||
flex-shrink: 0;
|
||||
padding: 8px 16px;
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
background: var(--brand);
|
||||
border-radius: 7px;
|
||||
transition: background 0.15s ease;
|
||||
}
|
||||
|
||||
.action-button:hover {
|
||||
background: var(--brand-d);
|
||||
}
|
||||
|
||||
.action-button--ghost {
|
||||
color: var(--brand);
|
||||
background: #fff;
|
||||
border: 1px solid var(--brand);
|
||||
}
|
||||
|
||||
.action-button--ghost:hover {
|
||||
background: var(--brand-l);
|
||||
}
|
||||
|
||||
.action-button--danger {
|
||||
color: var(--err);
|
||||
background: #fff;
|
||||
border: 1px solid var(--err);
|
||||
}
|
||||
|
||||
.action-button--danger:hover {
|
||||
background: var(--err-l);
|
||||
}
|
||||
|
||||
.detail-empty {
|
||||
display: grid;
|
||||
min-height: 560px;
|
||||
padding: 40px 24px;
|
||||
color: var(--mut);
|
||||
text-align: center;
|
||||
background: var(--card);
|
||||
border-radius: var(--r);
|
||||
box-shadow: var(--sh);
|
||||
place-items: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.detail-empty span {
|
||||
margin-bottom: 8px;
|
||||
font-size: 34px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.detail-empty p {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.detail-loading {
|
||||
display: flex;
|
||||
min-height: 680px;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.detail-loading span {
|
||||
display: block;
|
||||
background: linear-gradient(90deg, #edf3f5 25%, #f7fafb 37%, #edf3f5 63%);
|
||||
background-size: 400% 100%;
|
||||
border-radius: var(--r);
|
||||
box-shadow: var(--sh);
|
||||
animation: skeleton-shimmer 1.4s ease infinite;
|
||||
}
|
||||
|
||||
.detail-loading__actions {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.detail-loading__paper {
|
||||
flex: 1;
|
||||
min-height: 560px;
|
||||
}
|
||||
|
||||
@keyframes skeleton-shimmer {
|
||||
0% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: -100% 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.task-action-meta {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user