penambahanan otorisari paparan
This commit is contained in:
@@ -184,7 +184,7 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ getNomorLaporan($permohonan->id, $dokumen->id) ?? '-' }}
|
||||
{{ getNomorLaporan($permohonan->id, $dokumen->id) ?? '-' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -207,12 +207,11 @@
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) != 'rap')
|
||||
<a class="btn btn-primary" data-modal-toggle="#modal_2">
|
||||
KERTAS KERJA
|
||||
</a>
|
||||
<a class="btn btn-primary" data-modal-toggle="#modal_2">
|
||||
KERTAS KERJA
|
||||
</a>
|
||||
@endif
|
||||
<a class="btn btn-primary"
|
||||
onclick="paparan()">
|
||||
<a class="btn btn-primary" onclick="paparan({{ $permohonan->id }})">
|
||||
PAPARAN
|
||||
</a>
|
||||
|
||||
@@ -238,9 +237,9 @@
|
||||
</a>
|
||||
</div>
|
||||
@else
|
||||
{{-- pendapingan kjjp leleang --}}
|
||||
{{-- memo pendapingan lelang --}}
|
||||
{{-- existing di --}}
|
||||
{{-- pendapingan kjjp leleang --}}
|
||||
{{-- memo pendapingan lelang --}}
|
||||
{{-- existing di --}}
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="memo('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
@@ -273,7 +272,7 @@
|
||||
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{$permohonan->status_bayar}}')">
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{ $permohonan->status_bayar }}')">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-setting-2"></i>
|
||||
</span>
|
||||
@@ -369,71 +368,73 @@
|
||||
|
||||
<script>
|
||||
function seletSederhanaStandart(permohonanId, documentId, inspeksiId, jaminanId, fasilitasKredit, statusBayar) {
|
||||
if(statusBayar === 'belum_bayar'){
|
||||
if (statusBayar === 'belum_bayar') {
|
||||
Swal.fire({
|
||||
title: 'Jenis LPJ Ditentukan',
|
||||
text: 'Satus Pembayaran belum bayar. LPJ akan diarahkan ke resum.',
|
||||
icon: 'info',
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
resume(permohonanId, documentId, inspeksiId, jaminanId)
|
||||
});
|
||||
|
||||
}else{
|
||||
fetch(
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}`
|
||||
)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status) {
|
||||
// Jika status LPJ sudah ada, arahkan langsung ke halaman
|
||||
if (data.status === 'standard') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.standard', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
} else if (data.status === 'sederhana') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
} else {
|
||||
if (fasilitasKredit.toUpperCase() === 'KPR KERJASAMA') {
|
||||
Swal.fire({
|
||||
title: 'Jenis LPJ Ditentukan',
|
||||
text: 'Jenis fasilitas kredit adalah KPR Kerjasama. LPJ akan diarahkan ke Sederhana.',
|
||||
icon: 'info',
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana', jaminanId);
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Pilih Jenis LPJ',
|
||||
text: 'Apakah kamu akan memilih LPJ Standard?',
|
||||
icon: 'question',
|
||||
showCloseButton: true,
|
||||
showDenyButton: true,
|
||||
confirmButtonText: 'LPJ Standard',
|
||||
denyButtonText: 'LPJ Sederhana',
|
||||
confirmButtonColor: '#3085d6',
|
||||
denyButtonColor: '#d33',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'standard', jaminanId);
|
||||
} else if (result.isDenied) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana', jaminanId);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log(data);
|
||||
|
||||
title: 'Jenis LPJ Ditentukan',
|
||||
text: 'Satus Pembayaran belum bayar. LPJ akan diarahkan ke resum.',
|
||||
icon: 'info',
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
resume(permohonanId, documentId, inspeksiId, jaminanId)
|
||||
});
|
||||
|
||||
} else {
|
||||
fetch(
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}`
|
||||
)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status) {
|
||||
// Jika status LPJ sudah ada, arahkan langsung ke halaman
|
||||
if (data.status === 'standard') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.standard', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
} else if (data.status === 'sederhana') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
} else {
|
||||
if (fasilitasKredit.toUpperCase() === 'KPR KERJASAMA') {
|
||||
Swal.fire({
|
||||
title: 'Jenis LPJ Ditentukan',
|
||||
text: 'Jenis fasilitas kredit adalah KPR Kerjasama. LPJ akan diarahkan ke Sederhana.',
|
||||
icon: 'info',
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana', jaminanId);
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Pilih Jenis LPJ',
|
||||
text: 'Apakah kamu akan memilih LPJ Standard?',
|
||||
icon: 'question',
|
||||
showCloseButton: true,
|
||||
showDenyButton: true,
|
||||
confirmButtonText: 'LPJ Standard',
|
||||
denyButtonText: 'LPJ Sederhana',
|
||||
confirmButtonColor: '#3085d6',
|
||||
denyButtonColor: '#d33',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'standard',
|
||||
jaminanId);
|
||||
} else if (result.isDenied) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana',
|
||||
jaminanId);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log(data);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function saveStatusLpj(permohonanId, documentId, inspeksiId, type, jaminanId) {
|
||||
fetch(`{{ url('/penilai/save-status-lpj') }}`, {
|
||||
@@ -542,56 +543,56 @@
|
||||
}
|
||||
|
||||
|
||||
function paparan(){
|
||||
Swal.fire({
|
||||
title: 'Apakah Kamu yakin ingin membuat paparan',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
function paparan(permohonanId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Kamu yakin ingin melakukan paparan',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: "",
|
||||
type: "POST",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.log('Error checking button status:', error, status, xhr);
|
||||
if (xhr.responseJSON.message) {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
|
||||
} else {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
}
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: `/penilai/storePaparan/${permohonanId}`,
|
||||
type: "PUT",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.log('Error checking button status:', error, status, xhr);
|
||||
if (xhr.responseJSON.message) {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
|
||||
}
|
||||
} else {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function savePenilai() {
|
||||
showLoadingSwal('Mengirim data keserver ...');
|
||||
@@ -623,7 +624,6 @@
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
Reference in New Issue
Block a user