feat(signing): 接入患者与任务真实接口

This commit is contained in:
yelan
2026-08-31 16:08:17 +08:00
parent 1bc075d5d6
commit 40b0a5d040
5 changed files with 805 additions and 91 deletions
@@ -35,8 +35,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
const selectedTemplateId = ref('')
const selectedVisitId = ref('')
const method = ref<SigningMethod>('pad')
const smsPhone = ref('')
const patientPhoneRevealed = ref(false)
const loadingTemplates = ref(false)
const locating = ref(false)
const submitting = ref(false)
@@ -45,7 +43,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
patient: '',
visit: '',
document: '',
phone: '',
})
const selectedVisit = computed(
@@ -107,7 +104,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
errors.patient = ''
errors.visit = ''
errors.document = ''
errors.phone = ''
}
function resetForm() {
@@ -120,8 +116,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
selectedTemplateId.value = initialTemplate?.id ?? ''
selectedVisitId.value = ''
method.value = initialTemplate?.supportedMethods[0] ?? 'pad'
smsPhone.value = ''
patientPhoneRevealed.value = false
clearErrors()
}
@@ -171,7 +165,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
if (!profile) {
errors.patient = '未找到该患者,请核对输入内容'
smsPhone.value = ''
return
}
@@ -179,7 +172,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
visits.value = profile.visits
selectedVisitId.value =
profile.visits.find((visit) => visit.isCurrent)?.id ?? profile.visits[0]?.id ?? ''
smsPhone.value = profile.phone
} catch {
errors.patient = '患者信息查询失败,请稍后重试'
} finally {
@@ -207,7 +199,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
}
method.value = nextMethod
errors.phone = ''
}
function maskPhone(value: string) {
@@ -218,11 +209,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
return `${value.slice(0, 3)}****${value.slice(-4)}`
}
function togglePhone() {
patientPhoneRevealed.value = !patientPhoneRevealed.value
ElMessage.info('明文查看已记录审计日志')
}
function validate() {
clearErrors()
let valid = true
@@ -242,11 +228,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
valid = false
}
if (method.value === 'sms' && !smsPhone.value.trim()) {
errors.phone = '请确认短信接收手机号'
valid = false
}
return valid
}
@@ -264,11 +245,11 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
visitId: selectedVisit.value.id,
documentId: selectedTemplate.value.id,
documentName: selectedTemplate.value.name,
templateVersionId: selectedTemplate.value.versionId,
method: method.value,
visitType: selectedVisit.value.type,
visitNo: selectedVisit.value.visitNo,
department: selectedVisit.value.department,
phone: method.value === 'sms' ? smsPhone.value.trim() : undefined,
})
} finally {
submitting.value = false
@@ -287,7 +268,6 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
method,
patient,
patientId,
patientPhoneRevealed,
resetForNextTask,
resetForm,
selectMethod,
@@ -297,11 +277,9 @@ export function useSigningTaskForm(options: UseSigningTaskFormOptions) {
selectedTemplateId,
selectedVisit,
selectedVisitId,
smsPhone,
submit,
submitting,
templates,
togglePhone,
visits,
}
}