Добавлен вывод отчетов от системы
This commit is contained in:
@@ -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);
|
||||
|
||||
// Цепочка из вашего контроллера
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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!" />
|
||||
|
||||
Reference in New Issue
Block a user