From 5673decbee3855cc895fba950de80d54b6e50ab1 Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Thu, 3 Apr 2025 12:47:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Medical-examination-vehicle.vue | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/views/Department-entry/Medical-examination-vehicle.vue b/src/views/Department-entry/Medical-examination-vehicle.vue index c651e79..5377cde 100644 --- a/src/views/Department-entry/Medical-examination-vehicle.vue +++ b/src/views/Department-entry/Medical-examination-vehicle.vue @@ -1514,9 +1514,31 @@ const isReadOnly = computed(() => { }) // 修改分页处理函数 -const handleCurrentChange = (val) => { +const handleCurrentChange = async (val) => { pageNo.value = val - getPatientList() // 直接调用获取列表函数 + try { + const params = { + pageNo: pageNo.value, + pageSize: pageSize.value, + isprint: null + } + + // 根据当前状态筛选值设置不同的查询参数 + if (statusFilter.value === '2') { + // 已打印状态,查询 isprint 为 1 的数据 + params.isprint = 1 + } else { + // 其他状态,使用 status 字段查询 + params.status = statusFilter.value + } + + const res = await PatientApi.getPatientPage(params) + patients.value = res.list + total.value = res.total + } catch (error) { + console.error('获取患者列表失败:', error) + ElMessage.error('获取患者列表失败') + } } // 修改签名加载错误处理 @@ -2027,11 +2049,11 @@ const handleStatusFilterChange = async (value) => { // 重置选中的患者 selectedPatient.value = null // 清空选中的患者 searchQuery.value = '' // 清空搜索词 - patients.value = [] // 清空患者列表 + pageNo.value = 1 // 重置页码为第一页 try { const params = { - pageNo: 1, + pageNo: pageNo.value, pageSize: pageSize.value, isprint: null } @@ -2046,10 +2068,8 @@ const handleStatusFilterChange = async (value) => { } const res = await PatientApi.getPatientPage(params) - patients.value = res.list total.value = res.total - console.log( patients.value) } catch (error) { console.error('获取患者列表失败:', error) ElMessage.error('获取患者列表失败')