fix(门诊医生站): 修复中医诊断弹窗选择后诊断详情不显示的问题
- addDiagnosisDialog: 修复 vxe-table v4 cell-click 事件未解构 row 导致
conditionName/syndromeName 为 undefined,右侧详情始终为空
- diagnosislist: 新增 medTypeCode prop 按诊断类型过滤列表,避免中/西医错选
- diagnosis: 保存时排除中医诊断(已通过独立接口保存),防止重复提交
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="props.openAddDiagnosisDialog"
|
||||
v-model="openDialog"
|
||||
title="添加中医诊断"
|
||||
width="1300px"
|
||||
teleported
|
||||
@@ -153,6 +153,11 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const openDialog = ref(false);
|
||||
watch(() => props.openAddDiagnosisDialog, (val) => {
|
||||
openDialog.value = val;
|
||||
}, { immediate: true });
|
||||
|
||||
const conditionList = ref([]);
|
||||
const syndromeList = ref([]);
|
||||
const tcmDiagonsisList = ref([]);
|
||||
@@ -260,7 +265,8 @@ function handleOpen() {
|
||||
}
|
||||
|
||||
// 点击诊断列表处理,点击以后才显示证候列表
|
||||
function handleClickRow(row) {
|
||||
// vxe-table v4 cell-click 事件参数为 { row, column, rowIndex, ... },需解构获取实际行数据
|
||||
function handleClickRow({ row }) {
|
||||
if (syndromeSelected.value || tcmDiagonsisList.value.length == 0) {
|
||||
syndromeSelected.value = false;
|
||||
selectedDisease.value = true;
|
||||
@@ -286,7 +292,8 @@ function handleClickRow(row) {
|
||||
}
|
||||
}
|
||||
|
||||
function clickSyndromeRow(row) {
|
||||
// vxe-table v4 cell-click 事件参数为 { row, column, rowIndex, ... },需解构获取实际行数据
|
||||
function clickSyndromeRow({ row }) {
|
||||
// 检查是否已存在完全相同的诊断和证候
|
||||
let flag = true;
|
||||
const currentConditionName = tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].conditionName;
|
||||
|
||||
@@ -219,6 +219,7 @@
|
||||
<div class="diagnosis-popover-body">
|
||||
<diagnosislist
|
||||
:diagnosis-searchkey="diagnosisSearchkey"
|
||||
:med-type-code="scope.row.medTypeCode"
|
||||
@select-diagnosis="(row) => handleSelectDiagnosis(row, scope.row, scope.rowIndex)"
|
||||
/>
|
||||
</div>
|
||||
@@ -810,8 +811,18 @@ async function handleSaveDiagnosis() {
|
||||
// 开始加载状态,防止重复提交
|
||||
saveLoading.value = true;
|
||||
|
||||
// 保存前按排序号排序,并转换日期格式为后端期望的格式 yyyy/M/d HH:mm:ss
|
||||
const diagnosisChildList = form.value.diagnosisList.map(item => ({
|
||||
// 保存前按排序号排序,排除中医诊断(已通过中医对话框独立保存),并转换日期格式
|
||||
const westernOnlyList = form.value.diagnosisList
|
||||
.filter(item => item.typeName !== '中医诊断');
|
||||
|
||||
// 如果仅有中医诊断无西医诊断,直接刷新列表即可(中医已通过对话框独立保存)
|
||||
if (westernOnlyList.length === 0) {
|
||||
saveLoading.value = false;
|
||||
proxy.$modal.msgWarning('没有需要保存的西医诊断');
|
||||
return;
|
||||
}
|
||||
|
||||
const diagnosisChildList = westernOnlyList.map(item => ({
|
||||
...item,
|
||||
onsetDate: item.onsetDate ? formatDateStr(item.onsetDate, 'YYYY/M/D HH:mm:ss') : null,
|
||||
diagnosisTime: item.diagnosisTime ? formatDateStr(item.diagnosisTime, 'YYYY/M/D HH:mm:ss') : null
|
||||
|
||||
@@ -70,6 +70,11 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
/** 当前行的诊断类型编码,用于按分类过滤诊断列表 */
|
||||
medTypeCode: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['selectDiagnosis']);
|
||||
@@ -82,6 +87,18 @@ const queryParams = ref({
|
||||
});
|
||||
const diagnosisDefinitionList = ref([]);
|
||||
|
||||
/**
|
||||
* 将 medTypeCode 映射为后端 typeCode 参数
|
||||
* '1' (西医诊断) → typeCode='1'
|
||||
* '2','3' (中医主病/主证) → typeCode='2'
|
||||
* 其他 → 不过滤
|
||||
*/
|
||||
function mapMedTypeToTypeCode(medTypeCode) {
|
||||
if (medTypeCode === '1') return '1';
|
||||
if (medTypeCode === '2' || medTypeCode === '3') return '2';
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// 监听外部传入的搜索关键字
|
||||
watch(
|
||||
() => props.diagnosisSearchkey,
|
||||
@@ -94,9 +111,22 @@ watch(
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 监听诊断类型变化(切换不同分类的行时重新加载)
|
||||
watch(
|
||||
() => props.medTypeCode,
|
||||
() => {
|
||||
queryParams.value.pageNo = 1;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
// 获取诊断列表
|
||||
function getList() {
|
||||
getDiagnosisDefinitionList(queryParams.value).then((res) => {
|
||||
const params = {
|
||||
...queryParams.value,
|
||||
typeCode: mapMedTypeToTypeCode(props.medTypeCode),
|
||||
};
|
||||
getDiagnosisDefinitionList(params).then((res) => {
|
||||
diagnosisDefinitionList.value = res.data.records || [];
|
||||
total.value = res.data.total || 0;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user