perbaikan nomor laporan, dan penambahan button revisi laporan di so

This commit is contained in:
majid
2025-01-09 17:01:35 +07:00
parent 9c5c91ae9c
commit e84bce7034
12 changed files with 290 additions and 134 deletions

View File

@@ -132,6 +132,9 @@
<i class="ki-filled ki-double-check"></i>
Otorisator {{ $header ?? '' }}
</button>
<button class="btn btn-warning" onclick="revisiLaporan({{ $permohonan->id }})">
<i class="ki-filled ki-arrow-circle-right"></i> Revisi
</button>
@endif
@if(Auth::user()->hasAnyRole(['administrator','EO Appraisal']) && $permohonan->approval_so && $permohonan->approval_eo==null)
@@ -200,5 +203,53 @@
}
});
}
function revisiLaporan(dataId) {
const dataHeader = @json($header);
Swal.fire({
title: 'Apakah Anda yakin?',
text: `Untuk melakukan Revisi ${dataHeader}!`,
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 || '';
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
});
$.ajax({
url: `/otorisator/revisi/${dataId}/`,
type: 'POST',
data: {
message: userMessage
},
success: (response) => {
Swal.fire('Berhasil!', 'Data berhasil Revisi Laporan', 'success').then(() => {
window.location.href = '{{route('otorisator.pelaporan.index')}}';
});
console.log(response);
},
error: (error) => {
console.error('Error:', error);
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
'error');
}
});
}
});
}
</script>
@endpush