fix(surveyor/penilai): perbaikkan data pembanding dan tambah tombol freaze di penilai
This commit is contained in:
@@ -194,9 +194,15 @@
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data.status === 'paparan' || data.status === 'proses-paparan' || data.status === 'paparan' || data.status == 'revisi-laporan' || data.status === 'done' || data.status === 'revisi-paparan') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a class="btn btn-sm btn-outline btn-info" href="penilai/${data.id}/show">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="penilai/${data.id}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-icon btn-clear btn-warning"
|
||||
onclick="surveyorFreeze('${data.id}', '${data.nomor_registrasi}', '${data.debiture?.name}')"
|
||||
title="Freeze SLA">
|
||||
<i class="ki-filled ki-arrow-circle-right"></i>
|
||||
</button>
|
||||
</div>`;
|
||||
} else {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
@@ -221,6 +227,57 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function surveyorFreeze(permohonanId, noReg, debitur) {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: "Yakin akan Request Freeze dengan " + noReg + " untuk Debitur " + debitur +
|
||||
" ?",
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || ''; // Ambil pesan dari textarea
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/surveyor/storeFreeze/${permohonanId}`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!',
|
||||
response.message,
|
||||
'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Freeze.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showLoadingSwal(message, duration = 5000) {
|
||||
Swal.fire({
|
||||
title: message,
|
||||
|
||||
@@ -400,17 +400,13 @@
|
||||
onclick="uploadKertasKerja({{ $permohonan->id }}, '{{ $documentId }}', '{{ $inspeksiId }}', '{{ $jenisJaminanId }}')">Upload</button>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="form-group flex items-baseline flex-wrap">
|
||||
|
||||
@if ($jenisJaminanId)
|
||||
<a class="btn btn-outline btn-primary w-full"
|
||||
href="{{ route('penilai.export.kertas-kerja') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}">
|
||||
Export Kertas Kerja
|
||||
</a>
|
||||
@else
|
||||
<p class="text-red-500">Tidak ada dokumen yang memiliki jenis jaminan.</p>
|
||||
@endif
|
||||
</div> --}}
|
||||
<div class="flex justify-between items-center">
|
||||
@if ($permohonan->penilai->kertas_kerja)
|
||||
<span data-modal-dismiss="true" class="btn btn-warning btn-outline"
|
||||
onclick="viewPDF('{{ Storage::url($permohonan->penilai->kertas_kerja) }}')"><i
|
||||
class="ki-filled ki-eye mr-2"></i>Lihat Kertas Kerja</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -420,6 +416,7 @@
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('lpj::component.pdfviewer')
|
||||
|
||||
<script>
|
||||
function seletSederhanaStandart(permohonanId, documentId, inspeksiId, jaminanId, fasilitasKredit, statusBayar) {
|
||||
|
||||
Reference in New Issue
Block a user