From 7c0f1dc02ac19b5eed548cc7480aa34eaa4a7e36 Mon Sep 17 00:00:00 2001 From: Novy San87 Date: Thu, 6 Aug 2026 22:52:01 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20tombol=20Cetak=20PDF/Export=20Excel=20ki?= =?UTF-8?q?rim=20filter=20via=20state=20Alpine=20(class+jenis)=20=E2=80=94?= =?UTF-8?q?=20bukan=20atribut=20form=20yang=20kadang=20tidak=20membawa=20n?= =?UTF-8?q?ilai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/reports/violations.blade.php | 24 ++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/resources/views/reports/violations.blade.php b/resources/views/reports/violations.blade.php index 029060f..34d29ef 100644 --- a/resources/views/reports/violations.blade.php +++ b/resources/views/reports/violations.blade.php @@ -31,12 +31,12 @@
- -
@@ -331,6 +331,22 @@ this.dateTo = to; this.$nextTick(() => document.getElementById('filter-form').submit()); }, + queryString() { + const p = new URLSearchParams(); + if (this.dateFrom) p.set('date_from', this.dateFrom); + if (this.dateTo) p.set('date_to', this.dateTo); + if (this.classId) p.set('class_id', this.classId); + if (this.jenisId) p.set('violation_type_id', this.jenisId); + return p.toString(); + }, + cetakPdf() { + const qs = this.queryString(); + window.open('{{ route('reports.violations.pdf') }}' + (qs ? '?' + qs : ''), '_blank'); + }, + exportExcel() { + const qs = this.queryString(); + window.location.href = '{{ route('violations.export') }}' + (qs ? '?' + qs : ''); + }, resetFilter() { this.dateFrom = ''; this.dateTo = '';