diff --git a/app/Exports/DutyReportExport.php b/app/Exports/DutyReportExport.php index 2880de6..f126ad0 100644 --- a/app/Exports/DutyReportExport.php +++ b/app/Exports/DutyReportExport.php @@ -9,12 +9,6 @@ use Illuminate\Support\Collection; class DutyReportExport { - private const RU_MONTHS = [ - 1 => 'январь', 2 => 'февраль', 3 => 'март', 4 => 'апрель', - 5 => 'май', 6 => 'июнь', 7 => 'июль', 8 => 'август', - 9 => 'сентябрь', 10 => 'октябрь', 11 => 'ноябрь', 12 => 'декабрь', - ]; - public function __construct( protected array $patients, protected array $dateRange, @@ -29,12 +23,13 @@ class DutyReportExport public function toViewData(): array { $patients = collect($this->patients); + $startDate = Carbon::parse($this->dateRange[0]); $endDate = Carbon::parse($this->dateRange[1]); return [ 'title' => sprintf('%s «%s»', $this->reportName, $this->department->name_full ?? $this->department->name_short), - 'day' => $endDate->format('d'), - 'month' => self::RU_MONTHS[(int) $endDate->format('n')], + 'day' => $startDate->format('d'), + 'month' => $startDate->locale('ru')->getTranslatedMonthName('Do MMMM'), 'year' => $endDate->format('Y'), 'planned' => $this->urgencyGroup($patients, 'planned'), 'urgent' => $this->urgencyGroup($patients, 'urgent'), @@ -97,6 +92,7 @@ class DutyReportExport 'full_name' => $patient['full_name'], 'age' => $age !== null ? "{$age} ".$this->pluralizeAge($age) : '', 'diagnosis' => $withDiagnosis ? (data_get($patient, 'latest_migration.diagnosis_name') ?? '') : null, + 'migration_id' => (data_get($patient, 'latest_migration.original_id') ?? '') ]; } diff --git a/resources/views/reports/duty.blade.php b/resources/views/reports/duty.blade.php index cee9ca2..1245fea 100644 --- a/resources/views/reports/duty.blade.php +++ b/resources/views/reports/duty.blade.php @@ -9,8 +9,7 @@ .sub { text-align: center; margin: 0 0 16px; } .label { font-weight: bold; margin: 10px 0 2px; } .patient { margin: 2px 0 2px 12px; } - .signature { margin-top: 32px; } - .signature p { margin: 12px 0; } + .signature { position: absolute } @@ -19,24 +18,24 @@

Плановые: {{ $planned['count'] }}

@foreach ($planned['patients'] as $i => $p) -

{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif

+

{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif id = {{ $p['migration_id'] }}

@endforeach

Экстренные: {{ $urgent['count'] }}

@foreach ($urgent['patients'] as $i => $p) -

{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif

+

{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) Д/З: {{ $p['diagnosis'] }}.@endif id = {{ $p['migration_id'] }}

@endforeach

В отделении состоит: {{ $inDepartment }}

Плановых операций: {{ $plannedOperations['count'] }}

- @foreach ($plannedOperations['patients'] as $p) -

{{ $p['full_name'] }} {{ $p['age'] }}.

+ @foreach ($plannedOperations['patients'] as $i => $p) +

{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.

@endforeach

Экстренных операций: {{ $urgentOperations['count'] }}

- @foreach ($urgentOperations['patients'] as $p) -

{{ $p['full_name'] }} {{ $p['age'] }}.

+ @foreach ($urgentOperations['patients'] as $i => $p) +

{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.

@endforeach

Реанимация: {{ $reanimation['count'] }}

@@ -51,9 +50,15 @@

{{ $i + 1 }}. {{ $p['full_name'] }} {{ $p['age'] }}.@if ($p['diagnosis']) {{ $p['diagnosis'] }}.@endif

@endforeach -
-

Дежурный врач ПДО: _____________

-

Дежурный врач отделения: _____________

+
+
+ ____________________________ +
+
+
+
+ ____________________________ +