perbaikan laporan penilai dan print out

This commit is contained in:
majid
2025-01-09 10:18:52 +07:00
parent 029260bcef
commit a74f5bff5f
15 changed files with 656 additions and 328 deletions

View File

@@ -117,7 +117,6 @@
@php
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
@endphp
<label class="form-label max-w-56">
Surveyor
@@ -554,41 +553,6 @@
}
function checkLaporan(permohonanId, documentId, inspeksiId, jaminanId) {
// showLoadingSwal('Tunggu...');
fetch(
`{{ url('/penilai/check-laporan') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}`
)
.then(response => response.json())
.then(data => {
if (data.status) {
// Jika laporan ada, arahkan ke halaman cetak
window.location.href =
`{{ route('penilai.print-out') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}&statusLpj=0&type=${data.status}`;
} else {
// Jika laporan belum ada, tampilkan pesan peringatan
Swal.fire({
title: 'Laporan Belum Ada',
text: 'Silakan isi laporan terlebih dahulu sebelum mencetak.',
icon: 'warning',
confirmButtonText: 'OK',
confirmButtonColor: '#3085d6',
});
}
})
.catch(error => {
console.error('Error:', error);
Swal.fire({
title: 'Terjadi Kesalahan',
text: 'Tidak dapat memproses permintaan. Silakan coba lagi nanti.',
icon: 'error',
confirmButtonText: 'OK',
confirmButtonColor: '#d33',
});
});
}
</script>
@include('lpj::surveyor.js.utils')