* добавлены операции и услуги операций

* добавлена выборка и подсчет по датам для роли зав.
* переключатель ролей
* выбор отделений для роли зав.
This commit is contained in:
brusnitsyn
2026-01-22 17:58:27 +09:00
parent 8a0fdf9470
commit cb43c74a72
28 changed files with 961 additions and 143 deletions

View File

@@ -1,14 +1,35 @@
<script setup>
import {useAuthStore} from "../../Stores/auth.js";
import {NDropdown, NButton, NText} from 'naive-ui'
import {NSelect, NFlex, NText} from 'naive-ui'
import {computed} from "vue";
import {router, useForm} from "@inertiajs/vue3";
const authStore = useAuthStore()
const userOptions = [
{
label: 'Выход',
key: 'exit',
},
]
const userOptions = computed(() => {
return authStore.availableRoles.map(itm => {
return {
label: itm.name,
value: itm.role_id
}
})
})
const formRole = useForm({
role_id: authStore.user.role.role_id
})
const onChangeRole = (roleId) => {
console.log(roleId)
formRole.post('/user/role/change', {
onSuccess: () => {
router.visit(window.location.pathname, {
preserveScroll: true,
preserveState: false, // Это важно - сбрасывает состояние
only: ['user', 'auth'], // Указываем какие данные обновить
})
}
})
}
const themeOverride = {
border: null,
borderHover: null,
@@ -20,9 +41,17 @@ const themeOverride = {
</script>
<template>
<NText>
{{ authStore.user?.name }}
</NText>
<NFlex align="center" :wrap="false">
<div class="min-w-[220px]">
<NSelect :options="userOptions"
v-model:value="formRole.role_id"
@update:value="value => onChangeRole(value)"
/>
</div>
<div>
{{ authStore.user?.name }}
</div>
</NFlex>
<!-- <NDropdown :options="userOptions" placement="bottom-end">-->
<!-- <NButton :theme-overrides="themeOverride">-->
<!-- {{ authStore.user?.name }}-->