Исправление вывода дат для модальных окон
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user