Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender

This commit is contained in:
2025-03-05 15:18:25 +07:00
29 changed files with 2378 additions and 1245 deletions

View File

@@ -322,8 +322,8 @@
function surveyorRescheduleJadwalSurvey(permohonanId, idPenilaian, noReg, debitur, waktuPenilaian, rejectedNote) {
rejectedNote = JSON.parse(rejectedNote);
Swal.fire({
title: 'Reschedule Jadwal Kunjungan',
html: `
title: 'Reschedule Jadwal Kunjungan',
html: `
<div class="text-left space-y-4">
<p class="text-gray-700">
@@ -349,73 +349,113 @@
</div>
${rejectedNote && rejectedNote.trim() ? `
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${rejectedNote}</p>
` : ''}
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${rejectedNote}</p>
` : ''}
</div>
`,
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Reschedule',
preConfirm: () => {
const rescheduleDate = document.getElementById('reschedule_date').value;
const rescheduleNote = document.getElementById('reschedule_note').value;
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Reschedule',
preConfirm: () => {
const rescheduleDate = document.getElementById('reschedule_date').value;
const rescheduleNote = document.getElementById('reschedule_note').value;
if (!rescheduleDate || !rescheduleNote) {
Swal.showValidationMessage('Semua inputan wajib diisi!');
return false;
}
return {
rescheduleDate,
rescheduleNote
};
}
}).then((result) => {
if (result.isConfirmed) {
const {
rescheduleDate,
rescheduleNote
} = result.value;
// Data to send
const data = {
_token: "{{ csrf_token() }}",
penilaian_id: idPenilaian,
nomor_registrasi: noReg,
permohonan_id: permohonanId,
reschedule_date: rescheduleDate,
reschedule_note: rescheduleNote
};
$.ajax({
url: `{{ URL::to('/permohonan/store-reschedule-survey') }}/${idPenilaian}`,
type: "PUT",
cache: false,
data: data,
dataType: "json",
success: function(response) {
if (response.status === 'success') {
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
() => {
location.reload();
});
} else {
Swal.fire('Error!', response.message, 'error');
}
},
error: function(response) {
const errorMessage = response.responseJSON?.message ||
'Terjadi kesalahan saat memproses data.';
Swal.fire('Error!', errorMessage, 'error');
if (!rescheduleDate || !rescheduleNote) {
Swal.showValidationMessage('Semua inputan wajib diisi!');
return false;
}
return {
rescheduleDate,
rescheduleNote
};
}
}).then((result) => {
if (result.isConfirmed) {
const {
rescheduleDate,
rescheduleNote
} = result.value;
// Data to send
const data = {
_token: "{{ csrf_token() }}",
penilaian_id: idPenilaian,
nomor_registrasi: noReg,
permohonan_id: permohonanId,
reschedule_date: rescheduleDate,
reschedule_note: rescheduleNote,
keterangan: rejectedNote
};
$.ajax({
url: `{{ URL::to('/permohonan/store-reschedule-survey') }}/${idPenilaian}`,
type: "PUT",
cache: false,
data: data,
dataType: "json",
success: function(response) {
if (response.status === 'success') {
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
() => {
location.reload();
});
} else {
Swal.fire('Error!', response.message, 'error');
}
return {
rescheduleDate,
rescheduleNote
};
}
}).then((result) => {
if (result.isConfirmed) {
const {
rescheduleDate,
rescheduleNote
} = result.value;
// Data to send
const data = {
_token: "{{ csrf_token() }}",
penilaian_id: idPenilaian,
nomor_registrasi: noReg,
permohonan_id: permohonanId,
reschedule_date: rescheduleDate,
reschedule_note: rescheduleNote
};
$.ajax({
url: `{{ URL::to('/permohonan/store-reschedule-survey') }}/${idPenilaian}`,
type: "PUT",
cache: false,
data: data,
dataType: "json",
success: function(response) {
if (response.status === 'success') {
Swal.fire('Sukses Reschedule!', response.message,
'success').then(
() => {
location.reload();
});
} else {
Swal.fire('Error!', response.message, 'error');
}
},
error: function(response) {
const errorMessage = response.responseJSON?.message ||
'Terjadi kesalahan saat memproses data.';
Swal.fire('Error!', errorMessage, 'error');
}
});
}
});
}
});
}
});
}
// window.formatTanggalIndonesia(date)
// window.formatTanggalIndonesia(date)
</script>
@endpush