fix(so/penilai/surveyor) : perbaikkan print out, lampiran, send email jadwal, otorisator, dan typo
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Luas Bangunan</label>
|
||||
<label class="form-label max-w-56">Luas Bangunan(IMB)</label>
|
||||
<div class="mt-2">
|
||||
|
||||
@if (isset($permohonan->documents))
|
||||
|
||||
@@ -115,6 +115,26 @@
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Sentuh Tanahku</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputGistaru" type="file" name="foto_sentuh_tanahku"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'sentuh_tanahku-preview')">
|
||||
|
||||
<img id="sentuh_tanahku-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_sentuh_tanahku']) ? $forminspeksi['foto_sentuh_tanahku'] : '')) }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_sentuh_tanahku']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -196,27 +216,7 @@
|
||||
</div>
|
||||
<!-- Upload Photo Button -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Sentuh Tanahku</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputGistaru" type="file" name="foto_sentuh_tanahku"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'sentuh_tanahku-preview')">
|
||||
|
||||
<img id="sentuh_tanahku-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_sentuh_tanahku']) ? $forminspeksi['foto_sentuh_tanahku'] : '')) }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_sentuh_tanahku']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<label for="" class="form-label max-w-56 text-sm font-medium text-gray-700">Upload Peta</label>
|
||||
|
||||
@@ -352,7 +352,7 @@
|
||||
|
||||
<!-- Merupakan daerah -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Merupakan daerah</label>
|
||||
<label class="form-label max-w-56">Merupakan Daerah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['merupakanDaerah']))
|
||||
@@ -373,7 +373,7 @@
|
||||
<!-- Fasilitas Umum Sekitar -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Fasilitas Umum dekat Object</label>
|
||||
<label class="form-label max-w-56">Fasilitas Umum Dekat Objek</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['fasilitasObjek']))
|
||||
|
||||
@@ -97,65 +97,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" data-modal="true" id="modal_jadwal">
|
||||
<div class="modal-content modal-center-y max-w-[600px]">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Kunjungan</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('surveyor.storeJadwal') }}" method="POST" enctype="multipart/form-data"
|
||||
id="revisiForm">
|
||||
@method('put')
|
||||
@csrf
|
||||
<input id="ids" type="hidden" name="id">
|
||||
|
||||
<div class="pl-1 grid gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Kunjungan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('waktu_penilaian') border-danger bg-danger-light @enderror"
|
||||
type="datetime-local" name="waktu_penilaian" value="">
|
||||
@error('waktu_penilaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Catatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea id="deskripsi_penilaian"
|
||||
class="textarea @error('deskripsi_penilaian') border-danger bg-danger-light @enderror" rows="3"
|
||||
name="deskripsi_penilaian"></textarea>
|
||||
@error('deskripsi_penilaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer justify-end mt-2">
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
function jadwal(id) {
|
||||
document.getElementById('ids').value = id;
|
||||
}
|
||||
|
||||
function surveyorFreeze(permohonanId, noReg, debitur) {
|
||||
|
||||
Swal.fire({
|
||||
@@ -329,11 +275,13 @@
|
||||
};
|
||||
|
||||
// Melakukan AJAX request
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
@@ -352,6 +300,92 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function prosesJadwalSurvey(permohonanId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda Yakin?',
|
||||
html: `
|
||||
<div class="text-left space-y-4">
|
||||
<p class="text-gray-700 text-center">Untuk membuat jadwal kunjungan, silahkan isi form berikut!</p>
|
||||
<div>
|
||||
<label for="waktu_penilaian" class="block text-sm font-medium text-gray-700 mb-1 " style="text-align: start;">Jadwal Kunjungan <span class="text-danger">*</span></label>
|
||||
<input type="datetime-local" id="waktu_penilaian" class="input" style="margin-top: 10px;" required>
|
||||
</div>
|
||||
<div>
|
||||
<label for="deskripsi_penilaian" class="block text-sm font-medium text-gray-700 mb-1 mt-2" style="text-align: start;">Keterangan <span class="text-danger">*</span> </label>
|
||||
<textarea id="deskripsi-penilaian" class="textarea" placeholder="Masukkan keterangan" style="margin-top: 10px;" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Submit',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: () => {
|
||||
// Ambil nilai input
|
||||
const tanggalInspeksi = document.getElementById('waktu_penilaian').value;
|
||||
const keteranganInspeksi = document.getElementById('deskripsi-penilaian').value;
|
||||
|
||||
// Validasi input: cek apakah input kosong
|
||||
if (!tanggalInspeksi.trim()) {
|
||||
Swal.showValidationMessage('Harap mengisi Jadwal Kunjungan.');
|
||||
return false;
|
||||
}
|
||||
if (!keteranganInspeksi.trim()) {
|
||||
Swal.showValidationMessage('Harap mengisi Keterangan.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Jika semua valid, kembalikan data
|
||||
return {
|
||||
tanggal: tanggalInspeksi,
|
||||
keterangan: keteranganInspeksi
|
||||
};
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const {
|
||||
tanggal,
|
||||
keterangan
|
||||
} = result.value;
|
||||
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "/surveyor/store-jadwal/" + permohonanId;
|
||||
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: permohonanId,
|
||||
waktu_penilaian: tanggal,
|
||||
deskripsi_penilaian: keterangan
|
||||
};
|
||||
|
||||
// Change from PUT to POST method
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "POST", // Changed from PUT to POST
|
||||
cache: false,
|
||||
data: input_data,
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
// Arahkan langsung ke halaman inspeksi
|
||||
Swal.fire('Berhasil!', 'Data berhasil disimpan.', 'success').then(
|
||||
() => {
|
||||
window.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
@@ -442,8 +476,7 @@
|
||||
(data.penilaian.waktu_penilaian && data.penilaian.authorized_status == null)) {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary"
|
||||
data-modal-toggle="#modal_jadwal"
|
||||
onclick="jadwal(${data.penilaian.id})"
|
||||
onclick="prosesJadwalSurvey(${data.penilaian.id})"
|
||||
title="Buat Jadwal Kunjungan">
|
||||
<i class="ki-filled ki-calendar-edit"></i>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user