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

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

@@ -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>