搜索条件处理

This commit is contained in:
Euni4U 2025-03-24 16:55:19 +08:00
parent a03edb3cf7
commit 71be0f11ed
2 changed files with 19 additions and 87 deletions

View File

@ -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 })
} }
} }

View File

@ -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;
// deptIdid
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
}) })