From 262ea97824bf7967de29c08b6378d06944c69c72 Mon Sep 17 00:00:00 2001 From: qk123 <18211963828.@163.cpm> Date: Mon, 24 Nov 2025 15:13:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E4=B8=80=E6=82=A3=E8=80=85=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=97=85=E5=8E=86=E5=90=8E=E5=88=A4=E6=96=AD=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/doctorstation/index.vue | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/openhis-ui-vue3/src/views/doctorstation/index.vue b/openhis-ui-vue3/src/views/doctorstation/index.vue index 6a505c4f..3ee7cb9e 100644 --- a/openhis-ui-vue3/src/views/doctorstation/index.vue +++ b/openhis-ui-vue3/src/views/doctorstation/index.vue @@ -313,16 +313,6 @@ function checkPatientHistory(patient) { return; } - // // 如果当前就诊已经有明确的初复诊标识,则使用该标识 - // if (patient.visitType) { - // visitType.value = patient.visitType; - // // 如果是已完诊的记录,禁用修改 - // if (patient.statusEnum && patient.statusEnum !== 2) { // 假设2是就诊中状态 - // visitTypeDisabled.value = true; - // } - // return; - // } - // 查询患者历史就诊记录 const params = { patientId: patient.patientId, @@ -332,14 +322,17 @@ function checkPatientHistory(patient) { getEmrHistoryList(params).then(res => { if (res.code === 200) { const records = res.data?.records || []; - // 如果有历史记录,则为复诊 - if (res.data && res.data.total > 0) { + // 过滤掉当前正在进行的就诊记录(排除相同encounterId的记录) + const historyRecords = records.filter(record => record.encounterId !== patient.encounterId); + + // 如果有历史记录(排除当前就诊),则为复诊 + if (historyRecords.length > 0) { visitType.value = 'FOLLOW_UP'; // 计算最早一次病历创建时间作为初诊日期 - const earliest = records.reduce((min, cur) => { + const earliest = historyRecords.reduce((min, cur) => { const ct = new Date(cur.createTime).getTime(); return ct < min ? ct : min; - }, new Date(records[0].createTime).getTime()); + }, new Date(historyRecords[0].createTime).getTime()); // 使用统一格式化 firstVisitDate.value = formatDate(earliest); } else { @@ -429,9 +422,9 @@ function handleCardClick(item, index) { // 已完诊的记录禁用修改 visitTypeDisabled.value = item.statusEnum !== 2; // 如果有初诊日期也从数据库获取 - if (item.firstVisitDate) { - firstVisitDate.value = item.firstVisitDate; - } + // if (item.firstVisitDate) { + // firstVisitDate.value = item.firstVisitDate; + // } } else { // 对于没有初复诊记录的患者,才使用原有的判断逻辑 checkPatientHistory(item);