From 25c266babba013c1025a9f19bcb5cc775bc294b7 Mon Sep 17 00:00:00 2001 From: chenqi Date: Mon, 2 Mar 2026 14:14:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(report):=20=E4=BF=AE=E5=A4=8D=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E6=8A=A5=E8=A1=A8=E6=9F=A5=E8=AF=A2SQL=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E9=97=AE=E9=A2=98=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=A4=84=E6=96=B9=E7=BB=84=E5=A5=97=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复InventoryProductReportMapper.xml中SQL查询的缩进格式问题 - 在prescriptionlist.vue中添加组套数据验证防止空值异常 - 优化组套处理逻辑确保医嘱详情数据正确获取 - 修复最小单位数量计算避免partPercent为空时的错误 --- .../InventoryProductReportMapper.xml | 250 +++++++++--------- .../prescription/prescriptionlist.vue | 26 +- 2 files changed, 149 insertions(+), 127 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/InventoryProductReportMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/InventoryProductReportMapper.xml index 492d07d0..8a8a9041 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/InventoryProductReportMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/reportmanage/InventoryProductReportMapper.xml @@ -4,130 +4,130 @@ 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 944981bd..68ca515d 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -2453,9 +2453,31 @@ function setValue(row) { // 选择组套 function handleSaveGroup(orderGroupList) { + if (!orderGroupList || !Array.isArray(orderGroupList) || orderGroupList.length === 0) { + proxy.$modal.msgWarning('组套数据为空'); + return; + } + orderGroupList.forEach((item) => { rowIndex.value = prescriptionList.value.length; - setValue(item.orderDetailInfos); + + // 确保 item 有值 + if (!item) { + console.warn('组套中的项目为空'); + return; + } + + // 获取实际的医嘱项目数据 + // 如果 item 包含 orderDetailInfos,则使用它;否则直接使用 item + const orderDetail = item.orderDetailInfos || item; + + if (!orderDetail) { + console.warn('组套中的项目详情为空'); + return; + } + + // 使用医嘱项目详情设置值 + setValue(orderDetail); // 创建新的处方项目 const newRow = { @@ -2490,7 +2512,7 @@ function handleSaveGroup(orderGroupList) { } else { newRow.price = newRow.unitPrice; newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6); - newRow.minUnitQuantity = item.quantity * item.orderDetailInfos.partPercent; + newRow.minUnitQuantity = item.quantity * (orderDetail.partPercent || 1); } newRow.contentJson = JSON.stringify(newRow);