From 9116ea4a84c1aa00d64e9b625c6c2353e52e7891 Mon Sep 17 00:00:00 2001 From: chenqi Date: Mon, 2 Mar 2026 23:27:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E5=92=8C=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在医生工作站退费功能中添加患者选择验证 - 统一药品管理中的仓库类型选择逻辑,移除重复代码 - 修复统计管理页面清空按钮的数据重置问题 - 修正西药管理页面处方打印按钮的功能绑定 - 完善库存报表查询的SQL过滤条件实现 - 更新多个控制器接口参数类型以支持业务流程 - 优化退费列表对话框的数据加载和错误处理 --- .../impl/ProductDetailAppServiceImpl.java | 12 +-- .../impl/PaymentRecServiceImpl.java | 28 ++++++- ...endingMedicationDetailsAppServiceImpl.java | 5 +- .../PendingMedicationDetailsMapper.java | 10 ++- .../PendingMedicationDetailsMapper.xml | 78 +++++++++---------- openhis-ui-vue3/src/utils/request.js | 33 ++++++-- .../components/diagnosis/diagnosis.vue | 4 +- .../prescription/prescriptionlist.vue | 77 +++++++++++++++++- .../components/surgery/surgeryApplication.vue | 14 ++-- .../src/views/doctorstation/index.vue | 13 +++- .../chkstock/chkstockBatch/index.vue | 4 +- .../chkstock/chkstockPart/index.vue | 68 ++++++++-------- .../lossReportingManagement/lossReporting.js | 8 ++ .../lossReporting/index.vue | 59 ++++++++++++-- .../purchaseDocument/components/api.js | 4 +- .../requisitionManagement/components/api.js | 8 +- .../statisticalManagement/index.vue | 7 +- .../components/orderTable.vue | 63 ++++++++++++--- .../requisitionOrder/index.vue | 3 +- .../components/orderTable.vue | 63 ++++++++++++--- .../returnToDispensaryOrder/index.vue | 3 +- .../westernmedicine/index.vue | 38 +++++++-- 22 files changed, 447 insertions(+), 155 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java index 8444356f..1390a86f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inventorymanage/appservice/impl/ProductDetailAppServiceImpl.java @@ -108,9 +108,9 @@ public class ProductDetailAppServiceImpl extends ServiceImpl accountIdList = chargeItemList.stream().map(ChargeItem::getAccountId).collect(Collectors.toList()); + // 获取所有的账户id(过滤掉null值,防止groupingBy时空指针异常) + List accountIdList = chargeItemList.stream() + .map(ChargeItem::getAccountId) + .filter(Objects::nonNull) + .collect(Collectors.toList()); // account去重 List distinctAccountIdList = accountIdList.stream().distinct().collect(Collectors.toList()); + // 检查是否存在accountId为null的收费项 + long nullAccountIdCount = chargeItemList.stream() + .map(ChargeItem::getAccountId) + .filter(Objects::isNull) + .count(); + if (nullAccountIdCount > 0) { + throw new ServiceException("部分收费项缺少账户信息,请检查收费项数据"); + } + if (distinctAccountIdList.isEmpty()) { + throw new ServiceException("未找到有效的账户信息"); + } List accountList = iAccountService.list(new LambdaQueryWrapper() .in(Account::getId, distinctAccountIdList).eq(Account::getEncounterId, prePaymentDto.getEncounterId())); if (accountList.size() != distinctAccountIdList.size()) { @@ -503,9 +517,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService { // } // } - // 收费详情按照收费批次进行分组 + // 收费详情按照收费批次进行分组(过滤掉payTransNo为null的记录) Map> payTransNoMap - = paymentRecDetails.stream().collect(Collectors.groupingBy(PaymentRecDetail::getPayTransNo)); + = paymentRecDetails.stream() + .filter(detail -> detail.getPayTransNo() != null) + .collect(Collectors.groupingBy(PaymentRecDetail::getPayTransNo)); + + if (payTransNoMap.isEmpty()) { + throw new ServiceException("收费详情缺少批次号信息"); + } com.openhis.financial.model.PaymentResult paymentResult; List paymentResultList = new ArrayList<>(); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java index f3584448..2e703a4a 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/appservice/impl/PendingMedicationDetailsAppServiceImpl.java @@ -48,10 +48,11 @@ public class PendingMedicationDetailsAppServiceImpl implements IPendingMedicatio QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( pendingMedicationSearchParam, searchKey, new HashSet<>(Arrays.asList("medicine_name", "medicine_no", "py_str")), request); - // 查询待发药明细列表 + // 查询待发药明细列表(包含待配药、待发药、已配药三种状态,与门诊发药界面一致) Page pendingMedicationPage = pendingMedicationDetailsMapper .selectPendingMedicationDetailsPage(new Page<>(pageNo, pageSize), queryWrapper, - DispenseStatus.IN_PROGRESS.getValue(), EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue()); + DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.PREPARATION.getValue(), + DispenseStatus.PREPARED.getValue(), EncounterClass.AMB.getValue(), EncounterClass.IMP.getValue()); pendingMedicationPage.getRecords().forEach(e -> { // 发药类型 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java index 469ca84f..6ff972bf 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/pharmacymanage/mapper/PendingMedicationDetailsMapper.java @@ -20,11 +20,19 @@ public interface PendingMedicationDetailsMapper { * @param page 分页 * @param queryWrapper 查询条件 * @param inProgress 发药类型:待发药 + * @param preparation 发药类型:待配药 + * @param prepared 发药类型:已配药 + * @param amb 门诊类型 + * @param imp 住院类型 * @return 待发药明细 */ Page selectPendingMedicationDetailsPage( @Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, - @Param("inProgress") Integer inProgress, @Param("amb") Integer amb, @Param("imp") Integer imp); + @Param("inProgress") Integer inProgress, + @Param("preparation") Integer preparation, + @Param("prepared") Integer prepared, + @Param("amb") Integer amb, + @Param("imp") Integer imp); } diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml index 3d261cde..a8b01b22 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/pharmacymanage/PendingMedicationDetailsMapper.xml @@ -1,7 +1,7 @@ - diff --git a/openhis-ui-vue3/src/utils/request.js b/openhis-ui-vue3/src/utils/request.js index a3a3aa18..ebf30473 100644 --- a/openhis-ui-vue3/src/utils/request.js +++ b/openhis-ui-vue3/src/utils/request.js @@ -107,15 +107,32 @@ service.interceptors.request.use(config => { if (code === 401) { if (!isRelogin.show) { isRelogin.show = true; - ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { - isRelogin.show = false; + // 判断是否在登录页面 + const isLoginPage = window.location.pathname === '/login' || window.location.pathname === '/'; + + if (isLoginPage) { + // 登录页面直接清理token,不弹窗 useUserStore().logOut().then(() => { - location.href = '/index'; - }) - }).catch(() => { - isRelogin.show = false; - }); - } + isRelogin.show = false; + }).catch(() => { + isRelogin.show = false; + }); + return Promise.reject('登录已过期,请重新登录。') + } + + // 其他页面:显示提示后自动跳转 + ElMessage.warning('登录已过期,正在跳转到登录页面...'); + useUserStore().logOut().then(() => { + isRelogin.show = false; + // 跳转到登录页,保留当前路径作为redirect参数 + const currentPath = window.location.pathname; + const redirectUrl = currentPath !== '/login' ? `/login?redirect=${encodeURIComponent(currentPath)}` : '/login'; + location.href = redirectUrl; + }).catch(() => { + isRelogin.show = false; + location.href = '/login'; + }); + } return Promise.reject('无效的会话,或者会话已过期,请重新登录。') } else if (code === 500) { // 检查是否需要跳过错误提示 diff --git a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue index 263fdca3..bb1fe405 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue @@ -714,11 +714,11 @@ function handleNodeClick(data) { ? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0)) : 0; - form.value.diagnosisList.push({ +form.value.diagnosisList.push({ ybNo: data.ybNo, name: data.name, verificationStatusEnum: 4, - medTypeCode: '11', + medTypeCode: '初诊诊断', diagSrtNo: maxSortNo + 1, definitionId: data.definitionId, classification: '西医', // 默认为西医 diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index 68ca515d..f23aad91 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -230,6 +230,67 @@ + +