Merge branch '20260601-long'

This commit is contained in:
2026-06-01 17:02:47 +08:00
3 changed files with 1979 additions and 0 deletions
+78
View File
@@ -509,6 +509,32 @@
</el-button>
</template>
</el-dialog>
<el-dialog
v-model="completeDialogVisible"
title="完成问诊"
width="420px"
append-to-body
:close-on-click-modal="false"
destroy-on-close
>
<div class="complete-dialog">
<p class="complete-dialog-tip">是否添加医生备注</p>
<el-input
v-if="canAddCompleteNote"
v-model="completeNoteContent"
type="textarea"
:rows="4"
maxlength="500"
show-word-limit
placeholder="填写完成备注,将追加到医生备注时间轴"
/>
</div>
<template #footer>
<el-button @click="completeDialogVisible = false">取消</el-button>
<el-button type="primary" :loading="completeSubmitting" @click="submitComplete">确认完成</el-button>
</template>
</el-dialog>
</div>
</template>
@@ -518,7 +544,9 @@ import { defineAsyncComponent, onMounted, onUnmounted, watch } from 'vue'
import { appointmentLists, cancelAppointment, completeAppointment, appointmentDetail } from '@/api/doctor'
import { getCallSignature, generateMiniProgramQrcode, tcmDiagnosisDetail, prescriptionGetByAppointment } from '@/api/tcm'
import { getDictData } from '@/api/app'
import { addDoctorNote } from '@/api/patient'
import feedback from '@/utils/feedback'
import { hasPermission } from '@/utils/perm'
import {
formatDiabetesDiscoveryDisplay,
isDiabetesDiscoveryFilled
@@ -797,6 +825,12 @@ const ensureDetailDictOptions = async () => {
const editRef = ref()
const prescriptionRef = ref()
const chatDialogRef = ref()
const COMPLETE_NOTE_PERMISSION = ['doctor.appointment/addDoctorNote']
const completeDialogVisible = ref(false)
const completeSubmitting = ref(false)
const completeNoteContent = ref('')
const completeRow = ref<any>(null)
const canAddCompleteNote = computed(() => hasPermission(COMPLETE_NOTE_PERMISSION))
// 小程序二维码相关
const qrcodeDialogVisible = ref(false)
@@ -866,6 +900,12 @@ const handleCancel = async (row: any) => {
// 完成挂号
const handleComplete = async (row: any) => {
completeRow.value = row
completeNoteContent.value = ''
if (canAddCompleteNote.value) {
completeDialogVisible.value = true
return
}
try {
await feedback.confirm('确认患者已就诊完成?')
await completeAppointment({ id: row.id })
@@ -875,6 +915,37 @@ const handleComplete = async (row: any) => {
// 用户取消操作
}
}
const submitComplete = async () => {
const row = completeRow.value
if (!row?.id || completeSubmitting.value) return
completeSubmitting.value = true
try {
const note = completeNoteContent.value.trim()
await completeAppointment({ id: row.id })
let noteFailureMsg = ''
if (canAddCompleteNote.value && note) {
const diagnosisId = row.patient_id || row.diagnosis_id
if (diagnosisId) {
try {
await addDoctorNote({ diagnosis_id: Number(diagnosisId), content: note })
} catch (e) {
noteFailureMsg = '问诊已完成,但备注未保存'
}
} else {
noteFailureMsg = '问诊已完成,但该预约没有关联诊单,备注未保存'
}
}
noteFailureMsg ? feedback.msgWarning(noteFailureMsg) : feedback.msgSuccess('操作成功')
completeDialogVisible.value = false
completeNoteContent.value = ''
completeRow.value = null
loadData()
} catch (e: any) {
feedback.msgError(e?.msg || e?.message || '操作失败')
} finally {
completeSubmitting.value = false
}
}
// 编辑患者资料
const handleEditPatient = (row: any) => {
@@ -1330,6 +1401,13 @@ onUnmounted(() => {
color: var(--el-color-danger);
}
.complete-dialog-tip {
margin: 0 0 12px;
color: var(--el-text-color-primary);
font-size: 14px;
line-height: 22px;
}
.qrcode-content {
padding: 16px 0;
min-height: 200px;
File diff suppressed because it is too large Load Diff