✨ feat(lpj-module): tambah tampilan laporan inspeksi & refactor detail lokasi
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.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
</h3>
|
||||
|
||||
<div class="flex gap-2 items-center">
|
||||
{!! $customlink ?? '' !!}
|
||||
{!! $customlink ?? "" !!}
|
||||
@if (isset($id))
|
||||
@php
|
||||
$parameters = isset($id) ? ['id' => $id] : [];
|
||||
@@ -46,18 +46,18 @@
|
||||
Pemohon:
|
||||
</h3>
|
||||
<span class="text-gray-700 text-2sm">
|
||||
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
|
||||
{{ $permohonan->user->nik ?? '' }} | {{ $permohonan->user->name ?? '' }} | {{ $permohonan->user->branch->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if (isset($penawaran))
|
||||
@if(isset($penawaran))
|
||||
<div class="mb-5">
|
||||
<h3 class="font-medium text-gray-900 text-md">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-gray-700 text-2sm">
|
||||
{{ $penawaran->code }}
|
||||
</span>
|
||||
{{ $penawaran->code }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
@@ -65,17 +65,18 @@
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-gray-700 text-2sm">
|
||||
{{ $penawaran->tujuanPenilaianKjpp->name }}
|
||||
</span>
|
||||
{{ $penawaran->tujuanPenilaianKjpp->name }}
|
||||
</span>
|
||||
</div>
|
||||
@else
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="font-medium text-gray-900 text-md">
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-gray-700 text-2sm">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
@@ -83,8 +84,8 @@
|
||||
Nilai Plafond:
|
||||
</h3>
|
||||
<span class="text-gray-700 text-2sm">
|
||||
{{ $permohonan->nilaiPlafond->name }}
|
||||
</span>
|
||||
{{ $permohonan->nilaiPlafond->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
@@ -93,8 +94,8 @@
|
||||
</h3>
|
||||
<span
|
||||
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
|
||||
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
|
||||
</span>
|
||||
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
33
resources/views/component/detail-lokasi.blade.php
Normal file
33
resources/views/component/detail-lokasi.blade.php
Normal file
@@ -0,0 +1,33 @@
|
||||
@if (is_array($details) && count($details) > 0)
|
||||
@php $currentKey = ''; @endphp
|
||||
@foreach ($details as $value)
|
||||
@foreach ($value as $key => $item)
|
||||
|
||||
@if (!empty($item))
|
||||
<tr>
|
||||
<td style="padding: 2px; width:25%;">
|
||||
@if ($currentKey !== $key)
|
||||
{{ formatLabel($key) }}
|
||||
@endif
|
||||
@php
|
||||
if ($currentKey !== $key) {
|
||||
$currentKey = $key;
|
||||
}
|
||||
@endphp
|
||||
</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px;">
|
||||
@if (strpos(strtolower($key), 'tanggal') !== false)
|
||||
{{ formatTanggalIndonesia($item) }}
|
||||
@else
|
||||
{{ $item }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<span>m²</span>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -76,24 +76,17 @@
|
||||
|
||||
@foreach ($kategoriUnik as $item)
|
||||
@php
|
||||
$luas = match ($item) {
|
||||
'bangunan' => $forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ??
|
||||
$forminspeksi['bangunan']['luas_tanah_bagunan']['sesuai'] ?? null,
|
||||
'tanah' => $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ??
|
||||
$forminspeksi['tanah']['luas_tanah']['sesuai'] ?? null,
|
||||
'apartemen-kantor' => $forminspeksi['luas_unit']['sesuai'] ??
|
||||
$forminspeksi['luas_unit']['tidak sesuai'] ?? null,
|
||||
default => null,
|
||||
};
|
||||
|
||||
if ($item === 'bangunan') {
|
||||
$luas =
|
||||
$forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ??
|
||||
($forminspeksi['bangunan']['luas_tanah_bagunan']['sesuai'] ?? null);
|
||||
} elseif ($item === 'tanah') {
|
||||
$luas =
|
||||
$forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ??
|
||||
($forminspeksi['tanah']['luas_tanah']['sesuai'] ?? null);
|
||||
} elseif ($item === 'apartemen-kantor') {
|
||||
$luas =
|
||||
$forminspeksi['luas_unit']['sesuai'] ??
|
||||
($forminspeksi['luas_unit']['tidak sesuai'] ?? null);
|
||||
} else {
|
||||
$luas = null;
|
||||
}
|
||||
$luas = old('luas_' . $item, $lpjData['luas_' . $item] ?? $luas);
|
||||
|
||||
$luasKey = 'luas_' . $item;
|
||||
$nilaiKey1 = 'nilai_' . $item . '_1';
|
||||
$nilaiKey2 = 'nilai_' . $item . '_2';
|
||||
@@ -122,7 +115,8 @@
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline w-full lg:flex-nowrap">
|
||||
<label class="input">
|
||||
<i class="">Rp</i>
|
||||
<input id="{{ $nilaiKey2 }}" type="text" class="w-full currency-format"
|
||||
<input id="{{ $nilaiKey2 }}" type="text"
|
||||
class="w-full currency-format"
|
||||
name="{{ $nilaiKey2 }}"
|
||||
value="{{ old($nilaiKey2, $lpjData[$nilaiKey2] ?? null) }}">
|
||||
</label>
|
||||
@@ -477,7 +471,6 @@
|
||||
|
||||
if (luasInput && nilaiInput && outputElement) {
|
||||
const luas = parseFloat(luasInput.value.replace(/[^0-9.]/g, '')) || 0;
|
||||
console.log("a", luas);
|
||||
const nilai = parseInput(nilaiInput.value);
|
||||
const hasil = luas * nilai;
|
||||
|
||||
@@ -620,24 +613,4 @@
|
||||
|
||||
input.value = formattedValue;
|
||||
}
|
||||
|
||||
function showLoadingSwal(message, duration = 5000) {
|
||||
Swal.fire({
|
||||
title: message,
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
},
|
||||
timer: duration, // Durasi dalam milidetik
|
||||
timerProgressBar: true, // Menampilkan progres bar timer
|
||||
}).then((result) => {
|
||||
if (result.dismiss === Swal.DismissReason.timer) {
|
||||
console.log("Dialog loading otomatis ditutup.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hideLoadingSwal() {
|
||||
Swal.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,41 +1,11 @@
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
@if (!empty($detail->name) && isset($detail->details) && !empty($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td width="25%"><strong>{{ $detail->name ?? '' }}</strong></td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (isset($detail->details))
|
||||
@php
|
||||
$details = json_decode($detail->details, true);
|
||||
@endphp
|
||||
|
||||
@if (is_array($details) && count($details) > 0)
|
||||
@foreach ($details as $value)
|
||||
@if (is_array($value))
|
||||
@foreach ($value as $key => $item)
|
||||
@if (!empty($item))
|
||||
<tr>
|
||||
<td style="padding: 2px;">
|
||||
{{ formatLabel($key) }}
|
||||
</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px;">
|
||||
@if (strpos(strtolower($key), 'tanggal') !== false)
|
||||
{{ formatTanggalIndonesia($item) }}
|
||||
@else
|
||||
{{ $item }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<span>m²</span>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@if ($detail->name != 'LOKASI JAMINAN')
|
||||
@if (isset($detail->details))
|
||||
@php
|
||||
$details = json_decode($detail->details, true);
|
||||
@endphp
|
||||
@include('lpj::component.detail-lokasi', ['details' => $details])
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
132
resources/views/component/show-laporan-inspeksi.blade.php
Normal file
132
resources/views/component/show-laporan-inspeksi.blade.php
Normal file
@@ -0,0 +1,132 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user