Merge remote-tracking branch 'origin/develop' into zhaoyun
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="props.openAddDiagnosisDialog"
|
v-model="openDialog"
|
||||||
title="添加中医诊断"
|
title="添加中医诊断"
|
||||||
width="1300px"
|
width="1300px"
|
||||||
teleported
|
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 conditionList = ref([]);
|
||||||
const syndromeList = ref([]);
|
const syndromeList = ref([]);
|
||||||
const tcmDiagonsisList = 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) {
|
if (syndromeSelected.value || tcmDiagonsisList.value.length == 0) {
|
||||||
syndromeSelected.value = false;
|
syndromeSelected.value = false;
|
||||||
selectedDisease.value = true;
|
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;
|
let flag = true;
|
||||||
const currentConditionName = tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].conditionName;
|
const currentConditionName = tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].conditionName;
|
||||||
|
|||||||
@@ -219,6 +219,7 @@
|
|||||||
<div class="diagnosis-popover-body">
|
<div class="diagnosis-popover-body">
|
||||||
<diagnosislist
|
<diagnosislist
|
||||||
:diagnosis-searchkey="diagnosisSearchkey"
|
:diagnosis-searchkey="diagnosisSearchkey"
|
||||||
|
:med-type-code="scope.row.medTypeCode"
|
||||||
@select-diagnosis="(row) => handleSelectDiagnosis(row, scope.row, scope.rowIndex)"
|
@select-diagnosis="(row) => handleSelectDiagnosis(row, scope.row, scope.rowIndex)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -810,8 +811,18 @@ async function handleSaveDiagnosis() {
|
|||||||
// 开始加载状态,防止重复提交
|
// 开始加载状态,防止重复提交
|
||||||
saveLoading.value = true;
|
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,
|
...item,
|
||||||
onsetDate: item.onsetDate ? formatDateStr(item.onsetDate, 'YYYY/M/D HH:mm:ss') : null,
|
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
|
diagnosisTime: item.diagnosisTime ? formatDateStr(item.diagnosisTime, 'YYYY/M/D HH:mm:ss') : null
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
/** 当前行的诊断类型编码,用于按分类过滤诊断列表 */
|
||||||
|
medTypeCode: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['selectDiagnosis']);
|
const emit = defineEmits(['selectDiagnosis']);
|
||||||
@@ -82,6 +87,18 @@ const queryParams = ref({
|
|||||||
});
|
});
|
||||||
const diagnosisDefinitionList = 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(
|
watch(
|
||||||
() => props.diagnosisSearchkey,
|
() => props.diagnosisSearchkey,
|
||||||
@@ -94,9 +111,22 @@ watch(
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 监听诊断类型变化(切换不同分类的行时重新加载)
|
||||||
|
watch(
|
||||||
|
() => props.medTypeCode,
|
||||||
|
() => {
|
||||||
|
queryParams.value.pageNo = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 获取诊断列表
|
// 获取诊断列表
|
||||||
function 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 || [];
|
diagnosisDefinitionList.value = res.data.records || [];
|
||||||
total.value = res.data.total || 0;
|
total.value = res.data.total || 0;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user