333 门诊医生站开立耗材医嘱时,类型误转为“中成药”且保存报错
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user