Обновлен стартовый экран

Переписаны запросы для статистики, отчетов
Добавлена интеграция отчета сестры
This commit is contained in:
brusnitsyn
2026-05-28 22:10:00 +09:00
parent 90e0d04dfd
commit 739168d427
96 changed files with 6663 additions and 1465 deletions

View File

@@ -3,11 +3,12 @@ import AppLayout from "../../../Layouts/AppLayout.vue";
import {NFlex, NTag, NDataTable, NButton, NTabs, NTabPane} from 'naive-ui'
import AppContainer from "../../../Components/AppContainer.vue";
import AppPanel from "../../../Components/AppPanel.vue";
import DatePickerQuery from "../../../Components/DatePickerQuery.vue";
import ShiftPickerQuery from "../../../Components/ShiftPickerQuery.vue";
import UrgencyBadge from "../../../Components/UrgencyBadge.vue";
import {computed, h, onMounted, ref, shallowRef} from "vue"
import {TbCirclePlus, TbPencil} from 'vue-icons-plus/tb'
import {useAuthStore} from "../../../Stores/auth.js";
import {usePage} from "@inertiajs/vue3";
import AddMedicalHistoryModal from "../Components/AddMedicalHistoryModal.vue";
import EditMedicalHistoryModal from "../Components/EditMedicalHistoryModal.vue";
import {router} from "@inertiajs/vue3";
@@ -19,12 +20,32 @@ const props = defineProps({
type: Array,
default: []
},
reportNurseId: {
type: Number,
default: null
},
canSaveReport: Boolean,
canEditPastReport: Boolean,
department: {
type: Object,
default: null
},
selectedUserId: {
type: Number,
default: null
},
selectedDepartmentId: {
type: Number,
default: null
},
dates: {
type: Array,
default: []
}
})
const canEdit = computed(() => props.canSaveReport || props.canEditPastReport)
const showAddMedicalHistoryModal = shallowRef(false)
const showEditMedicalHistoryModal = shallowRef(false)
const editHistoryId = ref(null)
@@ -89,6 +110,7 @@ const columns = [
ActionsColumnDataTable,
{
row: row,
canEdit: canEdit.value,
onClickDelete: (historyId) => onClickDeleteButton(historyId),
onClickEdit: (historyId) => onClickEditButton(historyId),
}
@@ -114,13 +136,7 @@ const onClickDeleteButton = async (historyId) => {
if (confirmed) {
loading.value = true
router.reload({
only: [
'inDepartmentHistories',
'recipientHistories',
'dischargedHistories',
'deceasedHistories',
'transferredHistories'
],
only: ['patients'],
onSuccess: () => {
loading.value = false
}
@@ -129,7 +145,10 @@ const onClickDeleteButton = async (historyId) => {
}
const submit = () => {
router.post('/nurse/report/save', {}, {
router.post('/nurse/report/save', {
userId: props.selectedUserId,
departmentId: props.selectedDepartmentId,
}, {
onSuccess: () => {
alert('Сохранено')
}
@@ -147,13 +166,13 @@ const formattedLabel = (word, count) => {
<AppPanel>
<NFlex justify="space-between" align="center">
<NTag type="info" :bordered="false">
{{ userDepartment.name_full }}
{{ department?.name_full ?? userDepartment.name_full }}
</NTag>
<DatePickerQuery :date="dates" class="text-lg!" />
<ShiftPickerQuery :date="dates" class="text-lg!" />
</NFlex>
</AppPanel>
<AppPanel header="Пациенты в отделении" header-include-body>
<template #header-extra>
<AppPanel header="Журнал пациентов" header-include-body>
<template v-if="canEdit" #header-extra>
<NButton secondary :loading="loading" @click="showAddMedicalHistoryModal = true">
<template #icon>
<TbCirclePlus />
@@ -211,12 +230,12 @@ const formattedLabel = (word, count) => {
</NTabPane>
</NTabs>
</AppPanel>
<NButton secondary size="large" @click="submit" :loading="loading">
<NButton v-if="canSaveReport" secondary size="large" @click="submit" :loading="loading">
Сохранить отчет
</NButton>
</AppContainer>
<AddMedicalHistoryModal v-model:show="showAddMedicalHistoryModal" />
<EditMedicalHistoryModal v-model:show="showEditMedicalHistoryModal" :history-id="editHistoryId" />
<EditMedicalHistoryModal v-model:show="showEditMedicalHistoryModal" :history-id="editHistoryId" :report-nurse-id="props.reportNurseId" />
</AppLayout>
</template>