Bug #722 — 住院病历页面打不开(前端)

This commit is contained in:
wangjian963
2026-06-18 13:55:36 +08:00
parent 8ed2df212d
commit b002818935

View File

@@ -136,11 +136,11 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import {nextTick, onMounted, ref, watch} from 'vue'; import {getCurrentInstance, nextTick, onMounted, reactive, ref, watch} from 'vue';
import {ElMessage} from 'element-plus'; import {ElMessage} from 'element-plus';
import {getTreeList} from '@/views/basicmanage/caseTemplates/api'; import {getTreeList} from '@/views/basicmanage/caseTemplates/api';
import {addTemplate, getRecordByEncounterIdList, recordPrint, saveOrUpdateRecord} from './api'; import {addTemplate, getRecordByEncounterIdList, recordPrint, saveOrUpdateRecord} from './api';
import {patientInfo} from '../store/patient.js'; import {patientInfo as storePatientInfo} from '../store/patient.js';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
// 打印工具 // 打印工具
import {PRINT_TEMPLATE, simplePrint} from '@/utils/printUtils.js'; import {PRINT_TEMPLATE, simplePrint} from '@/utils/printUtils.js';
@@ -301,15 +301,15 @@ const handleSubmitOk = async (data) => {
if (currentOperate.value === 'add') { if (currentOperate.value === 'add') {
// //
try { try {
if (!patientInfo.value?.encounterId || !patientInfo.value?.patientId) { if (!storePatientInfo.value?.encounterId || !storePatientInfo.value?.patientId) {
ElMessage.error('请先选择患者!'); ElMessage.error('请先选择患者!');
return; return;
} }
editForm.value.definitionId = currentSelectTemplate.value.id; editForm.value.definitionId = currentSelectTemplate.value.id;
editForm.value.definitionBusNo = currentSelectTemplate.value.busNo; editForm.value.definitionBusNo = currentSelectTemplate.value.busNo;
editForm.value.contentJson = JSON.stringify(data); editForm.value.contentJson = JSON.stringify(data);
editForm.value.encounterId = patientInfo.value.encounterId; editForm.value.encounterId = storePatientInfo.value.encounterId;
editForm.value.patientId = patientInfo.value.patientId; editForm.value.patientId = storePatientInfo.value.patientId;
editForm.value.recordTime = dayjs().format('YYYY-MM-DD HH:mm:ss'); editForm.value.recordTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
// 提交病历 // 提交病历
await saveOrUpdateRecord(editForm.value); await saveOrUpdateRecord(editForm.value);
@@ -465,15 +465,15 @@ const selectedHistoryRecordId = ref('');
// 加载最新的病历数据并回显 // 加载最新的病历数据并回显
const loadLatestMedicalRecord = async () => { const loadLatestMedicalRecord = async () => {
if (!patientInfo.value.encounterId || !currentSelectTemplate.value.id) return; if (!storePatientInfo.value.encounterId || !currentSelectTemplate.value.id) return;
loading.value = true; loading.value = true;
try { try {
// 获取患者的历史病历记录 // 获取患者的历史病历记录
const res = await getRecordByEncounterIdList({ const res = await getRecordByEncounterIdList({
isPage: 0, isPage: 0,
encounterId: patientInfo.value.encounterId, encounterId: storePatientInfo.value.encounterId,
patientId: patientInfo.value.patientId, patientId: storePatientInfo.value.patientId,
definitionId: currentSelectTemplate.value.id, definitionId: currentSelectTemplate.value.id,
}); });