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);