From 5e5f2c3d79014a30b32fd74c80ce74295ef22f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91?= <赵云@gentronhealth.com> Date: Sat, 16 May 2026 16:11:29 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#403:=20=E4=BD=8F=E9=99=A2=E5=8C=BB?= =?UTF-8?q?=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99=EF=BC=9A=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E7=BB=84=E5=A5=97=E5=90=8E=EF=BC=8C=E8=8D=AF?= =?UTF-8?q?=E5=93=81=E6=98=8E=E7=BB=86=E5=AD=97=E6=AE=B5=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E6=9C=AA=E6=AD=A3=E7=A1=AE=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:handleSaveGroup 构建 newRow 时,dose、doseQuantity、methodCode、rateCode、dispensePerDuration、unitCode 等关键字段直接从 item 读取, 但 item 中这些字段可能为 null(组套未配置时)。orderGroupDrawer 已通过 mergedDetail 做了 ?? 兜底合并,但 handleSaveGroup 未使用。 修复:将 newRow 构建和价格计算中的字段读取统一改为从 mergedDetail 优先取值(mergedDetail.xxx ?? item.xxx), 确保组套未配置的字段回退到医嘱库默认值。 --- .../home/components/order/index.vue | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue index a2597ef61..6dab13c2c 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -1596,36 +1596,39 @@ function handleSaveGroup(orderGroupList) { patientId: patientInfo.value.patientId, encounterId: patientInfo.value.encounterId, accountId: accountId.value, - quantity: item.quantity, - methodCode: item.methodCode, - rateCode: item.rateCode, - dispensePerDuration: item.dispensePerDuration, - dose: item.dose, - doseQuantity: item.doseQuantity, + // 🔧 修复 Bug #403:从 mergedDetail 读取明细字段,而非直接从 item 取 + // item.dose 等字段可能为 null,mergedDetail 已做 ?? 兜底 + quantity: mergedDetail.quantity ?? item.quantity, + methodCode: mergedDetail.methodCode ?? item.methodCode, + rateCode: mergedDetail.rateCode ?? item.rateCode, + dispensePerDuration: mergedDetail.dispensePerDuration ?? item.dispensePerDuration, + dose: mergedDetail.dose ?? item.dose, + doseQuantity: mergedDetail.doseQuantity ?? item.doseQuantity, executeNum: 1, - unitCode: item.unitCode, - unitCode_dictText: item.unitCodeName || '', + unitCode: mergedDetail.unitCode ?? item.unitCode, + unitCode_dictText: item.unitCodeName || mergedDetail.unitCodeName || '', statusEnum: 1, - orgId: resolveOrgId(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '', - // 🔧 修复:同时保存 orgName,确保树匹配不到时仍有中文名称可显示 - orgName: findOrgName(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || item.orderDetailInfos?.orgName || mergedDetail.orgName || patientInfo.value?.inHospitalOrgName || '', + orgId: resolveOrgId(mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '', + // 🔧 修复:同时存储 orgName,确保树匹配不到时仍有中文名称可显示 + orgName: findOrgName(mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || mergedDetail.orgName || patientInfo.value?.inHospitalOrgName || '', dbOpType: prescriptionList.value[rowIndex.value].requestId ? '2' : '1', conditionId: conditionId.value, conditionDefinitionId: conditionDefinitionId.value, encounterDiagnosisId: encounterDiagnosisId.value, - therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || '1', + therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || mergedDetail.therapyEnum || '1', }; // 计算价格和总量 - const unitInfo = unitCodeList.value.find((k) => k.value == item.unitCode); + const resolvedUnitCode = mergedDetail.unitCode ?? item.unitCode; + const unitInfo = unitCodeList.value.find((k) => k.value == resolvedUnitCode); if (unitInfo && unitInfo.type == 'minUnit') { newRow.price = newRow.minUnitPrice; - newRow.totalPrice = (item.quantity * newRow.minUnitPrice).toFixed(6); - newRow.minUnitQuantity = item.quantity; + newRow.totalPrice = (newRow.quantity * newRow.minUnitPrice).toFixed(6); + newRow.minUnitQuantity = newRow.quantity; } else { newRow.price = newRow.unitPrice; - newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6); - newRow.minUnitQuantity = item.quantity * (item.orderDetailInfos?.partPercent || mergedDetail.partPercent || 1); + newRow.totalPrice = (newRow.quantity * newRow.unitPrice).toFixed(6); + newRow.minUnitQuantity = newRow.quantity * (mergedDetail.partPercent || 1); } newRow.contentJson = JSON.stringify(newRow);