Добавил уведомление о создании отчета

This commit is contained in:
brusnitsyn
2026-06-23 17:28:52 +09:00
parent 8e6bbc5f91
commit 6942b0c091
9 changed files with 121 additions and 42 deletions

View File

@@ -1,7 +1,8 @@
<script setup>
import AppLayout from "../../Layouts/AppLayout.vue";
import {useReportStore} from "../../Stores/report.js";
import {onMounted, ref, watch, provide, computed} from "vue";
import {onMounted, ref, watch, provide, computed, h} from "vue";
import {useNotification} from "../../Composables/useNotification.js";
import {useAuthStore} from "../../Stores/auth.js";
import {
NFormItem,
@@ -88,6 +89,26 @@ const props = defineProps({
const reportStore = useReportStore()
const authStore = useAuthStore()
const userDepartment = authStore.userDepartment
const {success} = useNotification()
const notifyReportSaved = () => {
const notification = success('Сохранено', 'Отчет успешно сохранен', {
meta: '',
duration: 5000,
action: () => h(
NButton,
{
text: true,
type: 'success',
onClick: () => {
notification.destroy()
router.visit('/')
}
},
{default: () => 'Вернуться на главную страницу'}
)
})
}
const patientCollection = ref({...props.patients})
const nursePatientCollection = ref({...props.nursePatients})
@@ -142,7 +163,7 @@ const submit = () => {
departmentId: props.selectedDepartmentId,
}, {
onSuccess: () => {
alert('Сохранено')
notifyReportSaved()
}
})
}