Обновлен стартовый экран
Переписаны запросы для статистики, отчетов Добавлена интеграция отчета сестры
This commit is contained in:
@@ -5,6 +5,10 @@ import {computed} from "vue";
|
||||
const props = defineProps({
|
||||
row: {
|
||||
type: Object
|
||||
},
|
||||
canEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
const emits = defineEmits(['clickEdit', 'clickDelete'])
|
||||
@@ -21,7 +25,7 @@ const isManualType = computed(() => props.row.source_type === 'manual')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NFlex align="center" justify="end">
|
||||
<NFlex v-if="canEdit" align="center" justify="end">
|
||||
<NButton v-if="isManualType" type="error" secondary size="tiny" @click="onClickDelete">
|
||||
<template #icon>
|
||||
<TbTrash />
|
||||
|
||||
@@ -23,6 +23,10 @@ const show = defineModel('show', { default: false })
|
||||
const props = defineProps({
|
||||
historyId: {
|
||||
type: Number
|
||||
},
|
||||
reportNurseId: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
})
|
||||
|
||||
@@ -105,16 +109,11 @@ const visitResultOptions = [
|
||||
const submit = async () => {
|
||||
buttonLoading.value = true
|
||||
await axios.post(`/api/nurse/patients/${form.value.patient_id}/correction`, {
|
||||
...form.value
|
||||
...form.value,
|
||||
report_nurse_id: props.reportNurseId,
|
||||
}).then(res => {
|
||||
router.reload({
|
||||
only: [
|
||||
'inDepartmentHistories',
|
||||
'recipientHistories',
|
||||
'dischargedHistories',
|
||||
'deceasedHistories',
|
||||
'transferredHistories'
|
||||
],
|
||||
only: ['patients'],
|
||||
onSuccess: () => {
|
||||
show.value = false
|
||||
},
|
||||
|
||||
@@ -3,11 +3,12 @@ import AppLayout from "../../../Layouts/AppLayout.vue";
|
||||
import {NFlex, NTag, NDataTable, NButton, NTabs, NTabPane} from 'naive-ui'
|
||||
import AppContainer from "../../../Components/AppContainer.vue";
|
||||
import AppPanel from "../../../Components/AppPanel.vue";
|
||||
import DatePickerQuery from "../../../Components/DatePickerQuery.vue";
|
||||
import ShiftPickerQuery from "../../../Components/ShiftPickerQuery.vue";
|
||||
import UrgencyBadge from "../../../Components/UrgencyBadge.vue";
|
||||
import {computed, h, onMounted, ref, shallowRef} from "vue"
|
||||
import {TbCirclePlus, TbPencil} from 'vue-icons-plus/tb'
|
||||
import {useAuthStore} from "../../../Stores/auth.js";
|
||||
import {usePage} from "@inertiajs/vue3";
|
||||
import AddMedicalHistoryModal from "../Components/AddMedicalHistoryModal.vue";
|
||||
import EditMedicalHistoryModal from "../Components/EditMedicalHistoryModal.vue";
|
||||
import {router} from "@inertiajs/vue3";
|
||||
@@ -19,12 +20,32 @@ const props = defineProps({
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
reportNurseId: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
canSaveReport: Boolean,
|
||||
canEditPastReport: Boolean,
|
||||
department: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
selectedUserId: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
selectedDepartmentId: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
dates: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
})
|
||||
|
||||
const canEdit = computed(() => props.canSaveReport || props.canEditPastReport)
|
||||
|
||||
const showAddMedicalHistoryModal = shallowRef(false)
|
||||
const showEditMedicalHistoryModal = shallowRef(false)
|
||||
const editHistoryId = ref(null)
|
||||
@@ -89,6 +110,7 @@ const columns = [
|
||||
ActionsColumnDataTable,
|
||||
{
|
||||
row: row,
|
||||
canEdit: canEdit.value,
|
||||
onClickDelete: (historyId) => onClickDeleteButton(historyId),
|
||||
onClickEdit: (historyId) => onClickEditButton(historyId),
|
||||
}
|
||||
@@ -114,13 +136,7 @@ const onClickDeleteButton = async (historyId) => {
|
||||
if (confirmed) {
|
||||
loading.value = true
|
||||
router.reload({
|
||||
only: [
|
||||
'inDepartmentHistories',
|
||||
'recipientHistories',
|
||||
'dischargedHistories',
|
||||
'deceasedHistories',
|
||||
'transferredHistories'
|
||||
],
|
||||
only: ['patients'],
|
||||
onSuccess: () => {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -129,7 +145,10 @@ const onClickDeleteButton = async (historyId) => {
|
||||
}
|
||||
|
||||
const submit = () => {
|
||||
router.post('/nurse/report/save', {}, {
|
||||
router.post('/nurse/report/save', {
|
||||
userId: props.selectedUserId,
|
||||
departmentId: props.selectedDepartmentId,
|
||||
}, {
|
||||
onSuccess: () => {
|
||||
alert('Сохранено')
|
||||
}
|
||||
@@ -147,13 +166,13 @@ const formattedLabel = (word, count) => {
|
||||
<AppPanel>
|
||||
<NFlex justify="space-between" align="center">
|
||||
<NTag type="info" :bordered="false">
|
||||
{{ userDepartment.name_full }}
|
||||
{{ department?.name_full ?? userDepartment.name_full }}
|
||||
</NTag>
|
||||
<DatePickerQuery :date="dates" class="text-lg!" />
|
||||
<ShiftPickerQuery :date="dates" class="text-lg!" />
|
||||
</NFlex>
|
||||
</AppPanel>
|
||||
<AppPanel header="Пациенты в отделении" header-include-body>
|
||||
<template #header-extra>
|
||||
<AppPanel header="Журнал пациентов" header-include-body>
|
||||
<template v-if="canEdit" #header-extra>
|
||||
<NButton secondary :loading="loading" @click="showAddMedicalHistoryModal = true">
|
||||
<template #icon>
|
||||
<TbCirclePlus />
|
||||
@@ -211,12 +230,12 @@ const formattedLabel = (word, count) => {
|
||||
</NTabPane>
|
||||
</NTabs>
|
||||
</AppPanel>
|
||||
<NButton secondary size="large" @click="submit" :loading="loading">
|
||||
<NButton v-if="canSaveReport" secondary size="large" @click="submit" :loading="loading">
|
||||
Сохранить отчет
|
||||
</NButton>
|
||||
</AppContainer>
|
||||
<AddMedicalHistoryModal v-model:show="showAddMedicalHistoryModal" />
|
||||
<EditMedicalHistoryModal v-model:show="showEditMedicalHistoryModal" :history-id="editHistoryId" />
|
||||
<EditMedicalHistoryModal v-model:show="showEditMedicalHistoryModal" :history-id="editHistoryId" :report-nurse-id="props.reportNurseId" />
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user