feat(签署方式): 扩展为手写板/短信/Pad/公众号四种并集中口径
This commit is contained in:
@@ -28,6 +28,7 @@ import { useLoginStore } from '@/stores/login'
|
||||
import { demoCampuses, demoDepartments } from '@/utils/mock-document-library'
|
||||
import { mockFlags } from '@/utils/mock-flags'
|
||||
import { clearMockState } from '@/utils/mock-storage'
|
||||
import { ALL_SIGNING_METHODS } from '@/utils/signing-method'
|
||||
|
||||
import DocumentFilterTabs from './components/DocumentFilterTabs.vue'
|
||||
import DocumentHistoryDialog from './components/DocumentHistoryDialog.vue'
|
||||
@@ -987,7 +988,7 @@ async function toSigningTemplate(template: DocumentTemplate): Promise<SigningTem
|
||||
campusId: template.campusId ?? undefined,
|
||||
category: template.category,
|
||||
description: template.description ?? '',
|
||||
supportedMethods: ['pad', 'sms'],
|
||||
supportedMethods: [...ALL_SIGNING_METHODS],
|
||||
contentHtml,
|
||||
contentSha256,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { formatSigningMethod, readSigningMethod } from '@/utils/signing-method'
|
||||
|
||||
import type { ReportTask, ReportTaskStatus } from '../types'
|
||||
|
||||
defineProps<{
|
||||
@@ -30,7 +32,7 @@ const statusLabels: Record<ReportTaskStatus, string> = {
|
||||
|
||||
function getStatusLabel(row: ReportTask) {
|
||||
if (row.status === 'pending') {
|
||||
return `${statusLabels[row.status]}·${row.method === 'pad' ? '手写板' : '短信'}`
|
||||
return `${statusLabels[row.status]}·${readSigningMethod(row.method).short}`
|
||||
}
|
||||
|
||||
return statusLabels[row.status]
|
||||
@@ -131,7 +133,7 @@ function handlePageSizeChange(event: Event) {
|
||||
</td>
|
||||
<td class="document-name" :title="row.documentName">{{ row.documentName }}</td>
|
||||
<td>{{ row.department }}</td>
|
||||
<td>{{ row.method === 'pad' ? '✍️ 手写板' : '📱 短信' }}</td>
|
||||
<td>{{ formatSigningMethod(row.method) }}</td>
|
||||
<td>
|
||||
<span class="status-tag" :class="getStatusClass(row.status)">
|
||||
{{ getStatusLabel(row) }}
|
||||
|
||||
@@ -22,6 +22,11 @@ import type {
|
||||
ReportTasksQueryDto,
|
||||
} from '@/api/management/types'
|
||||
import { useLoginStore } from '@/stores/login'
|
||||
import {
|
||||
formatSigningMethodTitle,
|
||||
REPORT_METHOD_FILTERS,
|
||||
toBackendSigningMethod,
|
||||
} from '@/utils/signing-method'
|
||||
|
||||
import DepartmentDistributionChart from './components/DepartmentDistributionChart.vue'
|
||||
import ReportDetailTable from './components/ReportDetailTable.vue'
|
||||
@@ -102,8 +107,7 @@ const filters = reactive<ReportFilterForm>({
|
||||
|
||||
const methodOptions: ReportSelectOption<ReportMethodFilter>[] = [
|
||||
{ value: 'all', label: '全部方式' },
|
||||
{ value: 'pad', label: '手写板' },
|
||||
{ value: 'sms', label: '短信' },
|
||||
...REPORT_METHOD_FILTERS.map((option) => ({ value: option.value, label: option.label })),
|
||||
]
|
||||
|
||||
interface ReportDateRange {
|
||||
@@ -571,7 +575,7 @@ function getScopeFilter(): ReportFilterDto {
|
||||
}
|
||||
|
||||
if (filters.method !== 'all') {
|
||||
filter.signMethod = filters.method === 'sms' ? 'SMS' : 'PAD'
|
||||
filter.signMethod = toBackendSigningMethod(filters.method)
|
||||
}
|
||||
|
||||
const keyword = filters.keyword.trim()
|
||||
@@ -994,7 +998,7 @@ function downloadMockReport() {
|
||||
task.documentName,
|
||||
task.department,
|
||||
task.campus,
|
||||
task.method === 'pad' ? '手写板' : '短信',
|
||||
formatSigningMethodTitle(task.method),
|
||||
getReportStatusLabel(task.status),
|
||||
formatExportDate(task.createdAt),
|
||||
formatExportDate(task.signedAt),
|
||||
|
||||
@@ -169,6 +169,38 @@ export const reportTasks: ReportTask[] = [
|
||||
status: 'void',
|
||||
createdAt: daysAgo(5, 11, 45),
|
||||
},
|
||||
// Pad 与公众号两条:四种方式都要有样本,否则「方式」列与筛选选到 Pad / 公众号时
|
||||
// 永远只能得到空结果,看着像筛选坏了(其实是演示数据没覆盖)。
|
||||
{
|
||||
id: 'T0813002',
|
||||
patientName: '罗文静',
|
||||
patientId: 'P202610007',
|
||||
documentName: '床旁超声检查知情同意书',
|
||||
department: '放射科',
|
||||
campus: '东院区',
|
||||
category: 'consent',
|
||||
method: 'ipad',
|
||||
status: 'signed',
|
||||
createdAt: daysAgo(2, 8, 50),
|
||||
signedAt: daysAgo(2, 8, 58),
|
||||
expiredAt: daysAgo(1, 8, 50),
|
||||
durationMinutes: 8,
|
||||
},
|
||||
{
|
||||
id: 'T0813001',
|
||||
patientName: '梁俊豪',
|
||||
patientId: 'P202610008',
|
||||
documentName: '体检报告发放及知情同意书',
|
||||
department: '健康管理中心',
|
||||
campus: '东院区',
|
||||
category: 'consent',
|
||||
method: 'wx',
|
||||
status: 'signed',
|
||||
createdAt: daysAgo(3, 16, 10),
|
||||
signedAt: daysAgo(3, 16, 26),
|
||||
expiredAt: daysAgo(2, 16, 10),
|
||||
durationMinutes: 16,
|
||||
},
|
||||
]
|
||||
|
||||
export const reportDepartmentColors: Record<string, string> = {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { SigningMethod } from '@/api/workbench/types'
|
||||
|
||||
export type ReportPeriodOption = '7d' | '14d' | 'month' | 'custom'
|
||||
|
||||
/** 院区由后端字典提供,保留 all 作为全院筛选值。 */
|
||||
@@ -5,7 +7,7 @@ export type ReportCampus = 'all' | (string & {})
|
||||
|
||||
export type ReportDocumentCategory = 'all' | (string & {})
|
||||
|
||||
export type ReportMethodFilter = 'all' | 'pad' | 'sms'
|
||||
export type ReportMethodFilter = 'all' | SigningMethod
|
||||
|
||||
export interface ReportFilterForm {
|
||||
period: ReportPeriodOption
|
||||
@@ -30,7 +32,7 @@ export interface ReportMetricCard {
|
||||
|
||||
export type ReportTaskStatus = 'signed' | 'pending' | 'signing' | 'expired' | 'void' | 'failed'
|
||||
|
||||
export type ReportSigningMethod = 'pad' | 'sms'
|
||||
export type ReportSigningMethod = SigningMethod
|
||||
|
||||
export interface ReportTask {
|
||||
id: string
|
||||
|
||||
Reference in New Issue
Block a user