333 门诊医生站开立耗材医嘱时,类型误转为“中成药”且保存报错
341 门诊挂号报错
This commit is contained in:
@@ -257,15 +257,16 @@ function fetchFromApi(searchKey) {
|
||||
searchKey: searchKey || '',
|
||||
statusEnum: 2,
|
||||
}).then((res) => {
|
||||
console.log('[Debug] 耗材列表返回数据:', res.data);
|
||||
console.log('[BugFix] 耗材列表返回数据:', res.data);
|
||||
if (res.data && res.data.records) {
|
||||
adviceBaseList.value = res.data.records.map((item) => {
|
||||
console.log('[Debug] 耗材项:', item.name, 'price:', item.price, 'retailPrice:', item.retailPrice);
|
||||
return {
|
||||
console.log('[BugFix] 耗材项:', item.name, 'price:', item.price, 'retailPrice:', item.retailPrice);
|
||||
const mappedItem = {
|
||||
...item,
|
||||
// 🔧 Bug Fix: 强制覆盖后端返回的字段,确保数据正确
|
||||
adviceName: item.name || item.busNo,
|
||||
adviceType: 4, // 强制设置为前端耗材类型
|
||||
adviceType_dictText: '耗材', // 🔧 Bug Fix: 设置医嘱类型显示文本
|
||||
adviceTableName: 'adm_device_definition',
|
||||
unitCode: item.unitCode || '',
|
||||
unitCode_dictText: item.unitCode_dictText || '',
|
||||
@@ -293,12 +294,14 @@ function fetchFromApi(searchKey) {
|
||||
deviceName: item.name,
|
||||
// 🔧 Bug #220 修复:正确处理耗材价格,支持price或retailPrice字段
|
||||
// 价格字段优先使用retailPrice
|
||||
priceList: (item.retailPrice !== undefined && item.retailPrice !== null)
|
||||
? [{ price: item.retailPrice }]
|
||||
: ((item.price !== undefined && item.price !== null)
|
||||
? [{ price: item.price }]
|
||||
priceList: (item.retailPrice !== undefined && item.retailPrice !== null)
|
||||
? [{ price: item.retailPrice }]
|
||||
: ((item.price !== undefined && item.price !== null)
|
||||
? [{ price: item.price }]
|
||||
: []),
|
||||
};
|
||||
console.log('[BugFix] 映射后的耗材项:', mappedItem.adviceName, 'adviceType:', mappedItem.adviceType, 'adviceType_dictText:', mappedItem.adviceType_dictText);
|
||||
return mappedItem;
|
||||
});
|
||||
nextTick(() => {
|
||||
currentIndex.value = 0;
|
||||
|
||||
Reference in New Issue
Block a user