Исправление вывода дат для модальных окон

This commit is contained in:
brusnitsyn
2026-07-13 16:45:35 +09:00
parent 6b3a4bfceb
commit 69d2bd8ce1
5 changed files with 19 additions and 46 deletions

View File

@@ -108,7 +108,7 @@ class StatisticsService
->join('report_duties as rd', 'rd.id', '=', 'rdp.report_duty_id')
->whereIn('rd.rf_department_id', $allDeptIds)
->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'))
->groupBy('rd.rf_department_id')
->get()

View File

@@ -9,22 +9,17 @@ import { computed, h, ref, watch } from 'vue'
import TooltipColumn from '../../Report/Components/DataTableColumns/TooltipColumn.vue'
import {usePage} from "@inertiajs/vue3";
const props = defineProps({
startAt: { required: false },
endAt: { required: false },
})
const open = defineModel('open')
const loading = ref(true)
const deadPatients = ref([])
const currentPatient = ref(null)
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 departments = new Set()
@@ -115,7 +110,7 @@ const fetch = (startAt, endAt) => {
watch(open, (open) => {
if (open) {
fetch(startAt.value, endAt.value)
fetch(props.startAt, props.endAt)
}
})
</script>

View File

@@ -10,6 +10,8 @@ import TooltipColumn from '../../Report/Components/DataTableColumns/TooltipColum
const props = defineProps({
departmentId: { required: true },
startAt: { required: false },
endAt: { required: false },
})
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) => {
loading.value = true
axios.get('/api/statistics/reports/observable-patients', {
@@ -104,7 +96,7 @@ const fetch = (startAt, endAt) => {
}
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 })
</script>
@@ -160,15 +152,6 @@ watch([open, () => props.departmentId], ([open, departmentId]) => {
:value="currentPatient?.observable_reason"
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>
</NDrawerContent>
</NDrawer>

View File

@@ -11,6 +11,8 @@ const props = defineProps({
departmentId: {
required: true
},
startAt: { required: false },
endAt: { required: false },
})
const open = defineModel('open')
@@ -18,16 +20,6 @@ const loading = ref(true)
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) => {
loading.value = true
axios.get('/api/statistics/reports/unwanted-events', {
@@ -47,7 +39,7 @@ const fetchUnwantedEvents = (startAt, endAt) => {
watch([open, () => props.departmentId], ([open, departmentId]) => {
if (open && departmentId) {
fetchUnwantedEvents(startAt.value, endAt.value)
fetchUnwantedEvents(props.startAt, props.endAt)
}
}, {
immediate: true,

View File

@@ -393,9 +393,12 @@ const buildReportHref = (departmentId, startAt, endAt) => {
>
</NDataTable>
<ModalUnwantedEvents v-model:open="showUnwantedEventsModal" :department-id="currentDepartmentId" />
<ModalObservablePatients v-model:open="showObservablePatientsModal" :department-id="currentDepartmentId" />
<ModalDeathPatients v-model:open="showDeathPatientsModal" />
<ModalUnwantedEvents v-model:open="showUnwantedEventsModal" :department-id="currentDepartmentId"
:start-at="date[0]" :end-at="date[1]" />
<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>
</template>