修改BUG
This commit is contained in:
parent
f6b12c03f6
commit
483f87b182
@ -436,17 +436,43 @@ const patientDataCache = ref(new Map())
|
||||
const medicalSnQuery = ref('')
|
||||
|
||||
// 添加本地搜索处理函数
|
||||
const handleLocalSearch = () => {
|
||||
const handleLocalSearch = async () => {
|
||||
if (!searchQuery.value) {
|
||||
filteredPatients.value = patients.value
|
||||
// 如果搜索框为空,恢复原始列表
|
||||
await getPatientList()
|
||||
return
|
||||
}
|
||||
|
||||
const query = searchQuery.value.toLowerCase()
|
||||
filteredPatients.value = patients.value.filter(patient =>
|
||||
(patient.pname && patient.pname.toLowerCase().includes(query)) ||
|
||||
(patient.medicalSn && patient.medicalSn.toLowerCase().includes(query))
|
||||
)
|
||||
try {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '搜索中...',
|
||||
background: 'rgba(255, 255, 255, 0.7)'
|
||||
})
|
||||
|
||||
const params = {
|
||||
pageNo: pageNo.value,
|
||||
pageSize: pageSize.value,
|
||||
// 添加搜索条件,根据姓名或体检编号搜索
|
||||
pname: searchQuery.value,
|
||||
medicalSn: searchQuery.value
|
||||
}
|
||||
|
||||
const res = await PatientApi.getPatientPage(params)
|
||||
|
||||
if (res.list && res.list.length > 0) {
|
||||
patients.value = res.list
|
||||
total.value = res.total
|
||||
} else {
|
||||
patients.value = []
|
||||
total.value = 0
|
||||
}
|
||||
|
||||
loading.close()
|
||||
} catch (error) {
|
||||
console.error('搜索患者失败:', error)
|
||||
ElMessage.error('搜索患者失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 修改获取患者列表数据的函数
|
||||
@ -1144,6 +1170,12 @@ const handleRefresh = async (e) => {
|
||||
urine: { summary: '' },
|
||||
biochemical: { summary: '' }
|
||||
}
|
||||
|
||||
// 清空搜索栏
|
||||
searchQuery.value = ''
|
||||
|
||||
// 重置状态筛选
|
||||
statusFilter.value = '0'
|
||||
|
||||
// 刷新患者列表
|
||||
await getPatientList()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user