perbaikana perhitungan npw dan nl otomatis, dan perbaikan otorisator

This commit is contained in:
majid
2024-12-20 07:11:41 +07:00
parent 8cc0f32410
commit b9f2e5dcf4
12 changed files with 552 additions and 769 deletions

View File

@@ -26,13 +26,18 @@
@push('scripts')
<script>
function otorisatorData(dataId) {
const dataHeader = {!! json_encode($header ?? '') !!};
function otorisatorData(dataId) {
const dataHeader = @json($header);
Swal.fire({
title: 'Apakah Anda yakin?',
text: `Untuk melakukan otorisator ${dataHeader}!`,
icon: 'warning',
input: 'textarea',
inputLabel: 'Keterangan',
inputPlaceholder: 'Masukkan keterangan...',
inputAttributes: {
'aria-label': 'Masukkan keterangan'
},
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
@@ -40,6 +45,7 @@
cancelButtonText: 'Batal',
}).then((result) => {
if (result.isConfirmed) {
const userMessage = result.value || ''; // Ambil pesan dari textarea
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
@@ -48,6 +54,9 @@
$.ajax({
url: `/otorisator/otorisator/${dataId}/${dataHeader}`,
type: 'POST',
data: {
message: userMessage
},
success: (response) => {
Swal.fire('Berhasil!', 'Data berhasil diotorisasi.', 'success').then(() => {
window.location.reload();
@@ -57,7 +66,7 @@
error: (error) => {
console.error('Error:', error);
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
'error');
'error');
}
});
}