Добавил уведомление о создании отчета
This commit is contained in:
@@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user