Fix Bug #439: 领用出库:选择领用药品后"总库存数量"列数据未显示

根因分析: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 <noreply@anthropic.com>
This commit is contained in:
关羽
2026-05-09 18:48:18 +08:00
parent 2c66e3b37a
commit f2d36b49b2

View File

@@ -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,