Исправление вывода дат для модальных окон
This commit is contained in:
@@ -108,7 +108,7 @@ class StatisticsService
|
|||||||
->join('report_duties as rd', 'rd.id', '=', 'rdp.report_duty_id')
|
->join('report_duties as rd', 'rd.id', '=', 'rdp.report_duty_id')
|
||||||
->whereIn('rd.rf_department_id', $allDeptIds)
|
->whereIn('rd.rf_department_id', $allDeptIds)
|
||||||
->where('omh.observable_in', '>=', $startDate)
|
->where('omh.observable_in', '>=', $startDate)
|
||||||
->where('omh.observable_in', '<=', $endDate)
|
->where('omh.observable_in', '<', $endDate)
|
||||||
->select('rd.rf_department_id', DB::raw('COUNT(DISTINCT omh.id) as count'))
|
->select('rd.rf_department_id', DB::raw('COUNT(DISTINCT omh.id) as count'))
|
||||||
->groupBy('rd.rf_department_id')
|
->groupBy('rd.rf_department_id')
|
||||||
->get()
|
->get()
|
||||||
|
|||||||
@@ -9,22 +9,17 @@ import { computed, h, ref, watch } from 'vue'
|
|||||||
import TooltipColumn from '../../Report/Components/DataTableColumns/TooltipColumn.vue'
|
import TooltipColumn from '../../Report/Components/DataTableColumns/TooltipColumn.vue'
|
||||||
import {usePage} from "@inertiajs/vue3";
|
import {usePage} from "@inertiajs/vue3";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
startAt: { required: false },
|
||||||
|
endAt: { required: false },
|
||||||
|
})
|
||||||
|
|
||||||
const open = defineModel('open')
|
const open = defineModel('open')
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const deadPatients = ref([])
|
const deadPatients = ref([])
|
||||||
const currentPatient = ref(null)
|
const currentPatient = ref(null)
|
||||||
const showDrawer = ref(false)
|
const showDrawer = ref(false)
|
||||||
|
|
||||||
const startAt = computed(() => {
|
|
||||||
const urlParams = new URLSearchParams(window.location.search)
|
|
||||||
return urlParams.get('startAt')
|
|
||||||
})
|
|
||||||
|
|
||||||
const endAt = computed(() => {
|
|
||||||
const urlParams = new URLSearchParams(window.location.search)
|
|
||||||
return urlParams.get('endAt')
|
|
||||||
})
|
|
||||||
|
|
||||||
// Получаем уникальные отделения для фильтра
|
// Получаем уникальные отделения для фильтра
|
||||||
const departmentOptions = computed(() => {
|
const departmentOptions = computed(() => {
|
||||||
const departments = new Set()
|
const departments = new Set()
|
||||||
@@ -115,7 +110,7 @@ const fetch = (startAt, endAt) => {
|
|||||||
|
|
||||||
watch(open, (open) => {
|
watch(open, (open) => {
|
||||||
if (open) {
|
if (open) {
|
||||||
fetch(startAt.value, endAt.value)
|
fetch(props.startAt, props.endAt)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import TooltipColumn from '../../Report/Components/DataTableColumns/TooltipColum
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
departmentId: { required: true },
|
departmentId: { required: true },
|
||||||
|
startAt: { required: false },
|
||||||
|
endAt: { required: false },
|
||||||
})
|
})
|
||||||
|
|
||||||
const open = defineModel('open')
|
const open = defineModel('open')
|
||||||
@@ -82,16 +84,6 @@ const columns = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const startAt = computed(() => {
|
|
||||||
const urlParams = new URLSearchParams(window.location.search)
|
|
||||||
return urlParams.get('startAt')
|
|
||||||
})
|
|
||||||
|
|
||||||
const endAt = computed(() => {
|
|
||||||
const urlParams = new URLSearchParams(window.location.search)
|
|
||||||
return urlParams.get('endAt')
|
|
||||||
})
|
|
||||||
|
|
||||||
const fetch = (startAt, endAt) => {
|
const fetch = (startAt, endAt) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
axios.get('/api/statistics/reports/observable-patients', {
|
axios.get('/api/statistics/reports/observable-patients', {
|
||||||
@@ -104,7 +96,7 @@ const fetch = (startAt, endAt) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch([open, () => props.departmentId], ([open, departmentId]) => {
|
watch([open, () => props.departmentId], ([open, departmentId]) => {
|
||||||
if (open && departmentId) fetch(startAt.value, endAt.value)
|
if (open && departmentId) fetch(props.startAt, props.endAt)
|
||||||
}, { immediate: true, deep: true })
|
}, { immediate: true, deep: true })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -160,15 +152,6 @@ watch([open, () => props.departmentId], ([open, departmentId]) => {
|
|||||||
:value="currentPatient?.observable_reason"
|
:value="currentPatient?.observable_reason"
|
||||||
placeholder="Причина не указана"
|
placeholder="Причина не указана"
|
||||||
/>
|
/>
|
||||||
<template v-if="currentPatient?.comment">
|
|
||||||
<NText depth="3" style="font-size:12px;">Комментарий:</NText>
|
|
||||||
<NInput
|
|
||||||
type="textarea"
|
|
||||||
readonly
|
|
||||||
:rows="4"
|
|
||||||
:value="currentPatient?.comment"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</NFlex>
|
</NFlex>
|
||||||
</NDrawerContent>
|
</NDrawerContent>
|
||||||
</NDrawer>
|
</NDrawer>
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ const props = defineProps({
|
|||||||
departmentId: {
|
departmentId: {
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
startAt: { required: false },
|
||||||
|
endAt: { required: false },
|
||||||
})
|
})
|
||||||
|
|
||||||
const open = defineModel('open')
|
const open = defineModel('open')
|
||||||
@@ -18,16 +20,6 @@ const loading = ref(true)
|
|||||||
|
|
||||||
const unwantedEvents = ref([])
|
const unwantedEvents = ref([])
|
||||||
|
|
||||||
const startAt = computed(() => {
|
|
||||||
const urlParams = new URLSearchParams(window.location.search)
|
|
||||||
return urlParams.get('startAt')
|
|
||||||
})
|
|
||||||
|
|
||||||
const endAt = computed(() => {
|
|
||||||
const urlParams = new URLSearchParams(window.location.search)
|
|
||||||
return urlParams.get('endAt')
|
|
||||||
})
|
|
||||||
|
|
||||||
const fetchUnwantedEvents = (startAt, endAt) => {
|
const fetchUnwantedEvents = (startAt, endAt) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
axios.get('/api/statistics/reports/unwanted-events', {
|
axios.get('/api/statistics/reports/unwanted-events', {
|
||||||
@@ -47,7 +39,7 @@ const fetchUnwantedEvents = (startAt, endAt) => {
|
|||||||
|
|
||||||
watch([open, () => props.departmentId], ([open, departmentId]) => {
|
watch([open, () => props.departmentId], ([open, departmentId]) => {
|
||||||
if (open && departmentId) {
|
if (open && departmentId) {
|
||||||
fetchUnwantedEvents(startAt.value, endAt.value)
|
fetchUnwantedEvents(props.startAt, props.endAt)
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|||||||
@@ -393,9 +393,12 @@ const buildReportHref = (departmentId, startAt, endAt) => {
|
|||||||
>
|
>
|
||||||
|
|
||||||
</NDataTable>
|
</NDataTable>
|
||||||
<ModalUnwantedEvents v-model:open="showUnwantedEventsModal" :department-id="currentDepartmentId" />
|
<ModalUnwantedEvents v-model:open="showUnwantedEventsModal" :department-id="currentDepartmentId"
|
||||||
<ModalObservablePatients v-model:open="showObservablePatientsModal" :department-id="currentDepartmentId" />
|
:start-at="date[0]" :end-at="date[1]" />
|
||||||
<ModalDeathPatients v-model:open="showDeathPatientsModal" />
|
<ModalObservablePatients v-model:open="showObservablePatientsModal" :department-id="currentDepartmentId"
|
||||||
|
:start-at="date[0]" :end-at="date[1]" />
|
||||||
|
<ModalDeathPatients v-model:open="showDeathPatientsModal"
|
||||||
|
:start-at="date[0]" :end-at="date[1]" />
|
||||||
</AppLayout>
|
</AppLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user