Merge remote-tracking branch 'origin/feature/senior-officer' into staging

This commit is contained in:
Daeng Deni Mardaeni
2025-03-10 07:40:22 +07:00
9 changed files with 104 additions and 22 deletions

View File

@@ -373,13 +373,14 @@ function checkRegionUserName($userId)
} }
} }
function getNomorLaporan($permohonanId, $documentId) function getNomorLaporan($permohonanId, $documentId, $type = 'nomor_laporan')
{ {
$laporan = Laporan::where([ $laporan = Laporan::where([
'permohonan_id' => $permohonanId, 'permohonan_id' => $permohonanId,
'dokumen_jaminan_id' => $documentId, 'dokumen_jaminan_id' => $documentId,
])->first(); ])->first();
return $laporan->nomor_laporan ?? null; return $type == 'nomor_laporan' ? $laporan->nomor_laporan : $laporan->created_at;
} }
function getCustomField($param) function getCustomField($param)

View File

@@ -116,7 +116,7 @@
'foto_sentuh_tanahku' => 'Sentuh Tanahku', 'foto_sentuh_tanahku' => 'Sentuh Tanahku',
'foto_gistaru' => 'Gistaru', 'foto_gistaru' => 'Gistaru',
'foto_bhumi' => 'Bhumi', 'foto_bhumi' => 'Bhumi',
'foto_argis_region' => 'Region', 'foto_argis_region' => 'Blad Tata Ruang',
'foto_tempat' => 'Tempat', 'foto_tempat' => 'Tempat',
]; ];
@@ -139,8 +139,8 @@
@if ($adaFoto) @if ($adaFoto)
<div class="card"> <div class="card">
<div class="card-header bg-agi-50" id="basic_settings"> <div class="card-header bg-agi-50" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title uppercase">
Peta, dan tata ruang, blad GS, Tata Ruang dan Peta
</h3> </h3>
</div> </div>
<div class="card-body"> <div class="card-body">

View File

@@ -168,7 +168,7 @@
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<p class="flex w-full text-gray-600 font-medium text-sm"> <p class="flex w-full text-gray-600 font-medium text-sm">
{{ formatTanggalIndonesia($permohonan->created_at) }}</p> {{ formatTanggalIndonesia($permohonan->penilaian->waktu_penilaian) }}</p>
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -177,7 +177,12 @@
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<p class="flex w-full text-gray-600 font-medium text-sm"> <p class="flex w-full text-gray-600 font-medium text-sm">
{{ formatTanggalIndonesia($permohonan->created_at) }}</p>
@php
$tglLaporan = getNomorLaporan($permohonan->id, $dokumen->id, 'tanggal_laporan');
@endphp
{{ isset($tglLaporan) ? formatTanggalIndonesia($tglLaporan) : '-' }}</p>
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -220,7 +225,7 @@
<div class="flex gap-5"> <div class="flex gap-5">
<a class="btn btn-primary" <a class="btn btn-primary"
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}"> href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
Lampiran Foto dan Dokument Lampiran Foto dan Dokumen
</a> </a>
@if (strtolower($permohonan->tujuanPenilaian->name) != 'rap') @if (strtolower($permohonan->tujuanPenilaian->name) != 'rap')
<a class="btn btn-primary" data-modal-toggle="#modal_2"> <a class="btn btn-primary" data-modal-toggle="#modal_2">

View File

@@ -702,8 +702,8 @@
console.log( console.log(
'Current route matches'); 'Current route matches');
} else { } else {
window.location.href = // window.location.href =
"{{ route('surveyor.show', ['id' => $permohonan->id]) }}"; // "{{ route('surveyor.show', ['id' => $permohonan->id]) }}";
} }
} }
@@ -743,6 +743,75 @@
input.value = formatCurrency(input.value); input.value = formatCurrency(input.value);
} }
}); });
// hide the "Lihat Objek Penilaian" toggle
const tableContainer = document.querySelector('.scrollable-x-auto');
const toggleContainer = document.createElement('div');
toggleContainer.className = 'flex items-center gap-4 mb-4 p-3 bg-gray-50 rounded';
const objekToggle = createCustomSwitch('Lihat Objek Penilaian', false, function(checked) {
toggleColumn(1, checked);
});
toggleContainer.appendChild(objekToggle);
tableContainer.parentNode.insertBefore(toggleContainer, tableContainer);
function createCustomSwitch(label, initialState, onChangeCallback) {
const container = document.createElement('div');
const switchLabel = document.createElement('label');
switchLabel.className = 'switch';
const input = document.createElement('input');
input.name = "check";
input.type = "checkbox";
input.value = "1";
input.checked = initialState;
const span = document.createElement('span');
span.className = 'switch-label';
span.textContent = label;
switchLabel.appendChild(input);
switchLabel.appendChild(span);
container.appendChild(switchLabel);
input.addEventListener('change', function() {
onChangeCallback(this.checked);
});
return container;
}
function toggleColumn(columnIndex, show) {
const table = document.getElementById('dataTable');
const rows = table.querySelectorAll('tr');
rows.forEach(row => {
const cells = row.querySelectorAll('td, th');
if (cells.length === 1 && cells[0].hasAttribute('colspan')) {
return;
}
if (cells[columnIndex]) {
cells[columnIndex].style.display = show ? '' : 'none';
}
});
const headerRow = table.querySelector('thead tr');
const headerCells = headerRow.querySelectorAll('th');
if (headerCells[columnIndex]) {
headerCells[columnIndex].style.display = show ? '' : 'none';
}
}
toggleColumn(1, false);
}); });
</script> </script>
@endpush @endpush

View File

@@ -351,8 +351,8 @@
confirmButtonText: 'OK' confirmButtonText: 'OK'
}).then((response) => { }).then((response) => {
if (response.isConfirmed) { if (response.isConfirmed) {
window.location.href = // window.location.href =
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}'; // '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
} }
}); });
} else { } else {

View File

@@ -39,7 +39,7 @@
<td> <td>
<label> <label>
<input type="radio" name="luas_bangunan_radio" value="tidak sesuai" {{ $cekLuasBangunan == 'tidak sesuai' ? 'checked' : '' }}> <input type="radio" name="luas_bangunan_radio" value="tidak sesuai" {{ $cekLuasBangunan == 'tidak sesuai' ? 'checked' : '' }}>
Tidak Sesuai {{ $luasBangunanTidakSesuai ? '- '. $luasBangunanTidakSesuai . ' m²' : '' }} Tidak Sesuai {{ $luasBangunanTidakSesuai ? '- '. $luasBangunanTidakSesuai . ' m² (luas fisik)' : '' }}
</label> </label>
</td> </td>
</tr> </tr>

View File

@@ -60,7 +60,7 @@
'foto_gistaru' => 'Gistaru', 'foto_gistaru' => 'Gistaru',
'foto_bhumi' => 'Bhumi', 'foto_bhumi' => 'Bhumi',
'foto_argis_region' => 'Blad Tata Ruang ', 'foto_argis_region' => 'Blad Tata Ruang ',
'foto_tempat' => 'Tempat', 'foto_tempat' => 'Peta Lokasi',
]; ];
// Memindahkan foto_tempat ke depan jika ada // Memindahkan foto_tempat ke depan jika ada
if (($key = array_search('upload_gs', $fotoTypes)) !== false) { if (($key = array_search('upload_gs', $fotoTypes)) !== false) {

View File

@@ -296,8 +296,8 @@
<td class="checkbox-item"> <td class="checkbox-item">
<label class="checkbox-label"> <label class="checkbox-label">
<input type="checkbox" <input type="checkbox"
{{ isset($forminspeksi['lingkungan']['fasilitas_dekat_object']) && in_array($item->name, $forminspeksi['lingkungan']['fasilitas_dekat_object']) ? 'checked' : '' }}> {{ isset($forminspeksi['lingkungan']['fasilitas_dekat_object']) && $forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name] ? 'checked' : '' }}>
{{ $item->name }} {{ $item->name}} {{isset($forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name]) ? '('. $forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name] .')' : ''}}
</label> </label>
</td> </td>
@endforeach @endforeach

View File

@@ -150,6 +150,7 @@
} }
} }
</style> </style>
</head> </head>
@@ -207,6 +208,10 @@
</table> </table>
</header> </header>
<div style="text-align: center; text-transform: uppercase; font-weight: bold;">
<h1 style="font-size: 14px;">
FORM INSPEKSI {{ $data ?? '' }}
</h1></div>
<div style="border: 1px solid #000;"> <div style="border: 1px solid #000;">
<table <table
style="width: 100%; border-top: none; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;"> style="width: 100%; border-top: none; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
@@ -239,12 +244,14 @@
</tr> </tr>
<tr> <tr>
<td style="width: 25%; padding: 2px;">Debitur/Perwakilan</td> <td style="width: 25%; padding: 2px; vertical-align: top;">Debitur/Perwakilan</td>
<td style="width: 1%; padding: 2px;">:</td> <td style="width: 1%; padding: 2px; vertical-align: top;">:</td>
<td style="vertical-align: top; padding: 2px;"> <td style="vertical-align: top; padding: 2px;">
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan'])) @if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item) @foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
<p style="margin: 0; padding:0;">
{{ $item }} {{ $item }}
</p>
@endforeach @endforeach
@endif @endif
</td> </td>
@@ -607,7 +614,7 @@
<footer id="footer"> <footer id="footer">
Cabang : {{ $permohonan->debiture->branch->name ?? '' }} {{-- Cabang : {{ $permohonan->debiture->branch->name ?? '' }} --}}
</footer> </footer>
<script type="text/php"> <script type="text/php">
if (isset($pdf)) { if (isset($pdf)) {