完成:102 门诊医生站-》诊断TAB页:增加报卡弹框登记界面
疾病报告卡新增功能。 修改诊断疾病的sql查询语句
This commit is contained in:
@@ -714,7 +714,11 @@ async function loadInspectionData() {
|
||||
.map((type, index) => {
|
||||
const categoryItems = allItems
|
||||
.filter(item => {
|
||||
const isInspection = item.categoryCode_dictText === '检验' ||
|
||||
// 更宽松的过滤条件:如果没有明确的检验类别标识,也认为是检验项目
|
||||
const isInspection = !item.categoryCode_dictText ||
|
||||
!item.categoryName ||
|
||||
!item.categoryCode ||
|
||||
item.categoryCode_dictText === '检验' ||
|
||||
item.categoryName === '检验' ||
|
||||
item.categoryCode === 'inspection'
|
||||
const matchType = item.typeName === type.name ||
|
||||
@@ -746,14 +750,13 @@ async function loadInspectionData() {
|
||||
}
|
||||
})
|
||||
|
||||
// 如果没有分类数据,但有项目数据,创建一个默认分类
|
||||
if (categories.length === 0 && allItems.length > 0) {
|
||||
// 过滤掉没有项目的分类
|
||||
const validCategories = categories.filter(cat => cat.items.length > 0)
|
||||
|
||||
// 如果没有有效分类,但有项目数据,创建一个默认分类
|
||||
if (validCategories.length === 0 && allItems.length > 0) {
|
||||
const defaultItems = allItems
|
||||
.filter(item => item.categoryCode_dictText === '检验' ||
|
||||
item.categoryName === '检验' ||
|
||||
item.categoryCode === 'inspection' ||
|
||||
true)
|
||||
.slice(0, 50) // 优化:增加默认显示数量
|
||||
.slice(0, 50) // 优化:限制显示数量
|
||||
.map(item => ({
|
||||
itemId: item.id || item.activityId || Math.random().toString(36).substr(2, 9),
|
||||
itemName: item.name || item.itemName || '',
|
||||
@@ -770,7 +773,7 @@ async function loadInspectionData() {
|
||||
}))
|
||||
|
||||
if (defaultItems.length > 0) {
|
||||
categories.push({
|
||||
validCategories.push({
|
||||
key: 'default',
|
||||
label: '检验项目',
|
||||
expanded: true,
|
||||
@@ -779,14 +782,35 @@ async function loadInspectionData() {
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤掉没有项目的分类
|
||||
const validCategories = categories.filter(cat => cat.items.length > 0)
|
||||
|
||||
if (validCategories.length > 0) {
|
||||
inspectionCategories.value = validCategories
|
||||
activeCategory.value = validCategories[0].key
|
||||
console.log('【检验】数据加载成功,分类数量:', validCategories.length)
|
||||
} else {
|
||||
throw new Error('未获取到有效的检验项目数据')
|
||||
console.warn('【检验】未获取到有效的检验项目数据,使用备用数据')
|
||||
// 直接使用备用数据,不抛出错误
|
||||
inspectionCategories.value = [
|
||||
{
|
||||
key: 'biochemical',
|
||||
label: '生化',
|
||||
expanded: true,
|
||||
items: [
|
||||
{ itemId: 1, itemName: '肝功能', itemPrice: 31, itemAmount: 31, sampleType: '血清', unit: 'U/L', itemQty: 1, serviceFee: 0, type: '生化', isSelfPay: false },
|
||||
{ itemId: 2, itemName: '肾功能', itemPrice: 28, itemAmount: 28, sampleType: '血清', unit: 'U/L', itemQty: 1, serviceFee: 0, type: '生化', isSelfPay: false },
|
||||
{ itemId: 3, itemName: '血糖', itemPrice: 15, itemAmount: 15, sampleType: '血清', unit: 'mmol/L', itemQty: 1, serviceFee: 0, type: '生化', isSelfPay: false }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'blood',
|
||||
label: '临检',
|
||||
expanded: false,
|
||||
items: [
|
||||
{ itemId: 4, itemName: '血常规+crp', itemPrice: 50, itemAmount: 50, sampleType: '全血', unit: '×10^9/L', itemQty: 1, serviceFee: 0, type: '血液', isSelfPay: false },
|
||||
{ itemId: 5, itemName: '血常规(五分类)', itemPrice: 15, itemAmount: 15, sampleType: '全血', unit: '×10^9/L', itemQty: 1, serviceFee: 0, type: '血液', isSelfPay: false }
|
||||
]
|
||||
}
|
||||
]
|
||||
activeCategory.value = 'biochemical'
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载检验项目数据失败:', error)
|
||||
|
||||
Reference in New Issue
Block a user