CRUD petugas/pegawai + filter-sort-rekap transaksi parkir + fix save member kartu + hilangkan alert ganti Swal-loading
This commit is contained in:
@@ -137,7 +137,7 @@
|
||||
});
|
||||
|
||||
$('.btn-cancel').click();
|
||||
alert('Berhasil disimpan 🔥');
|
||||
if (window.Swal) Swal.fire({icon: 'success', title: 'Berhasil', text: 'Konfigurasi hardware tersimpan.'});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -34,9 +34,13 @@ $(document).ready(function () {
|
||||
$(document).on('click', '.vehicle-price', function () {
|
||||
|
||||
|
||||
let id = $(this).data('id');
|
||||
let nama = $(this).data('nama');
|
||||
let btn = $(this);
|
||||
let btnHtml = btn.html();
|
||||
let id = btn.data('id');
|
||||
let nama = btn.data('nama');
|
||||
console.log(id);
|
||||
|
||||
btn.prop('disabled', true).html('<span class="spinner-border spinner-border-sm me-1"></span>Memuat...');
|
||||
|
||||
$.ajax({
|
||||
url: '/setup/master/price/' + id,
|
||||
@@ -70,6 +74,9 @@ $(document).ready(function () {
|
||||
},
|
||||
error: function (xhr) {
|
||||
Swal.fire({icon: 'error', title: 'Gagal memuat tarif', text: xhr.responseJSON?.message || 'Data tarif tidak ditemukan.'});
|
||||
},
|
||||
complete: function () {
|
||||
btn.prop('disabled', false).html(btnHtml);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -105,6 +112,10 @@ $(document).ready(function () {
|
||||
url = url.replace(':id', encodeURIComponent(id));
|
||||
console.log(url);
|
||||
|
||||
const saveBtn = $(this);
|
||||
const saveHtml = saveBtn.html();
|
||||
saveBtn.prop('disabled', true).html('<span class="spinner-border spinner-border-sm me-1"></span>Menyimpan...');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'PUT',
|
||||
@@ -126,6 +137,9 @@ $(document).ready(function () {
|
||||
return;
|
||||
}
|
||||
Swal.fire({icon: 'error', title: 'Gagal memperbarui tarif', text: xhr.responseJSON?.message || 'Silakan periksa kembali data tarif.'});
|
||||
},
|
||||
complete: function() {
|
||||
saveBtn.prop('disabled', false).html(saveHtml);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user