fix(surveyor) : penambahan tombol switch objek penilaian, tambah luas fisik bangunan, dan print out linkungan

This commit is contained in:
majid
2025-03-10 03:58:48 +07:00
parent 83203bf43a
commit 2043335042
6 changed files with 86 additions and 12 deletions

View File

@@ -220,7 +220,7 @@
<div class="flex gap-5">
<a class="btn btn-primary"
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>
@if (strtolower($permohonan->tujuanPenilaian->name) != 'rap')
<a class="btn btn-primary" data-modal-toggle="#modal_2">

View File

@@ -702,8 +702,8 @@
console.log(
'Current route matches');
} else {
window.location.href =
"{{ route('surveyor.show', ['id' => $permohonan->id]) }}";
// window.location.href =
// "{{ route('surveyor.show', ['id' => $permohonan->id]) }}";
}
}
@@ -743,6 +743,75 @@
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>
@endpush

View File

@@ -98,7 +98,7 @@
</label>
<input type="text" name="luas_denah[]"
class="input w-full number-format"
value="{{ isset($denah['luas_denah']) ? $denah['luas_denah'] . ' m²' : '' }}"
value="{{ isset($denah['luas_denah']) ? $denah['luas_denah'] . ' m²' : '' }}"
onkeyup="formatNumber(this)">
</div>
</div>
@@ -351,8 +351,8 @@
confirmButtonText: 'OK'
}).then((response) => {
if (response.isConfirmed) {
window.location.href =
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
// window.location.href =
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
}
});
} else {

View File

@@ -39,7 +39,7 @@
<td>
<label>
<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>
</td>
</tr>

View File

@@ -207,7 +207,7 @@
- Nama Makam:
{{ $forminspeksi['lingkungan']['nama_makam'] ?? '' }}
, Jarak Makam:
{{ $forminspeksi['lingkungan']['jarak_makam'] ?? '' }}
{{ $forminspeksi['lingkungan']['jarak_makam'] ?? '' }}
@endif
</label>
<label class="checkbox-label">
@@ -234,7 +234,7 @@
{{ $forminspeksi['lingkungan']['nama_tps'] ?? '' }}
, Jarak TPS:
{{ $forminspeksi['lingkungan']['jarak_tps'] ?? '' }}
@endif
</label>
<label class="checkbox-label">
@@ -296,8 +296,8 @@
<td class="checkbox-item">
<label class="checkbox-label">
<input type="checkbox"
{{ isset($forminspeksi['lingkungan']['fasilitas_dekat_object']) && in_array($item->name, $forminspeksi['lingkungan']['fasilitas_dekat_object']) ? 'checked' : '' }}>
{{ $item->name }}
{{ isset($forminspeksi['lingkungan']['fasilitas_dekat_object']) && $forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name] ? 'checked' : '' }}>
{{ $item->name}} {{isset($forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name]) ? '('. $forminspeksi['lingkungan']['fasilitas_dekat_object_input'][$item->name] .')' : ''}}
</label>
</td>
@endforeach

View File

@@ -150,6 +150,7 @@
}
}
</style>
</head>
@@ -207,6 +208,10 @@
</table>
</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;">
<table
style="width: 100%; border-top: none; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
@@ -607,7 +612,7 @@
<footer id="footer">
Cabang : {{ $permohonan->debiture->branch->name ?? '' }}
{{-- Cabang : {{ $permohonan->debiture->branch->name ?? '' }} --}}
</footer>
<script type="text/php">
if (isset($pdf)) {