From f2d36b49b2511579648b97c6c882f9e87d5a3725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Sat, 9 May 2026 18:48:18 +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=EF=BC=9A=E9=80=89=E6=8B=A9=E9=A2=86=E7=94=A8=E8=8D=AF?= =?UTF-8?q?=E5=93=81=E5=90=8E"=E6=80=BB=E5=BA=93=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E9=87=8F"=E5=88=97=E6=95=B0=E6=8D=AE=E6=9C=AA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因分析:handleLocationClick 中使用 row.itemId 作为 getCount 查询参数, 但 row 来自药品选择弹窗的 rowValue 对象,该对象携带 definitionId 而非 itemId。 selectRow 中已将 definitionId 正确设置到 form.purchaseinventoryList[index].itemId, 但 handleLocationClick 未使用该值,导致 getItemId 为 undefined,后端查询无数据返回。 修复:1. 将 itemId 改为从 form.purchaseinventoryList[index].itemId 获取 2. 为 getCount 添加 .catch() 降级处理,API 失败时 totalQuantity 置 0 避免空白 Co-Authored-By: Claude Opus 4.7 --- .../requisitionManagement/requisitionManagement/index.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 f46e0be7..e3bd57df 100755 --- a/openhis-ui-vue3/src/views/medicationmanagement/requisitionManagement/requisitionManagement/index.vue +++ b/openhis-ui-vue3/src/views/medicationmanagement/requisitionManagement/requisitionManagement/index.vue @@ -1007,7 +1007,7 @@ function selectRow(rowValue, index) { // 选择仓库 function handleLocationClick(item, row, index) { getCount({ - itemId: row.itemId, + itemId: form.purchaseinventoryList[index].itemId, orgLocationId: form.purchaseinventoryList[index].sourceLocationId, // objLocationId:purposeLocationId, lotNumber: form.purchaseinventoryList[index].lotNumber, @@ -1068,6 +1068,9 @@ function handleLocationClick(item, row, index) { proxy.$message.warning('仓库数量为0,无法调用!'); // } } + }).catch(() => { + form.purchaseinventoryList[index].totalQuantity = 0; + form.purchaseinventoryList[index].price = 0; }); store.setCurrentDataLYCK({ purchaseinventoryList: form.purchaseinventoryList,