diff --git a/src/api/inspect/inspectpatient/index.ts b/src/api/inspect/inspectpatient/index.ts index b21a68b..1732fef 100644 --- a/src/api/inspect/inspectpatient/index.ts +++ b/src/api/inspect/inspectpatient/index.ts @@ -115,5 +115,9 @@ export const PatientApi = { //根据体检编号给患者绑定体检项目 bindPatientProject: async (medicalSn: string) => { return await request.get({ url: `/inspect/patient/createPatientitem?medicalSn=` + medicalSn }) + }, + //根据体检编号&姓名&身份证号获取患者信息 + getPatientInfoByMedicalSn: async (searchKey: string) => { + return await request.get({ url: `/inspect/patient/PatientBySearchKey?searchKey=` + searchKey }) } } diff --git a/src/views/Department-entry/Medical-examination-vehicle.vue b/src/views/Department-entry/Medical-examination-vehicle.vue index 813bfcc..73ab353 100644 --- a/src/views/Department-entry/Medical-examination-vehicle.vue +++ b/src/views/Department-entry/Medical-examination-vehicle.vue @@ -41,7 +41,7 @@ @@ -158,8 +158,9 @@
参考值
提示
风险
-
阳性/阴性
-
操作
+ + @@ -193,7 +194,7 @@
{{ item.note }}
{{ item.risk }}
-
+
@@ -516,18 +517,13 @@ const handleLocalSearch = async () => { background: 'rgba(255, 255, 255, 0.7)' }) - const params = { - pageNo: pageNo.value, - pageSize: pageSize.value, - // 使用或条件搜索 - searchKey: searchQuery.value // 使用统一的搜索关键字字段 - } - - const res = await PatientApi.getPatientPage(params) - - if (res.list && res.list.length > 0) { - patients.value = res.list - total.value = res.total + // 获取搜索结果 + const res = await PatientApi.getPatientInfoByMedicalSn(searchQuery.value) + // 根据返回的数据结构调整处理逻辑 + if (res) { + // 检查返回的是单个对象还是列表 + patients.value = res + total.value = res.length } else { patients.value = [] total.value = 0 @@ -537,6 +533,7 @@ const handleLocalSearch = async () => { } catch (error) { console.error('搜索患者失败:', error) ElMessage.error('搜索患者失败') + loading.close() } } @@ -776,7 +773,6 @@ const handlePatientSelect = async (patient) => { } catch (error) { console.error('[handlePatientSelect] 切换患者失败:', 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) => { if (!item.reference || item.reference === 'null-null') { @@ -1574,30 +1537,6 @@ const formatReference = (reference) => { 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) => { if (!date) return '' @@ -2009,22 +1948,11 @@ const statusFilter = ref('0') // 默认选择待检查 const filteredPatients = computed(() => { let result = patients.value - // 先按状态筛选 + // 只按状态筛选,移除搜索词本地筛选逻辑 if (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 })