modified: .gitignore
This commit is contained in:
@@ -98,7 +98,7 @@ const fetchUnwantedEvents = () => {
|
||||
departmentId: props.departmentId
|
||||
}
|
||||
axios.post('/api/mis/patients', data).then((res) => {
|
||||
observablePatients.value = reportStore.addRowNumbers(res.data)
|
||||
observablePatients.value = reportStore.addRowNumbers(res.data?.data ?? res.data ?? [])
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
@@ -76,14 +76,7 @@ const columns = ref([
|
||||
const startAt = searchParams.get('startAt') ?? propsStartAt
|
||||
const endAt = searchParams.get('endAt') ?? propsEndAt
|
||||
|
||||
const linkData = {}
|
||||
|
||||
if (startAt)
|
||||
linkData.startAt = startAt
|
||||
if (endAt)
|
||||
linkData.endAt = endAt
|
||||
|
||||
linkData.departmentId = row.department_id
|
||||
const reportHref = buildReportHref(row.department_id, startAt, endAt)
|
||||
|
||||
return h(NFlex, {align: 'center', justify: 'start'}, [
|
||||
h(NBadge, {
|
||||
@@ -91,8 +84,7 @@ const columns = ref([
|
||||
type: row.isReportToday ? 'success' : 'error'
|
||||
}),
|
||||
h(Link, {
|
||||
href: `/report`,
|
||||
data: linkData,
|
||||
href: reportHref,
|
||||
class: 'underline decoration-dashed'
|
||||
}, row.department),
|
||||
h(NSpace, {align: 'center', size: 'small'}, [
|
||||
@@ -324,6 +316,25 @@ const downloadReport = async () => {
|
||||
console.error('Ошибка скачивания:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const buildReportHref = (departmentId, startAt, endAt) => {
|
||||
const params = new URLSearchParams()
|
||||
|
||||
if (startAt !== null && startAt !== undefined && startAt !== '') {
|
||||
params.set('startAt', String(startAt))
|
||||
}
|
||||
|
||||
if (endAt !== null && endAt !== undefined && endAt !== '') {
|
||||
params.set('endAt', String(endAt))
|
||||
}
|
||||
|
||||
if (departmentId !== null && departmentId !== undefined && departmentId !== '') {
|
||||
params.set('departmentId', String(departmentId))
|
||||
}
|
||||
|
||||
const query = params.toString()
|
||||
return query ? `/report?${query}` : '/report'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user