* изменил таблицы в основном отчете

* изменил метод сохранения пациентов основного отчета
This commit is contained in:
brusnitsyn
2026-05-07 18:00:43 +09:00
parent 723ccee8d3
commit bb9e67ab3d
25 changed files with 1438 additions and 52 deletions

View File

@@ -0,0 +1,69 @@
<script setup>
import {NSpace, NDropdown, NButton, NIcon} from 'naive-ui'
import {TbExternalLink, TbEyePlus, TbClick} from "vue-icons-plus/tb"
import {computed, h} from "vue";
const props = defineProps({
row: Object,
isMis: Boolean,
isAddObservable: Boolean
})
const renderIcon = (icon) => {
return () => h(
NIcon,
{},
{
default: () => h(icon)
}
)
}
const actions = computed(() => ([
{
label: 'Просмотреть в МИС',
key: 'mis',
icon: renderIcon(TbExternalLink),
show: props.isMis
},
{
type: 'divider',
key: 'd1',
show: props.isMis && props.isAddObservable
},
{
label: 'Добавить в наблюдение',
key: 'add-observable',
icon: renderIcon(TbEyePlus),
show: props.isAddObservable
},
]))
const onOpenMis = () => {
const id = props.row.id
window.open(`https://stationar.amurzdrav.ru/prod/statist/edit/card/${id}`, '_blank')
}
const onSelectOption = (key, option) => {
switch (key) {
case 'mis': onOpenMis()
break
}
}
</script>
<template>
<NSpace size="small" justify="end">
<NDropdown size="small" trigger="click" placement="bottom-end" :options="actions" @select="onSelectOption">
<NButton secondary size="tiny">
<template #icon>
<TbClick />
</template>
Действия
</NButton>
</NDropdown>
</NSpace>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,16 @@
<script setup>
const props = defineProps({
index: {
type: [String, Number],
default: null
}
})
</script>
<template>
<div>{{index}}</div>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,24 @@
<script setup>
import { NTooltip } from 'naive-ui'
import {computed} from "vue";
const props = defineProps({
operations: Array
})
const firstOperation = computed(() => props.operations[0])
</script>
<template>
<NTooltip v-if="operations.length" :arrow="false">
<template #trigger>
<div class="absolute inset-0 p-2 pt-2.5">
{{ firstOperation?.code_service }}
</div>
</template>
{{ firstOperation?.name_service }}
</NTooltip>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,22 @@
<script setup>
import {NTooltip} from 'naive-ui'
const props = defineProps({
triggerText: String,
contentText: String
})
</script>
<template>
<NTooltip trigger="hover" :arrow="false">
<template #trigger>
<div>
{{ triggerText }}
</div>
</template>
{{ contentText }}
</NTooltip>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,86 @@
<script setup>
import {NDataTable, NSpace, NInput, NButton, NFlex} from "naive-ui";
import {TbSearch} from 'vue-icons-plus/tb'
import {computed, h, ref} from "vue";
import IndexColumn from "./DataTableColumns/IndexColumn.vue";
const props = defineProps({
columns: {
type: Array,
default: []
},
data: {
type: Array,
default: []
},
loading: {
type: Boolean
},
})
const patients = ref([...props.data])
const tableColumns = computed(() => {
const baseColumns = [...props.columns]
const numericColumn = {
title: '',
key: 'index',
minWidth: 50,
maxWidth: 60,
width: 50,
resizable: false,
render: (row, i) => h(IndexColumn, { index: i + 1 })
}
baseColumns.unshift(numericColumn)
return baseColumns
})
const searchArg = ref(null)
const findPatient = (arg) => {
patients.value = patients.value.find(itm => itm.full_name === arg)
}
const rowProps = (row) => {
const style = []
if (row.admitted_today) {
style.push('--n-merged-td-color: #047857')
}
return {
style: style,
}
}
</script>
<template>
<NSpace vertical>
<NFlex :wrap="false">
<NInput v-model:value="searchArg" placeholder="Поиск пациента" @input="value => findPatient(value)" />
<NButton secondary @click="findPatient(searchArg)">
<template #icon>
<TbSearch />
</template>
Найти
</NButton>
</NFlex>
<NDataTable :columns="tableColumns"
:data="patients"
table-layout="fixed"
max-height="280"
min-height="280"
:loading="loading"
size="small"
:row-props="rowProps"
/>
</NSpace>
</template>
<style scoped>
:deep(.n-data-table-th),
:deep(.n-data-table-td) {
font-size: var(--n-font-size);
}
</style>

View File

@@ -0,0 +1,16 @@
<script setup>
import { NCollapse } from 'naive-ui'
import {ref} from "vue";
const openedCollapsible = ref()
</script>
<template>
<NCollapse v-model:expanded-names="openedCollapsible">
<slot />
</NCollapse>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,27 @@
<script setup>
import { NCollapseItem } from 'naive-ui'
import {computed} from "vue";
const props = defineProps({
label: {
type: String
},
counter: {
type: [String, Number],
default: null
}
})
const counterText = computed(() => props.counter ? `(${props.counter})` : '')
const header = computed(() => `${props.label} ${counterText.value}`)
</script>
<template>
<NCollapseItem :title="header">
<slot />
</NCollapseItem>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,26 @@
<script setup>
import AppPanel from "../../../Components/AppPanel.vue";
import {NNumberAnimation, NStatistic} from "naive-ui";
const props = defineProps({
to: Number,
})
</script>
<template>
<AppPanel class="min-w-[120px] min-h-[100px] max-h-[102px] h-full"
style="--n-padding-top: 0; --n-padding-bottom: 0; --n-padding-left: 8px; --n-padding-right: 8px;">
<div class="w-full h-full flex flex items-center justify-center">
<NStatistic class="text-center">
<NNumberAnimation :from="0" :to="to" />
<template #label>
<slot />
</template>
</NStatistic>
</div>
</AppPanel>
</template>
<style scoped>
</style>