Добавил Откуда доставлен и поступил от начала заболевания (дата и время)

This commit is contained in:
brusnitsyn
2026-07-07 17:12:01 +09:00
parent a97930f18e
commit dbc1883eaf
7 changed files with 157 additions and 7 deletions

View File

@@ -74,4 +74,7 @@ VITE_APP_TAG="${APP_TAG}"
VITE_SENTRY_DNS= VITE_SENTRY_DNS=
SYNCIO_BASE_URL=
SYNCIO_SECRET= SYNCIO_SECRET=
SYNCIO_TOKEN=
FIAS_URL=

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Inertia\Inertia;
class FiasController extends Controller
{
public function index(Request $request)
{
$search = $request->input('search');
$response = Http::post(config('fias.url') . '/find', [
'search' => $search,
'filter_by' => [
'level' => '[5,6]',
'isactive' => 1
],
'sort_by' => [
'level' => 'asc'
]
]);
return $response->json();
}
}

5
config/fias.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
return [
'url' => env('FIAS_URL'),
];

View File

@@ -0,0 +1,41 @@
<script setup>
import { useDebounceFn } from '@vueuse/core'
import {ref, defineModel} from 'vue'
import { NSelect } from 'naive-ui'
const value = defineModel('value')
const objectId = defineModel('objectid')
const options = ref()
const loading = ref(false)
const debounceSearch = useDebounceFn((query) => {
axios.post('/api/fias', {
search: query
}).then((res) => {
options.value = res.data
loading.value = false
})
}, 1000, { maxWait: 5000 })
const handleSearch = async (query) => {
if (!query.length) {
options.value = []
return
}
loading.value = true
await debounceSearch(query)
}
const updateValue = (selectedValue) => {
const oId = options.value.find((itm) => itm.full_name === selectedValue)
objectId.value = oId.objectid
}
</script>
<template>
<NSelect v-model:value="value" @update-value="(v) => updateValue(v)" filterable placeholder="" :options="options"
label-field="full_name" value-field="full_name" :loading="loading" clearable remote
:clear-filter-after-select="false" @search="handleSearch" />
</template>

View File

@@ -1,11 +1,12 @@
<script setup> <script setup>
import {NModal, NSteps, NStep, NTabs, NTabPane, NFlex, NGrid, NGi, NButton, NRadioGroup, NSelect, NInput, NFormItemGi, NDatePicker} from 'naive-ui' import {NModal, NSteps, NStep, NTabs, NTabPane, NFlex, NGrid, NGi, NButton, NRadioGroup, NSelect, NInput, NFormItemGi, NDatePicker, NCheckbox} from 'naive-ui'
import {computed, ref, watch} from "vue"; import {computed, ref, watch} from "vue";
import AppRadio from "../../../Components/AppRadio.vue"; import AppRadio from "../../../Components/AppRadio.vue";
import {useDebounceFn} from "@vueuse/core"; import {useDebounceFn} from "@vueuse/core";
import {format} from "date-fns"; import {format} from "date-fns";
import {router, usePage} from "@inertiajs/vue3"; import {router, usePage} from "@inertiajs/vue3";
import AppPanel from "../../../Components/AppPanel.vue" import AppPanel from "../../../Components/AppPanel.vue"
import AppSearchAddress from '../../../Components/AppSearchAddress.vue';
const show = defineModel('show', { default: false }) const show = defineModel('show', { default: false })
const currentStep = ref(1) const currentStep = ref(1)
@@ -24,6 +25,8 @@ const form = ref({
recipient_date: format(new Date(), 'yyyy-MM-dd HH:mm:ss'), recipient_date: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
death_date: null, death_date: null,
extract_date: null, extract_date: null,
deliveriFromAddress: null,
deliveryFromObjectId: null,
mis_id: null mis_id: null
}) })
@@ -39,6 +42,8 @@ const resetForm = () => {
recipient_date: format(new Date(), 'yyyy-MM-dd HH:mm:ss'), recipient_date: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
death_date: null, death_date: null,
extract_date: null, extract_date: null,
deliveriFromAddress: null,
deliveryFromObjectId: null,
mis_id: null mis_id: null
} }
} }
@@ -187,6 +192,21 @@ watch(() => currentStep.value, (val) => {
if (val === 1) resetForm() if (val === 1) resetForm()
}) })
const canShowExtractDateField = ref(false)
const canShowDeathDateField = ref(false)
watch(() => form.value.visit_result_id, (newVisitResultId, oldVisitResultId) => {
if ([1, 2, 3, 4, 7, 8, 9, 10].includes(newVisitResultId)) {
canShowDeathDateField.value = false
canShowExtractDateField.value = true
} else if ([5, 6].includes(newVisitResultId)) {
canShowDeathDateField.value = true
canShowExtractDateField.value = false
} else {
canShowDeathDateField.value = false
canShowExtractDateField.value = false
}
})
const onAfterLeave = () => { const onAfterLeave = () => {
resetForm() resetForm()
currentStep.value = 1 currentStep.value = 1
@@ -249,12 +269,27 @@ const onAfterLeave = () => {
<NFormItemGi span="1" label="Дата и время госпитализации"> <NFormItemGi span="1" label="Дата и время госпитализации">
<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 /> <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>
<NFormItemGi span="1" label="Дата и время выписки"> <NFormItemGi v-if="canShowExtractDateField" span="1" label="Дата и время выписки">
<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 /> <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>
<NFormItemGi span="1" label="Дата и время смерти"> <NFormItemGi v-if="canShowDeathDateField" span="1" label="Дата и время смерти">
<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 /> <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> </NFormItemGi>
<NFormItemGi span="2" label="Поступил от начала заболевания">
<NGrid cols="2" x-gap="8">
<NGi>
<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 />
</NGi>
<NGi class="flex items-center">
<NCheckbox class="text-nowrap">
Неизвестно
</NCheckbox>
</NGi>
</NGrid>
</NFormItemGi>
<NFormItemGi span="2" label="Откуда доставлен">
<AppSearchAddress v-model:value="form.deliveriFromAddress" v-model:objectid="form.deliveryObjectId" />
</NFormItemGi>
</NGrid> </NGrid>
</AppPanel> </AppPanel>
</NTabPane> </NTabPane>

View File

@@ -13,12 +13,14 @@ import {
NSelect, NSelect,
NInput, NInput,
NFormItemGi, NFormItemGi,
NDatePicker NDatePicker,
NCheckbox
} from 'naive-ui' } from 'naive-ui'
import {computed, ref, watch} from "vue"; import {computed, ref, watch} from "vue";
import AppRadio from "../../../Components/AppRadio.vue"; import AppRadio from "../../../Components/AppRadio.vue";
import axios from "axios"; import axios from "axios";
import {router} from "@inertiajs/vue3"; import {router} from "@inertiajs/vue3";
import AppSearchAddress from '../../../Components/AppSearchAddress.vue';
const show = defineModel('show', { default: false }) const show = defineModel('show', { default: false })
const props = defineProps({ const props = defineProps({
historyId: { historyId: {
@@ -44,7 +46,9 @@ const form = ref({
birth_date: null, birth_date: null,
recipient_date: null, recipient_date: null,
death_date: null, death_date: null,
extract_date: null extract_date: null,
deliveriFromAddress: null,
deliveryFromObjectId: null
}) })
const loading = ref(true) const loading = ref(true)
const buttonLoading = ref(false) const buttonLoading = ref(false)
@@ -152,6 +156,21 @@ const fetchPatient = async (historyId) => {
watch(() => props.historyId, async (newHistoryId, historyId) => { watch(() => props.historyId, async (newHistoryId, historyId) => {
await fetchPatient(newHistoryId) await fetchPatient(newHistoryId)
}) })
const canShowExtractDateField = ref(false)
const canShowDeathDateField = ref(false)
watch(() => form.value.visit_result_id, (newVisitResultId, oldVisitResultId) => {
if ([1, 2, 3, 4, 7, 8, 9, 10].includes(newVisitResultId)) {
canShowDeathDateField.value = false
canShowExtractDateField.value = true
} else if ([5, 6].includes(newVisitResultId)) {
canShowDeathDateField.value = true
canShowExtractDateField.value = false
} else {
canShowDeathDateField.value = false
canShowExtractDateField.value = false
}
})
</script> </script>
<template> <template>
@@ -182,12 +201,27 @@ watch(() => props.historyId, async (newHistoryId, historyId) => {
<NFormItemGi span="1" label="Дата и время госпитализации"> <NFormItemGi span="1" label="Дата и время госпитализации">
<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 /> <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>
<NFormItemGi span="1" label="Дата и время выписки"> <NFormItemGi v-if="canShowExtractDateField" span="1" label="Дата и время выписки">
<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 /> <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>
<NFormItemGi span="1" label="Дата и время смерти"> <NFormItemGi v-if="canShowDeathDateField" span="1" label="Дата и время смерти">
<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 /> <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> </NFormItemGi>
<NFormItemGi span="2" label="Поступил от начала заболевания">
<NGrid cols="2" x-gap="8">
<NGi>
<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 />
</NGi>
<NGi class="flex items-center">
<NCheckbox class="text-nowrap">
Неизвестно
</NCheckbox>
</NGi>
</NGrid>
</NFormItemGi>
<NFormItemGi span="2" label="Откуда доставлен">
<AppSearchAddress v-model:value="form.deliveriFromAddress" v-model:objectid="form.deliveryObjectId" />
</NFormItemGi>
</NGrid> </NGrid>
<template v-if="!loading" #action> <template v-if="!loading" #action>
<NFlex justify="end"> <NFlex justify="end">

View File

@@ -119,3 +119,6 @@ Route::middleware(['auth:sanctum'])->group(function () {
Route::prefix('syncio')->group(function () { Route::prefix('syncio')->group(function () {
Route::post('webhook', \App\Http\Controllers\Api\Syncio\SyncioWebhookController::class); Route::post('webhook', \App\Http\Controllers\Api\Syncio\SyncioWebhookController::class);
}); });
Route::prefix('fias')->group(function () {
Route::post('/', [\App\Http\Controllers\Api\FiasController::class, 'index']);
});