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:
Daeng Deni Mardaeni
2025-11-09 21:19:58 +07:00
parent 535be2cff3
commit 0d5b6b1529
31 changed files with 2193 additions and 1865 deletions

View File

@@ -8,7 +8,7 @@
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('permohonan.datatables') }}">
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('permohonan.datatables') }}">
<div class="flex-wrap py-5 card-header bg-agi-50">
<h3 class="card-title">
Daftar Permohonan
@@ -22,9 +22,8 @@
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('permohonan.export') }}"> Export to Excel </a>
@if (auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan
</a>
@if(auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan </a>
@endif
</div>
</div>
@@ -32,50 +31,50 @@
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
data-datatable-table="true">
data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
</th>
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="mig_mst_lpj_nomor_jaminan">
</th>
<th class="min-w-[150px]" data-datatable-column="mig_mst_lpj_nomor_jaminan">
<span class="sort"> <span class="sort-label"> Nomor LPJ Lama </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="pemohon">
</th>
<th class="min-w-[150px]" data-datatable-column="pemohon">
<span class="sort"> <span class="sort-label"> User Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="branch">
</th>
<th class="min-w-[150px]" data-datatable-column="branch">
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="debitur_id">
</th>
<th class="min-w-[150px]" data-datatable-column="debitur_id">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px] text-center" data-datatable-column="status">
</th>
<th class="min-w-[150px] text-center" data-datatable-column="status">
<span class="sort"> <span class="sort-label"> Status </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="keterangan">
</th>
<th class="min-w-[150px]" data-datatable-column="keterangan">
<span class="sort"> <span class="sort-label"> Keterangan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-right" data-datatable-column="actions">Action</th>
</tr>
</th>
<th class="min-w-[50px] text-right" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
@@ -146,17 +145,26 @@
nomor_registrasi: {
title: 'Nomor Registrasi',
},
mig_mst_lpj_nomor_jaminan: {
nomor_lpj: {
title: 'Nomor LPJ Lama',
},
tanggal_permohonan: {
title: 'Tanggal Permohonan',
render: (item, data) => {
return `${window.formatTanggalIndonesia(data.tanggal_permohonan)}`;
},
},
pemohon: {
title: 'User Pemohon'
},
branch: {
user_id: {
title: 'User Pemohon',
render: (item, data) => {
return data?.user?.name ?? data?.mig_nama_ao ?? '-';
}},
branch_id: {
title: 'Cabang Pemohon',
render: (item, data) => {
return `${data?.branch?.name || '-'}`;
},
},
debitur_id: {
title: 'Debitur',
@@ -260,17 +268,13 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
`;
}
if (data.status !== 'done' && data.status !== 'batal' && hasRole(['administrator',
'pemohon-ao'
])) {
if (data.status !== 'done' && data.status !== 'batal' && hasRole(['administrator', 'pemohon-ao'])) {
actionHtml += `
<a class="btn btn-sm btn-outline btn-info" href="permohonan/${data.id}/edit" title="Edit Permohonan">
<i class="ki-outline ki-notepad-edit"></i>
</a>`;
}
if (data.status !== 'done' && data.status !== 'batal' && hasRole(['administrator',
'pemohon-ao'
])) {
if (data.status === 'order' && hasRole(['administrator', 'pemohon-ao'])) {
actionHtml += `
<a onclick="deleteData(${data.id}, '${data.nomor_registrasi}','${data.debiture?.name}')" class="delete btn btn-sm btn-outline btn-danger" title="Batalkan Permohonan">
<i class="ki-outline ki-cross-square"></i>
@@ -288,7 +292,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
let dataTable = new KTDataTable(element, dataTableOptions);
// Custom search functionality
searchInput.addEventListener('input', function() {
searchInput.addEventListener('input', function () {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
@@ -333,7 +337,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
cache: false,
data: input_data,
dataType: "json",
success: function(response) {
success: function (response) {
console.log(response);
if ('success' == response.status) {
swal.fire('Sukses Menyetujui!', response.message, 'success').then(
@@ -345,7 +349,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
}
},
error: function(response, textStatus, errorThrown) {
error: function (response, textStatus, errorThrown) {
// var errors = response.responseJSON.errors;
// console.log(errors);
console.log(response);
@@ -423,7 +427,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
cache: false,
data: data,
dataType: "json",
success: function(response) {
success: function (response) {
if (response.status === 'success') {
Swal.fire('Sukses Reschedule!', response.message,
'success').then(() => {
@@ -433,7 +437,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
Swal.fire('Error!', response.message, 'error');
}
},
error: function(response) {
error: function (response) {
console.log(response);
}
});
@@ -489,8 +493,8 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
placeholder="Masukkan alasan reschedule..."></textarea>
</div>
${note ? `
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${note}</p>
` : ''}
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${note}</p>
` : ''}
</div>
`,
@@ -537,7 +541,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
cache: false,
data: data,
dataType: "json",
success: function(response) {
success: function (response) {
if (response.status === 'success') {
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
() => {
@@ -547,7 +551,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
Swal.fire('Error!', response.message, 'error');
}
},
error: function(response) {
error: function (response) {
const errorMessage = response.responseJSON?.message ||
'Terjadi kesalahan saat memproses data.';
Swal.fire('Error!', errorMessage, 'error');