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

@@ -64,7 +64,7 @@
@endphp
@foreach($formFields as $field => $config)
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<div id="{{ $field }}_wrapper" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $config['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
@if($config['type'] === 'select')
@@ -114,6 +114,7 @@
const tujuanPenilaianSelect = document.getElementById('tujuan_penilaian_id');
const nilaiPlafondSelect = document.getElementById('nilai_plafond_id');
const statusBayarSelect = document.getElementById('status_bayar');
const statusBayarWrapper = document.getElementById('status_bayar_wrapper');
// Initialize TomSelect
const statusBayarTomSelect = new window.TomSelect(statusBayarSelect, {
@@ -131,16 +132,15 @@
if (tujuanPenilaianValue === '2' && (nilaiPlafondValue === '2' || nilaiPlafondValue === '3')) {
statusBayarTomSelect.setValue('sudah_bayar');
statusBayarTomSelect.disable();
statusBayarWrapper.style.display = 'none';
} else {
@if(isset($permohonan))
statusBayarTomSelect.setValue('{{$permohonan->status_bayar ?? ''}}');
@else
statusBayarTomSelect.setValue('');
@endif
statusBayarTomSelect.enable();
statusBayarWrapper.style.display = 'flex';
}
console.log('Status Bayar:', statusBayarTomSelect.getValue());
}

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