Ringkasan: - Menambahkan halaman hasil inspeksi dan tampilan cetak laporan. - Mengekstrak komponen detail lokasi ke partial baru agar reusable. - Menambahkan null-safe access dan perbaikan binding data di view. - Merapikan tombol cetak dan navigasi agar konsisten antar halaman. Perubahan utama: 1. activitydetail.blade.php → ubah tombol print jadi route, tambah null-safe user/branch. 2. detail-lokasi.blade.php (baru) → komponen reusable untuk detail lokasi dengan formatLabel & tanggal. 3. form-penilai.blade.php → refactor luas menggunakan match, hapus fungsi debug & Swal loading. 4. print-out-dokument.blade.php → gunakan partial lpj::component.detail-lokasi untuk detail lokasi. 5. show-laporan-inspeksi.blade.php (baru) → tab 'Laporan' & 'Hasil Inspeksi' + tombol cetak dan back. 6. print-out-sederhana / print-out-standar → penyesuaian tampilan & binding data. 7. signature-approval.blade.php → perbaikan layout area tanda tangan. 8. surveyor/components/* → normalisasi tampilan, validasi gambar, dan penyelarasan fakta/lingkungan. 9. routes/web.php → tambah dan ubah rute untuk laporan inspeksi dan cetak laporan. Catatan: - Tidak ada perubahan query database; semua modifikasi bersifat tampilan. - Logging tambahan untuk observabilitas proses render laporan.
133 lines
5.3 KiB
PHP
133 lines
5.3 KiB
PHP
@extends('layouts.main')
|
|
|
|
@section('breadcrumbs')
|
|
{{-- {{ Breadcrumbs::render(request()->route()->getName()) }} --}}
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
|
<div class="card">
|
|
<div class="card-header py-5 flex-wrap">
|
|
<div class="card-title flex flex-row gap-1.5">
|
|
<button id="tab-laporan" class="btn btn-sm btn-primary">Laporan</button>
|
|
<button id="tab-hasil" class="btn btn-sm btn-light">Hasil Inspeksi</button>
|
|
</div>
|
|
<div class="flex items-wrap gap-2.5">
|
|
{{-- <a href="{{ $back ?? route()->previous()}}" class="btn btn-xs btn-info"><i
|
|
class="ki-filled ki-exit-left"></i>
|
|
Back</a> --}}
|
|
<a id="back-button" class="btn btn-xs btn-info">
|
|
<i class="ki-filled ki-exit-left"></i> Back
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
@php
|
|
$permohonan_id = request()->segment(3);
|
|
$dokumen_id = request()->segment(4);
|
|
$jenis_jaminan_id = request()->segment(5);
|
|
@endphp
|
|
|
|
<div id="laporan" class="tab-content">
|
|
<div class="floating-button">
|
|
<a href="penilai/print-out-laporan/{{ $permohonan_id }}/{{ $dokumen_id }}/{{ $jenis_jaminan_id }}" class="btn btn-primary">
|
|
Cetak Laporan
|
|
<i class="ki-filled ki-printer"></i>
|
|
</a>
|
|
</div>
|
|
|
|
@php
|
|
$laporan = [
|
|
'sederhana' => 'lpj::penilai.components.print-out-sederhana',
|
|
'standar' => 'lpj::penilai.components.print-out-standar',
|
|
'resume' => 'lpj::penilai.components.print-resume',
|
|
'memo' => 'lpj::penilai.components.print-memo',
|
|
'rap' => 'lpj::penilai.components.print-out-rap',
|
|
'call-report' => 'penilai.components.print-out-call-report',
|
|
];
|
|
@endphp
|
|
@if (array_key_exists($lpj->type_penilai, $laporan))
|
|
@include($laporan[$lpj->type_penilai])
|
|
@else
|
|
<p>Tipe laporan tidak ditemukan.</p>
|
|
@endif
|
|
</div>
|
|
<div id="hasil-inspeksi" class="tab-content hidden-tab">
|
|
<div class="floating-button">
|
|
<a href="surveyor/print-out-inspeksi/{{ $permohonan_id }}/{{ $dokumen_id }}/{{ $jenis_jaminan_id }}"
|
|
class="btn btn-primary">
|
|
Cetak Laporan
|
|
<i class="ki-filled ki-printer"></i>
|
|
</a>
|
|
</div>
|
|
@include('lpj::surveyor.components.print-out.main')
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const tabLaporan = document.getElementById('tab-laporan');
|
|
const tabHasil = document.getElementById('tab-hasil');
|
|
const laporanContent = document.getElementById('laporan');
|
|
const hasilContent = document.getElementById('hasil-inspeksi');
|
|
|
|
tabLaporan.addEventListener('click', () => {
|
|
tabLaporan.classList.add('btn-primary');
|
|
tabLaporan.classList.remove('btn-light');
|
|
tabHasil.classList.add('btn-light');
|
|
tabHasil.classList.remove('btn-primary');
|
|
laporanContent.classList.remove('hidden-tab');
|
|
hasilContent.classList.add('hidden-tab');
|
|
});
|
|
|
|
tabHasil.addEventListener('click', () => {
|
|
tabHasil.classList.add('btn-primary');
|
|
tabHasil.classList.remove('btn-light');
|
|
tabLaporan.classList.add('btn-light');
|
|
tabLaporan.classList.remove('btn-primary');
|
|
laporanContent.classList.add('hidden-tab');
|
|
hasilContent.classList.remove('hidden-tab');
|
|
});
|
|
});
|
|
|
|
document.getElementById('back-button').addEventListener('click', function(e) {
|
|
e.preventDefault();
|
|
|
|
console.log('Back button clicked', window.history.length);
|
|
if (window.history.length > 1) {
|
|
window.history.back();
|
|
} else {
|
|
window.location.href = "{{ $back ?? route()->previous()}}";
|
|
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
.hidden-tab {
|
|
display: none;
|
|
}
|
|
|
|
.floating-button {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
right: 20px;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.floating-button .btn {
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
border-radius: 50px;
|
|
padding: 10px 20px;
|
|
}
|
|
|
|
.floating-button .btn:hover {
|
|
transform: scale(1.05);
|
|
transition: transform 0.2s ease-in-out;
|
|
}
|
|
</style>
|
|
|
|
{{-- @include('lpj::surveyor.js.utils') --}}
|
|
@endsection
|