From f3855c9d30fff79a333e578c80052ea1d574c563 Mon Sep 17 00:00:00 2001 From: guanyu Date: Sun, 17 May 2026 18:10:36 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#439:=20=E9=A2=86=E7=94=A8=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E9=80=89=E6=8B=A9=E9=A2=86=E7=94=A8=E8=8D=AF=E5=93=81?= =?UTF-8?q?=E5=90=8E"=E6=80=BB=E5=BA=93=E5=AD=98=E6=95=B0=E9=87=8F"?= =?UTF-8?q?=E5=88=97=E6=95=B0=E6=8D=AE=E6=9C=AA=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:handleLocationClick 中 pickBestOrgQuantityRow 返回的 d 有数据但 orgQuantity <= 0 时, applyFromDto 不被调用,导致 totalQuantity 保持空字符串 '',界面显示为空白。 修复:将条件从 "d && Number(d.orgQuantity ?? 0) > 0" 改为 "d", 确保只要后端返回库存记录就调用 applyFromDto 填充 totalQuantity(无论数量是否为 0)。 同时在批号回退分支(lotTrimmed 路径)中做同样处理。 Co-Authored-By: Claude Opus 4.7 --- .../requisitionManagement/index.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/openhis-ui-vue3/src/views/medicationmanagement/requisitionManagement/requisitionManagement/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/requisitionManagement/requisitionManagement/index.vue index f9bacdf61..1d56b6da6 100755 --- a/openhis-ui-vue3/src/views/medicationmanagement/requisitionManagement/requisitionManagement/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/requisitionManagement/requisitionManagement/index.vue @@ -1131,8 +1131,7 @@ function handleLocationClick(item, row, index) { .then((res) => { const list = res.data || []; const d = pickBestOrgQuantityRow(list); - const strictOk = d && Number(d.orgQuantity ?? 0) > 0; - if (strictOk) { + if (d) { applyFromDto(d, false); if (Number(r.totalQuantity) <= 0) { proxy.$message.warning('仓库数量为0,无法调用!'); @@ -1144,11 +1143,15 @@ function handleLocationClick(item, row, index) { return runGet(false).then((res2) => { const list2 = res2.data || []; const d2 = pickBestOrgQuantityRow(list2); - if (d2 && Number(d2.orgQuantity ?? 0) > 0) { + if (d2) { applyFromDto(d2, true); - proxy.$message.info( - '所选批号在本仓库无对应库存或批号不一致,已按仓库实物回显批号与可领数量,请核对。' - ); + if (Number(r.totalQuantity) <= 0) { + proxy.$message.warning('仓库数量为0,无法调用!'); + } else { + proxy.$message.info( + '所选批号在本仓库无对应库存或批号不一致,已按仓库实物回显批号与可领数量,请核对。' + ); + } } else { r.totalQuantity = 0; r.price = 0;