fix(doctorstation): 修复耗材无库存时价格设置问题
- 前端组件中确保覆盖后端可能冲突的字段并强制设置耗材类型 - 后端服务中修复库存为空时无法获取价格的问题,直接从定价主表获取统一零售价 - 数据库查询中使用COALESCE函数优先从多个来源获取零售价,提高价格获取准确性 - 优化价格获取逻辑,支持从adm_charge_item_definition和adm_charge_item_def_detail表中按优先级获取价格 - 添加按批次售价的价格匹配机制,确保不同定价策略的正确应用
This commit is contained in:
@@ -293,7 +293,23 @@ function fetchFromApi(searchKey) {
|
||||
categoryCode: item.categoryCode || '',
|
||||
deviceId: item.id,
|
||||
deviceName: item.name,
|
||||
// 🔧 Bug Fix: ...item 展开放在前面,然后用前端字段覆盖
|
||||
...item,
|
||||
// 确保前端覆盖后端可能冲突的字段
|
||||
adviceName: item.name || item.busNo,
|
||||
adviceType: 4, // 强制设置为前端耗材类型
|
||||
unitCode: item.unitCode || '',
|
||||
unitCode_dictText: item.unitCode_dictText || '',
|
||||
minUnitCode: item.minUnitCode || item.unitCode || '',
|
||||
minUnitCode_dictText: item.minUnitCode_dictText || item.unitCode_dictText || '',
|
||||
volume: item.size || item.totalVolume || '',
|
||||
partPercent: item.partPercent || 1,
|
||||
// 价格字段优先使用retailPrice
|
||||
priceList: (item.retailPrice !== undefined && item.retailPrice !== null)
|
||||
? [{ price: item.retailPrice }]
|
||||
: ((item.price !== undefined && item.price !== null)
|
||||
? [{ price: item.price }]
|
||||
: []),
|
||||
};
|
||||
});
|
||||
nextTick(() => {
|
||||
|
||||
Reference in New Issue
Block a user