feat(文书管理): 增加版本工作流与版本历史
- 模板状态按后端原始状态展示与筛选,待审核与已驳回分开展示 - 仅已发布模板可发起签署,新增提交审核/审核通过/驳回等动作 - 新增版本历史弹窗,复用统一的模板时间格式化方法 - 演示数据补齐已签署任务的签名图,并提供获取签名 dataURL 的接口 - 修复编辑器插入占位符时未定位光标导致内容落到文首的问题
This commit is contained in:
@@ -113,7 +113,9 @@ defineExpose({ getDocumentElement })
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<template v-else-if="task.status === 'expired'">
|
||||
<!-- 处理失败与已超时都需要「重新发起」这条出路:只给「作废」的话,
|
||||
一次偶发的后端处理失败就得把整个任务废掉重来 -->
|
||||
<template v-else-if="task.status === 'expired' || task.status === 'failed'">
|
||||
<button type="button" class="action-button" @click="emit('action', 'reopen')">
|
||||
↻ 重新发起
|
||||
</button>
|
||||
|
||||
@@ -4,7 +4,11 @@ import { ElMessage } from 'element-plus'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
import { getCampuses, getDepartments } from '@/api/management/organization'
|
||||
import { downloadSigningArtifact, getSigningArtifacts } from '@/api/workbench/artifacts'
|
||||
import {
|
||||
downloadSigningArtifact,
|
||||
fetchSignatureDataUrl,
|
||||
getSigningArtifacts,
|
||||
} from '@/api/workbench/artifacts'
|
||||
import { createPadSigningSession } from '@/api/workbench/deliveries'
|
||||
import {
|
||||
completeSigningTask,
|
||||
@@ -279,6 +283,23 @@ async function loadTaskDetail(id: string | null) {
|
||||
} else {
|
||||
artifactsError.value = true
|
||||
}
|
||||
|
||||
// 任务接口不返回签名,签名图是独立的 SIGNATURE_IMAGE 产物;
|
||||
// 这里把它取回来转成 dataURL 补到任务上,文书里的签名位才有内容。
|
||||
// 取不到就保持原样(渲染成「待患者签名」),不伪造一个签名糊上去。
|
||||
if (detail && !detail.signatureDataUrl) {
|
||||
const signatureArtifact = artifacts.value.find(
|
||||
(item) => item.artifactType === 'SIGNATURE_IMAGE',
|
||||
)
|
||||
|
||||
if (signatureArtifact) {
|
||||
const signatureDataUrl = await fetchSignatureDataUrl(signatureArtifact)
|
||||
|
||||
if (requestId === detailRequestId && signatureDataUrl) {
|
||||
selectedTask.value = { ...detail, signatureDataUrl }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
if (requestId === detailRequestId) {
|
||||
@@ -459,8 +480,8 @@ async function handleTaskAction(action: SigningTaskAction) {
|
||||
return
|
||||
}
|
||||
|
||||
if (action === 'reopen' && task.status !== 'expired') {
|
||||
ElMessage.info('只有已超时任务可以重新发起')
|
||||
if (action === 'reopen' && task.status !== 'expired' && task.status !== 'failed') {
|
||||
ElMessage.info('只有已超时或处理失败的任务可以重新发起')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user