From b7fb7c3746f53b86848459990dbdc45a37ef0ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E8=8F=B2?= <12704587+yvwen@user.noreply.gitee.com> Date: Sun, 30 Mar 2025 14:36:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8F=91=E8=8D=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IWesternMedicineDispenseAppServiceImpl.java | 4 ++-- .../openhis/web/pharmacymanage/dto/EncounterInfoPageDto.java | 3 +++ .../web/pharmacymanage/dto/EncounterInfoSearchParam.java | 2 +- .../web/pharmacymanage/dto/PrescriptionMedicineInfoDto.java | 2 +- .../web/pharmacymanage/dto/PrescriptionPatientInfoDto.java | 2 +- .../mapper/pharmacymanage/WesternMedicineDispenseMapper.xml | 5 +++-- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java index 2ba9374b..1652f1aa 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/IWesternMedicineDispenseAppServiceImpl.java @@ -125,7 +125,7 @@ public class IWesternMedicineDispenseAppServiceImpl implements IWesternMedicineD PrescriptionPatientInfoDto prescriptionPatientInfoDto = westernMedicineDispenseMapper. selectPrescriptionPatientInfo(encounterId); // 年龄 - prescriptionPatientInfoDto.setAge(AgeCalculatorUtil.getAge(prescriptionPatientInfoDto.getBirth_date())); + prescriptionPatientInfoDto.setAge(AgeCalculatorUtil.getAge(prescriptionPatientInfoDto.getBirthDate())); // 性别 prescriptionPatientInfoDto.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, prescriptionPatientInfoDto.getGenderEnum())); @@ -141,7 +141,7 @@ public class IWesternMedicineDispenseAppServiceImpl implements IWesternMedicineD if(!prescriptionMedicineInfoList.isEmpty()) { BigDecimal totalPrice = new BigDecimal(0); for (PrescriptionMedicineInfoDto item : prescriptionMedicineInfoList) { - totalPrice.add(item.getTotal_price()); + totalPrice.add(item.getTotalPrice()); } prescriptionPatientInfoDto.setTotalPrice(totalPrice); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoPageDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoPageDto.java index dc1eeed6..374b4f56 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoPageDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoPageDto.java @@ -5,6 +5,8 @@ package com.openhis.web.pharmacymanage.dto; import java.io.Serializable; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; import lombok.experimental.Accessors; @@ -21,6 +23,7 @@ public class EncounterInfoPageDto implements Serializable { private static final long serialVersionUID = 1L; /** 就诊ID */ + @JsonSerialize(using = ToStringSerializer.class) private Long encounterId; /** 科室 */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoSearchParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoSearchParam.java index d46515c4..76c6b31f 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoSearchParam.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/EncounterInfoSearchParam.java @@ -19,7 +19,7 @@ import lombok.experimental.Accessors; public class EncounterInfoSearchParam implements Serializable { /** 科室 */ - private long departmentId; + private Long departmentId; /** 患者姓名或者证件号 */ private String condition; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionMedicineInfoDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionMedicineInfoDto.java index a694d4b8..a7d59ad3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionMedicineInfoDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionMedicineInfoDto.java @@ -76,5 +76,5 @@ public class PrescriptionMedicineInfoDto implements Serializable { private BigDecimal unitPrice; /** 金额 */ - private BigDecimal total_price; + private BigDecimal totalPrice; } \ No newline at end of file diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionPatientInfoDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionPatientInfoDto.java index 3ee74c4e..a6c83812 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionPatientInfoDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/pharmacymanage/dto/PrescriptionPatientInfoDto.java @@ -30,7 +30,7 @@ public class PrescriptionPatientInfoDto implements Serializable { private String genderEnum_enumText; /** 生日 */ - private Date birth_date; + private Date birthDate; /** 年龄 */ private String age; diff --git a/openhis-server/openhis-application/src/main/resources/mapper/pharmacymanage/WesternMedicineDispenseMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/pharmacymanage/WesternMedicineDispenseMapper.xml index 4dd1a866..001b61c2 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/pharmacymanage/WesternMedicineDispenseMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/pharmacymanage/WesternMedicineDispenseMapper.xml @@ -8,16 +8,17 @@ patient_name, gender_enum, encounter_date, - organization_id, + department_id, id_card, start_time FROM ( SELECT + T1.tenant_id, T1.id AS encounter_id, T1.start_time, TO_CHAR(T1.start_time,'YYYY-MM-DD') AS encounter_date, - T1.organization_id, + T1.organization_id AS department_id, T2.gender_enum, T2.name AS patient_name, T2.id_card, From a8f9643da7a196d16646820175b30257ec8f4a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E8=8F=B2?= <12704587+yvwen@user.noreply.gitee.com> Date: Sun, 30 Mar 2025 14:36:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8F=91=E8=8D=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../westernmedicine/index.vue | 88 +++++++++++++------ 1 file changed, 59 insertions(+), 29 deletions(-) diff --git a/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue b/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue index 5b151109..de0b83a3 100644 --- a/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue +++ b/openhis-ui-vue3/src/views/pharmacymanagement/westernmedicine/index.vue @@ -7,8 +7,8 @@ @keyup.enter="handleQuery" /> - + - + - + @@ -45,28 +45,28 @@
- 姓名: - 性别: - 年龄: - 合同类型: - 证件号: + 姓名:{{ personInfo.patientName }} + 性别:{{ personInfo.genderEnum_enumText }} + 年龄:{{ personInfo.age }} + 合同类型:{{ personInfo.categoryEnum_enumText }} + 证件号:{{ personInfo.idCard }}
- 就诊科室: - 就诊日期: - 门诊诊断:{{ medicineInfoList.a }} + 就诊科室:{{ personInfo.organizationName }} + 就诊日期:{{ personInfo.encounterDate }} + 门诊诊断:{{ personInfo.patientName }}
- 总金额:{{ price ? price.toFixed(2) : '0.00' }}元 + 总金额:{{ totalPrice ? totalPrice.toFixed(2) : '0.00' }}元
- - - + + + @@ -76,7 +76,7 @@ - + @@ -93,7 +93,7 @@ --> - + @@ -137,6 +137,7 @@ const backReason = ref([]); const selectedPrescriptionNo = ref(''); const showDialog = ref(false); const notPerformedReasonEnum = ref(); +const currentRow = ref(null); const { proxy } = getCurrentInstance(); @@ -153,6 +154,14 @@ const data = reactive({ const { queryParams } = toRefs(data); function getList() { + const currentDate = new Date(); + const year = currentDate.getFullYear(); + const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要加 1 + const day = String(currentDate.getDate()).padStart(2, '0'); + const formattedDateTime = `${year}-${month}-${day}`; + queryParams.value.startTimeSTime = formattedDateTime + " 00:00:00"; + queryParams.value.startTimeETime = formattedDateTime + " 23:59:59"; + console.log("222",queryParams.value) listPatient(queryParams.value).then((response) => { console.log("Full response1:", response); @@ -172,14 +181,19 @@ function getList() { /** 搜索按钮操作 */ function handleQuery() { if (dateRange.value) { - queryParams.value.startTimeSTime = dateRange.value[0]; - queryParams.value.startTimeETime = dateRange.value[1]; + queryParams.value.startTimeSTime = dateRange.value[0] + " 00:00:00"; + queryParams.value.startTimeETime = dateRange.value[1] + " 23:59:59"; } else { queryParams.value.startTimeSTime = null; queryParams.value.startTimeETime = null; } queryParams.value.pageNo = 1; - getList(); + console.log("222",queryParams.value) + listPatient(queryParams.value).then((response) => { + console.log("Full response1:", response); + patientList.value = response.data.records; + total.value = response.data.total; + }); } function countGroupRows(data) { @@ -192,6 +206,7 @@ function countGroupRows(data) { groupInfo.count++; groupInfo.indices.push(index); }); + console.log("F*******:", groupCounts); return groupCounts; } @@ -216,6 +231,7 @@ function getRowMarkers(groupCounts, data) { markers[indices[indices.length - 1]] = "┗ "; } }); + console.log("F*******:", markers); return markers; } @@ -229,17 +245,29 @@ function handleSelectionChange(selection) { } } -// 行合并逻辑 function spanMethod({ row, column, rowIndex, columnIndex }) { - if (columnIndex === 6) { // 假设药品名称在第7列(索引为6) - const medicineName = row.genderEnum_enumText; - const count = medicineInfoList.value.filter(item => item.genderEnum_enumText === medicineName).length; - if (rowIndex % count === 0) { - return [count, 1]; + // 定义需要合并的列范围(前6列,包括selection列) + const columnsToMerge = [0, 1, 2, 3, 4, 5]; // 假设selection列是第0列,其他列依次是1, 2, 3, 4, 5 + + // 检查当前列是否在需要合并的列范围内 + if (columnsToMerge.includes(columnIndex)) { + const prescriptionNo = row.prescriptionNo; + + // 查找当前处方号在列表中第一次出现的索引 + const firstRowIndex = medicineInfoList.value.findIndex(item => item.prescriptionNo === prescriptionNo); + + // 如果当前行是该处方号的首行,则合并count行 + if (rowIndex === firstRowIndex) { + // 计算该处方号的总行数 + const count = medicineInfoList.value.filter(item => item.prescriptionNo === prescriptionNo).length; + return [count, 1]; // 合并count行,1列 } else { - return [0, 0]; + return [0, 0]; // 其他行不显示 } } + + // 其他列不进行合并 + return [1, 1]; } function formatPrice(row, column, cellValue) { @@ -253,7 +281,9 @@ function handleCurrentChange(row) { currentRow.value = row; // 更新当前选中行的数据 console.log("当前选中行的数据:", currentRow.value); listWesternmedicine(currentRow.value).then((response) => { - medicineInfoList.value = response.data; + console.log("121212",response) + personInfo.value = response.data.prescriptionPatientInfoDto; + medicineInfoList.value = response.data.prescriptionMedicineInfoDtoList; // 统计每个 groupId 的行数 const groupCounts = countGroupRows(medicineInfoList.value); // 设置每行的标记