333 门诊医生站开立耗材医嘱时,类型误转为“中成药”且保存报错

This commit is contained in:
Ranyunqiao
2026-04-03 16:42:10 +08:00
parent f6b39a4815
commit 8a84b40ee5
4 changed files with 194 additions and 49 deletions

View File

@@ -273,7 +273,10 @@ function fetchFromApi(searchKey) {
minUnitCode_dictText: item.minUnitCode_dictText || item.unitCode_dictText || '',
volume: item.size || item.totalVolume || '',
partPercent: item.partPercent || 1,
inventoryList: [],
// 🔧 Bug Fix: 如果后端提供了inventoryList则使用否则为空数组
inventoryList: item.inventoryList || [],
// 🔧 Bug Fix: 构造stockList用于库存显示
stockList: item.inventoryList || [],
adviceDefinitionId: item.id,
chargeItemDefinitionId: item.id,
positionId: item.locationId,
@@ -354,6 +357,11 @@ function handleQuantity(row) {
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
return totalQuantity.toString() + row.minUnitCode_dictText;
}
// 🔧 Bug Fix: 耗材类型可能没有inventoryList但可能有stockList
if (row.stockList && row.stockList.length > 0) {
const totalQuantity = row.stockList.reduce((sum, item) => sum + (item.quantity || 0), 0);
return totalQuantity.toString() + row.minUnitCode_dictText;
}
return 0;
}