Добавлен вывод отчетов от системы

This commit is contained in:
brusnitsyn
2026-06-03 11:03:12 +09:00
parent f2cb6373ce
commit c857bd9f72
3 changed files with 16 additions and 5 deletions

View File

@@ -178,7 +178,7 @@ class GenerateDutyReport extends Command
// Формируем DateRange через ваш сервис (учёт смен, часовых поясов)
$user = User::find($userId);
$lpuDoctorId = $user->rf_lpudoctor_id ?? 1;
$lpuDoctorId = 0;
$dateRange = $dateRangeService->createDateRangeForDate($shiftEnd, $user);
// Цепочка из вашего контроллера

View File

@@ -49,7 +49,7 @@ class DutyReportService
$departmentId = $departmentId ?? $user->rf_department_id;
$data = [
'report_date' => Carbon::now()->format('Y-m-d'),
'report_date' => $dateRange->endSql(),
'sent_at' => Carbon::now()->format('Y-m-d H:i:s'),
'period_type' => 'day',
'period_start' => $dateRange->startSql(),

View File

@@ -1,7 +1,7 @@
<script setup>
import AppLayout from "../../Layouts/AppLayout.vue";
import {useReportStore} from "../../Stores/report.js";
import {onMounted, ref, watch, provide} from "vue";
import {onMounted, ref, watch, provide, computed} from "vue";
import {useAuthStore} from "../../Stores/auth.js";
import {
NFormItem,
@@ -184,6 +184,17 @@ const syncPageProps = (pageProps = props) => {
onMounted(syncPageProps)
const reportCreator = computed(() => {
if (latestReportObj.value === null) return ''
if (latestReportObj.value.doctor.LPUDoctorID === 0) return 'Отчет создан системой'
else return `Отчет создан: ${latestReportObj.value.doctor.FAM_V} ${latestReportObj.value.doctor.IM_V} ${latestReportObj.value.doctor.OT_V}`
})
const reportCreatorType = computed(() => {
if (latestReportObj.value === null) return 'warning'
if (latestReportObj.value.doctor.LPUDoctorID === 0) return 'error'
else return 'warning'
})
watch(() => props, (newProps) => {
syncPageProps(newProps)
}, {
@@ -206,8 +217,8 @@ watch(() => props, (newProps) => {
<NTag type="info" :bordered="false">
{{ department.name_full }}
</NTag>
<NTag v-if="props.latestReport" type="warning" :bordered="false">
Отчет создан: {{ `${props.latestReport.doctor.FAM_V} ${props.latestReport.doctor.IM_V} ${props.latestReport.doctor.OT_V}` }}
<NTag v-if="props.latestReport" :type="reportCreatorType" :bordered="false">
{{ reportCreator }}
</NTag>
</NSpace>
<DatePickerQuery :date="dates" :is-head-or-admin="true" class="text-lg!" />