Добавил уведомление о создании отчета
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import AppPanel from "../../../Components/AppPanel.vue";
|
||||
import {NNumberAnimation, NStatistic} from "naive-ui";
|
||||
import {NNumberAnimation, NStatistic, NTooltip} from "naive-ui";
|
||||
const props = defineProps({
|
||||
label: String,
|
||||
counter: {
|
||||
@@ -35,15 +35,27 @@ const props = defineProps({
|
||||
<div class="flex flex-col items-center justify-center text-center py-2">
|
||||
<NStatistic :label="label">
|
||||
<template v-if="isDoubleCounter">
|
||||
<span :class="counterClass">
|
||||
<NNumberAnimation :from="0" :to="counter" />
|
||||
<span v-if="percent" style="color: var(--n-close-icon-color)">%</span>
|
||||
</span>
|
||||
<NTooltip>
|
||||
<template #trigger>
|
||||
<span :class="counterClass">
|
||||
<NNumberAnimation :from="0" :to="counter" />
|
||||
<span v-if="percent" style="color: var(--n-close-icon-color)">%</span>
|
||||
</span>
|
||||
</template>
|
||||
Данные из МИС
|
||||
</NTooltip>
|
||||
|
||||
<span style="color: var(--n-close-icon-color)"> / </span>
|
||||
<span :class="counterSuffixClass">
|
||||
<NNumberAnimation :from="0" :to="counterSuffix" />
|
||||
<span v-if="percent" style="color: var(--n-close-icon-color)">%</span>
|
||||
</span>
|
||||
<NTooltip>
|
||||
<template #trigger>
|
||||
<span :class="counterSuffixClass">
|
||||
<NNumberAnimation :from="0" :to="counterSuffix" />
|
||||
<span v-if="percent" style="color: var(--n-close-icon-color)">%</span>
|
||||
</span>
|
||||
</template>
|
||||
Данные из журнала пациентов
|
||||
</NTooltip>
|
||||
|
||||
</template>
|
||||
<span v-else :class="counterClass">
|
||||
<NNumberAnimation :from="0" :to="counter" />
|
||||
|
||||
@@ -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