Files
kartoteka/resources/js/Pages/Home/Index.vue
brusnitsyn c5c1a2b3e1 Новая логика поисковой выдачи
И добавлена кнопка Добавить карту в архив
2025-12-26 17:41:25 +09:00

81 lines
3.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup>
import AppLayout from "../../Layouts/AppLayout.vue"
import TableCards from './DataTable/Index.vue'
import ArchiveHistoryCreateModal from './ArchiveHistoryCreateModal/Index.vue'
import { NInput, NFlex, NDivider, NDatePicker, NSpace, NFormItem, NRadioButton, NH1, NTabs, NButton, NSelect } from 'naive-ui'
import {useMedicalHistoryFilter} from "../../Composables/useMedicalHistoryFilter.js";
import {ref} from "vue";
const props = defineProps({
cards: {
type: Array,
default: []
},
statuses: {
type: Array,
default: []
},
filters: {
type: Array,
default: []
}
})
const ArchiveHistoryCreateModalShow = ref(false)
const {
isLoading, applyFilters, filtersRef, handleSearch, dateRange, searchValue,
handleDateRangeChange, handleViewTypeChange, handleStatusChange
} = useMedicalHistoryFilter(props.filters)
const viewType = ref('archive')
const handleBeforeLeave = (tabName) => {
handleViewTypeChange(tabName)
return true
}
</script>
<template>
<AppLayout>
<template #header>
<NSpace vertical>
<!-- <NH1 class="!my-0 mb-5">-->
<!-- Архив-->
<!-- </NH1>-->
<!-- <NRadioGroup v-model:value="viewType" @update:value="val => handleViewTypeChange(val)">-->
<!-- <NRadioButton value="archive">Архив</NRadioButton>-->
<!-- <NRadioButton value="mis">МИС</NRadioButton>-->
<!-- <NRadioButton value="softinfo">СофтИнфо</NRadioButton>-->
<!-- </NRadioGroup>-->
<NFlex class="pb-4" align="center" :wrap="false">
<NFormItem class="w-[720px]" label="Поиск" :show-feedback="false">
<NInput placeholder="Поиск по ФИО, № карты" v-model:value="searchValue" @update:value="val => handleSearch(val)" size="large" />
</NFormItem>
<div class="mt-6">
<NDivider vertical />
</div>
<NFormItem class="w-[340px]" label="Дата выписки" :show-feedback="false">
<NDatePicker v-model:value="dateRange" @update:value="handleDateRangeChange" type="daterange" clearable format="dd.MM.yyyy" start-placeholder="Дата выписки с" end-placeholder="по" size="large" />
</NFormItem>
<NFormItem class="w-[340px]" label="Статус карты" :show-feedback="false">
<NSelect :options="statuses" @update:value="val => handleStatusChange(val)" clearable size="large" />
</NFormItem>
<NFormItem class="w-[340px]" :show-feedback="false">
<NButton type="primary" @click="ArchiveHistoryCreateModalShow = true" secondary size="large">
Добавить карту в архив
</NButton>
</NFormItem>
</NFlex>
</NSpace>
</template>
<TableCards :filters="filters" :data="cards.data" :meta="cards.meta" min-height="calc(100vh - 212px)" max-height="calc(100vh - 320px)" />
<ArchiveHistoryCreateModal v-model:open="ArchiveHistoryCreateModalShow" />
</AppLayout>
</template>
<style scoped>
:deep(.n-tabs .n-tabs-nav) {
max-width: 420px;
}
</style>