修改分页

This commit is contained in:
Euni4U 2025-04-03 12:47:09 +08:00
parent 51b3742b9f
commit 5673decbee

View File

@ -1514,9 +1514,31 @@ const isReadOnly = computed(() => {
}) })
// //
const handleCurrentChange = (val) => { const handleCurrentChange = async (val) => {
pageNo.value = 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 // selectedPatient.value = null //
searchQuery.value = '' // searchQuery.value = '' //
patients.value = [] // pageNo.value = 1 //
try { try {
const params = { const params = {
pageNo: 1, pageNo: pageNo.value,
pageSize: pageSize.value, pageSize: pageSize.value,
isprint: null isprint: null
} }
@ -2046,10 +2068,8 @@ const handleStatusFilterChange = async (value) => {
} }
const res = await PatientApi.getPatientPage(params) const res = await PatientApi.getPatientPage(params)
patients.value = res.list patients.value = res.list
total.value = res.total total.value = res.total
console.log( patients.value)
} catch (error) { } catch (error) {
console.error('获取患者列表失败:', error) console.error('获取患者列表失败:', error)
ElMessage.error('获取患者列表失败') ElMessage.error('获取患者列表失败')