Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -267,7 +267,7 @@
|
|||||||
}).then((rejectResult) => {
|
}).then((rejectResult) => {
|
||||||
if (rejectResult.isConfirmed) {
|
if (rejectResult.isConfirmed) {
|
||||||
handleAjaxRequest(
|
handleAjaxRequest(
|
||||||
`/otorisator/revisi/${dataId}`, {
|
`/otorisator/revisi-laporan/${dataId}`, {
|
||||||
keterangan: rejectResult.value
|
keterangan: rejectResult.value
|
||||||
},
|
},
|
||||||
'Data berhasil ditolak.',
|
'Data berhasil ditolak.',
|
||||||
|
|||||||
@@ -206,14 +206,16 @@
|
|||||||
|
|
||||||
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
|
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
|
||||||
actionHtml += `
|
actionHtml += `
|
||||||
<a onclick="surveyorRescheduleJadwalSurvey(
|
<a
|
||||||
${data.id},
|
title="Reschedule Jadwal Survey"
|
||||||
${data.penilaian.id},
|
data-permohonan-id="${data.id}"
|
||||||
'${data.nomor_registrasi}',
|
data-id-penilaian="${data.penilaian.id}"
|
||||||
'${data.debiture ? data.debiture.name.replace(/'/g, "\\'") : ""}',
|
data-no-reg="${data.nomor_registrasi}"
|
||||||
'${data.penilaian.waktu_penilaian}',
|
data-debitur="${data.debiture ? data.debiture.name.replace(/'/g, "\\'") : ""}"
|
||||||
'${data.penilaian.rejected_note ? JSON.stringify(data.penilaian.rejected_note).replace(/'/g, "\\'").replace(/"/g, '"') : '{}'}'
|
data-waktu-penilaian="${data.penilaian.waktu_penilaian}"
|
||||||
)" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey">
|
data-rejected-note="${data.penilaian.rejected_note ? JSON.stringify(data.penilaian.rejected_note).replace(/'/g, "\\'").replace(/"/g, '"') : '{}'}"
|
||||||
|
onclick="surveyorRescheduleJadwalSurvey(this)"
|
||||||
|
class="delete btn btn-sm btn-outline btn-light">
|
||||||
<i class="ki-filled ki-calendar-remove"></i>
|
<i class="ki-filled ki-calendar-remove"></i>
|
||||||
</a>`;
|
</a>`;
|
||||||
}
|
}
|
||||||
@@ -319,11 +321,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function surveyorRescheduleJadwalSurvey(permohonanId, idPenilaian, noReg, debitur, waktuPenilaian, rejectedNote) {
|
function surveyorRescheduleJadwalSurvey(element) {
|
||||||
rejectedNote = JSON.parse(rejectedNote);
|
const permohonanId = element.getAttribute('data-permohonan-id');
|
||||||
|
const idPenilaian = element.getAttribute('data-id-penilaian');
|
||||||
|
const noReg = element.getAttribute('data-no-reg');
|
||||||
|
const debitur = element.getAttribute('data-debitur');
|
||||||
|
const waktuPenilaian = element.getAttribute('data-waktu-penilaian');
|
||||||
|
let rejectedNote = element.getAttribute('data-rejected-note');
|
||||||
|
try {
|
||||||
|
rejectedNote = rejectedNote ? JSON.parse(rejectedNote) : null;
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Failed to parse rejectedNote:', e);
|
||||||
|
rejectedNote = null;
|
||||||
|
}
|
||||||
|
const note = rejectedNote && typeof rejectedNote === 'string' && rejectedNote.trim() ? String(rejectedNote)
|
||||||
|
.trim() : '';
|
||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Reschedule Jadwal Kunjungan',
|
title: 'Reschedule Jadwal Kunjungan',
|
||||||
html: `
|
html: `
|
||||||
<div class="text-left space-y-4">
|
<div class="text-left space-y-4">
|
||||||
|
|
||||||
<p class="text-gray-700">
|
<p class="text-gray-700">
|
||||||
@@ -347,50 +363,50 @@
|
|||||||
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
||||||
placeholder="Masukkan alasan reschedule..."></textarea>
|
placeholder="Masukkan alasan reschedule..."></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
${note ? `
|
||||||
|
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${note}</p>
|
||||||
|
` : ''}
|
||||||
|
|
||||||
${rejectedNote && rejectedNote.trim() ? `
|
|
||||||
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${rejectedNote}</p>
|
|
||||||
` : ''}
|
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
icon: 'warning',
|
icon: 'warning',
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: '#3085d6',
|
confirmButtonColor: '#3085d6',
|
||||||
cancelButtonColor: '#d33',
|
cancelButtonColor: '#d33',
|
||||||
confirmButtonText: 'Reschedule',
|
confirmButtonText: 'Reschedule',
|
||||||
preConfirm: () => {
|
preConfirm: () => {
|
||||||
const rescheduleDate = document.getElementById('reschedule_date').value;
|
const rescheduleDate = document.getElementById('reschedule_date').value;
|
||||||
const rescheduleNote = document.getElementById('reschedule_note').value;
|
const rescheduleNote = document.getElementById('reschedule_note').value;
|
||||||
|
|
||||||
if (!rescheduleDate || !rescheduleNote) {
|
if (!rescheduleDate || !rescheduleNote) {
|
||||||
Swal.showValidationMessage('Semua inputan wajib diisi!');
|
Swal.showValidationMessage('Semua inputan wajib diisi!');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
rescheduleDate,
|
||||||
|
rescheduleNote
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
const {
|
||||||
rescheduleDate,
|
rescheduleDate,
|
||||||
rescheduleNote
|
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: rescheduleNote
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
const {
|
|
||||||
rescheduleDate,
|
|
||||||
rescheduleNote
|
|
||||||
} = result.value;
|
|
||||||
|
|
||||||
// Data to send
|
$.ajax({
|
||||||
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}`,
|
url: `{{ URL::to('/permohonan/store-reschedule-survey') }}/${idPenilaian}`,
|
||||||
type: "PUT",
|
type: "PUT",
|
||||||
cache: false,
|
cache: false,
|
||||||
@@ -399,19 +415,13 @@
|
|||||||
success: function(response) {
|
success: function(response) {
|
||||||
if (response.status === 'success') {
|
if (response.status === 'success') {
|
||||||
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
|
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
|
||||||
() => {
|
() => {
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Swal.fire('Error!', response.message, 'error');
|
Swal.fire('Error!', response.message, 'error');
|
||||||
}
|
}
|
||||||
|
}).then((result) => {
|
||||||
return {
|
|
||||||
rescheduleDate,
|
|
||||||
rescheduleNote
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
const {
|
const {
|
||||||
rescheduleDate,
|
rescheduleDate,
|
||||||
@@ -425,7 +435,8 @@
|
|||||||
nomor_registrasi: noReg,
|
nomor_registrasi: noReg,
|
||||||
permohonan_id: permohonanId,
|
permohonan_id: permohonanId,
|
||||||
reschedule_date: rescheduleDate,
|
reschedule_date: rescheduleDate,
|
||||||
reschedule_note: rescheduleNote
|
reschedule_note: rescheduleNote,
|
||||||
|
keterangan: rejectedNote
|
||||||
};
|
};
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -444,18 +455,66 @@
|
|||||||
} else {
|
} else {
|
||||||
Swal.fire('Error!', response.message, 'error');
|
Swal.fire('Error!', response.message, 'error');
|
||||||
}
|
}
|
||||||
},
|
|
||||||
error: function(response) {
|
return {
|
||||||
const errorMessage = response.responseJSON?.message ||
|
rescheduleDate,
|
||||||
'Terjadi kesalahan saat memproses data.';
|
rescheduleNote
|
||||||
Swal.fire('Error!', errorMessage, 'error');
|
};
|
||||||
|
}
|
||||||
|
}).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>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Route::post('otorisator/{id}/{context}', [PenilaianController::class, 'otorisatorUpdate'])->name('otorisator.update');
|
Route::post('otorisator/{id}/{context}', [PenilaianController::class, 'otorisatorUpdate'])->name('otorisator.update');
|
||||||
Route::post('revisi/{id}', [PenilaianController::class, 'revisiLaporan'])->name('otorisator.revisi');
|
Route::post('revisi-laporan/{id}', [PenilaianController::class, 'revisiLaporan'])->name('otorisator.revisi');
|
||||||
|
|
||||||
Route::get('pembatalan', [PenilaianController::class, 'otorisator'])->name('pembatalan.index')->defaults(
|
Route::get('pembatalan', [PenilaianController::class, 'otorisator'])->name('pembatalan.index')->defaults(
|
||||||
'type',
|
'type',
|
||||||
|
|||||||
Reference in New Issue
Block a user