搜索条件处理
This commit is contained in:
parent
a03edb3cf7
commit
71be0f11ed
@ -115,5 +115,9 @@ export const PatientApi = {
|
|||||||
//根据体检编号给患者绑定体检项目
|
//根据体检编号给患者绑定体检项目
|
||||||
bindPatientProject: async (medicalSn: string) => {
|
bindPatientProject: async (medicalSn: string) => {
|
||||||
return await request.get({ url: `/inspect/patient/createPatientitem?medicalSn=` + medicalSn })
|
return await request.get({ url: `/inspect/patient/createPatientitem?medicalSn=` + medicalSn })
|
||||||
|
},
|
||||||
|
//根据体检编号&姓名&身份证号获取患者信息
|
||||||
|
getPatientInfoByMedicalSn: async (searchKey: string) => {
|
||||||
|
return await request.get({ url: `/inspect/patient/PatientBySearchKey?searchKey=` + searchKey })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<input
|
<input
|
||||||
v-model="searchQuery"
|
v-model="searchQuery"
|
||||||
placeholder="请输入姓名/体检编号/身份证"
|
placeholder="请输入姓名/体检编号/身份证"
|
||||||
@input="handleLocalSearch"
|
@keydown.enter="handleLocalSearch"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -158,8 +158,9 @@
|
|||||||
<div class="header-cell" style="width: 15%">参考值</div>
|
<div class="header-cell" style="width: 15%">参考值</div>
|
||||||
<div class="header-cell" style="width: 10%">提示</div>
|
<div class="header-cell" style="width: 10%">提示</div>
|
||||||
<div class="header-cell" style="width: 15%">风险</div>
|
<div class="header-cell" style="width: 15%">风险</div>
|
||||||
<div class="header-cell" style="width: 10%">阳性/阴性</div>
|
|
||||||
<div class="header-cell" style="width: 10%">操作</div>
|
<!-- <div class="header-cell" style="width: 10%">阳性/阴性</div>
|
||||||
|
<div class="header-cell" style="width: 10%">操作</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 表格内容 -->
|
<!-- 表格内容 -->
|
||||||
@ -193,7 +194,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="table-cell" style="width: 10%">{{ item.note }}</div>
|
<div class="table-cell" style="width: 10%">{{ item.note }}</div>
|
||||||
<div class="table-cell" style="width: 15%">{{ item.risk }}</div>
|
<div class="table-cell" style="width: 15%">{{ item.risk }}</div>
|
||||||
<div class="table-cell" style="width: 10%">
|
<!-- <div class="table-cell" style="width: 10%">
|
||||||
<el-tag
|
<el-tag
|
||||||
v-if="item.positive === '阳性'"
|
v-if="item.positive === '阳性'"
|
||||||
type="danger"
|
type="danger"
|
||||||
@ -236,7 +237,7 @@
|
|||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -516,18 +517,13 @@ const handleLocalSearch = async () => {
|
|||||||
background: 'rgba(255, 255, 255, 0.7)'
|
background: 'rgba(255, 255, 255, 0.7)'
|
||||||
})
|
})
|
||||||
|
|
||||||
const params = {
|
// 获取搜索结果
|
||||||
pageNo: pageNo.value,
|
const res = await PatientApi.getPatientInfoByMedicalSn(searchQuery.value)
|
||||||
pageSize: pageSize.value,
|
// 根据返回的数据结构调整处理逻辑
|
||||||
// 使用或条件搜索
|
if (res) {
|
||||||
searchKey: searchQuery.value // 使用统一的搜索关键字字段
|
// 检查返回的是单个对象还是列表
|
||||||
}
|
patients.value = res
|
||||||
|
total.value = res.length
|
||||||
const res = await PatientApi.getPatientPage(params)
|
|
||||||
|
|
||||||
if (res.list && res.list.length > 0) {
|
|
||||||
patients.value = res.list
|
|
||||||
total.value = res.total
|
|
||||||
} else {
|
} else {
|
||||||
patients.value = []
|
patients.value = []
|
||||||
total.value = 0
|
total.value = 0
|
||||||
@ -537,6 +533,7 @@ const handleLocalSearch = async () => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('搜索患者失败:', error)
|
console.error('搜索患者失败:', error)
|
||||||
ElMessage.error('搜索患者失败')
|
ElMessage.error('搜索患者失败')
|
||||||
|
loading.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -776,7 +773,6 @@ const handlePatientSelect = async (patient) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[handlePatientSelect] 切换患者失败:', error)
|
console.error('[handlePatientSelect] 切换患者失败:', error)
|
||||||
message.error('切换患者失败')
|
message.error('切换患者失败')
|
||||||
isImageDepartment.value = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -862,39 +858,6 @@ const processConclusion = (item, category, conclusions) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改检查是否为影像科的函数
|
|
||||||
const checkIsImageDepartment = (deptId) => {
|
|
||||||
// 强制返回true用于测试
|
|
||||||
// return true;
|
|
||||||
|
|
||||||
// 如果deptId是对象,尝试获取其id属性
|
|
||||||
const id = typeof deptId === 'object' ? deptId.id || deptId.deptId : deptId
|
|
||||||
|
|
||||||
// 影像科的ID列表 - 根据实际情况调整
|
|
||||||
const imageDeptIds = [
|
|
||||||
'7',
|
|
||||||
'8',
|
|
||||||
'9',
|
|
||||||
'10',
|
|
||||||
'11',
|
|
||||||
'12',
|
|
||||||
'13',
|
|
||||||
'CT室',
|
|
||||||
'DR室',
|
|
||||||
'超声科',
|
|
||||||
'放射科',
|
|
||||||
'影像科',
|
|
||||||
'CT',
|
|
||||||
'MRI',
|
|
||||||
'超声',
|
|
||||||
'放射'
|
|
||||||
]
|
|
||||||
|
|
||||||
// 检查ID是否在列表中
|
|
||||||
const result = imageDeptIds.includes(String(id))
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改获取状态提示的函数
|
// 修改获取状态提示的函数
|
||||||
const getStatusNote = (item) => {
|
const getStatusNote = (item) => {
|
||||||
if (!item.reference || item.reference === 'null-null') {
|
if (!item.reference || item.reference === 'null-null') {
|
||||||
@ -1574,30 +1537,6 @@ const formatReference = (reference) => {
|
|||||||
return `${low}-${high}`
|
return `${low}-${high}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加isImageDepartment的响应式引用
|
|
||||||
const isImageDepartment = ref(false)
|
|
||||||
|
|
||||||
// 添加判断是否为血常规检查的计算属性
|
|
||||||
const isBloodTest = computed(() => {
|
|
||||||
if (!selectedPatient.value) return false
|
|
||||||
|
|
||||||
const currentItems = Object.values(examItems.value)
|
|
||||||
.flat()
|
|
||||||
.filter((item) => {
|
|
||||||
const itemName = (item.name || '').toLowerCase()
|
|
||||||
return (
|
|
||||||
itemName.includes('血常规') ||
|
|
||||||
itemName.includes('血细胞') ||
|
|
||||||
itemName.includes('血红蛋白') ||
|
|
||||||
itemName.includes('白细胞') ||
|
|
||||||
itemName.includes('红细胞') ||
|
|
||||||
itemName.includes('血小板')
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
return currentItems.length > 0
|
|
||||||
})
|
|
||||||
|
|
||||||
// 添加日期格式化函数
|
// 添加日期格式化函数
|
||||||
const formatDate = (date) => {
|
const formatDate = (date) => {
|
||||||
if (!date) return ''
|
if (!date) return ''
|
||||||
@ -2009,22 +1948,11 @@ const statusFilter = ref('0') // 默认选择待检查
|
|||||||
const filteredPatients = computed(() => {
|
const filteredPatients = computed(() => {
|
||||||
let result = patients.value
|
let result = patients.value
|
||||||
|
|
||||||
// 先按状态筛选
|
// 只按状态筛选,移除搜索词本地筛选逻辑
|
||||||
if (statusFilter.value !== '') {
|
if (statusFilter.value !== '') {
|
||||||
result = result.filter((patient) => String(patient.status) === statusFilter.value)
|
result = result.filter((patient) => String(patient.status) === statusFilter.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 再按搜索词筛选
|
|
||||||
if (searchQuery.value) {
|
|
||||||
const query = searchQuery.value.toLowerCase()
|
|
||||||
result = result.filter(
|
|
||||||
(patient) =>
|
|
||||||
(patient.pname && patient.pname.toLowerCase().includes(query)) ||
|
|
||||||
(patient.medicalSn && patient.medicalSn.toLowerCase().includes(query)) ||
|
|
||||||
(patient.cardId && patient.cardId.toLowerCase().includes(query))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user