Fix Bug #401: 门诊完诊审计日志错误:div_log 表中 pool_id 与 slot_id 存值与设计规范不符

调整完诊时 div_log 的 pool_id/slot_id 获取优先级:优先使用 triage_queue_item
(挂号时录入的号源信息,为权威来源),队列项不存在或值缺失时回退使用
encounter → order → slot → pool 链路

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
荀彧
2026-05-13 10:15:08 +08:00
committed by 关羽
parent f7a3f658fb
commit a09020a4fd
3 changed files with 34 additions and 27 deletions

View File

@@ -67,7 +67,7 @@
<el-col :span="20" :xs="24">
<div style="margin-bottom: 10px">
<el-button type="primary" plain @click="handleAddDiagnosis()"> 新增诊断 </el-button>
<el-button type="primary" plain @click="handleSaveDiagnosis()"> 保存诊断 </el-button>
<el-button type="primary" plain :loading="saveLoading" @click="handleSaveDiagnosis()"> 保存诊断 </el-button>
<!-- <el-button type="primary" plain @click="handleAddTcmDiagonsis()"> 中医诊断 </el-button> -->
<el-button type="primary" plain @click="handleImport()"> 导入慢性病诊断 </el-button>
</div>
@@ -169,7 +169,7 @@
<script setup>
import {getCurrentInstance} from 'vue'; // 添加 nextTick 导入
import useUserStore from '@/store/modules/user';
import {
import { formatDateStr } from '@/utils/index';
delEncounterDiagnosis,
deleteDiagnosisBind,
diagnosisInit,
@@ -190,6 +190,7 @@ import {ElMessage} from 'element-plus';
// const diagnosisList = ref([]);
const allowAdd = ref(false);
const isSaving = ref(false);
const saveLoading = ref(false);
const tree = ref([]);
const openDiagnosis = ref(false);
const openAddDiagnosisDialog = ref(false);
@@ -305,7 +306,7 @@ function getList() {
ybNo: item.ybNo,
medTypeCode: item.medTypeCode,
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN')
diagnosisTime: formatDateStr(new Date(), 'YYYY/M/D HH:mm:ss')
});
});
@@ -355,7 +356,7 @@ function handleImport() {
iptDiseTypeCode: 2,
diagnosisDesc: '',
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN'),
diagnosisTime: formatDateStr(new Date(), 'YYYY/M/D HH:mm:ss'),
//添加 patientId
patientId: props.patientInfo.patientId
},
@@ -479,7 +480,7 @@ function addDiagnosisItem() {
iptDiseTypeCode: 2,
diagnosisDesc: '',
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN'),
diagnosisTime: formatDateStr(new Date(), 'YYYY/M/D HH:mm:ss'),
// 新增这一行:为每个诊断项添加 patientId
patientId: props.patientInfo.patientId
@@ -568,6 +569,7 @@ function handleMaindise(value, index) {
* 保存诊断
*/
function handleSaveDiagnosis() {
if (saveLoading.value) return;
for (let index = 0; index < (form.value.diagnosisList || []).length; index++) {
const item = form.value.diagnosisList[index];
if (!item.diagSrtNo) {
@@ -588,6 +590,7 @@ function handleSaveDiagnosis() {
return;
}
saveLoading.value = true;
// 设置保存标志避免触发watch监听器
isSaving.value = true;
@@ -624,6 +627,7 @@ function handleSaveDiagnosis() {
});
}
}).finally(() => {
saveLoading.value = false;
setTimeout(() => {
isSaving.value = false;
}, 100);
@@ -695,7 +699,7 @@ function handleNodeClick(data) {
diagSrtNo: form.value.diagnosisList.length + 1,
definitionId: data.definitionId,
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN'),
diagnosisTime: formatDateStr(new Date(), 'YYYY/M/D HH:mm:ss'),
// 添加 patientId
patientId: props.patientInfo.patientId
});