perbaikan laporan penilai dan print out
This commit is contained in:
@@ -59,8 +59,7 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
const datas = @json($forminspeksi);
|
||||
console.log(datas);
|
||||
|
||||
|
||||
function updateAlamatFields(status) {
|
||||
// Ambil elemen formulir
|
||||
|
||||
@@ -97,14 +97,14 @@
|
||||
<div class="w-full">
|
||||
<div id="lainnya_developer-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($forminspeksi['lainnya_developer']))
|
||||
@foreach ($forminspeksi['lainnya_developer'] as $item)
|
||||
@foreach ($forminspeksi['lainnya_developer'] as $index => $item)
|
||||
<div class="lainnya_developer flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="lainnya_developer[]" rows="3">{{ old("lainnya_developer.$index", $positif) }}</textarea>
|
||||
<textarea class="textarea mt-2" name="lainnya_developer[]" rows="3">{{ old("lainnya_developer.$index", $item) }}</textarea>
|
||||
</div>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
@endforeach>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="lainnya_developer flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="lainnya_developer[]" rows="3">{{ old('lainnya_developer.0', '') }}</textarea>
|
||||
|
||||
@@ -302,4 +302,40 @@
|
||||
console.error('Error fetching villages:', error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user