diff --git a/.gitignore b/.gitignore index 60559922..aea6eb06 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ bin-release/ /.claude /.claude /.claude +/.kbctx diff --git a/admin/src/views/tcm/diagnosis/components/CallRecordPanel.vue b/admin/src/views/tcm/diagnosis/components/CallRecordPanel.vue index 9dfc9ea3..083c8e1e 100644 --- a/admin/src/views/tcm/diagnosis/components/CallRecordPanel.vue +++ b/admin/src/views/tcm/diagnosis/components/CallRecordPanel.vue @@ -1,6 +1,6 @@ @@ -47,7 +51,7 @@ {{ row.recording_status_text || '—' }} - + @@ -66,10 +153,17 @@ import { computed, onMounted, ref } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ArrowLeft } from '@element-plus/icons-vue' import { diagnosisReadonlyDetail } from '@/api/tcm' +import { getDoctorNotes } from '@/api/patient' import { formatGender } from '@/utils/diag-display' +import { hasPermission } from '@/utils/perm' import PatientInfoCard from './components/PatientInfoCard.vue' import PatientCaseCard from './components/PatientCaseCard.vue' import DailyMatrix from './components/DailyMatrix.vue' +import CallRecordPanel from './components/CallRecordPanel.vue' +import ImChatRecordPanel from './components/ImChatRecordPanel.vue' +import AssignLogPanel from './components/AssignLogPanel.vue' +import AppointmentRecordPanel from './components/AppointmentRecordPanel.vue' +import PatientOrderList from './components/PatientOrderList.vue' import NoteTimeline from '@/views/patient/reception/components/NoteTimeline.vue' const route = useRoute() @@ -80,10 +174,19 @@ const diagnosisIdNum = computed(() => Number(route.query.id || 0)) const loading = ref(false) const errorMsg = ref('') const detail = ref(null) +/** 医生备注:readonlyDetail 返回 + getDoctorNotes 对齐接诊台结构 */ +const doctorNotesLocal = ref([]) const apt = computed(() => detail.value?.appointment || {}) const diag = computed(() => detail.value?.diagnosis || {}) -const doctorNotes = computed(() => detail.value?.doctor_notes || []) + +const hasDailyRecordPermission = computed(() => hasPermission(['tcm.diagnosis/dailyRecord'])) + +const diagnosisNumericId = computed(() => + Number(diag.value?.id ?? diagnosisIdNum.value ?? 0) +) +const patientNumericId = computed(() => Number(diag.value?.patient_id ?? 0)) + const unservedDays = computed(() => { const v = detail.value?.unserved_days return v === null || v === undefined ? null : Number(v) @@ -103,11 +206,23 @@ const unservedDaysClass = (n: unknown) => { return 'unserved-green' } +const fetchDoctorNotes = async () => { + const id = diagnosisNumericId.value + if (!id) return + try { + const data = (await getDoctorNotes({ diagnosis_id: id })) || [] + doctorNotesLocal.value = data + } catch { + /* 失败时保留 readonlyDetail 已下发的 doctor_notes,避免整块备注空白 */ + } +} + const fetchDetail = async () => { const id = diagnosisIdNum.value if (!id || id <= 0) { errorMsg.value = '诊单 id 缺失' detail.value = null + doctorNotesLocal.value = [] return } loading.value = true @@ -115,9 +230,12 @@ const fetchDetail = async () => { try { const res: any = await diagnosisReadonlyDetail({ id }) detail.value = res || null + doctorNotesLocal.value = Array.isArray(res?.doctor_notes) ? res.doctor_notes : [] + await fetchDoctorNotes() } catch (e: any) { errorMsg.value = e?.message || '' detail.value = null + doctorNotesLocal.value = [] } finally { loading.value = false } @@ -276,4 +394,18 @@ onMounted(fetchDetail) background: linear-gradient(180deg, #4f8cff 0%, #2563eb 100%); } } + +.card-body { + min-width: 0; +} + +/* 与 DailyMatrix 根节点 .daily-matrix { padding: 16px } 对齐,使下方区块与「日常记录 / 待办」主内容区左右留白一致 */ +.card-body--matrix-align { + padding: 16px; + box-sizing: border-box; +} + +.section-card .card-title { + margin-bottom: 0; +}