diff --git a/app/Exports/ReportPageExport.php b/app/Exports/ReportPageExport.php new file mode 100644 index 0000000..305fb6c --- /dev/null +++ b/app/Exports/ReportPageExport.php @@ -0,0 +1,23 @@ +summaryRows), + new ArraySheetExport('Пациенты', $this->patientRows), + ]; + } +} + diff --git a/app/Exports/Sheets/ArraySheetExport.php b/app/Exports/Sheets/ArraySheetExport.php new file mode 100644 index 0000000..68dbfe8 --- /dev/null +++ b/app/Exports/Sheets/ArraySheetExport.php @@ -0,0 +1,92 @@ +rows; + } + + public function title(): string + { + return $this->sheetTitle; + } + + public function styles(Worksheet $sheet): array + { + $sheet->getPageSetup()->setPaperSize(PageSetup::PAPERSIZE_A4); + $sheet->getPageSetup()->setOrientation(PageSetup::ORIENTATION_LANDSCAPE); + $sheet->getPageSetup()->setFitToPage(true); + $sheet->getPageSetup()->setFitToWidth(1); + $sheet->getPageSetup()->setFitToHeight(0); + + $sheet->getPageMargins()->setTop(0.2); + $sheet->getPageMargins()->setBottom(0.2); + $sheet->getPageMargins()->setLeft(0.2); + $sheet->getPageMargins()->setRight(0.2); + + $highestRow = $sheet->getHighestRow(); + $highestColumn = $sheet->getHighestColumn(); + + $sheet->getStyle("A1:{$highestColumn}{$highestRow}")->applyFromArray([ + 'alignment' => [ + 'horizontal' => Alignment::HORIZONTAL_LEFT, + 'vertical' => Alignment::VERTICAL_CENTER, + 'wrapText' => true, + ], + 'borders' => [ + 'allBorders' => [ + 'borderStyle' => Border::BORDER_THIN, + 'color' => ['argb' => 'D0D7DE'], + ], + ], + ]); + + $sheet->getStyle("A1:{$highestColumn}1")->applyFromArray([ + 'font' => [ + 'bold' => true, + ], + 'fill' => [ + 'fillType' => Fill::FILL_SOLID, + 'startColor' => ['argb' => 'EEF2FF'], + ], + ]); + + for ($row = 1; $row <= $highestRow; $row++) { + $firstCell = (string) $sheet->getCell("A{$row}")->getValue(); + $secondCell = (string) $sheet->getCell("B{$row}")->getValue(); + + // Строки секций (МИС / Спец. контингент) + if (in_array($firstCell, ['МИС', 'Спец. контингент'], true) && $secondCell === '') { + $sheet->getStyle("A{$row}:{$highestColumn}{$row}")->applyFromArray([ + 'font' => ['bold' => true], + 'fill' => [ + 'fillType' => Fill::FILL_SOLID, + 'startColor' => ['argb' => 'F4F6F8'], + ], + ]); + } + } + + $sheet->freezePane('A2'); + + return []; + } +} diff --git a/app/Models/ReanimationPatientIndicator.php b/app/Models/ReanimationPatientIndicator.php new file mode 100644 index 0000000..727a449 --- /dev/null +++ b/app/Models/ReanimationPatientIndicator.php @@ -0,0 +1,19 @@ +id('reanimation_patient_indicator_id'); + $table->unsignedBigInteger('rf_department_id'); + $table->unsignedBigInteger('rf_report_id')->nullable(); + $table->unsignedBigInteger('rf_medicalhistory_id'); + $table->string('indicator', 100); + $table->text('comment')->nullable(); + $table->unsignedBigInteger('created_by')->nullable(); + $table->timestamps(); + + $table->index( + ['rf_department_id', 'rf_medicalhistory_id', 'created_at'], + 'idx_reanimation_indicator_department_history_created_at' + ); + $table->index(['rf_report_id'], 'idx_reanimation_indicator_report'); + }); + } + + public function down(): void + { + Schema::dropIfExists('reanimation_patient_indicators'); + } +}; diff --git a/resources/js/Pages/Report/Components/ReanimationIndicatorModal.vue b/resources/js/Pages/Report/Components/ReanimationIndicatorModal.vue new file mode 100644 index 0000000..84e65ec --- /dev/null +++ b/resources/js/Pages/Report/Components/ReanimationIndicatorModal.vue @@ -0,0 +1,92 @@ + + +