From 29ecfd90f23d142925df113e16abd007adc8fe63 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Fri, 30 Jan 2026 11:10:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=B6=E8=B4=B9=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=99-=E9=97=A8=E8=AF=8A=E6=8C=82=E5=8F=B7?= =?UTF-8?q?=EF=BC=9A=E6=8C=82=E5=8F=B7=E7=B1=BB=E5=9E=8B=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=87=8D=E5=A4=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../charge/outpatientregistration/index.vue | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue index e944cca8..470da838 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue @@ -1155,7 +1155,10 @@ function getHealthcare(data) { form.value.organizationId = data.organizationId; getHealthcareMetadata(param).then((response) => { - healthcareList.value = response.data.records; + // 对数据进行去重处理,name去重 + const uniqueRecords = removeDuplicateHealthcareItems(response.data.records); + healthcareList.value = uniqueRecords; + console.log('去重后的数据列表,healthcareList', healthcareList.value) console.log('getHealthcareMetadata', 'response', response.data); // 使用 nextTick 确保数据更新后再过滤 nextTick(() => { @@ -1167,6 +1170,21 @@ function getHealthcare(data) { }); } +/** 根据name对挂号类型数据进行去重 */ +function removeDuplicateHealthcareItems(records) { + const seenNames = new Set(); + const uniqueRecords = []; + + for (const item of records) { + if (item.name && !seenNames.has(item.name)) { + seenNames.add(item.name); + uniqueRecords.push(item); + } + } + + return uniqueRecords; +} + /** 根据就诊科室和挂号类型过滤医生列表 */ function filterDoctorsByHealthcare() { // 如果没有医生列表,直接返回