From ba1b35d37f5c2066fbc4a8dee85e1df3ffb813ba Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Wed, 12 Mar 2025 17:51:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inspect/inspectpatient/index.ts | 6 + src/views/Department-entry/All.vue | 13 +- .../Medical-examination-vehicle.vue | 593 ++++++++---------- .../Inspection-checklist.vue | 247 ++++++++ 4 files changed, 532 insertions(+), 327 deletions(-) create mode 100644 src/views/Inspection-checklist/Inspection-checklist.vue diff --git a/src/api/inspect/inspectpatient/index.ts b/src/api/inspect/inspectpatient/index.ts index d383042..223397f 100644 --- a/src/api/inspect/inspectpatient/index.ts +++ b/src/api/inspect/inspectpatient/index.ts @@ -25,6 +25,7 @@ export interface PatientVO { auditorTime: Date // 审核时间 chargetime: Date // 收费时间 headimage: string // 个人信息图片 + domicileaddress: string // 住址 } // 患者信息 API @@ -58,4 +59,9 @@ export const PatientApi = { exportPatient: async (params) => { return await request.download({ url: `/inspect/patient/export-excel`, params }) }, + + // 导入患者信息 + uploadExcel: async (data: FormData) => { + return await request.upload({ url: `/inspect/patient/uploadExcel`, data }) + } } diff --git a/src/views/Department-entry/All.vue b/src/views/Department-entry/All.vue index 345bf4a..b655c88 100644 --- a/src/views/Department-entry/All.vue +++ b/src/views/Department-entry/All.vue @@ -129,7 +129,8 @@ const getImageUrls = async () => { 'ultrasound': ['ultrasound', 'us', '超声', '彩超', 'b超', 'doppler'], 'ecg': ['ecg', 'ekg', '心电图', 'electrocardiogram'], 'blood': ['blood', 'cbc', '血常规', '血液', 'bloodtest'], - 'urine': ['urine', 'ua', '尿常规', '尿液', 'urinalysis','RT','rt'] + 'urine': ['urine', 'ua', '尿常规', '尿液', 'urinalysis','RT','rt'], + 'biochemical': ['biochemical', 'biochemistry', '生化', '化验','生化检查','生化检验','bt','BT'] } const patterns = typePatterns[props.examType] @@ -162,9 +163,6 @@ const getImageUrls = async () => { type: isPDF ? 'pdf' : 'image' } }).filter(item => item) - - console.log('处理后的媒体文件:', mediaFiles.value) // 添加调试日志 - // 只收集图片URL用于预览 imageUrls.value = mediaFiles.value .filter(file => file.type === 'image') @@ -361,9 +359,6 @@ const loadPatientData = async (patient) => { if (patientItemsResponse?.list && patientItemsResponse.list.length > 0) { // 选择第一个检查项目作为当前项目 currentItem.value = patientItemsResponse.list[0] - - console.log('找到的当前检查项目:', currentItem.value) - // 如果找到了检查项目,加载其检查所见和结果 if (currentItem.value) { imageFinding.value = currentItem.value.examDescription || '' @@ -407,7 +402,6 @@ watch( () => props.examType, async (newType) => { if (newType && reportData.value.medicalSn) { - console.log('检查类型变更为:', newType) imageUrls.value = await getImageUrls() } }, @@ -428,7 +422,8 @@ const getExamTypeTitle = () => { ultrasound: '超声', ecg: '心电图', blood: '血常规', - urine: '尿常规' + urine: '尿常规', + biochemical: '生化' } return typeMap[props.examType] || '检查' } diff --git a/src/views/Department-entry/Medical-examination-vehicle.vue b/src/views/Department-entry/Medical-examination-vehicle.vue index 699fbec..228ab33 100644 --- a/src/views/Department-entry/Medical-examination-vehicle.vue +++ b/src/views/Department-entry/Medical-examination-vehicle.vue @@ -6,52 +6,34 @@
患者列表 - - 刷新 - +
+ + 同步 + + + 刷新 + +
- -
-
- -
- - -
-
- -
- 搜索 -
+ +
+ + 待检查 + 已检查 + 全部 +
@@ -331,9 +313,7 @@ import { PatientApi } from '@/api/inspect/inspectpatient' import { PatientitemsApi } from '@/api/inspect/inspectpatientitems' import { getUserProfile } from '@/api/system/user/profile' import ExamImages from './Exam_images.vue' -import CT from './CT.vue' // 导入CT组件 -import { ArrowDown, Refresh } from '@element-plus/icons-vue' -import BloodTest from './blood.vue' // 导入血常规组件 +import { ArrowDown, Refresh, RefreshRight } from '@element-plus/icons-vue' import All from './All.vue' // 导入All组件用于超声、心电图等 const dialogTitle = ref('体检报告') @@ -390,7 +370,8 @@ const examTabs = ref([ { id: 'ultrasound', name: '超声', color: '#0099CC' }, { id: 'ecg', name: '心电图', color: '#00CCFF' }, { id: 'blood', name: '血常规', color: '#66CCFF' }, - { id: 'urine', name: '尿常规', color: '#99CCFF' } + { id: 'urine', name: '尿常规', color: '#99CCFF' }, + { id: 'biochemical', name: '生化', color: '#0099CC' } ]) const currentTab = ref('general') @@ -420,10 +401,33 @@ return [...currentExamItems.value].sort((a, b) => { }); }); -// 修改切换标签页函数,添加小结切换逻辑 +// 修改切换标签页函数,添加数据清理逻辑 const switchTab = (tabId) => { - currentTab.value = tabId - // 不再需要单独设置 activeConclusion + // 保存当前标签页的数据 + if (currentTab.value && examItems.value) { + // 存储当前标签页的数据到缓存 + const currentItems = sortedExamItems.value || []; + + // 如果切换到新标签页,检查是否有数据 + if (tabId !== currentTab.value) { + // 设置新的当前标签 + currentTab.value = tabId; + + // 如果新标签页没有数据,显示空状态 + if (!examItems.value[tabId] || examItems.value[tabId].length === 0) { + // 确保该标签页有一个空数组 + examItems.value[tabId] = []; + } + } + } else { + // 如果没有当前标签页数据,直接设置新标签 + currentTab.value = tabId; + + // 确保该标签页有一个空数组 + if (!examItems.value[tabId]) { + examItems.value[tabId] = []; + } + } } // 修改 conclusionData 的数据结构 @@ -432,58 +436,14 @@ const conclusionData = ref({ ultrasound: { finding: '', diagnosis: '' }, ecg: { finding: '', diagnosis: '' }, blood: { summary: '' }, - urine: { summary: '' } + urine: { summary: '' }, + biochemical: { summary: '' } // 添加生化检查的小结 }) // 其他数据 const examConclusion = ref('') const examDate = ref('') -// 添加时间周期选项 -const timePeriods = [ - { label: '今日', value: 'today' }, - { label: '本周', value: 'week' }, - { label: '本月', value: 'month' }, - { label: '自定义', value: 'custom' }, - { label: '重置', value: 'reset' } -] - -// 添加日期相关的响应式数据 -const selectedPeriod = ref('today') -const showDatePicker = ref(false) -const customDateRange = ref([]) - -// 添加日期快捷选项 -const shortcuts = [ - { - text: '最近一周', - value: () => { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) - return [start, end] - }, - }, - { - text: '最近一个月', - value: () => { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) - return [start, end] - }, - }, - { - text: '最近三个月', - value: () => { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) - return [start, end] - }, - }, -] - const pageNo = ref(1) const pageSize = ref(100) const total = ref(0) @@ -491,7 +451,6 @@ const total = ref(0) // 添加搜索相关的状态 const searchQuery = ref('') const originalPatients = ref([]) // 保存原始患者列表 -const filteredPatients = ref([]) // 添加过滤后的患者列表 // 添加数据缓存 const patientDataCache = ref(new Map()) @@ -513,7 +472,7 @@ const handleLocalSearch = () => { ) } -// 修改获取患者列表数据的函数,确保状态更新 +// 修改获取患者列表数据的函数 const getPatientList = async () => { try { const loading = ElLoading.service({ @@ -526,71 +485,63 @@ const getPatientList = async () => { pageNo: pageNo.value, pageSize: pageSize.value } + const res = await PatientApi.getPatientPage(params) - // 获取患者列表后,检查每个患者的检查状态 if (res.list && res.list.length > 0) { - // 可以考虑批量查询所有患者的检查项目状态 - // 或者在后端接口中直接返回每个患者的检查状态 + patients.value = res.list + originalPatients.value = res.list + total.value = res.total + } else { + patients.value = [] + originalPatients.value = [] + total.value = 0 } - patients.value = res.list - originalPatients.value = res.list // 保存原始列表用于搜索 - filteredPatients.value = res.list // 初始化过滤后的列表 - total.value = res.total - loading.close() - - // 如果当前有选中的患者,更新其状态 - if (selectedPatient.value) { - const updatedPatient = res.list.find(p => p.id === selectedPatient.value.id) - if (updatedPatient) { - selectedPatient.value = updatedPatient - } - } } catch (error) { console.error('获取患者列表出错:', error) - message.error('获取患者列表出错') + ElMessage.error('获取患者列表失败') } } // 修改获取患者体检项目数据的方法 const getpatientitemData = async (medicalSn) => { -try { - const params = { - medicalSn: medicalSn, - pageNo: 1, - pageSize: 100 - } - const itemsRes = await PatientitemsApi.getPatientitemsPage(params) - - if (itemsRes.list && itemsRes.list.length > 0) { - patientitemData.value = itemsRes.list[0] + try { + const params = { + medicalSn: medicalSn, + pageNo: 1, + pageSize: 100 + } + const itemsRes = await PatientitemsApi.getPatientitemsPage(params) - // 获取用户信息 - const userProfile = await getUserProfile() - user.value = userProfile - - // 检查当前部门的项目状态 - const currentDeptItems = itemsRes.list.filter(item => - item.sectionID === userProfile.deptId || item.sectionID == userProfile.deptId - ) - // 如果有项目且都是已检查状态,更新患者状态 - if (currentDeptItems.length > 0 && currentDeptItems.every(item => item.itemStatus === '1')) { - // 更新患者列表中的状态 - const patientIndex = patients.value.findIndex(p => p.medicalSn === medicalSn) - if (patientIndex !== -1) { - patients.value[patientIndex] = { - ...patients.value[patientIndex], - examStatus: '1' // 添加检查状态属性 + if (itemsRes.list && itemsRes.list.length > 0) { + patientitemData.value = itemsRes.list[0] + + // 获取用户信息 + const userProfile = await getUserProfile() + user.value = userProfile + + // 检查当前部门的项目状态 + const currentDeptItems = itemsRes.list.filter(item => + item.sectionID === userProfile.deptId || item.sectionID == userProfile.deptId + ) + // 如果有项目且都是已检查状态,更新患者状态 + if (currentDeptItems.length > 0 && currentDeptItems.every(item => item.itemStatus === '1')) { + // 更新患者列表中的状态 + const patientIndex = patients.value.findIndex(p => p.medicalSn === medicalSn) + if (patientIndex !== -1) { + patients.value[patientIndex] = { + ...patients.value[patientIndex], + examStatus: '1' // 添加检查状态属性 + } } } } + } catch (error) { + console.error('获取患者体检项目数据出错:', error) + message.error('获取患者体检项目数据出错') } -} catch (error) { - console.error('获取患者体检项目数据出错:', error) - message.error('获取患者体检项目数据出错') -} } // 删除原来的loadPatientData声明,只保留这一个完整的实现 @@ -627,18 +578,11 @@ const loadPatientData = async (patient) => { // 检查患者是否已有检查项目 const hasItems = await checkPatientHasItems(patient.medicalSn) - // 如果没有检查项目,自动同步 + // 如果没有检查项目,提示用户需要同步 if (!hasItems) { - console.log('患者没有检查项目,自动同步') - try { - await PatientitemsApi.createPatientapiInfo({ - medicalSn: patient.medicalSn - }) - console.log('自动同步成功') - } catch (syncError) { - console.error('自动同步失败:', syncError) - // 同步失败不阻止后续操作 - } + console.log('患者没有检查项目,需要同步') + ElMessage.info('该患者没有检查项目,请点击"同步"按钮获取最新数据') + // 不再自动同步 } // 获取检查项目 @@ -659,7 +603,8 @@ const loadPatientData = async (patient) => { ultrasound: { finding: '', diagnosis: '' }, ecg: { finding: '', diagnosis: '' }, blood: { summary: '' }, - urine: { summary: '' } + urine: { summary: '' }, + biochemical: { summary: '' } // 添加生化检查的小结 } // 初始化检查医生和检查时间为空 @@ -736,6 +681,9 @@ const getCategoryByItemName = (itemName) => { return 'blood' } else if (itemName.includes('尿常规') || itemName.includes('尿液分析')) { return 'urine' + } else if (itemName.includes('生化') || itemName.includes('肝功能') || itemName.includes('肾功能') || + itemName.includes('血脂') || itemName.includes('血糖') || itemName.includes('电解质')) { + return 'biochemical' } else { return 'general' } @@ -886,7 +834,7 @@ return '一般检查' } // 标签颜色映射 -const tabColors = ['#003366', '#006699', '#0099CC', '#00CCFF'] +const tabColors = ['#003366', '#006699', '#0099CC', '#00CCFF', '#0099CC'] const getTabColor = (index) => { return tabColors[index % tabColors.length] } @@ -967,73 +915,14 @@ try { onMounted(async () => { // 清理页面状态 patients.value = [] - filteredPatients.value = [] // 初始化过滤后的列表 selectedPatient.value = null - reportData.value = { - medicalSn: '', - cardId: '', - pName: '', - gender: '', - birthday: '', - nationality: '', - nation: '', - race: '', - phoneNum: '', - status: 0, - reportType: '', - medicalDateTime: '', - chargeType: '', - totalPrice: 0, - headPicUrl: '', - summaryResult: '', - auditor: '', - auditorTime: '' - } - patientitemData.value = { - medicalSn: '', - itemName: '', - itemCode: '', - price: 0, - discountedPrice: 0, - discounted: 0, - sectionID: '', - examDescription: '', - itemResult: '', - unit: '', - highValue: 0, - lowValue: 0, - itemStatus: '', - createTime: '', - positive: '', - inspectdoctor: '', - inspecttime: '' - } - customDateRange.value = [] - - // 初始化科室类型 - try { - const userProfile = await getUserProfile() - user.value = userProfile - isImageDepartment.value = checkIsImageDepartment(userProfile.deptId) - - // 添加默认查询所有人员 - await getPatientList() - } catch (error) { - console.error('获取用户信息失败:', error) - isImageDepartment.value = false - } - - // 设置默认为今日 - const today = new Date() - selectedPeriod.value = 'today' - const todayStart = new Date(today) - todayStart.setHours(0, 0, 0, 0) - const todayEnd = new Date(today) - todayEnd.setHours(23, 59, 59, 999) - customDateRange.value = [todayStart, todayEnd] - // 获取今日数据 - await fetchPatientsByDate() + // 设置合理的分页大小 + pageSize.value = 20 // 或其他合适的数值 + pageNo.value = 1 + + // 直接调用获取列表方法,不附加任何过滤条件 + await getPatientList() }) // 修改处理时间周期切换的函数 @@ -1043,6 +932,16 @@ const handlePeriodChange = (period) => { // 清除选中状态 selectedPatient.value = null + if (period === 'reset') { + // 重置所有筛选条件 + selectedPeriod.value = '' // 清除选中的时间周期 + customDateRange.value = [] // 清除日期范围 + showDatePicker.value = false + // 重新获取所有数据,不带日期过滤 + getPatientList() + return + } + const today = new Date() let startDate, endDate @@ -1076,19 +975,10 @@ const handlePeriodChange = (period) => { case 'custom': showDatePicker.value = !showDatePicker.value break - - case 'reset': - selectedPeriod.value = 'today' - const todayStart = new Date(today.setHours(0, 0, 0, 0)) - const todayEnd = new Date(today.setHours(23, 59, 59, 999)) - customDateRange.value = [todayStart, todayEnd] - showDatePicker.value = false - fetchPatientsByDate() - break } } -// 修改按日期获取患者列表方法 +// 修改按日期获取患者列表方法 - 不再自动同步 const fetchPatientsByDate = async () => { try { if (!customDateRange.value || customDateRange.value.length !== 2) return @@ -1106,7 +996,6 @@ const fetchPatientsByDate = async () => { const res = await PatientApi.getPatientPage(params) patients.value = res.list originalPatients.value = res.list - filteredPatients.value = res.list total.value = res.total // 如果没有查询到患者,清除右侧详情 @@ -1214,89 +1103,26 @@ const checkEditPermission = () => { } // 修改同步结果处理函数 -const handleSyncResults = async () => { - if (!selectedPatient.value?.medicalSn) { - console.warn('未选择患者,无法同步') - ElMessage.warning('请先选择患者') - return - } - +const handleSync = async () => { try { - console.log('开始同步患者数据, 体检编号:', selectedPatient.value.medicalSn) const loading = ElLoading.service({ lock: true, text: '同步中...', background: 'rgba(255, 255, 255, 0.7)' }) - - // 先查询该体检编号是否已有检查项目 - const existingItems = await PatientitemsApi.getPatientitemsPage({ - medicalSn: selectedPatient.value.medicalSn, - pageNo: 1, - pageSize: 1 - }) - - // 如果已有检查项目,则不再同步 - if (existingItems.list && existingItems.list.length > 0) { - console.log('该患者已有检查项目,无需再次同步') - loading.close() - ElMessage.info('该患者已有检查项目,无需再次同步') - - // 重新加载患者数据 - await loadPatientData(selectedPatient.value) - return - } - - // 调用同步接口 - const syncResult = await PatientitemsApi.createPatientapiInfo({ - medicalSn: selectedPatient.value.medicalSn - }) - console.log('同步接口调用成功:', syncResult) - - // 重新加载患者数据 - console.log('重新加载患者数据') - await loadPatientData(selectedPatient.value) - console.log('患者数据加载完成') - - loading.close() - console.log('同步操作完成') - ElMessage.success('同步成功') - } catch (error) { - console.error('同步失败:', error) - ElMessage.error('同步失败,请稍后重试') - } -} - -// 修改刷新处理函数 -const handleRefresh = async () => { - try { - const loading = ElLoading.service({ - lock: true, - text: '刷新中...', - background: 'rgba(255, 255, 255, 0.7)' - }) - - // 重置所有状态 - selectedPeriod.value = 'today' - showDatePicker.value = false - searchQuery.value = '' - selectedPatient.value = null - pageNo.value = 1 - - // 设置今日日期范围 - const today = new Date() - const todayStart = new Date(today.setHours(0, 0, 0, 0)) - const todayEnd = new Date(today.setHours(23, 59, 59, 999)) - customDateRange.value = [todayStart, todayEnd] try { - // 1. 先调用同步接口 + // 调用同步接口 await PatientitemsApi.createPatientapiInfo({}) - // 2. 等待一小段时间确保后端数据同步完成 + // 等待一小段时间确保后端数据同步完成 await new Promise(resolve => setTimeout(resolve, 1000)) - // 3. 获取最新的患者列表 + // 获取最新的患者列表 + const today = new Date() + const todayStart = new Date(today.setHours(0, 0, 0, 0)) + const todayEnd = new Date(today.setHours(23, 59, 59, 999)) + const params = { pageNo: pageNo.value, pageSize: pageSize.value, @@ -1311,18 +1137,52 @@ const handleRefresh = async () => { // 更新列表数据 patients.value = res.list originalPatients.value = res.list - filteredPatients.value = res.list total.value = res.total // 清除缓存 patientDataCache.value.clear() + loading.close() + ElMessage.success('同步成功') + } catch (error) { + loading.close() + console.error('同步数据失败:', error) + ElMessage.error('同步数据失败,请稍后重试') + } + } catch (error) { + console.error('同步失败:', error) + ElMessage.error('同步失败,请稍后重试') + } +} + +// 修改刷新处理函数 - 移除同步功能 +const handleRefresh = async () => { + try { + const loading = ElLoading.service({ + lock: true, + text: '刷新中...', + background: 'rgba(255, 255, 255, 0.7)' + }) + + // 重置所有状态 + searchQuery.value = '' + selectedPatient.value = null + pageNo.value = 1 + statusFilter.value = '0' // 重置为默认的待检查状态 + + try { + // 获取最新的患者列表 + await getPatientList() + + // 清除缓存 + patientDataCache.value.clear() + loading.close() ElMessage.success('刷新成功') } catch (error) { loading.close() - console.error('同步数据失败:', error) - ElMessage.error('同步数据失败,请稍后重试') + console.error('刷新数据失败:', error) + ElMessage.error('刷新数据失败,请稍后重试') } } catch (error) { console.error('刷新失败:', error) @@ -1437,7 +1297,7 @@ const isReadOnly = computed(() => { // 修改分页处理函数 const handleCurrentChange = (val) => { pageNo.value = val - getPatientList() // 使用通用查询函数替代特定日期查询 + getPatientList() // 直接调用获取列表函数 } // 修改签名加载错误处理 @@ -1586,6 +1446,13 @@ const validateAllResults = () => { errors.push('尿常规体检小结不能为空') } } + + // 检查生化 + if (conclusionData.value.biochemical) { + if (!conclusionData.value.biochemical.summary?.trim()) { + errors.push('生化检查体检小结不能为空') + } + } if (errors.length > 0) { ElMessage({ @@ -1601,7 +1468,7 @@ const validateAllResults = () => { return true } -// 修改统一保存方法,更新检查医生和检查日期 +// 修改统一保存方法,更新检查医生和检查日期,同时更新患者状态和体检日期 const handleSaveAllResults = async () => { if (!checkEditPermission()) return @@ -1661,18 +1528,28 @@ const handleSaveAllResults = async () => { } else if (itemName.includes('血常规') || itemName.includes('血细胞') || itemName.includes('血红蛋白')) { allUpdatedItems.push({ ...baseFields, - analyse: conclusionData.value.blood?.summary?.trim() || '' // 只将小结保存到analyse字段 + analyse: conclusionData.value.blood?.summary?.trim() || '', // 只将小结保存到analyse字段 + itemResult: conclusionData.value.blood?.summary?.trim() || '' // 同时更新itemResult字段 }) } else if (itemName.includes('尿常规') || itemName.includes('尿液分析')) { allUpdatedItems.push({ ...baseFields, - analyse: conclusionData.value.urine?.summary?.trim() || '' // 只将小结保存到analyse字段 + analyse: conclusionData.value.urine?.summary?.trim() || '', // 只将小结保存到analyse字段 + itemResult: conclusionData.value.urine?.summary?.trim() || '' // 同时更新itemResult字段 + }) + } else if (itemName.includes('生化') || itemName.includes('肝功能') || itemName.includes('肾功能') || + itemName.includes('血脂') || itemName.includes('血糖') || itemName.includes('电解质')) { + allUpdatedItems.push({ + ...baseFields, + analyse: conclusionData.value.biochemical?.summary?.trim() || '', // 只将小结保存到analyse字段 + itemResult: conclusionData.value.biochemical?.summary?.trim() || '' // 同时更新itemResult字段 }) } else { // 一般检查项目 allUpdatedItems.push({ ...baseFields, - analyse: conclusionData.value.general?.summary?.trim() || '' // 只将小结保存到analyse字段 + analyse: conclusionData.value.general?.summary?.trim() || '', // 只将小结保存到analyse字段 + itemResult: conclusionData.value.general?.summary?.trim() || '' // 同时更新itemResult字段 }) } }) @@ -1692,25 +1569,29 @@ const handleSaveAllResults = async () => { // 更新患者状态为已检查 - 调用更新患者状态的API if (selectedPatient.value) { - // 更新数据库中的status字段为1 + // 更新数据库中的status字段为1,同时更新体检日期为当前时间戳 await PatientApi.updatePatient({ id: selectedPatient.value.id, - status: 1 // 设置为已检查状态 + status: 1, // 设置为已检查状态 + medicalDateTime: currentTimestamp // 更新体检日期为当前时间戳 }) // 更新本地状态 selectedPatient.value.status = 1 + selectedPatient.value.medicalDateTime = currentTimestamp // 更新列表中的患者状态 const patientIndex = patients.value.findIndex(p => p.id === selectedPatient.value.id) if (patientIndex !== -1) { patients.value[patientIndex].status = 1 + patients.value[patientIndex].medicalDateTime = currentTimestamp } // 更新过滤后的列表中的患者状态 const filteredIndex = filteredPatients.value.findIndex(p => p.id === selectedPatient.value.id) if (filteredIndex !== -1) { filteredPatients.value[filteredIndex].status = 1 + filteredPatients.value[filteredIndex].medicalDateTime = currentTimestamp } } @@ -1772,9 +1653,42 @@ const inspectTime = ref('') // 添加特殊检查类型的计算属性 const isSpecialExam = computed(() => { - return ['ultrasound', 'ecg', 'blood', 'urine'].includes(currentTab.value) + return ['ultrasound', 'ecg', 'blood', 'urine', 'biochemical'].includes(currentTab.value) }) +// 添加状态筛选的响应式引用 +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)) + ) + } + + return result +}) + +// 添加状态筛选变化处理函数 +const handleStatusFilterChange = (value) => { + statusFilter.value = value + // 重置选中的患者 + selectedPatient.value = null +} + \ No newline at end of file diff --git a/src/views/Inspection-checklist/Inspection-checklist.vue b/src/views/Inspection-checklist/Inspection-checklist.vue new file mode 100644 index 0000000..4c049b8 --- /dev/null +++ b/src/views/Inspection-checklist/Inspection-checklist.vue @@ -0,0 +1,247 @@ + + +