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

* добавил диалог при удалении карты
* добавил сохранение движения
* добавил вывод сохраненного отчета
* изменил логику сохранения отчета
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

@@ -0,0 +1,42 @@
<script setup>
import {NFlex, NButton} from 'naive-ui'
import {TbPencil, TbTrash} from 'vue-icons-plus/tb'
import {computed} from "vue";
const props = defineProps({
row: {
type: Object
}
})
const emits = defineEmits(['clickEdit', 'clickDelete'])
const onClickEdit = () => {
emits('clickEdit', props.row.id)
}
const onClickDelete = () => {
emits('clickDelete', props.row.id)
}
const isMisType = computed(() => props.row.source_type === 'mis')
const isManualType = computed(() => props.row.source_type === 'manual')
</script>
<template>
<NFlex align="center" justify="end">
<NButton v-if="isManualType" type="error" secondary size="tiny" @click="onClickDelete">
<template #icon>
<TbTrash />
</template>
Удалить
</NButton>
<NButton secondary size="tiny" @click="onClickEdit">
<template #icon>
<TbPencil />
</template>
Редактировать
</NButton>
</NFlex>
</template>
<style scoped>
</style>

View File

@@ -160,10 +160,10 @@ const onChangeSearch = (historyId) => {
form.value.urgency_id = res.data.urgency_id
form.value.visit_result_id = res.data.visit_result_id
form.value.birth_date = res.data.birth_date ? format(new Date(res.data.birth_date), 'yyyy-MM-dd HH:mm:ss') : null
form.value.death_date = res.data.death_date ? format(new Date(res.data.death_date), 'yyyy-MM-dd HH:mm:ss') : null
form.value.extract_date = res.data.extract_date ? format(new Date(res.data.extract_date), 'yyyy-MM-dd HH:mm:ss') : null
form.value.recipient_date = res.data.recipient_date ? format(new Date(res.data.recipient_date), 'yyyy-MM-dd HH:mm:ss') : null
form.value.birth_date = res.data.birth_date
form.value.death_date = res.data.death_date
form.value.extract_date = res.data.extract_date
form.value.recipient_date = res.data.recipient_date
})
}

View File

@@ -28,6 +28,7 @@ const props = defineProps({
const form = ref({
patient_source: 'mis',
original_id: null,
patient_id: null,
full_name: '',
urgency_id: 1,
@@ -128,7 +129,9 @@ const fetchPatient = async (historyId) => {
loading.value = true
await axios.get(`/api/nurse/patients/${historyId}`)
.then(res => {
form.value.patient_source = res.data.source_type
form.value.patient_id = historyId
form.value.original_id = res.data.original_id
form.value.full_name = res.data.full_name
form.value.urgency_id = res.data.urgency_id
form.value.visit_result_id = res.data.visit_result_id

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>