* оптимизировал запросы выдачи пациентов, сохранения снапшотов

* доработал страницу отчета дежурного
* переделал "действия" над пациентом
* подключил виджеты на странице отчета дежурного
This commit is contained in:
brusnitsyn
2026-05-08 17:04:56 +09:00
parent 6cf1ffbb2b
commit 90e0d04dfd
17 changed files with 818 additions and 292 deletions

View File

@@ -5,7 +5,7 @@ import AppContainer from "../../../Components/AppContainer.vue";
import AppPanel from "../../../Components/AppPanel.vue";
import DatePickerQuery from "../../../Components/DatePickerQuery.vue";
import UrgencyBadge from "../../../Components/UrgencyBadge.vue";
import {h, onMounted, ref, shallowRef} from "vue"
import {computed, h, onMounted, ref, shallowRef} from "vue"
import {TbCirclePlus, TbPencil} from 'vue-icons-plus/tb'
import {useAuthStore} from "../../../Stores/auth.js";
import AddMedicalHistoryModal from "../Components/AddMedicalHistoryModal.vue";
@@ -15,23 +15,7 @@ import ActionsColumnDataTable from "../Components/ActionsColumnDataTable.vue";
import {useAppDialog} from "../../../Composables/useAppDialog.js";
const props = defineProps({
inDepartmentHistories: {
type: Array,
default: []
},
recipientHistories: {
type: Array,
default: []
},
dischargedHistories: {
type: Array,
default: []
},
deceasedHistories: {
type: Array,
default: []
},
transferredHistories: {
patients: {
type: Array,
default: []
},
@@ -48,6 +32,31 @@ const authStore = useAuthStore()
const userDepartment = authStore.userDepartment
const loading = ref(false)
const patientsByGroup = computed(() => {
const groups = {
urgent: [],
planned: [],
deceased: [],
in_department: [],
recipient: [],
discharged: [],
transferred: [],
};
for (const p of props.patients.data) {
// Группировка по срочности
if (p.patient_urgency === 'urgent') groups.urgent.push(p);
else if (p.patient_urgency === 'planned') groups.planned.push(p);
// Группировка по статусу (дублирование нужно, если один пациент может быть в двух таблицах)
if (groups.hasOwnProperty(p.patient_status)) {
groups[p.patient_status].push(p);
}
}
return groups;
})
const columns = [
{
title: 'ФИО',
@@ -154,46 +163,46 @@ const formattedLabel = (word, count) => {
</template>
<NTabs type="line">
<NTabPane name="all"
:tab="formattedLabel('В отделении', inDepartmentHistories.length)"
:tab="formattedLabel('В отделении', patientsByGroup.in_department.length)"
>
<NDataTable :columns="columns"
:data="inDepartmentHistories"
:data="patientsByGroup.in_department"
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="income" :tab="formattedLabel('Поступившие', recipientHistories.length)">
<NTabPane name="income" :tab="formattedLabel('Поступившие', patientsByGroup.recipient.length)">
<NDataTable :columns="columns"
:data="recipientHistories"
:data="patientsByGroup.recipient"
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="outcome" :tab="formattedLabel('Выписанные', dischargedHistories.length)">
<NTabPane name="outcome" :tab="formattedLabel('Выписанные', patientsByGroup.discharged.length)">
<NDataTable :columns="columns"
:data="dischargedHistories"
:data="patientsByGroup.discharged"
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="dead" :tab="formattedLabel('Умершие', deceasedHistories.length)">
<NTabPane name="dead" :tab="formattedLabel('Умершие', patientsByGroup.deceased.length)">
<NDataTable :columns="columns"
:data="deceasedHistories"
:data="patientsByGroup.deceased"
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="transfer" :tab="formattedLabel('Переведенные', transferredHistories.length)">
<NTabPane name="transfer" :tab="formattedLabel('Переведенные', patientsByGroup.transferred.length)">
<NDataTable :columns="columns"
:data="transferredHistories"
:data="patientsByGroup.transferred"
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"