* добавил объединение изменений движений

* добавил автоматическое создание движения при редактировании
* добавил функционал для сохранения отчета и пациентов
* изменил форматирование дат
* добавил частичную перезагрузку при сохранении изменений
This commit is contained in:
brusnitsyn
2026-05-05 17:06:15 +09:00
parent 51a4b5b9de
commit 717641e4bb
18 changed files with 712 additions and 60 deletions

View File

@@ -4,12 +4,13 @@ import {computed, ref, watch} from "vue";
import AppRadio from "../../../Components/AppRadio.vue";
import {useDebounceFn} from "@vueuse/core";
import {format} from "date-fns";
import {router} from "@inertiajs/vue3";
const show = defineModel('show', { default: false })
const currentStep = ref(1)
const currentStatus = ref('process')
const isFinallyStep = computed(() => currentStep.value === 2)
const disableFillable = ref(false)
const buttonLoading = ref(false)
const form = ref({
patient_source: 'mis',
@@ -61,7 +62,43 @@ const visitResultOptions = [
{
label: '1 - Выписан',
value: 1
}
},
{
label: '2 - Переведён в др. ЛПУ',
value: 2
},
{
label: '3 - Переведён в дневной стационар',
value: 2
},
{
label: '4 - Переведён на другой профиль коек',
value: 4
},
{
label: '5 - Умер',
value: 5
},
{
label: '6 - Умер в приёмном покое',
value: 6
},
{
label: '7 - Лечение прервано по инициативе пациента',
value: 7
},
{
label: '8 - Лечение прервано по инициативе ЛПУ',
value: 8
},
{
label: '9 - Лечение продолжено',
value: 9
},
{
label: '10 - Самовольно прерванное лечение',
value: 10
},
]
const prev = () => {
@@ -77,10 +114,25 @@ const next = () => {
}
const submit = () => {
buttonLoading.value = true
axios.post('/api/nurse/patients', {
...form.value
}).then(res => {
console.log(res)
router.reload({
only: [
'inDepartmentHistories',
'recipientHistories',
'dischargedHistories',
'deceasedHistories',
'transferredHistories'
],
onSuccess: () => {
show.value = false
},
onFinish: () => {
buttonLoading.value = false
}
})
})
}
@@ -125,6 +177,8 @@ watch(() => currentStep.value, (val) => {
title="Добавление пациента"
class="max-w-xl min-h-[500px]"
draggable
:close-on-esc="!buttonLoading"
:closable="!buttonLoading"
>
<NSteps size="small" :current="currentStep" :status="currentStatus">
<NStep title="Тип пациента" description="Укажите тип пациента" />
@@ -163,16 +217,16 @@ watch(() => currentStep.value, (val) => {
<NSelect filterable v-model:value="form.visit_result_id" :options="visitResultOptions" />
</NFormItemGi>
<NFormItemGi span="1" label="Дата рождения">
<NDatePicker v-model:value="form.birth_date" class="w-full" value-format="yyyy-MM-dd" />
<NDatePicker v-model:value="form.birth_date" class="w-full" format="dd.MM.yyyy" value-format="yyyy-MM-dd" clearable />
</NFormItemGi>
<NFormItemGi span="1" label="Дата и время госпитализации">
<NDatePicker v-model:value="form.recipient_date" type="datetime" class="w-full" value-format="yyyy-MM-dd HH:mm:ss" />
<NDatePicker v-model:value="form.recipient_date" type="datetime" class="w-full" format="dd.MM.yyyy HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable />
</NFormItemGi>
<NFormItemGi span="1" label="Дата и время выписки">
<NDatePicker v-model:value="form.extract_date" type="datetime" class="w-full" value-format="yyyy-MM-dd HH:mm:ss" />
<NDatePicker v-model:value="form.extract_date" type="datetime" class="w-full" format="dd.MM.yyyy HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable />
</NFormItemGi>
<NFormItemGi span="1" label="Дата и время смерти">
<NDatePicker v-model:value="form.death_date" type="datetime" class="w-full" value-format="yyyy-MM-dd HH:mm:ss" />
<NDatePicker v-model:value="form.death_date" type="datetime" class="w-full" format="dd.MM.yyyy HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable />
</NFormItemGi>
</NGrid>
</NTabPane>
@@ -180,13 +234,13 @@ watch(() => currentStep.value, (val) => {
<template #action>
<NGrid cols="2" justify="space-between">
<NGi>
<NButton v-if="currentStep > 1" secondary @click="prev">
<NButton v-if="currentStep > 1" secondary @click="prev" :loading="buttonLoading">
Назад
</NButton>
</NGi>
<NGi>
<NFlex justify="end">
<NButton v-if="isFinallyStep" secondary type="primary" @click="submit">
<NButton v-if="isFinallyStep" secondary type="primary" @click="submit" :loading="buttonLoading">
Добавить
</NButton>
<NButton v-else secondary type="primary" @click="next">

View File

@@ -18,6 +18,7 @@ import {
import {computed, ref, watch} from "vue";
import AppRadio from "../../../Components/AppRadio.vue";
import axios from "axios";
import {router} from "@inertiajs/vue3";
const show = defineModel('show', { default: false })
const props = defineProps({
historyId: {
@@ -37,6 +38,7 @@ const form = ref({
extract_date: null
})
const loading = ref(true)
const buttonLoading = ref(false)
const urgencyOptions = [
{
@@ -60,14 +62,65 @@ const visitResultOptions = [
{
label: '1 - Выписан',
value: 1
}
},
{
label: '2 - Переведён в др. ЛПУ',
value: 2
},
{
label: '3 - Переведён в дневной стационар',
value: 3
},
{
label: '4 - Переведён на другой профиль коек',
value: 4
},
{
label: '5 - Умер',
value: 5
},
{
label: '6 - Умер в приёмном покое',
value: 6
},
{
label: '7 - Лечение прервано по инициативе пациента',
value: 7
},
{
label: '8 - Лечение прервано по инициативе ЛПУ',
value: 8
},
{
label: '9 - Лечение продолжено',
value: 9
},
{
label: '10 - Самовольно прерванное лечение',
value: 10
},
]
const submit = () => {
axios.post(`/api/nurse/patients/${form.value.patient_id}/correction`, {
const submit = async () => {
buttonLoading.value = true
await axios.post(`/api/nurse/patients/${form.value.patient_id}/correction`, {
...form.value
}).then(res => {
console.log(res)
router.reload({
only: [
'inDepartmentHistories',
'recipientHistories',
'dischargedHistories',
'deceasedHistories',
'transferredHistories'
],
onSuccess: () => {
show.value = false
},
onFinish: () => {
buttonLoading.value = false
}
})
})
}
@@ -102,6 +155,7 @@ watch(() => props.historyId, async (newHistoryId, historyId) => {
title="Редактирование пациента"
class="max-w-xl min-h-[500px] relative"
draggable
:closable="!buttonLoading"
>
<div v-if="loading">
<NSpin class="absolute top-1/2 left-1/2 -translate-x-1/2" />
@@ -117,21 +171,21 @@ watch(() => props.historyId, async (newHistoryId, historyId) => {
<NSelect filterable v-model:value="form.visit_result_id" :options="visitResultOptions" />
</NFormItemGi>
<NFormItemGi span="1" label="Дата рождения">
<NDatePicker v-model:value="form.birth_date" class="w-full" />
<NDatePicker v-model:formatted-value="form.birth_date" class="w-full" format="dd.MM.yyyy" value-format="yyyy-MM-dd" clearable />
</NFormItemGi>
<NFormItemGi span="1" label="Дата и время госпитализации">
<NDatePicker v-model:value="form.recipient_date" type="datetime" class="w-full" />
<NDatePicker v-model:formatted-value="form.recipient_date" type="datetime" class="w-full" format="dd.MM.yyyy HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable />
</NFormItemGi>
<NFormItemGi span="1" label="Дата и время выписки">
<NDatePicker v-model:value="form.extract_date" type="datetime" class="w-full" />
<NDatePicker v-model:formatted-value="form.extract_date" type="datetime" class="w-full" format="dd.MM.yyyy HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable />
</NFormItemGi>
<NFormItemGi span="1" label="Дата и время смерти">
<NDatePicker v-model:value="form.death_date" type="datetime" class="w-full" />
<NDatePicker v-model:formatted-value="form.death_date" type="datetime" class="w-full" format="dd.MM.yyyy HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable />
</NFormItemGi>
</NGrid>
<template v-if="!loading" #action>
<NFlex justify="end">
<NButton secondary type="primary" @click="submit">
<NButton secondary type="primary" @click="submit" :loading="buttonLoading">
Сохранить
</NButton>
</NFlex>

View File

@@ -10,6 +10,7 @@ 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";
const props = defineProps({
inDepartmentHistories: {
@@ -85,7 +86,11 @@ const onClickEditButton = (historyId) => {
}
const submit = () => {
// TODO: сохранение отчета и пациентов
router.post('/nurse/report/save', {}, {
onSuccess: () => {
alert('Сохранено')
}
})
}
const formattedLabel = (word, count) => {
@@ -158,7 +163,7 @@ const formattedLabel = (word, count) => {
</NTabPane>
</NTabs>
</AppPanel>
<NButton secondary size="large">
<NButton secondary size="large" @click="submit">
Сохранить отчет
</NButton>
</AppContainer>