Merge remote-tracking branch 'composer/feature/senior-officer' into staging

This commit is contained in:
Daeng Deni Mardaeni
2025-03-03 08:00:55 +07:00
26 changed files with 921 additions and 606 deletions

View File

@@ -392,7 +392,7 @@ class ActivityController extends Controller
$q->where('user_id', $id); $q->where('user_id', $id);
}) })
->whereHas('permohonan', function ($q) { ->whereHas('permohonan', function ($q) {
$q->whereIn('status', ['assign', 'proses-laporan', 'done', 'proses-survey', 'request-reschedule', 'reschedule', 'rejected-reschedule', 'approved-reschedule', 'revisi-laporan', 'survey']); $q->whereNotIn('status', ['done']);
}); });

View File

@@ -181,7 +181,13 @@ class PembayaranController extends Controller
$permohonan = Permohonan::find($id); $permohonan = Permohonan::find($id);
if ($permohonan) { if ($permohonan) {
if ($request->type === 'revisi') {
$data['status_bayar'] = 'belum_bayar';
} else {
$data['status_bayar'] = 'sudah_bayar'; $data['status_bayar'] = 'sudah_bayar';
}
if ($permohonan->jenis_penilaian_id == 2) { if ($permohonan->jenis_penilaian_id == 2) {
$data['status'] = 'spk'; $data['status'] = 'spk';
} }

View File

@@ -297,7 +297,6 @@ class PenilaiController extends Controller
return redirect() return redirect()
->route('penilai.show', ['id' => $id])->with('success', 'diperbarui ke status paparan dan dikirim ke So untuk proses lebih lanjut.'); ->route('penilai.show', ['id' => $id])->with('success', 'diperbarui ke status paparan dan dikirim ke So untuk proses lebih lanjut.');
} catch (\Exception $e) { } catch (\Exception $e) {
return redirect()->route('penilai.show', ['id' => $id])->with('error', 'Terjadi kesalahan saat memproses permohonan.'); return redirect()->route('penilai.show', ['id' => $id])->with('error', 'Terjadi kesalahan saat memproses permohonan.');
} }
@@ -772,7 +771,6 @@ class PenilaiController extends Controller
'success' => true, 'success' => true,
'message' => 'Berhasil Megirim reported ke so' 'message' => 'Berhasil Megirim reported ke so'
], 200); ], 200);
} catch (\Exception $e) { } catch (\Exception $e) {
return response()->json([ return response()->json([
'success' => false, 'success' => false,
@@ -1039,7 +1037,6 @@ class PenilaiController extends Controller
'trace' => $e->getTraceAsString() 'trace' => $e->getTraceAsString()
], 500); ], 500);
} }
} }
public function storeCallReport(Request $request) public function storeCallReport(Request $request)
@@ -1056,7 +1053,8 @@ class PenilaiController extends Controller
'fakta_negatif' => 'nullable|array', 'fakta_negatif' => 'nullable|array',
'type' => 'required', 'type' => 'required',
'action' => 'required', 'action' => 'required',
'keterangan' => 'nullable|array' 'keterangan' => 'nullable|array',
]); ]);
@@ -1234,12 +1232,10 @@ class PenilaiController extends Controller
$pdf->setPaper('A4', 'portrait'); $pdf->setPaper('A4', 'portrait');
return $pdf->download('Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '_data.pdf'); return $pdf->download('Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '_data.pdf');
} }
} catch (\Exception $e) { } catch (\Exception $e) {
Log::error('PDF generation failed: ' . $e->getMessage()); Log::error('PDF generation failed: ' . $e->getMessage());
return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.' . $e->getMessage()], 500); return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.' . $e->getMessage()], 500);
} }
} }
private function getViewLaporan($tipe) private function getViewLaporan($tipe)
@@ -1608,6 +1604,4 @@ class PenilaiController extends Controller
'message' => 'Berhasil Revisi Ke surveyor', 'message' => 'Berhasil Revisi Ke surveyor',
], 200); ], 200);
} }
} }

View File

@@ -682,6 +682,7 @@ class SurveyorController extends Controller
$request->validate([ $request->validate([
'edited_image' => 'required|string', 'edited_image' => 'required|string',
'original_path' => 'required|string', 'original_path' => 'required|string',
'nomor_registrasi' => 'required',
]); ]);
// Decode base64 image // Decode base64 image
@@ -701,7 +702,7 @@ class SurveyorController extends Controller
// Path asli // Path asli
$originalPath = $request->input('original_path'); $originalPath = $request->input('original_path');
$fileName = basename($originalPath); $fileName = basename($originalPath);
$newFilePath = 'edited_images/' . $fileName; $newFilePath = 'surveyor/upload_foto/'. $request->input('nomor_registrasi') . '/' . $fileName;
// Simpan file ke storage // Simpan file ke storage
Storage::disk('public')->put($newFilePath, $decodedImage); Storage::disk('public')->put($newFilePath, $decodedImage);
@@ -1675,10 +1676,6 @@ class SurveyorController extends Controller
'basicData', 'basicData',
'cekAlamat' 'cekAlamat'
)); ));
// return response()->json([
// 'daya'=> $permohonan
// ]);
} }
/** /**

View File

@@ -106,11 +106,14 @@
@push('scripts') @push('scripts')
<script type="text/javascript"> <script type="text/javascript">
function pembayaranOtorisator(id) { function handlePembayaran(id, type) {
// alert('hai id = ' + id); let rv = type
let title = type === 'revisi' ? 'Apakah Anda yakin ingin merevisi pembayaran ini?' : 'Apakah Anda yakin?';
let text = type === 'revisi' ? 'Untuk melakukan revisi pembayaran!' : 'Untuk melakukan approve pembayaran!';
Swal.fire({ Swal.fire({
title: 'Apakah Anda yakin?', title: title,
text: `Untuk melakukan approve Pembayaran!`, text: text,
icon: 'warning', icon: 'warning',
input: 'textarea', // Menambahkan input textarea input: 'textarea', // Menambahkan input textarea
inputLabel: 'Keterangan', inputLabel: 'Keterangan',
@@ -133,6 +136,7 @@
input_data._method = 'PUT'; input_data._method = 'PUT';
input_data.id = id; input_data.id = id;
input_data.keterangan = keterangan; input_data.keterangan = keterangan;
input_data.type = rv;
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {
@@ -324,10 +328,10 @@
} }
if(permohonan) { if(permohonan) {
return `${permohonan.approve_keterangan_bayar}`; return `${permohonan.approve_keterangan_bayar}` || '-';
} }
return ""; return "-";
}, },
}, },
actions: { actions: {
@@ -339,12 +343,16 @@
var permohonan = data.penawaran.permohonan; var permohonan = data.penawaran.permohonan;
} }
if(permohonan) {
var iconPembayaranOtorisator = ''; var iconPembayaranOtorisator = '';
if(permohonan) {
if (!permohonan.approve_bayar_by) { if (!permohonan.approve_bayar_by) {
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="pembayaranOtorisator(${permohonan.id})"> iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id},'otorisator')">
<i class="ki-filled ki-double-check"></i> <i class="ki-filled ki-double-check"></i>
</a>`; </a>`;
}else{
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id}, 'revisi')">
<i class="ki-filled ki-arrow-circle-left"></i>
</a>`;
} }
return `<div class="flex flex-nowrap justify-center">` + iconPembayaranOtorisator + `</div>`; return `<div class="flex flex-nowrap justify-center">` + iconPembayaranOtorisator + `</div>`;

View File

@@ -20,8 +20,13 @@
@foreach ($informasi as $key) @foreach ($informasi as $key)
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-') @if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}: @php
{{ $forminspeksi['fakta'][$key] }}</p> $displayKey = ucfirst(str_replace('_', ' ', $key));
if (strlen($key) == 3) {
$displayKey = strtoupper($key);
}
@endphp
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
@endif @endif
@endforeach @endforeach

View File

@@ -116,7 +116,11 @@
<td>Tusuk Sate</td> <td>Tusuk Sate</td>
<td>:</td> <td>:</td>
<td> <td>
{{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'yes' ? 'Ya' : 'Tidak' }} {{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'Ya' : 'Tidak' }}
@if (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
{{ isset($forminspeksi['tanah']['tusuk_sate_ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate_ya'] . ')' : '' }}
@endif
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -251,40 +251,81 @@
@include('lpj::component.detail-jaminan', ['status' => true]) @include('lpj::component.detail-jaminan', ['status' => true])
</div> </div>
</div> </div>
<div class="w-full grid grid-cols-1 lg:grid-cols-2 gap-4">
<!-- Bagian Nilai KJPP -->
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md"> <div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
<div class="card-header bg-agi-50"> <div class="card-header bg-agi-50">
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai Likuidasi</h1> <h1 class="text-md font-medium text-gray-900 uppercase">Nilai KJPP</h1>
</div> </div>
<div class="card-body grid gap-5 w-full"> <div class="card-body grid gap-5 w-full">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="Lelang" class="form-label max-w-56">Lelang ke </label> <label for="lelang-1" class="form-label max-w-56">Lelang ke </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="lelang" name="lelang" class="input w-full" <input type="text" id="lelang-1" name="lelang_kjpp" class="input w-full"
placeholder="Masukkan Lelang" value="{{ $callReport['lelang'] ?? old('lelang') }}"> placeholder="Masukkan Lelang" value="{{ $callReport['lelang_kjpp'] ?? '' }}">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="penilai" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label> <label for="nilai-pasar-1" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="nilai-pasar" name="nilai_pasar" <input type="text" id="nilai-pasar-1" name="nilai_pasar_kjpp"
class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['nilai_pasar_kjpp'] ?? '' }}">
value="{{ $callReport['nilai_pasar'] ?? old('likuidasi') }}">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="likuidasi_nilai_1" class="form-label max-w-56">Nilai Likuidasi(%)</label> <label for="likuidasi-1" class="form-label max-w-56">Nilai Likuidasi(%)</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="likuidasi" name="likuidasi" class="input w-full likuidasi" <input type="text" id="likuidasi-1" name="persentase_likuidasi_kjpp" class="input w-full likuidasi"
placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)" value="{{ $callReport['persentase_likuidasi'] ?? old('likuidasi') }}"> placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)"
data-group="1" value="{{ $callReport['persentase_likuidasi_kjpp'] ?? '' }}">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="total-likuidasi" class="form-label max-w-56">Total Nilai Likuidasi <label for="total-likuidasi-1" class="form-label max-w-56">Total Nilai Likuidasi (NL)</label>
(NL)</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="total-likuidasi" name="likuidasi_nilai_1" <input type="text" id="total-likuidasi-1" name="hasil_nilai_likuidasi_kjpp"
class="input w-full total-likuidasi currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['hasil_nilai_likuidasi'] ?? old('likuidasi') }}"> class="input w-full total-likuidasi currency-format" placeholder="Hasil perhitungan" value="{{ $callReport['hasil_nilai_likuidasi_kjpp'] ?? '' }}">
</div>
</div>
</div>
</div>
<!-- Bagian Nilai Internal -->
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
<div class="card-header bg-agi-50">
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai Internal</h1>
</div>
<div class="card-body grid gap-5 w-full">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="lelang-2" class="form-label max-w-56">Lelang ke </label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="lelang-2" name="lelang_internal" class="input w-full"
placeholder="Masukkan Lelang" value="{{ $callReport['lelang_internal'] ?? '' }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="nilai-pasar-2" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="nilai-pasar-2" name="nilai_pasar_internal"
class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['nilai_pasar_internal'] ?? '' }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="likuidasi-2" class="form-label max-w-56">Nilai Likuidasi(%)</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="likuidasi-2" name="persentase_likuidasi_internal" class="input w-full likuidasi"
placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)"
data-group="2" value="{{ $callReport['persentase_likuidasi_internal'] ?? '' }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="total-likuidasi-2" class="form-label max-w-56">Total Nilai Likuidasi (NL)</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="total-likuidasi-2" name="hasil_nilai_likuidasi_internal"
class="input w-full total-likuidasi currency-format" placeholder="Hasil perhitungan" value="{{ $callReport['hasil_nilai_likuidasi_internal'] ?? '' }}">
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -315,9 +356,8 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="penilai" class="form-label max-w-56">Pihak KJPP</label> <label for="penilai" class="form-label max-w-56">Pihak KJPP</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="penilai" name="pihak_kjjpp" <input type="text" id="penilai" name="pihak_kjjpp" class="input w-full "
class="input w-full " value="{{ $callReport['pihak_kjjpp'] ?? ($forminspeksi['signature']['kjjp']['name'] ?? '') }}"
value="{{ $forminspeksi['signature']['kjjp']['name'] ?? $callReport['pihak_kjjpp'] ?? '' }}"
placeholder="Masukkan Nama KJPP"> placeholder="Masukkan Nama KJPP">
</div> </div>
</div> </div>
@@ -382,7 +422,8 @@
@else @else
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full"> <div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old('fakta_positif.0', '') }}</textarea> <textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old('fakta_positif.0', '') }}</textarea>
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;"> <button class="btn btn-danger btn-sm remove-btn" type="button"
style="display: none;">
<i class="ki-outline ki-trash"></i> <i class="ki-outline ki-trash"></i>
</button> </button>
</div> </div>
@@ -410,7 +451,8 @@
@else @else
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full"> <div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old('fakta_negatif.0', $forminspeksi['fakta']['fakta_negatif'][0] ?? '') }}</textarea> <textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old('fakta_negatif.0', $forminspeksi['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;"> <button class="btn btn-danger btn-sm remove-btn" type="button"
style="display: none;">
<i class="ki-outline ki-trash"></i> <i class="ki-outline ki-trash"></i>
</button> </button>
<em id="error-fakta_negatif" class="alert text-danger text-sm"></em> <em id="error-fakta_negatif" class="alert text-danger text-sm"></em>
@@ -501,24 +543,41 @@
perihal: "", perihal: "",
pihak_kjjpp: "", pihak_kjjpp: "",
dari: "", dari: "",
lelang: "", lelang_kjpp: "",
nilai_pasar: "", nilai_pasar_kjpp: "",
persentase_likuidasi: "", persentase_likuidasi_kjpp: "",
hasil_nilai_likuidasi: "" hasil_nilai_likuidasi_kjpp: "",
lelang_internal: "",
nilai_pasar_internal: "",
persentase_likuidasi_internal: "",
hasil_nilai_likuidasi_internal: "",
}; };
jsonData.perihal = document.querySelector('input[name="perihal"]')?.value.trim() || ""; jsonData.perihal = document.querySelector('input[name="perihal"]')?.value.trim() || "";
jsonData.pihak_kjjpp = document.querySelector('input[name="pihak_kjjpp"]')?.value.trim() || "";
jsonData.dari = document.querySelector('input[name="dari"]')?.value.trim() || ""; jsonData.dari = document.querySelector('input[name="dari"]')?.value.trim() || "";
jsonData.tanggal = document.querySelector('input[name="tanggal"]')?.value.trim() || ""; jsonData.tanggal = document.querySelector('input[name="tanggal"]')?.value.trim() || "";
jsonData.kepada = document.querySelector('input[name="kepada"]')?.value.trim() || ""; jsonData.kepada = document.querySelector('input[name="kepada"]')?.value.trim() || "";
jsonData.nomor_laporan = document.querySelector('input[name="nomor_laporan"]')?.value.trim() || ""; jsonData.nomor_laporan = document.querySelector('input[name="nomor_laporan"]')?.value.trim() || "";
jsonData.lelang = document.querySelector('input[name="lelang"]')?.value.trim() || ""; jsonData.lelang_kjpp = document.querySelector('input[name="lelang_kjpp"]')?.value.trim() || "";
// Ambil nilai lainnya // Ambil nilai lainnya
jsonData.nilai_pasar = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar"]')?.value.trim() || ""); jsonData.nilai_pasar_kjpp = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar_kjpp"]')?.value.trim() ||
jsonData.persentase_likuidasi = cleanCurrencyValue(document.querySelector('input[name="likuidasi"]')?.value.trim() || ""); "");
jsonData.hasil_nilai_likuidasi = cleanCurrencyValue(document.querySelector('input[name="likuidasi_nilai_1"]')?.value.trim() || ""); jsonData.persentase_likuidasi_kjpp = cleanCurrencyValue(document.querySelector('input[name="persentase_likuidasi_kjpp"]')?.value
.trim() || "");
jsonData.hasil_nilai_likuidasi_kjpp = cleanCurrencyValue(document.querySelector('input[name="hasil_nilai_likuidasi_kjpp"]')
?.value.trim() || "");
jsonData.lelang_internal = document.querySelector('input[name="lelang_internal"]')?.value.trim() || "";
jsonData.nilai_pasar_internal = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar_internal"]')?.value.trim() ||
"");
jsonData.persentase_likuidasi_internal = cleanCurrencyValue(document.querySelector('input[name="persentase_likuidasi_internal"]')?.value
.trim() || "");
jsonData.hasil_nilai_likuidasi_internal = cleanCurrencyValue(document.querySelector('input[name="hasil_nilai_likuidasi_internal"]')
?.value.trim() || "");
return jsonData; return jsonData;
} }
@@ -613,10 +672,14 @@
} }
</script> </script>
<script> <script>
function calculateTotal() { function calculateTotal(event) {
let nilaiPasarInput = document.getElementById('nilai-pasar'); const group = event.dataset.group;
let nilaiLikuidasi = document.getElementById('likuidasi');
let totalLikuidasi = document.getElementById('total-likuidasi'); // Ambil elemen-elemen terkait berdasarkan group
const nilaiPasarInput = document.querySelector(`#nilai-pasar-${group}`);
const nilaiLikuidasi = document.querySelector(`#likuidasi-${group}`);
const totalLikuidasi = document.querySelector(`#total-likuidasi-${group}`);
const cleanNilaiPasar = cleanCurrencyValue(nilaiPasarInput.value); const cleanNilaiPasar = cleanCurrencyValue(nilaiPasarInput.value);
let cleanLikuidasi = cleanCurrencyValue(nilaiLikuidasi.value); let cleanLikuidasi = cleanCurrencyValue(nilaiLikuidasi.value);

View File

@@ -908,8 +908,13 @@
@foreach ($informasi as $key) @foreach ($informasi as $key)
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-') @if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}: @php
{{ $forminspeksi['fakta'][$key] }}</p> $displayKey = ucfirst(str_replace('_', ' ', $key));
if (strlen($key) == 3) {
$displayKey = strtoupper($key);
}
@endphp
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
@endif @endif
@endforeach @endforeach

View File

@@ -415,7 +415,7 @@
YANG BERLAKU, APABILA LEWAT MAKA HARUS DILAKUKAN ORDER ULANG SESUAI PROSEDUR YANG YANG BERLAKU, APABILA LEWAT MAKA HARUS DILAKUKAN ORDER ULANG SESUAI PROSEDUR YANG
BERLAKU BERLAKU
</li> </li>
<li>Apabila sudah melewati 6 bulan, maka harus penilaian ulang kembali <li class="uppercase">Apabila sudah melewati 6 bulan, maka harus penilaian ulang kembali
</li> </li>
</ol> </ol>
</div> </div>

View File

@@ -10,7 +10,7 @@
<div class="card border border-agi-100 pb-2.5"> <div class="card border border-agi-100 pb-2.5">
<div class="card-header bg-agi-50" id="basic_settings"> <div class="card-header bg-agi-50" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
Detail Penilai Detail Penilaian
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('penilai.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> <a href="{{ route('penilai.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>

View File

@@ -329,10 +329,10 @@
).then((result) => { ).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
const requestData = isPaparanSO ? { const requestData = isPaparanSO ? {
message: result.value.keterangan, message: result.value.message,
tanggalPaparan: result.value.tanggalPaparan tanggalPaparan: result.value.tanggalPaparan
} : { } : {
message: result.value.keterangan message: result.value.message
}; };
handleAjaxRequest( handleAjaxRequest(

View File

@@ -206,7 +206,14 @@
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') { if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
actionHtml += ` actionHtml += `
<a onclick="surveyorRescheduleJadwalSurvey(${data.id},${data.penilaian.id},'${data.nomor_registrasi}', '${data.debiture.name}', '${data.penilaian.waktu_penilaian}', ${JSON.stringify(data.penilaian.rejected_note)})" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey"> <a onclick="surveyorRescheduleJadwalSurvey(
${data.id},
${data.penilaian.id},
${data.nomor_registrasi},
${data.debiture.name},
${data.penilaian.waktu_penilaian},
${JSON.stringify(data.penilaian.rejected_note)}
)" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey">
<i class="ki-filled ki-calendar-remove"></i> <i class="ki-filled ki-calendar-remove"></i>
</a>`; </a>`;
} }

View File

@@ -5,8 +5,6 @@
@endsection @endsection
@section('content') @section('content')
<link rel="stylesheet" href="https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" type="text/css" />
{{-- <link rel="stylesheet" href="https://uicdn.toast.com/tui-image-editor/latest/tui-image-editor.css" /> --}}
<style> <style>
.dropzone { .dropzone {
border: 2px dashed #3498db; border: 2px dashed #3498db;
@@ -266,9 +264,6 @@
@include('lpj::surveyor.js.fotojs') @include('lpj::surveyor.js.fotojs')
@include('lpj::surveyor.js.utils') @include('lpj::surveyor.js.utils')
@push('scripts') @push('scripts')
<script src="https://unpkg.com/dropzone@5/dist/min/dropzone.min.js"></script>
<script src="https://scaleflex.cloudimg.io/v7/plugins/filerobot-image-editor/latest/filerobot-image-editor.min.js">
</script>
<script> <script>
let jsonDataContoh = @json($formFoto); let jsonDataContoh = @json($formFoto);
Dropzone.autoDiscover = false; Dropzone.autoDiscover = false;
@@ -632,20 +627,9 @@
const config = { const config = {
source: imagePath || '', source: imagePath || '',
onSave: (editedImageObject, designState) => { onSave: (editedImageObject, designState) => {
console.log('Image saved', editedImageObject);
// Save the edited image
saveEditedImage(editedImageObject, document.getElementById('editDataFilePath').value); saveEditedImage(editedImageObject, document.getElementById('editDataFilePath').value);
window.FilerobotImageEditor.terminate();
// Close the editor
FilerobotImageEditor.terminate();
// Hide the modal
document.getElementById('modal_10').setAttribute('data-modal-dismiss', 'true');
// Update the preview if needed
updateImagePreview(editedImageObject.imageBase64 || editedImageObject.imageCanvas.toDataURL());
}, },
annotationsCommon: { annotationsCommon: {
fill: '#ff0000' fill: '#ff0000'
@@ -681,17 +665,29 @@
config config
); );
// Render the editor
filerobotImageEditor.render({ filerobotImageEditor.render({
onClose: (closingReason) => { onClose: (closingReason) => {
console.log('Editor closed:', closingReason); console.log('Editor closed:', closingReason);
filerobotImageEditor.terminate(); filerobotImageEditor.terminate();
// Hide the modal let closeButton = document.getElementById('modal_10');
document.querySelector('#modal_10').setAttribute('data-modal-dismiss', 'true');
if (!closeButton) {
closeButton = document.createElement('button');
closeButton.setAttribute('data-modal-dismiss', 'true');
closeButton.setAttribute('type', 'button');
closeButton.setAttribute('class', 'btn btn-primary');
closeButton.setAttribute('data-modal-toggle', '#modal_10');
document.body.appendChild(closeButton);
}
closeButton.click();
console.log('Modal closed via close button simulation');
} }
}); });
} }
window.addEditAndDeleteButtons = function(file, response) { window.addEditAndDeleteButtons = function(file, response) {
@@ -831,13 +827,20 @@
console.log(`${key}:`, value); console.log(`${key}:`, value);
}); });
fetch('/api/save-edited-image', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
$.ajax({
url: `{{ route('surveyor.saveEditedImage') }}`,
type: 'POST',
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
data: {
edited_image: imageData,
original_path: originalFilePath,
nomor_registrasi: '{{ $permohonan->nomor_registrasi }}'
},
success: function(response) {
Swal.fire({ Swal.fire({
icon: 'success', icon: 'success',
title: 'Perubahan Disimpan', title: 'Perubahan Disimpan',
@@ -848,16 +851,22 @@
window.location.reload(); window.location.reload();
} }
});; });
},
}) error: function(xhr) {
.catch(error => {
const errorMessage = xhr.responseJSON?.message || 'Terjadi kesalahan'; const errorMessage = xhr.responseJSON?.message || 'Terjadi kesalahan';
Swal.fire({ Swal.fire({
icon: 'error', icon: 'error',
title: 'Gagal Menyimpan', title: 'Gagal Menyimpan',
text: errorMessage, text: errorMessage,
}).then((response) => {
if (response.isConfirmed) {
window.location.reload();
}
}); });
}
}); });
} }
</script> </script>

View File

@@ -339,7 +339,7 @@
@endphp @endphp
<select id="hub_cadeb_tidak_sesuai" class="input w-full" name="hub_cadeb_tidak_sesuai" <select id="hub_cadeb_tidak_sesuai" class="input w-full" name="hub_cadeb_tidak_sesuai"
style="{{ old('hub_cadeb_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}"> style="{{ $statusKey != 'sesuai' ? '' : 'display: none;' }}">
<option value="">Select Hubungan Cadeb</option> <option value="">Select Hubungan Cadeb</option>
@if (isset($basicData['hubCadeb'])) @if (isset($basicData['hubCadeb']))
@foreach ($basicData['hubCadeb'] as $item) @foreach ($basicData['hubCadeb'] as $item)
@@ -403,7 +403,7 @@
<input id="hub_penghuni_tidak_sesuai" class="input" name="hub_penghuni_tidak_sesuai" <input id="hub_penghuni_tidak_sesuai" class="input" name="hub_penghuni_tidak_sesuai"
placeholder="Masukkan Hubungan penghuni jaminan" placeholder="Masukkan Hubungan penghuni jaminan"
value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}" value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}"
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData ?? false) ? '' : 'display: none;' }}"> style="{{ $statusKey != 'sesuai' ? '' : 'display: none;' }}">
</div> </div>
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em> <em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
</div> </div>

View File

@@ -91,6 +91,8 @@
@push('scripts') @push('scripts')
<script src="https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
const datas = @json($forminspeksi);
console.log(datas);
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const signaturePads = {}; const signaturePads = {};
const types = ['penilai', 'cabang', 'debitur', 'kjjp']; const types = ['penilai', 'cabang', 'debitur', 'kjjp'];
@@ -343,8 +345,6 @@
showLoadingSwal('Mengirim data ke server...'); showLoadingSwal('Mengirim data ke server...');
const form = document.querySelector('form'); const form = document.querySelector('form');
const formData = new FormData(form); const formData = new FormData(form);
console.log('Form data entries:', Array.from(formData.entries()));
$.ajax({ $.ajax({
url: '{{ route('surveyor.store') }}', url: '{{ route('surveyor.store') }}',
type: 'POST', type: 'POST',
@@ -364,8 +364,8 @@
confirmButtonText: 'OK' confirmButtonText: 'OK'
}).then((response) => { }).then((response) => {
if (response.isConfirmed) { if (response.isConfirmed) {
window.location.href = // window.location.href =
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}'; // '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
} }
}); });
} else { } else {
@@ -389,8 +389,6 @@
}); });
return; return;
} }
let errors = xhr.responseJSON?.errors; let errors = xhr.responseJSON?.errors;
$('.alert').text(''); $('.alert').text('');
if (errors) { if (errors) {

View File

@@ -7,7 +7,7 @@
: 'sesuai'; : 'sesuai';
$luasBangunan = $forminspeksi['bangunan']['luas_tanah_bagunan'][$cekLuasBangunan] ?? null; $luasBangunan = $forminspeksi['bangunan']['luas_tanah_bagunan'][$cekLuasBangunan] ?? null;
@endphp @endphp
<td width="25%"><strong>Luas Tanah Bangunan</strong></td> <td width="25%"><strong>Luas Bangunan (IMB)</strong></td>
<td>{{ $luasBangunan }}</td> <td>{{ $luasBangunan }}</td>
</tr> </tr>
@@ -28,6 +28,7 @@
<input type="checkbox" <input type="checkbox"
{{ isset($forminspeksi['bangunan']['jenis_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['jenis_bangunan']) ? 'checked' : '' }}> {{ isset($forminspeksi['bangunan']['jenis_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['jenis_bangunan']) ? 'checked' : '' }}>
{{ $item->name }} {{ $item->name }}
</label> </label>
</td> </td>
@endforeach @endforeach
@@ -80,6 +81,18 @@
<input type="checkbox" name="sifat_bangunan[]" value="{{ $item->name }}" <input type="checkbox" name="sifat_bangunan[]" value="{{ $item->name }}"
{{ isset($forminspeksi['bangunan']['sifat_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']) ? 'checked' : '' }}> {{ isset($forminspeksi['bangunan']['sifat_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']) ? 'checked' : '' }}>
{{ $item->name }} {{ $item->name }}
@if (isset($forminspeksi['bangunan']['sifat_bangunan']) &&
in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']))
@php
$inputValues = isset($forminspeksi['bangunan']['sifat_bangunan_input'][$index])
? $forminspeksi['bangunan']['sifat_bangunan_input'][$index]
: null;
@endphp
@if ($inputValues)
<span class="label-checkbox"> - {{ $inputValues }}</span>
@endif
@endif
</label> </label>
</td> </td>
@endforeach @endforeach
@@ -90,7 +103,8 @@
</tr> </tr>
@if (isset($forminspeksi['bangunan']['spesifikasi_bangunan']) && count($forminspeksi['bangunan']['spesifikasi_bangunan']) > 0) @if (isset($forminspeksi['bangunan']['spesifikasi_bangunan']) &&
count($forminspeksi['bangunan']['spesifikasi_bangunan']) > 0)
@foreach ($forminspeksi['bangunan']['spesifikasi_bangunan'] as $bangunanIndex => $bangunan) @foreach ($forminspeksi['bangunan']['spesifikasi_bangunan'] as $bangunanIndex => $bangunan)
<tr> <tr>
<td colspan="2"><strong>Spesifikasi Bangunan {{ $bangunanIndex + 1 }}</strong></td> <td colspan="2"><strong>Spesifikasi Bangunan {{ $bangunanIndex + 1 }}</strong></td>
@@ -109,14 +123,20 @@
@php @php
$selectedValues = []; $selectedValues = [];
if (isset($bangunan['spek_kategori_bangunan'][$spesifikasi->name])) { if (isset($bangunan['spek_kategori_bangunan'][$spesifikasi->name])) {
$selectedValues = array_values($bangunan['spek_kategori_bangunan'][$spesifikasi->name]); $selectedValues = array_values(
$bangunan['spek_kategori_bangunan'][$spesifikasi->name],
);
} }
$lainnyaValue = $bangunan['spek_kategori_bangunan'][$spesifikasi->name]['lainnya'] ?? ''; $lainnyaValue =
$bangunan['spek_kategori_bangunan'][$spesifikasi->name][
'lainnya'
] ?? '';
@endphp @endphp
<td class="checkbox-item"> <td class="checkbox-item">
<label class="checkbox-label"> <label class="checkbox-label">
<input type="checkbox" class="checkbox-lainnya" style="margin-right: 3px;" <input type="checkbox" class="checkbox-lainnya"
style="margin-right: 3px;"
name="spesifikasi_bangunan[{{ $bangunanIndex }}][{{ $spesifikasi->name }}][]" name="spesifikasi_bangunan[{{ $bangunanIndex }}][{{ $spesifikasi->name }}][]"
value="{{ $kategori->name }}" value="{{ $kategori->name }}"
@if (in_array($kategori->name, $selectedValues)) checked @endif> @if (in_array($kategori->name, $selectedValues)) checked @endif>

View File

@@ -129,8 +129,13 @@
@foreach ($informasi as $key) @foreach ($informasi as $key)
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-') @if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}: @php
{{ $forminspeksi['fakta'][$key] }}</p> $displayKey = ucfirst(str_replace('_', ' ', $key));
if (strlen($key) == 3) {
$displayKey = strtoupper($key);
}
@endphp
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
@endif @endif
@endforeach @endforeach
</td> </td>

View File

@@ -13,23 +13,23 @@
<table> <table>
<tr> <tr>
<td width="25%">Jarak Jalan Utama</td> <td width="25%">Jarak Jalan Utama</td>
<td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Jalan Lingkungan</td> <td>Jalan Lingkungan</td>
<td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['jalan_linkungan'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Jarak CBD Point</td> <td>Jarak CBD Point</td>
<td>{{ $forminspeksi['lingkungan']['jarak_cbd_point'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['jarak_cbd_point'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Nama CBD Point</td> <td>Nama CBD Point</td>
<td>{{ $forminspeksi['lingkungan']['nama_cbd_point'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['nama_cbd_point'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Lebar Perkerasan Jalan</td> <td>Lebar Perkerasan Jalan</td>
<td>{{ $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: top;"><strong>Sarana Pelengkap</strong></td> <td style="vertical-align: top;"><strong>Sarana Pelengkap</strong></td>
@@ -191,6 +191,55 @@
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: top;"><strong>Dekat Makam</strong></td>
<td>
<div class="checkbox-item">
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="ya"
{{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya' ? 'checked' : '' }}>
Ya
@if (($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya')
- Nama Makam:
{{ $forminspeksi['lingkungan']['nama_makam'] ?? '' }}
, Jarak Makam:
{{ $forminspeksi['lingkungan']['jarak_makam'] ?? '' }}
@endif
</label>
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="tidak"
{{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'tidak' ? 'checked' : '' }}>
Tidak
</label>
</div>
</td>
</tr>
<tr>
<td style="vertical-align: top;"><strong>Dekat TPS</strong></td>
<td>
<div class="checkbox-item">
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="ya"
{{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya' ? 'checked' : '' }}>
Ya
@if (($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya')
- Nama TPS:
{{ $forminspeksi['lingkungan']['nama_tps'] ?? '' }}
, Jarak TPS:
{{ $forminspeksi['lingkungan']['jarak_tps'] ?? '' }}
@endif
</label>
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="tidak"
{{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'tidak' ? 'checked' : '' }}>
Tidak
</label>
</div>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: top;"><strong>Merupakan Daerah</strong></td> <td style="vertical-align: top;"><strong>Merupakan Daerah</strong></td>
<td> <td>

View File

@@ -193,6 +193,12 @@
.page-break { .page-break {
page-break-after: always; page-break-after: always;
} }
.no-break {
page-break-inside: avoid;
page-break-before: auto;
page-break-after: auto;
}
</style> </style>
</head> </head>
@@ -308,7 +314,13 @@
</tr> </tr>
<tr> <tr>
<td><strong>Nama Debiture/ Wakil Debiture</strong></td> <td><strong>Nama Debiture/ Wakil Debiture</strong></td>
<td>{{ $permohonan->debiture->name ?? '' }}</td> <td>{{ $permohonan->debiture->name ?? '' }}
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
/ {{ $item }}
@endforeach
@endif
</td>
<td><strong>Kunjungan Tanggal</strong></td> <td><strong>Kunjungan Tanggal</strong></td>
<td>{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td> <td>{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
</tr> </tr>
@@ -556,10 +568,12 @@
</table> </table>
</td> </td>
</tr> </tr>
@if (strtolower($permohonan->tujuanPenilaian->name) == 'rap') @if (strtolower($permohonan->tujuanPenilaian->name) == 'rap')
@include('lpj::surveyor.components.print-out.rap') @include('lpj::surveyor.components.print-out.rap')
@else @else
<tr> <tr>
<td style="text-align: center; border: 1px solid #000;"> <td style="text-align: center; border: 1px solid #000;">
E E
</td> </td>
@@ -600,7 +614,7 @@
</td> </td>
</tr> </tr>
@endIf @endIf
</div>
{{-- <tr> {{-- <tr>
<td style="text-align: center; border: 1px solid #000;"> <td style="text-align: center; border: 1px solid #000;">
G G

View File

@@ -123,13 +123,16 @@
<td><strong>Tusuk Sate</strong></td> <td><strong>Tusuk Sate</strong></td>
<td> <td>
<label> <label>
<input type="radio" name="tusuk_sate" value="yes" <input type="radio" name="tusuk_sate" value="Ya"
{{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'yes' ? 'Ya' : 'Tidak' }} {{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'checked' : '' }}>
Ya Ya
@if (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
{{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate']['Ya'] . ')' : '' }}
@endif
</label> </label>
<label> <label>
<input type="radio" name="tusuk_sate" value="no" <input type="radio" name="tusuk_sate" value="Tidak"
{{isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'no' ? 'checked' : '' }}> {{isset($forminspeksi['tanah']['tusuk_sate']['Tidak']) && $forminspeksi['tanah']['tusuk_sate']['Tidak'] ? 'checked' : '' }}>
Tidak Tidak
</label> </label>
</td> </td>

View File

@@ -85,10 +85,9 @@
<!-- Select dropdown untuk "Tidak Sesuai" --> <!-- Select dropdown untuk "Tidak Sesuai" -->
<div id="hadap_mata_angin_tidak_sesuai" class="flex items-baseline gap-2" <div id="hadap_mata_angin_tidak_sesuai" class="flex items-baseline gap-2"
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}"> style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
<select <select class="input w-full
class="input w-full id="
id=" hadap_mata_angin_tidak_sesuai" hadap_mata_angin_tidak_sesuai" name="hadap_mata_angin_tidak_sesuai">
name="hadap_mata_angin_tidak_sesuai">
@php @php
$statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai']) $statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])
? 'sesuai' ? 'sesuai'
@@ -273,13 +272,24 @@
<div class="flex-wrap items-stretch"> <div class="flex-wrap items-stretch">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2"> <div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="tusuk_sate" value="yes" <input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
{{ old('tusuk_sate') == 'yes' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'yes') ? 'checked' : '' }}> type="radio" class="radio" name="tusuk_sate" value="Ya"
{{ old('tusuk_sate') == 'Ya' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'checked' : '' }}>
<span class="ml-2">Ya</span> <span class="ml-2">Ya</span>
@php
$statusKey = isset($forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'Ya' : 'Tidak';
$selectedData = $forminspeksi['tanah']['tusuk_sate'][$statusKey] ?? null;
@endphp
<input id="tusuk_sate_ya" class="input" name="tusuk_sate_ya"
placeholder="Masukkan Tusuk Sate..."
value="{{ old('tusuk_sate_ya', isset($selectedData) ? $selectedData : '') }}"
style="{{ $statusKey == 'Ya' ? '' : 'display: none;' }}">
</label> </label>
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="tusuk_sate" value="no" <input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
{{ old('tusuk_sate') == 'no' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'no') ? 'checked' : '' }}> type="radio" class="radio" name="tusuk_sate" value="Tidak"
{{ old('tusuk_sate') == 'Tidak' || (isset($forminspeksi['tanah']['tusuk_sate']['Tidak']) && $forminspeksi['tanah']['tusuk_sate']['Tidak']) ? 'checked' : '' }}>
<span class="ml-2">Tidak</span> <span class="ml-2">Tidak</span>
</label> </label>
</div> </div>

View File

@@ -101,6 +101,8 @@
@endsection @endsection
@push('scripts') @push('scripts')
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script> <script>
function surveyorFreeze(permohonanId, noReg, debitur) { function surveyorFreeze(permohonanId, noReg, debitur) {
@@ -308,11 +310,32 @@
<div class="text-left space-y-4"> <div class="text-left space-y-4">
<p class="text-gray-700 text-center">Untuk membuat jadwal kunjungan, silahkan isi form berikut!</p> <p class="text-gray-700 text-center">Untuk membuat jadwal kunjungan, silahkan isi form berikut!</p>
<div> <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> <label for="tanggal_kunjungan" class="block text-sm font-medium text-gray-700 mb-1" style="text-align: start;">Tanggal Kunjungan <span class="text-danger">*</span></label>
<input type="datetime-local" id="waktu_penilaian" class="input" style="margin-top: 10px;" required> <input type="date" id="tanggal_kunjungan" class="input" style="margin-top: 10px; width: 100%;" required>
</div> </div>
<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> <label class="block text-sm font-medium text-gray-700 mb-1 mt-2" style="text-align: start;">Waktu Kunjungan (Format 24 Jam) <span class="text-danger">*</span></label>
<div style="display: flex; align-items: center; gap: 10px; margin-top: 10px;">
<div style="position: relative; flex: 1;">
<input type="text" id="jam_kunjungan" class="input" maxlength="2" style="width: 100%; text-align: center; padding-right: 30px;" placeholder="00">
<div style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;">
<button type="button" id="jam_up" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px; margin-bottom: 2px;">▲</button>
<button type="button" id="jam_down" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px;">▼</button>
</div>
</div>
<span style="font-weight: bold;">:</span>
<div style="position: relative; flex: 1;">
<input type="text" id="menit_kunjungan" class="input" maxlength="2" style="width: 100%; text-align: center; padding-right: 30px;" placeholder="00">
<div style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;">
<button type="button" id="menit_up" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px; margin-bottom: 2px;">▲</button>
<button type="button" id="menit_down" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px;">▼</button>
</div>
</div>
</div>
</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> <textarea id="deskripsi-penilaian" class="textarea" placeholder="Masukkan keterangan" style="margin-top: 10px;" required></textarea>
</div> </div>
</div> </div>
@@ -322,14 +345,120 @@
cancelButtonColor: '#d33', cancelButtonColor: '#d33',
confirmButtonText: 'Submit', confirmButtonText: 'Submit',
cancelButtonText: 'Batal', cancelButtonText: 'Batal',
didOpen: () => {
// Set default value ke waktu saat ini
const now = new Date();
const dateString = now.toISOString().slice(0, 10);
const hours = now.getHours();
const minutes = now.getMinutes();
// Set default values
document.getElementById('tanggal_kunjungan').value = dateString;
document.getElementById('jam_kunjungan').value = hours.toString().padStart(2, '0');
document.getElementById('menit_kunjungan').value = minutes.toString().padStart(2, '0');
// Handler untuk input jam
const jamInput = document.getElementById('jam_kunjungan');
const jamUp = document.getElementById('jam_up');
const jamDown = document.getElementById('jam_down');
// Validasi hanya angka untuk jam
jamInput.addEventListener('input', function(e) {
this.value = this.value.replace(/[^0-9]/g, '').substring(0, 2);
let value = parseInt(this.value, 10);
if (!isNaN(value)) {
if (value > 23) {
this.value = "00";
} else {
this.value = value.toString().padStart(2, '0');
}
}
});
jamInput.addEventListener('blur', function() {
if (this.value === "" || isNaN(parseInt(this.value, 10))) {
this.value = "00";
} else {
this.value = parseInt(this.value, 10).toString().padStart(2, '0');
}
});
// Button handlers untuk jam
jamUp.addEventListener('click', function() {
let value = parseInt(jamInput.value, 10);
if (isNaN(value)) value = 0;
value = (value + 1) % 24;
jamInput.value = value.toString().padStart(2, '0');
});
jamDown.addEventListener('click', function() {
let value = parseInt(jamInput.value, 10);
if (isNaN(value)) value = 0;
value = (value - 1 + 24) % 24;
jamInput.value = value.toString().padStart(2, '0');
});
// Handler untuk input menit
const menitInput = document.getElementById('menit_kunjungan');
const menitUp = document.getElementById('menit_up');
const menitDown = document.getElementById('menit_down');
// Validasi hanya angka untuk menit
menitInput.addEventListener('input', function(e) {
this.value = this.value.replace(/[^0-9]/g, '').substring(0, 2);
let value = parseInt(this.value, 10);
if (!isNaN(value)) {
if (value > 59) {
this.value = "00";
} else {
this.value = value.toString().padStart(2, '0');
}
}
});
menitInput.addEventListener('blur', function() {
if (this.value === "" || isNaN(parseInt(this.value, 10))) {
this.value = "00";
} else {
this.value = parseInt(this.value, 10).toString().padStart(2, '0');
}
});
// Button handlers untuk menit
menitUp.addEventListener('click', function() {
let value = parseInt(menitInput.value, 10);
if (isNaN(value)) value = 0;
value = (value + 1) % 60;
menitInput.value = value.toString().padStart(2, '0');
});
menitDown.addEventListener('click', function() {
let value = parseInt(menitInput.value, 10);
if (isNaN(value)) value = 0;
value = (value - 1 + 60) % 60;
menitInput.value = value.toString().padStart(2, '0');
});
},
preConfirm: () => { preConfirm: () => {
// Ambil nilai input // Ambil nilai input
const tanggalInspeksi = document.getElementById('waktu_penilaian').value; const tanggalKunjungan = document.getElementById('tanggal_kunjungan').value;
let jamKunjungan = document.getElementById('jam_kunjungan').value;
let menitKunjungan = document.getElementById('menit_kunjungan').value;
const keteranganInspeksi = document.getElementById('deskripsi-penilaian').value; const keteranganInspeksi = document.getElementById('deskripsi-penilaian').value;
// Validasi input: cek apakah input kosong // Validasi input: cek apakah input kosong
if (!tanggalInspeksi.trim()) { if (!tanggalKunjungan.trim()) {
Swal.showValidationMessage('Harap mengisi Jadwal Kunjungan.'); Swal.showValidationMessage('Harap mengisi Tanggal Kunjungan.');
return false;
}
if (!jamKunjungan || !menitKunjungan) {
Swal.showValidationMessage('Harap mengisi Waktu Kunjungan.');
return false; return false;
} }
if (!keteranganInspeksi.trim()) { if (!keteranganInspeksi.trim()) {
@@ -337,9 +466,16 @@
return false; return false;
} }
// Pastikan format 2 digit
jamKunjungan = parseInt(jamKunjungan, 10).toString().padStart(2, '0');
menitKunjungan = parseInt(menitKunjungan, 10).toString().padStart(2, '0');
// Gabungkan tanggal dan waktu dalam format ISO
const datetimeValue = `${tanggalKunjungan}T${jamKunjungan}:${menitKunjungan}`;
// Jika semua valid, kembalikan data // Jika semua valid, kembalikan data
return { return {
tanggal: tanggalInspeksi, tanggal: datetimeValue,
keterangan: keteranganInspeksi keterangan: keteranganInspeksi
}; };
} }
@@ -360,16 +496,14 @@
deskripsi_penilaian: keterangan deskripsi_penilaian: keterangan
}; };
// Change from PUT to POST method
$.ajax({ $.ajax({
url: useURL, url: useURL,
type: "POST", // Changed from PUT to POST type: "POST",
cache: false, cache: false,
data: input_data, data: input_data,
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {
// Arahkan langsung ke halaman inspeksi Swal.fire('Berhasil!', 'Berhasil membuat jadwal.', 'success').then(
Swal.fire('Berhasil!', 'Data berhasil disimpan.', 'success').then(
() => { () => {
window.location.reload(); window.location.reload();
}); });

View File

@@ -3,19 +3,7 @@
const ruteLainnyaDiv = document.getElementById("ruteLainnya"); const ruteLainnyaDiv = document.getElementById("ruteLainnya");
const lantaiLainnyaDiv = document.getElementById("lantaiLainnya"); const lantaiLainnyaDiv = document.getElementById("lantaiLainnya");
// Function to add delete event listeners to existing buttons
function addDeleteListeners(container) {
container.querySelectorAll(".delete-btn").forEach(button => {
button.addEventListener("click", function() {
this.closest(
".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5")
.remove();
});
});
}
// Add delete listeners to existing buttons
addDeleteListeners(ruteLainnyaDiv);
// Create new div for additional items // Create new div for additional items
function createNewDiv(container, inputName) { function createNewDiv(container, inputName) {
@@ -64,13 +52,8 @@
} }
// Event listener for adding more items // Event listener for adding more items
document.getElementById("btnAddMore").addEventListener("click", function() {
createNewDiv(ruteLainnyaDiv, "rute_lainnya");
});
document.getElementById("btnAddMoreObject").addEventListener("click", function() {
createNewDiv(lantaiLainnyaDiv, "lantai_lainnya");
});
function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) { function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) {
const addButton = document.getElementById(buttonId); const addButton = document.getElementById(buttonId);

View File

@@ -600,7 +600,7 @@
Breadcrumbs::for('penilai.show', function (BreadcrumbTrail $trail) { Breadcrumbs::for('penilai.show', function (BreadcrumbTrail $trail) {
$trail->parent('penilai'); $trail->parent('penilai');
$trail->push('Detail Penilai'); $trail->push('Detail Penilaian');
}); });
Breadcrumbs::for('penilai.edit', function (BreadcrumbTrail $trail) { Breadcrumbs::for('penilai.edit', function (BreadcrumbTrail $trail) {

View File

@@ -583,6 +583,7 @@ Route::middleware(['auth'])->group(function () {
Route::put('store-approve-reschedule/{id}', [SurveyorController::class, 'approveReschedule'])->name('approveReschedule'); Route::put('store-approve-reschedule/{id}', [SurveyorController::class, 'approveReschedule'])->name('approveReschedule');
Route::put('store-rejected-reschedule/{id}', [SurveyorController::class, 'rejectReschedule'])->name('rejectReschedule'); Route::put('store-rejected-reschedule/{id}', [SurveyorController::class, 'rejectReschedule'])->name('rejectReschedule');
Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey'); Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey');
Route::post('save-edited-image/', [SurveyorController::class, 'saveEditedImage'])->name('saveEditedImage');
}); });