From fd0e6ee817cc4b824aa14ba74f685563b702ca35 Mon Sep 17 00:00:00 2001 From: brusnitsyn Date: Fri, 24 Apr 2026 16:44:58 +0900 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=B0?= =?UTF-8?q?=20=D0=98=20=D0=B8=D0=BD=D0=B4=D0=B8=D0=BA=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D1=80=20=D1=80=D0=B5=D0=B0=D0=BD=D0=B8=D0=BC=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Exports/ReportPageExport.php | 23 +++++ app/Exports/Sheets/ArraySheetExport.php | 92 +++++++++++++++++++ app/Models/ReanimationPatientIndicator.php | 19 ++++ ...e_reanimation_patient_indicators_table.php | 33 +++++++ .../Components/ReanimationIndicatorModal.vue | 92 +++++++++++++++++++ 5 files changed, 259 insertions(+) create mode 100644 app/Exports/ReportPageExport.php create mode 100644 app/Exports/Sheets/ArraySheetExport.php create mode 100644 app/Models/ReanimationPatientIndicator.php create mode 100644 database/migrations/2026_04_24_120000_create_reanimation_patient_indicators_table.php create mode 100644 resources/js/Pages/Report/Components/ReanimationIndicatorModal.vue 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 @@ + + +