* добавил удаление карты, если она была добавлена не из МИС

* добавил диалог при удалении карты
* добавил сохранение движения
* добавил вывод сохраненного отчета
* изменил логику сохранения отчета
This commit is contained in:
brusnitsyn
2026-05-06 17:03:41 +09:00
parent fe2264dfce
commit 2026a1ca9f
22 changed files with 928 additions and 195 deletions

View File

@@ -5,12 +5,14 @@ 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, ref, shallowRef} from "vue"
import {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";
import EditMedicalHistoryModal from "../Components/EditMedicalHistoryModal.vue";
import {router} from "@inertiajs/vue3";
import ActionsColumnDataTable from "../Components/ActionsColumnDataTable.vue";
import {useAppDialog} from "../../../Composables/useAppDialog.js";
const props = defineProps({
inDepartmentHistories: {
@@ -44,6 +46,7 @@ const showEditMedicalHistoryModal = shallowRef(false)
const editHistoryId = ref(null)
const authStore = useAuthStore()
const userDepartment = authStore.userDepartment
const loading = ref(false)
const columns = [
{
@@ -74,8 +77,13 @@ const columns = [
align: 'end',
render: (row) => {
return h(
NButton, { size: 'tiny', type: 'default', secondary: true, onClick: () => onClickEditButton(row.id) },
{ default: () => 'Редактировать', icon: () => h(TbPencil, { size: '18px' }) })
ActionsColumnDataTable,
{
row: row,
onClickDelete: (historyId) => onClickDeleteButton(historyId),
onClickEdit: (historyId) => onClickEditButton(historyId),
}
)
}
}
]
@@ -85,6 +93,32 @@ const onClickEditButton = (historyId) => {
editHistoryId.value = historyId
}
const onClickDeleteButton = async (historyId) => {
const confirmed = await useAppDialog({
title: 'Удалить историю?',
content: 'Это действие необратимо',
onConfirm: async () => {
await axios.delete(`/api/nurse/patients/${historyId}`)
}
})
if (confirmed) {
loading.value = true
router.reload({
only: [
'inDepartmentHistories',
'recipientHistories',
'dischargedHistories',
'deceasedHistories',
'transferredHistories'
],
onSuccess: () => {
loading.value = false
}
})
}
}
const submit = () => {
router.post('/nurse/report/save', {}, {
onSuccess: () => {
@@ -111,7 +145,7 @@ const formattedLabel = (word, count) => {
</AppPanel>
<AppPanel header="Пациенты в отделении" header-include-body>
<template #header-extra>
<NButton secondary @click="showAddMedicalHistoryModal = true">
<NButton secondary :loading="loading" @click="showAddMedicalHistoryModal = true">
<template #icon>
<TbCirclePlus />
</template>
@@ -127,6 +161,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="income" :tab="formattedLabel('Поступившие', recipientHistories.length)">
@@ -135,6 +170,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="outcome" :tab="formattedLabel('Выписанные', dischargedHistories.length)">
@@ -143,6 +179,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="dead" :tab="formattedLabel('Умершие', deceasedHistories.length)">
@@ -151,6 +188,7 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
<NTabPane name="transfer" :tab="formattedLabel('Переведенные', transferredHistories.length)">
@@ -159,11 +197,12 @@ const formattedLabel = (word, count) => {
table-layout="fixed"
max-height="calc(100vh - 435px)"
min-height="calc(100vh - 435px)"
:loading="loading"
/>
</NTabPane>
</NTabs>
</AppPanel>
<NButton secondary size="large" @click="submit">
<NButton secondary size="large" @click="submit" :loading="loading">
Сохранить отчет
</NButton>
</AppContainer>