fix(penilai): print out laporan

This commit is contained in:
majid
2025-03-07 10:46:24 +07:00
parent 69e888c6d4
commit 3e6613f955
10 changed files with 134 additions and 84 deletions

View File

@@ -1472,8 +1472,8 @@ class SurveyorController extends Controller
'dokument_id' => 'required', 'dokument_id' => 'required',
'name_foto_objek' => 'nullable|string', 'name_foto_objek' => 'nullable|string',
'nomor_registrasi' => 'required|string', 'nomor_registrasi' => 'required|string',
'foto_objek' => 'nullable|image|max:'.$maxSize, 'foto_objek' => 'nullable|jpeg|png|jpg|gif|svg|max:'.$maxSize,
'foto_objek_pembanding.*' => 'nullable|image|max:'.$maxSize, 'foto_objek_pembanding.*' => 'nullable|jpeg|png|jpg|gif|svg|max:'.$maxSize,
]); ]);
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT', 'MESIN']; $tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT', 'MESIN'];

View File

@@ -138,7 +138,7 @@
@foreach (json_decode($detail->details) as $key => $value) @foreach (json_decode($detail->details) as $key => $value)
@if (!is_null($value) && $value !== '') @if (!is_null($value) && $value !== '')
<tr> <tr>
<td style="padding: 2px;">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td> <td style="padding: 2px;"> {{formatLabel($key)}}</td>
<td style=" padding: 2px;">:</td> <td style=" padding: 2px;">:</td>
<td style="">{{ $value }} <td style="">{{ $value }}
@if ($key == 'luas_bangunan' || $key == 'luas_tanah') @if ($key == 'luas_bangunan' || $key == 'luas_tanah')

View File

@@ -175,7 +175,7 @@
@if (!is_null($value) && $value !== '') @if (!is_null($value) && $value !== '')
<tr> <tr>
<td style="width: 20%; padding: 2px;"> <td style="width: 20%; padding: 2px;">
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }} {{formatLabel($key)}}
</td> </td>
<td style="width: 1%; padding: 2px;">:</td> <td style="width: 1%; padding: 2px;">:</td>
<td style="width: 79%; padding: 2px;"> <td style="width: 79%; padding: 2px;">
@@ -570,9 +570,9 @@
PETA PETA
</h6> </h6>
</div> </div>
<div class="photo-container"> <div style="text-align: center">
@php @php
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat']; $fotoTypes = ['upload_gs','foto_sentuh_tanahku','foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
// Memindahkan foto_tempat ke depan jika ada // Memindahkan foto_tempat ke depan jika ada
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) { if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
unset($fotoTypes[$key]); unset($fotoTypes[$key]);
@@ -607,9 +607,8 @@
</div> </div>
</div> </div>
<div class="page-break"></div> <div class="page-break"></div>
<div class="section"> <div class="section">
<div class="judul"> <div class="judul">
<h6 class="border" style="text-align: center"> <h6 class="border" style="text-align: center">

View File

@@ -197,7 +197,7 @@
@if (!is_null($value) && $value !== '') @if (!is_null($value) && $value !== '')
<tr> <tr>
<td style="padding: 2px; vertical-align: top;"> <td style="padding: 2px; vertical-align: top;">
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }} {{formatLabel($key)}}
</td> </td>
<td style="padding: 2px; vertical-align: top;">:</td> <td style="padding: 2px; vertical-align: top;">:</td>
<td style="padding: 2px; vertical-align: top;"> <td style="padding: 2px; vertical-align: top;">
@@ -1095,7 +1095,7 @@
</div> </div>
<div class="photo-container"> <div class="photo-container">
@php @php
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat', 'foto_sentuh_tanahku']; $fotoTypes = ['upload_gs','foto_sentuh_tanahku','foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
// Memindahkan foto_tempat ke depan jika ada // Memindahkan foto_tempat ke depan jika ada
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) { if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
unset($fotoTypes[$key]); unset($fotoTypes[$key]);

View File

@@ -202,7 +202,7 @@
@foreach (json_decode($detail->details) as $key => $value) @foreach (json_decode($detail->details) as $key => $value)
@if (!is_null($value) && $value !== '') @if (!is_null($value) && $value !== '')
<td style="width:25%; padding: 2px; vertical-align: top;"> <td style="width:25%; padding: 2px; vertical-align: top;">
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td> {{formatLabel($key)}}</td>
<td style="width:1%; padding: 2px; vertical-align: top;">:</td> <td style="width:1%; padding: 2px; vertical-align: top;">:</td>
<td style=" padding: 2px; vertical-align: top;">{{ $value }} <td style=" padding: 2px; vertical-align: top;">{{ $value }}
@if ($key == 'luas_bangunan' || $key == 'luas_tanah') @if ($key == 'luas_bangunan' || $key == 'luas_tanah')
@@ -562,7 +562,7 @@
</table> </table>
<div class="photo-container"> <div class="photo-container">
@php @php
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat','foto_sentuh_tanahku']; $fotoTypes = ['upload_gs','foto_sentuh_tanahku','foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
// Memindahkan foto_tempat ke depan jika ada // Memindahkan foto_tempat ke depan jika ada
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) { if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
unset($fotoTypes[$key]); unset($fotoTypes[$key]);

View File

@@ -109,7 +109,7 @@
@foreach ($details as $key => $value) @foreach ($details as $key => $value)
@if (!is_null($value) && $value !== '') @if (!is_null($value) && $value !== '')
<tr> <tr>
<td style="">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td> <td style=""> {{formatLabel($key)}}</td>
<td style=" padding: 2px;">:</td> <td style=" padding: 2px;">:</td>
<td style="">{{ $value }} <td style="">{{ $value }}
@if ($key == 'luas_bangunan' || $key == 'luas_tanah') @if ($key == 'luas_bangunan' || $key == 'luas_tanah')

View File

@@ -99,10 +99,15 @@
Status Bayar Status Bayar
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<span @if (strtolower($permohonan->tujuanPenilaian->name) ==
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase"> 'penilaian ulang')
{{ str_replace('_', ' ', $permohonan->status_bayar) }} <span>-</span>
</span> @else
<span
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
</span>
@endif
</div> </div>
</div> </div>
@@ -190,17 +195,16 @@
</div> </div>
@if ($permohonan->status == 'revisi-laporan') @if ($permohonan->status == 'revisi-laporan')
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Catatan Revisi Catatan Revisi
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<p class="flex w-full text-gray-600 font-medium text-sm"> <p class="flex w-full text-gray-600 font-medium text-sm">
{{ $permohonan->keterangan ?? '' }} {{ $permohonan->keterangan ?? '' }}
</p> </p>
</div>
</div> </div>
</div>
@endif @endif
</div> </div>
@@ -226,7 +230,8 @@
Kertas Kerja Kertas Kerja
</a> </a>
@endif @endif
<a class="btn btn-primary" onclick="paparan({{ $permohonan->id }}, {{ $dokumen->id }}, {{ $inspeksiId }}, {{ $dokumen->jenis_jaminan_id }})"> <a class="btn btn-primary"
onclick="paparan({{ $permohonan->id }}, {{ $dokumen->id }}, {{ $inspeksiId }}, {{ $dokumen->jenis_jaminan_id }})">
Paparan Paparan
</a> </a>
@@ -295,9 +300,6 @@
</a> </a>
</div> </div>
@endif @endif
@endif
{{-- @if ($permohonan->penilaian->jenis_penilaian_id == 2 && $permohonan->tujuanPenilaian->id == 4) --}}
<div class="menu-item"> <div class="menu-item">
<a class="menu-link" <a class="menu-link"
onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})"> onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
@@ -310,6 +312,10 @@
</span> </span>
</a> </a>
</div> </div>
@endif
{{-- @if ($permohonan->penilaian->jenis_penilaian_id == 2 && $permohonan->tujuanPenilaian->id == 4) --}}
{{-- @endif --}} {{-- @endif --}}
</div> </div>
@@ -319,8 +325,8 @@
<div class="flex justify-end gap-5"> <div class="flex justify-end gap-5">
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id]) }}" class="btn btn-light" <a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id]) }}"
> class="btn btn-light">
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi <i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
</a> </a>
@@ -345,7 +351,9 @@
REPORT REPORT
</a> </a>
<a class="btn btn-warning" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' ? 'disabled' : '' }} onclick="revisiSurveyor('{{ $permohonan->id }}', '{{$permohonan->debiture->name }}', '{{$permohonan->nomor_registrasi }}')"> <a class="btn btn-warning"
{{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' ? 'disabled' : '' }}
onclick="revisiSurveyor('{{ $permohonan->id }}', '{{ $permohonan->debiture->name }}', '{{ $permohonan->nomor_registrasi }}')">
<i class="ki-filled ki-arrow-circle-right"></i> <i class="ki-filled ki-arrow-circle-right"></i>
REVISI REVISI
</a> </a>
@@ -407,10 +415,10 @@
</div> </div>
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
@if (isset($permohonan->penilai) && isset($permohonan->penilai->kertas_kerja) && $permohonan->penilai->kertas_kerja) @if (isset($permohonan->penilai) && isset($permohonan->penilai->kertas_kerja) && $permohonan->penilai->kertas_kerja)
<span data-modal-dismiss="true" class="btn btn-warning btn-outline" <span data-modal-dismiss="true" class="btn btn-warning btn-outline"
onclick="viewPDF('{{ Storage::url($permohonan->penilai->kertas_kerja) }}')"><i onclick="viewPDF('{{ Storage::url($permohonan->penilai->kertas_kerja) }}')"><i
class="ki-filled ki-eye mr-2"></i>Lihat Kertas Kerja</span> class="ki-filled ki-eye mr-2"></i>Lihat Kertas Kerja</span>
@endif @endif
</div> </div>
</div> </div>
@@ -610,7 +618,8 @@
confirmButtonText: 'Yes' confirmButtonText: 'Yes'
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
window.location.href = `/penilai/${permohonanId}/edit?document_id=${documentId}&inspeksi_id=${inspeksiId}&jaminanId=${jaminanId}`; window.location.href =
`/penilai/${permohonanId}/edit?document_id=${documentId}&inspeksi_id=${inspeksiId}&jaminanId=${jaminanId}`;
} }
}); });
} }
@@ -635,7 +644,7 @@
// window.location.reload(); // window.location.reload();
hideLoadingSwal(); hideLoadingSwal();
toastrSuccessBuild(response.message); toastrSuccessBuild(response.message);
}else{ } else {
// hideLoadingSwal(); // hideLoadingSwal();
Swal.fire('Perhatian!', response.message, 'warning'); Swal.fire('Perhatian!', response.message, 'warning');
} }
@@ -658,52 +667,52 @@
function revisiSurveyor(dataId, debitur, noreg) { function revisiSurveyor(dataId, debitur, noreg) {
Swal.fire({ Swal.fire({
title: 'Apakah Anda yakin?', title: 'Apakah Anda yakin?',
text: `Untuk melakukan Revisi nomor registrasi ${noreg} atas nama debiture ${debitur} !`, text: `Untuk melakukan Revisi nomor registrasi ${noreg} atas nama debiture ${debitur} !`,
icon: 'warning', icon: 'warning',
input: 'textarea', input: 'textarea',
inputLabel: 'Keterangan', inputLabel: 'Keterangan',
inputPlaceholder: 'Masukkan keterangan...', inputPlaceholder: 'Masukkan keterangan...',
inputAttributes: { inputAttributes: {
'aria-label': 'Masukkan keterangan' 'aria-label': 'Masukkan keterangan'
},
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Ya, Lanjutkan!',
cancelButtonText: 'Batal',
}).then((result) => {
if (result.isConfirmed) {
const userMessage = result.value || '';
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}, },
showCancelButton: true, });
confirmButtonColor: '#3085d6', $.ajax({
cancelButtonColor: '#d33', url: `/penilai/revisi-surveyor/${dataId}`,
confirmButtonText: 'Ya, Lanjutkan!', type: 'PUT',
cancelButtonText: 'Batal', data: {
}).then((result) => { message: userMessage
if (result.isConfirmed) { },
const userMessage = result.value || ''; success: (response) => {
$.ajaxSetup({ Swal.fire('Berhasil!', response.message, 'success').then(
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
});
$.ajax({
url: `/penilai/revisi-surveyor/${dataId}`,
type: 'PUT',
data: {
message: userMessage
},
success: (response) => {
Swal.fire('Berhasil!', response.message , 'success').then(
() => { () => {
window.location.href = window.location.href =
'{{ route('penilai.index') }}'; '{{ route('penilai.index') }}';
}); });
console.log(response); console.log(response);
}, },
error: (error) => { error: (error) => {
console.error('Error:', error); console.error('Error:', error);
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.', Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
'error'); 'error');
}
});
} }
}); });
} }
});
}
</script> </script>
@include('lpj::surveyor.js.utils') @include('lpj::surveyor.js.utils')

View File

@@ -356,9 +356,30 @@
if (preview) { if (preview) {
preview.id = newImageId; preview.id = newImageId;
preview.src = ''; preview.src = '';
preview.accept = ".jpg,.jpeg,.png";
preview.classList.add('hidden'); preview.classList.add('hidden');
input.onchange = function() { input.onchange = function() {
previewImage(this, newImageId); const file = this.files[0];
if (file) {
const validExtensions = ['image/jpeg', 'image/png', 'image/gif',
'image/webp'
];
if (validExtensions.includes(file.type)) {
previewImage(this, newImageId);
} else {
Swal.fire({
icon: 'error',
title: 'Format Tidak Didukung',
text: 'Hanya file gambar dengan format JPG, PNG, GIF, atau WEBP yang diperbolehkan.',
position: 'top-end',
toast: true,
showConfirmButton: false,
timer: 3000,
timerProgressBar: true
});
this.value = '';
}
}
}; };
} }
} }

View File

@@ -115,6 +115,27 @@
@endforeach @endforeach
@endif @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">Gambar Surat Ukur</span>
</label>
<div class="input-group w-full flex gap-2">
<input class="upload_gs" type="hidden" name="upload_gs" value="upload_gs">
<div class="w-full">
<input id="inputGistaru" type="file" name="upload_gs"
class="file-input file-input-bordered w-full"
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
onchange="previewImage(this, 'upload-gs-preview')">
<img id="upload-gs-preview"
src="{{ asset('storage/' . (isset($forminspeksi['upload_gs']) ? $forminspeksi['upload_gs'] : '')) }}"
alt="Foto Gs" class="mt-2 max-w-full h-auto"
style="{{ isset($forminspeksi['upload_gs']) ? '' : 'display: none;' }} max-width: 30rem;" />
</div>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
<span class="form-label">Sentuh Tanahku</span> <span class="form-label">Sentuh Tanahku</span>

View File

@@ -66,7 +66,7 @@
@endif @endif
<input type="hidden" name="name_foto_objek" class="input" <input type="hidden" name="name_foto_objek" class="input"
value="{{ $mainPhoto['path'] ?? '' }}"> value="{{ $mainPhoto['path'] ?? '' }}">
<input type="file" name="foto_objek" class="file-input" accept="image/*" <input type="file" name="foto_objek" class="file-input" accept=".jpg,.jpeg,.png"
onchange="previewImage(this, 'uploadedImage1')"> onchange="previewImage(this, 'uploadedImage1')">
</div> </div>
@@ -75,7 +75,7 @@
<td class="px-4 py-2"> <td class="px-4 py-2">
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<img id="uploadedImage2" class="max-w-[200px] hidden" alt="Pembanding Image"> <img id="uploadedImage2" class="max-w-[200px] hidden" alt="Pembanding Image">
<input type="file" name="foto_objek_pembanding[]" class="file-input" accept="image/*" <input type="file" name="foto_objek_pembanding[]" class="file-input" accept=".jpg,.jpeg,.png"
onchange="previewImage(this, 'uploadedImage2')"> onchange="previewImage(this, 'uploadedImage2')">
</div> </div>
</td> </td>