* связка таблицы архива с пациентами
* добавил разграничение карт по типам баз * модель для хранения изменений статуса карт * добавил окно с просмотром выдачи карты * добавил фильтрацию вывода карт
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
<script setup>
|
||||
import {NDataTable, NEllipsis} from "naive-ui"
|
||||
import {h, reactive, ref} from "vue"
|
||||
import {useMedicalHistory} from "../../../Composables/useMedicalHistory.js";
|
||||
import {computed, h, reactive, ref} from "vue"
|
||||
import {useMedicalHistoryFilter} from "../../../Composables/useMedicalHistoryFilter.js";
|
||||
import ArchiveHistoryModal from '../ArchiveHistoryModal/Index.vue'
|
||||
|
||||
const { navigate } = useMedicalHistory('/')
|
||||
const props = defineProps({
|
||||
data: {
|
||||
filters: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
meta: {
|
||||
type: Object,
|
||||
default: {}
|
||||
data: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
maxHeight: {
|
||||
type: String,
|
||||
@@ -20,15 +20,17 @@ const props = defineProps({
|
||||
minHeight: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
const { isLoading, handlePageChange, handlePageSizeChange, meta } = useMedicalHistoryFilter(props.filters)
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: '№ карты',
|
||||
key: 'nkarta',
|
||||
key: 'medcardnum',
|
||||
width: 100,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.nkarta })
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.medcardnum })
|
||||
},
|
||||
{
|
||||
title: 'ФИО',
|
||||
@@ -44,21 +46,21 @@ const columns = ref([
|
||||
},
|
||||
{
|
||||
title: 'Дата поступления',
|
||||
key: 'mpostdate',
|
||||
key: 'daterecipient',
|
||||
width: 150,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.mpostdate })
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.daterecipient })
|
||||
},
|
||||
{
|
||||
title: 'Дата выписки',
|
||||
key: 'menddate',
|
||||
key: 'dateextract',
|
||||
width: 130,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.menddate })
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.dateextract })
|
||||
},
|
||||
{
|
||||
title: '№ архива',
|
||||
key: 'narhiv',
|
||||
width: 120,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.narhiv })
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.narhiv || '-' })
|
||||
},
|
||||
{
|
||||
title: 'Дата архива',
|
||||
@@ -73,28 +75,35 @@ const columns = ref([
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.status || '-' })
|
||||
}
|
||||
])
|
||||
const showArchiveHistoryModal = ref(false)
|
||||
const selectedPatientId = ref(null)
|
||||
const rowProps = (row) => ({
|
||||
onDblclick: () => {
|
||||
selectedPatientId.value = row.id
|
||||
showArchiveHistoryModal.value = true
|
||||
}
|
||||
})
|
||||
|
||||
const paginationReactive = reactive({
|
||||
page: props.meta.current_page,
|
||||
pageCount: props.meta.last_page,
|
||||
pageSize: props.meta.per_page,
|
||||
itemCount: props.meta.total,
|
||||
const pagination = computed(() => ({
|
||||
page: meta.value.current_page || 1,
|
||||
pageCount: meta.value.last_page || 1,
|
||||
pageSize: meta.value.per_page || 15,
|
||||
itemCount: meta.value.total || 0,
|
||||
pageSizes: [15, 50, 100],
|
||||
showSizePicker: true,
|
||||
prefix({ itemCount }) {
|
||||
return `Всего карт ${itemCount}.`
|
||||
},
|
||||
onUpdatePage(page) {
|
||||
navigate(undefined, page)
|
||||
onUpdatePage: (page) => {
|
||||
handlePageChange(page)
|
||||
},
|
||||
onUpdatePageSize(pageSize) {
|
||||
navigate(undefined, 1, pageSize)
|
||||
}
|
||||
})
|
||||
onUpdatePageSize: handlePageSizeChange
|
||||
}))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NDataTable remote striped :columns="columns" :pagination="paginationReactive" :max-height="maxHeight" size="small" :min-height="minHeight" :data="data" />
|
||||
<NDataTable remote striped :loading="isLoading" :row-props="rowProps" :columns="columns" :pagination="pagination" :max-height="maxHeight" size="small" :min-height="minHeight" :data="data" />
|
||||
<ArchiveHistoryModal v-model:open="showArchiveHistoryModal" :patient-id="selectedPatientId" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user