From ff105d08004b784d9bc2f320e490f0052c8dca5b Mon Sep 17 00:00:00 2001
From: wangjian963 <15215920+aprilry@user.noreply.gitee.com>
Date: Tue, 23 Jun 2026 13:48:35 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=A8=E8=AF=8A?=
=?UTF-8?q?=E5=8C=BB=E7=94=9F=E7=AB=99=E6=A8=A1=E5=9D=97=E4=B8=AD=E5=8C=BB?=
=?UTF-8?q?tab=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E5=8A=A0=E8=BD=BD?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../web/doctorstation/dto/RequestBaseDto.java | 6 ++++++
.../DoctorStationChineseMedicalAppMapper.xml | 6 ++++--
.../components/tcm/tcmAdvice.vue | 20 +++++++++++++------
.../inHospitalManagement/listFee/index.vue | 2 +-
.../components/depositQuery.vue | 2 +-
.../src/views/knowledgegraph/PathwayList.vue | 2 +-
.../src/views/knowledgegraph/RelationList.vue | 2 +-
.../transferManagent/batchTransfer/index.vue | 2 +-
8 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/dto/RequestBaseDto.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/dto/RequestBaseDto.java
index 4a0d18e26..b5dcc2e43 100755
--- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/dto/RequestBaseDto.java
+++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/dto/RequestBaseDto.java
@@ -224,6 +224,12 @@ public class RequestBaseDto {
*/
private Integer sortNumber;
+ /**
+ * 账户id (费用性质/合同)
+ */
+ @JsonSerialize(using = ToStringSerializer.class)
+ private Long accountId;
+
/**
* 用药说明
*/
diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationChineseMedicalAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationChineseMedicalAppMapper.xml
index 0ce2bc973..56a20a217 100755
--- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationChineseMedicalAppMapper.xml
+++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationChineseMedicalAppMapper.xml
@@ -62,7 +62,8 @@
T1.suffering_flag AS suffering_flag,
T1.dosage_instruction AS dosage_instruction,
T2.part_percent AS part_percent,
- ccd.name AS condition_definition_name
+ ccd.name AS condition_definition_name,
+ T4.account_id AS account_id
FROM med_medication_request AS T1
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
AND T2.delete_flag = '0'
@@ -115,7 +116,8 @@
T1.chinese_herbs_dose_quantity AS chinese_herbs_dose_quantity,
T1.suffering_flag AS suffering_flag,
T2.part_percent AS part_percent,
- ccd.name AS condition_definition_name
+ ccd.name AS condition_definition_name,
+ T4.account_id AS account_id
FROM med_medication_request AS T1
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
AND T2.delete_flag = '0'
diff --git a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue
index 61fe1e594..1debfa34b 100755
--- a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue
+++ b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue
@@ -130,7 +130,7 @@
煎药方式:
@@ -569,6 +569,7 @@ const tcmPrescriptionList = ref([
rateCode: '',
dispensePerDuration: '',
chineseHerbsDoseQuantity: '',
+ dosageInstruction: '',
sufferingFlag: '0',
checkAll: false,
groupIndexList: [],
@@ -688,11 +689,12 @@ async function getListInfo(addNewRow) {
id: generatePrescriptionId(),
prescriptionList: [],
conditionDefinitionId: '',
- accountId: contractList.value[0].accountId,
+ accountId: contractList.value?.[0]?.accountId || '',
methodCode: '',
rateCode: '',
dispensePerDuration: '',
chineseHerbsDoseQuantity: '',
+ dosageInstruction: '',
sufferingFlag: '0',
checkAll: false,
groupIndexList: [],
@@ -729,6 +731,9 @@ async function getListInfo(addNewRow) {
if (firstItem.sufferingFlag !== undefined && firstItem.sufferingFlag !== null) {
prescription.sufferingFlag = firstItem.sufferingFlag;
}
+ if (firstItem.dosageInstruction !== undefined && firstItem.dosageInstruction !== null) {
+ prescription.dosageInstruction = firstItem.dosageInstruction;
+ }
}
return prescription;
@@ -740,11 +745,12 @@ async function getListInfo(addNewRow) {
id: generatePrescriptionId(),
prescriptionList: [],
conditionDefinitionId: '',
- accountId: contractList.value[0].accountId,
+ accountId: contractList.value?.[0]?.accountId || '',
methodCode: '',
rateCode: '',
dispensePerDuration: '',
chineseHerbsDoseQuantity: '',
+ dosageInstruction: '',
sufferingFlag: '0',
checkAll: false,
groupIndexList: [],
@@ -754,7 +760,7 @@ async function getListInfo(addNewRow) {
isAdding: false,
});
}
- tcmPrescriptionList.value.accountId = contractList.value[0].accountId;
+ tcmPrescriptionList.value.accountId = contractList.value?.[0]?.accountId || '';
if (props.activeTab == 'prescription' && addNewRow) {
handleAddMedicine(0);
}
@@ -898,6 +904,7 @@ function addNewPrescription() {
rateCode: '',
dispensePerDuration: '',
chineseHerbsDoseQuantity: '',
+ dosageInstruction: '',
sufferingFlag: '0',
checkAll: false,
groupIndexList: [],
@@ -1160,7 +1167,7 @@ function handleSave(pIndex) {
groupId: item.groupId,
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
- accountId: accountId.value,
+ accountId: prescription.accountId,
conditionId: prescription.conditionId,
encounterDiagnosisId: prescription.encounterDiagnosisId,
diagnosisName: prescription.diagnosisName,
@@ -1237,7 +1244,7 @@ function handleSaveBatch(pIndex) {
.map((item, index) => {
return {
...item,
- accountId: accountId.value,
+ accountId: prescription.accountId,
conditionId: prescription.conditionId,
encounterDiagnosisId: prescription.encounterDiagnosisId,
conditionDefinitionId: prescription.conditionDefinitionId,
@@ -1249,6 +1256,7 @@ function handleSaveBatch(pIndex) {
rateCode: prescription.rateCode,
dispensePerDuration: prescription.dispensePerDuration,
chineseHerbsDoseQuantity: prescription.chineseHerbsDoseQuantity,
+ dosageInstruction: prescription.dosageInstruction,
dbOpType: item.requestId ? '2' : '1',
};
});
diff --git a/healthlink-his-ui/src/views/inHospitalManagement/listFee/index.vue b/healthlink-his-ui/src/views/inHospitalManagement/listFee/index.vue
index af8244ad5..985310f35 100755
--- a/healthlink-his-ui/src/views/inHospitalManagement/listFee/index.vue
+++ b/healthlink-his-ui/src/views/inHospitalManagement/listFee/index.vue
@@ -159,7 +159,7 @@ const searchKey = ref('')
const patientList = ref([])
const patientTotal = ref(0)
const pageNo = ref(1)
-const $110)
+const pageSize = ref(10)
const currentPatient = ref(null)
const feeItems = ref([])
const feeLoading = ref(false)
diff --git a/healthlink-his-ui/src/views/inpatientNurse/InpatientBilling/components/depositQuery.vue b/healthlink-his-ui/src/views/inpatientNurse/InpatientBilling/components/depositQuery.vue
index 0e7766b82..bc0bc9532 100755
--- a/healthlink-his-ui/src/views/inpatientNurse/InpatientBilling/components/depositQuery.vue
+++ b/healthlink-his-ui/src/views/inpatientNurse/InpatientBilling/components/depositQuery.vue
@@ -300,7 +300,7 @@ const patientInfo = ref('');
// 分页相关
const currentPage = ref(1);
-const $110);
+const pageSize = ref(10)
const total = ref(0);
// 打印相关
diff --git a/healthlink-his-ui/src/views/knowledgegraph/PathwayList.vue b/healthlink-his-ui/src/views/knowledgegraph/PathwayList.vue
index dbb4f4101..ca8f9a78b 100644
--- a/healthlink-his-ui/src/views/knowledgegraph/PathwayList.vue
+++ b/healthlink-his-ui/src/views/knowledgegraph/PathwayList.vue
@@ -84,7 +84,7 @@ const loading = ref(false)
const tableData = ref([])
const total = ref(0)
const pageNo = ref(1)
-const $110)
+const pageSize = ref(10)
const keyword = ref('')
const showEdit = ref(false)
const showSteps = ref(false)
diff --git a/healthlink-his-ui/src/views/knowledgegraph/RelationList.vue b/healthlink-his-ui/src/views/knowledgegraph/RelationList.vue
index 99f0f818a..e7f6002a2 100644
--- a/healthlink-his-ui/src/views/knowledgegraph/RelationList.vue
+++ b/healthlink-his-ui/src/views/knowledgegraph/RelationList.vue
@@ -82,7 +82,7 @@ const loading = ref(false)
const tableData = ref([])
const total = ref(0)
const pageNo = ref(1)
-const $110)
+const pageSize = ref(10)
const showForm = ref(false)
const filters = ref({ sourceType: '', targetType: '', relationType: '' })
diff --git a/healthlink-his-ui/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue b/healthlink-his-ui/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue
index ecf1c6414..fb4f927b1 100755
--- a/healthlink-his-ui/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue
+++ b/healthlink-his-ui/src/views/medicationmanagement/transferManagent/batchTransfer/index.vue
@@ -666,7 +666,7 @@ const tableData = ref([]);
// 当前页码
const pageNum = ref(1);
// 每页显示数据
-const $110);
+const pageSize = ref(10)
const purchaseinventoryList = ref([]);
const open = ref(false);
const loading = ref(false);
From 9689e4610ac14ebbd6494082aa3c646468b70002 Mon Sep 17 00:00:00 2001
From: wangjian963 <15215920+aprilry@user.noreply.gitee.com>
Date: Tue, 23 Jun 2026 14:27:01 +0800
Subject: [PATCH 2/2] =?UTF-8?q?fix(diagnosis):=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E4=B8=AD=E5=8C=BB=E8=AF=8A=E6=96=AD=E5=BC=B9=E7=AA=97=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E6=AE=8B=E7=95=99=E3=80=81=E9=87=8D=E5=A4=8D=E5=8F=8A?=
=?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=95=B0=E6=8D=AE=E4=B8=8D=E4=B8=80=E8=87=B4?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
问题:
1. 中医诊断弹窗关闭后重新打开,右侧诊断详情区仍显示已删除的诊断
2. 诊断详情区出现重复的诊断数据
3. 弹窗显示的中医诊断在诊断表格中不显示(两边数据不一致)
---
.../diagnosis/addDiagnosisDialog.vue | 76 +++++++++++++++----
.../components/diagnosis/diagnosis.vue | 48 +++++++++---
2 files changed, 101 insertions(+), 23 deletions(-)
diff --git a/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue b/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue
index 14c92abbb..ed4eafc8e 100755
--- a/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue
+++ b/healthlink-his-ui/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue
@@ -169,24 +169,36 @@ const selectedDisease = ref(false);
const { proxy } = getCurrentInstance();
const emit = defineEmits(['close']);
+// 请求序列号,防止异步回调竞态导致数据重复
+let openSeq = 0;
+
// 获取诊断类型字典
const { diag_type } = proxy.useDict('diag_type');
function handleOpen() {
+ // 递增序列号,使之前未完成的异步回调失效
+ const currentSeq = ++openSeq;
+ console.log('[addDiagnosisDialog] handleOpen() 触发, seq=', currentSeq, 'updateZy长度=', props.updateZy.length);
+
// 获取诊断列表
getTcmCondition().then((res) => {
+ // 仅当是最新请求时才更新数据
+ if (currentSeq !== openSeq) return;
conditionList.value = res.data.records;
+ console.log('[addDiagnosisDialog] 诊断列表加载完成, 条数=', res.data.records?.length);
});
-
- // 清空数据
+
+ // 清空数据(同步清空,确保每次打开弹窗都是干净的状态)
tcmDiagonsisSaveList.value = [];
tcmDiagonsisList.value = [];
syndromeSelected.value = true; // 设置为true,允许添加新的诊断
-
+ console.log('[addDiagnosisDialog] 列表已清空, tcmDiagonsisList.length=', tcmDiagonsisList.value.length);
+
// 如果是修改模式,加载传入的诊断数据
if (props.updateZy.length > 0) {
+ console.log('[addDiagnosisDialog] 编辑模式, 从updateZy加载数据:', JSON.stringify(props.updateZy));
props.updateZy.forEach((item) => {
let updateIds = item.updateId.split("-");
let name = item.name.split("-");
@@ -218,14 +230,33 @@ function handleOpen() {
});
syndromeSelected.value = true;
});
+ console.log('[addDiagnosisDialog] 编辑模式加载完成, tcmDiagonsisList=', JSON.stringify(tcmDiagonsisList.value));
} else {
// 不是修改模式,加载已保存的中医诊断
+ console.log('[addDiagnosisDialog] 新增模式, 从API加载已有诊断, encounterId=', props.patientInfo?.encounterId);
if (props.patientInfo && props.patientInfo.encounterId) {
- getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
+ // 添加时间戳参数防止浏览器缓存,确保每次打开弹窗都获取最新数据
+ getTcmDiagnosis({ encounterId: props.patientInfo.encounterId, _t: Date.now() }).then((res) => {
+ // 仅当是最新请求时才更新数据,防止旧回调污染列表
+ if (currentSeq !== openSeq) {
+ console.log('[addDiagnosisDialog] API响应被丢弃(seq不匹配), currentSeq=', currentSeq, 'openSeq=', openSeq);
+ return;
+ }
+ console.log('[addDiagnosisDialog] API返回 getTcmDiagnosis, code=', res.code, 'illness条数=', res.data?.illness?.length);
if (res.code === 200 && res.data.illness && res.data.illness.length > 0) {
+ // 用于去重的集合:疾病名+证候名
+ const seenPairs = new Set();
res.data.illness.forEach((item, index) => {
const symptom = res.data.symptom[index];
if (symptom) {
+ const pairKey = item.name + '|' + symptom.name;
+ // 如果已存在完全相同的疾病+证候组合,跳过(防止数据库中已有重复数据显示多次)
+ if (seenPairs.has(pairKey)) {
+ console.log('[addDiagnosisDialog] 跳过重复已有诊断: illness=', item.name, 'symptom=', symptom.name, 'syndromeGroupNo=', item.syndromeGroupNo);
+ return;
+ }
+ seenPairs.add(pairKey);
+ console.log('[addDiagnosisDialog] 添加已有诊断: illness=', item.name, 'symptom=', symptom.name, 'syndromeGroupNo=', item.syndromeGroupNo);
// 添加到显示列表
tcmDiagonsisList.value.push({
conditionName: item.name,
@@ -233,7 +264,7 @@ function handleOpen() {
syndromeGroupNo: item.syndromeGroupNo,
isExisting: true // 标记为已存在
});
-
+
// 添加到保存列表
tcmDiagonsisSaveList.value.push(
{
@@ -257,8 +288,13 @@ function handleOpen() {
);
}
});
+ console.log('[addDiagnosisDialog] 加载完成, tcmDiagonsisList=', JSON.stringify(tcmDiagonsisList.value));
+ } else {
+ console.log('[addDiagnosisDialog] 没有已有诊断数据');
}
}).catch(err => {
+ // 忽略过期请求的错误
+ if (currentSeq !== openSeq) return;
console.error('加载已保存的中医诊断失败:', err);
});
}
@@ -268,14 +304,16 @@ function handleOpen() {
// 点击诊断列表处理,点击以后才显示证候列表
// vxe-table v4 cell-click 事件参数为 { row, column, rowIndex, ... },需解构获取实际行数据
function handleClickRow({ row }) {
+ console.log('[addDiagnosisDialog] handleClickRow 触发, row.name=', row.name, 'syndromeSelected=', syndromeSelected.value, 'listLength=', tcmDiagonsisList.value.length);
if (syndromeSelected.value || tcmDiagonsisList.value.length == 0) {
syndromeSelected.value = false;
selectedDisease.value = true;
timestamp.value = Date.now();
+ console.log('[addDiagnosisDialog] 添加新诊断: disease=', row.name, 'syndromeGroupNo=', timestamp.value);
getTcmSyndrome().then((res) => {
syndromeList.value = res.data.records;
});
-
+
// 添加新的诊断
tcmDiagonsisSaveList.value.push({
definitionId: row.id,
@@ -290,22 +328,23 @@ function handleClickRow({ row }) {
syndromeGroupNo: timestamp.value,
isExisting: false // 标记为新增
});
+ console.log('[addDiagnosisDialog] 添加后 tcmDiagonsisList=', JSON.stringify(tcmDiagonsisList.value));
}
}
// vxe-table v4 cell-click 事件参数为 { row, column, rowIndex, ... },需解构获取实际行数据
function clickSyndromeRow({ row }) {
- // 检查是否已存在完全相同的诊断和证候
+ // 检查是否已存在完全相同的诊断和证候(包括已保存的和当前新增的)
let flag = true;
const currentConditionName = tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].conditionName;
-
+
tcmDiagonsisList.value.forEach(item => {
if (item.conditionName === currentConditionName && item.syndromeName === row.name) {
proxy.$modal.msgWarning('不能存在完全相同的诊断和证候');
flag = false;
}
});
-
+
if (flag) {
tcmDiagonsisSaveList.value.push({
definitionId: row.id,
@@ -321,29 +360,33 @@ function clickSyndromeRow({ row }) {
// 删除诊断
function removeDiagnosis(row, index) {
+ console.log('[addDiagnosisDialog] removeDiagnosis 触发, row=', JSON.stringify(row), 'index=', index);
tcmDiagonsisList.value.splice(index, 1);
tcmDiagonsisSaveList.value = tcmDiagonsisSaveList.value.filter((item) => {
return item.syndromeGroupNo !== row.syndromeGroupNo;
});
-
+ console.log('[addDiagnosisDialog] 删除后 tcmDiagonsisList=', JSON.stringify(tcmDiagonsisList.value));
}
function save() {
// 只保存新增的诊断,过滤掉已存在的
const newDiagnosisList = tcmDiagonsisSaveList.value.filter(item => !item.isExisting);
-
+ console.log('[addDiagnosisDialog] save() 触发, newDiagnosisList长度=', newDiagnosisList.length, 'updateZy长度=', props.updateZy.length);
+
if (newDiagnosisList.length === 0) {
proxy.$modal.msgWarning('没有新增的诊断需要保存');
return;
}
-
+
if (props.updateZy.length > 0) {
// 修改模式
+ console.log('[addDiagnosisDialog] 调用 updateTcmDiagnosis');
updateTcmDiagnosis({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
diagnosisChildList: newDiagnosisList,
}).then((res) => {
+ console.log('[addDiagnosisDialog] updateTcmDiagnosis 响应, code=', res.code);
if (res.code == 200) {
emit('close');
proxy.$modal.msgSuccess('诊断已保存');
@@ -351,11 +394,13 @@ function save() {
});
} else {
// 新增模式
+ console.log('[addDiagnosisDialog] 调用 saveTcmDiagnosis');
saveTcmDiagnosis({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
diagnosisChildList: newDiagnosisList,
}).then((res) => {
+ console.log('[addDiagnosisDialog] saveTcmDiagnosis 响应, code=', res.code);
if (res.code == 200) {
emit('close');
proxy.$modal.msgSuccess('诊断已保存');
@@ -367,13 +412,15 @@ function save() {
function submit() {
// 检查是否有新增的诊断
const hasNewDiagnosis = tcmDiagonsisSaveList.value.some(item => !item.isExisting);
-
+ console.log('[addDiagnosisDialog] submit() 触发, hasNewDiagnosis=', hasNewDiagnosis, 'syndromeSelected=', syndromeSelected.value);
+
if (!hasNewDiagnosis) {
// 如果没有新增诊断,直接关闭
+ console.log('[addDiagnosisDialog] 无新增诊断,直接关闭弹窗');
emit('close');
return;
}
-
+
if (syndromeSelected.value || tcmDiagonsisSaveList.value.length % 2 == 0) {
save();
} else {
@@ -381,6 +428,7 @@ function submit() {
}
}
function close() {
+ console.log('[addDiagnosisDialog] close() 触发 (弹窗@close事件)');
emit('close');
}
diff --git a/healthlink-his-ui/src/views/doctorstation/components/diagnosis/diagnosis.vue b/healthlink-his-ui/src/views/doctorstation/components/diagnosis/diagnosis.vue
index 45a32037c..a859c1dbf 100755
--- a/healthlink-his-ui/src/views/doctorstation/components/diagnosis/diagnosis.vue
+++ b/healthlink-his-ui/src/views/doctorstation/components/diagnosis/diagnosis.vue
@@ -539,17 +539,25 @@ async function getList() {
});
emits('diagnosisSave', false);
}
- // 获取现有诊断的排序号集合,用于判断是否重复
- const existingDiagSrtNoSet = new Set(form.value.diagnosisList.map(item => item.diagSrtNo));
+ // 收集已有中医诊断的 syndromeGroupNo,用于去重
+ const existingTcmGroups = new Set(
+ form.value.diagnosisList
+ .filter(item => item.typeName === '中医诊断' && item.syndromeGroupNo)
+ .map(item => item.syndromeGroupNo)
+ );
const tcmRes = await getTcmDiagnosis({ encounterId: props.patientInfo.encounterId });
+ console.log('[diagnosis] getList() getTcmDiagnosis 返回, code=', tcmRes.code, 'illness条数=', tcmRes.data?.illness?.length);
if (tcmRes.code == 200) {
if (tcmRes.data.illness.length > 0) {
tcmRes.data.illness.forEach((item, index) => {
- // 如果该排序号的诊断已存在,则跳过(避免重复添加)
- if (existingDiagSrtNoSet.has(item.diagSrtNo)) {
+ // 使用 syndromeGroupNo 去重,避免与西医诊断的 diagSrtNo 冲突
+ if (existingTcmGroups.has(item.syndromeGroupNo)) {
+ console.log('[diagnosis] getList() 跳过重复中医诊断, syndromeGroupNo=', item.syndromeGroupNo, 'name=', item.name);
return;
}
+ existingTcmGroups.add(item.syndromeGroupNo);
+ console.log('[diagnosis] getList() 添加中医诊断到表格: illness=', item.name, 'symptom=', tcmRes.data.symptom[index]?.name, 'syndromeGroupNo=', item.syndromeGroupNo);
form.value.diagnosisList.push({
name: item.name + '-' + tcmRes.data.symptom[index].name,
diagSrtNo: item.diagSrtNo,
@@ -564,8 +572,6 @@ async function getList() {
symptomDefinitionId : tcmRes.data.symptom[index].definitionId,
symptomYbNo: tcmRes.data.symptom[index].ybNo,
});
- // 添加后更新集合
- existingDiagSrtNoSet.add(item.diagSrtNo);
});
}
emits('diagnosisSave', false);
@@ -734,6 +740,7 @@ function handleAddDiagnosis() {
// 添加中医诊断
function handleAddTcmDiagonsis() {
+ console.log('[diagnosis] handleAddTcmDiagonsis() 触发, 清空updateZy并打开弹窗');
updateZy.value = [];
openAddDiagnosisDialog.value = true;
}
@@ -742,8 +749,10 @@ function handleAddTcmDiagonsis() {
* 删除诊断
*/
function handleDeleteDiagnosis(row, index) {
+ console.log('[diagnosis] handleDeleteDiagnosis 触发, row=', JSON.stringify({name: row.name, conditionId: row.conditionId, syndromeGroupNo: row.syndromeGroupNo, typeName: row.typeName}));
if (row.conditionId) {
delEncounterDiagnosis(row.conditionId).then((res) => {
+ console.log('[diagnosis] delEncounterDiagnosis 响应, code=', res.code);
if (res.code == 200) {
proxy.$modal.msgSuccess('删除成功');
getList();
@@ -751,11 +760,21 @@ function handleDeleteDiagnosis(row, index) {
}
});
} else if (row.syndromeGroupNo) {
- deleteTcmDiagnosis(row.syndromeGroupNo).then(() => {
- getList();
- getTree();
+ console.log('[diagnosis] 调用 deleteTcmDiagnosis, syndromeGroupNo=', row.syndromeGroupNo);
+ deleteTcmDiagnosis(row.syndromeGroupNo).then((res) => {
+ console.log('[diagnosis] deleteTcmDiagnosis 响应, code=', res?.code, 'msg=', res?.msg);
+ if (res.code == 200) {
+ proxy.$modal.msgSuccess('删除成功');
+ getList();
+ getTree();
+ } else {
+ proxy.$modal.msgError(res?.msg || '删除失败,请稍后重试');
+ }
+ }).catch(() => {
+ proxy.$modal.msgError('删除请求失败,请检查网络');
});
} else {
+ console.log('[diagnosis] 本地删除(未保存的诊断), index=', index);
form.value.diagnosisList.splice(index, 1);
// 删除后不重新计算排序号,保持用户设置的排序不变
emits('diagnosisSave', false);
@@ -961,11 +980,20 @@ function handleInfectiousDiseaseReport() {
* 关闭诊断弹窗
*/
function closeDiagnosisDialog(str) {
+ console.log('[diagnosis] closeDiagnosisDialog 触发, str=', str, 'openAddDiagnosisDialog=', openAddDiagnosisDialog.value, 'openDiagnosis=', openDiagnosis.value);
if (str === 'success') {
proxy.$modal.msgSuccess('操作成功');
}
+ // 防止重复调用导致并发 getList()
+ if (!openAddDiagnosisDialog.value && !openDiagnosis.value) {
+ console.log('[diagnosis] closeDiagnosisDialog 跳过(弹窗已关闭)');
+ return;
+ }
openAddDiagnosisDialog.value = false;
openDiagnosis.value = false;
+ // 清理 updateZy,避免编辑模式数据残留
+ updateZy.value = [];
+ console.log('[diagnosis] 弹窗关闭, updateZy已清空, 开始刷新列表');
getList();
getTree();
}
@@ -1010,6 +1038,7 @@ function closeDiagnosisPopover(row) {
/**获取焦点时 打开列表 */
function handleFocus(row, index) {
if(row.typeName==='中医诊断'){
+ console.log('[diagnosis] handleFocus 触发(编辑中医诊断), row.name=', row.name, 'syndromeGroupNo=', row.syndromeGroupNo);
updateZy.value = [];
updateZy.value.push({
illnessDefinitionId: row.illnessDefinitionId,
@@ -1021,6 +1050,7 @@ function handleFocus(row, index) {
diagSrtNo: row.diagSrtNo,
name:row.name,
});
+ console.log('[diagnosis] updateZy 已设置, 打开编辑弹窗');
openAddDiagnosisDialog.value = true;
}else{
// 关闭其他行的弹窗