penambahan kirim email, dan perbaikan print out
This commit is contained in:
596
resources/views/penilai/components/call-report.blade.php
Normal file
596
resources/views/penilai/components/call-report.blade.php
Normal file
@@ -0,0 +1,596 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@php
|
||||
$senior_officer = null;
|
||||
if ($permohonan->debiture && $permohonan->debiture->documents) {
|
||||
foreach ($permohonan->debiture->documents as $dokumen) {
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
$teams = $permohonan->region->teams;
|
||||
|
||||
if ($teams) {
|
||||
foreach ($teams as $team) {
|
||||
$team_users = $team->teamsUsers;
|
||||
// print_r($team_users);
|
||||
if ($team_users) {
|
||||
foreach ($team_users as $team_user) {
|
||||
$user = $team_user->user;
|
||||
|
||||
if ($user && $user->hasRole('senior-officer')) {
|
||||
$senior_officer = $user;
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@endphp
|
||||
<form id="formInspeksi" method="POST" enctype="multipart/form-data" class="grid gap-5">
|
||||
@csrf
|
||||
<input type="hidden" name="nomor_registrasi" value="{{ $permohonan->nomor_registrasi ?? ''}}">
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id ?? "" }}">
|
||||
<input type="hidden" name="dokument_id" value="{{ request('documentId') }}">
|
||||
<input type="hidden" name="action" value="callReport">
|
||||
<input type="hidden" name="type" value="callReport">
|
||||
@include('lpj::assetsku.includenya')
|
||||
{{-- @include('lpj::surveyor.components.header')
|
||||
@include('lpj::surveyor.components.callReport') --}}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
CALL Report
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kepada</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="kepada" class="input w-full" placeholder="Masukkan..."
|
||||
value=" {{ $callReport['kepada'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Dari</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="dari" class="input w-full" placeholder="Masukkan..."
|
||||
value="{{ $callReport['dari'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Laporan</label>
|
||||
<div class="flex flex-wrap items-base line w-full">
|
||||
<input type="text" name="nomor_rap" class="input w-full" placeholder="Masukkan..."
|
||||
value="{{ $nomorLaporan ?? '' }}" @readonly(true)>
|
||||
</div>
|
||||
</div>
|
||||
{{-- 250109828129/ --}}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="date" name="tanggal" class="input w-full" placeholder="Masukkan..."
|
||||
value="{{ $callReport['tanggal'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Perihal</label>
|
||||
<div class="flex flex-wrap items-base line w-full">
|
||||
<input type="text" name="perihal" class="input w-full" placeholder="Masukkan..."
|
||||
value="{{ $callReport['perihal'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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">Menindak lanjuti permintaan <b>
|
||||
{{$permohonan->tujuanPenilaian->name ?? ''}}</b>, BAG CABang <b>{{ $permohonan->branch->name }}</b>
|
||||
disampaikan hal sebagai berikut:
|
||||
</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5 w-full">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="lokasi" class="form-label max-w-56">Nama Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="lokasi" name="lokasi" class="input w-full"
|
||||
placeholder="Masukkan Jl."
|
||||
value="{{ $memo->lokasi->lokasi ?? old('lokasi') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="penilai" class="form-label max-w-56">KJPP</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="penilai" class="input w-full"
|
||||
placeholder="Masukkan Penilai"
|
||||
value="{{ $memo->lokasi->penilai ?? old('penilai') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Aset</label>
|
||||
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<select id="jenis_asset_tidak_sesuai" class="input w-full" name="jenis_asset_tidak_sesuai">
|
||||
<option value="">Select Jenis asset</option>
|
||||
@isset($basicData['jenisJaminan'] )
|
||||
@foreach ($basicData['jenisJaminan'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ ($memo->jenis_asset_tidak_sesuai ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endisset
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="penilai" class="form-label max-w-56">Lokasi Objek Penilaian</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="penilai" class="input w-full"
|
||||
placeholder="Masukkan Penilai"
|
||||
value="{{ $memo->lokasi->penilai ?? old('penilai') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="penilai" class="form-label max-w-56">Dokumen </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="penilai" class="input w-full"
|
||||
placeholder="Masukkan Penilai"
|
||||
value="{{ $memo->lokasi->penilai ?? old('penilai') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="penilai" class="form-label max-w-56">Tanggal Penilaian </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="penilai" class="input w-full"
|
||||
placeholder="Masukkan Penilai"
|
||||
value="{{ $memo->lokasi->penilai ?? old('penilai') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="penilai" class="form-label max-w-56">Lelang ke </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="penilai" class="input w-full"
|
||||
placeholder="Masukkan Penilai"
|
||||
value="{{ $memo->lokasi->penilai ?? old('penilai') }}">
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="likuidasi" name="likuidasi" class="input w-full"
|
||||
placeholder="Masukkan likuidasi"
|
||||
value="{{ old('likuidasi') }}">
|
||||
</div>
|
||||
</div>
|
||||
<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 Likuidasi (NL)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="penilai" class="input w-full"
|
||||
placeholder="Masukkan Penilai"
|
||||
value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<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">Penilaian ke lokasi objek telah dilakukan oleh :
|
||||
</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5 w-full">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="staf" class="form-label max-w-56">Staf Subdit Appraisal </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="staf" name="staf" class="input w-full"
|
||||
placeholder="Masukkan Nama Staff"
|
||||
value="{{ $penilai->userPenilaiTeam->name ?? "" }}" @readonly(true)>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<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>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="pihak_kjjpp" class="input w-full"
|
||||
placeholder="Masukkan Pihak KJPP"
|
||||
value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="pihak_bag" class="form-label max-w-56">Pihak BAGI Cab </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="pihak_bag" name="pihak_bag" class="input w-full"
|
||||
placeholder="Masukkan Pihak Bag"
|
||||
value="{{ $permohonan->user->name ?? '' }}" @readonly(true)>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="debitur_perwakilan" class="form-label max-w-56">Debitur/perwakilan debitur </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="debitur_perwakilan" name="debitur_perwakilan" class="input w-full"
|
||||
placeholder="Masukkan Penilai"
|
||||
value="{{ $permohonan->debiture->name ?? '' }}" @readonly(true)>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Informasi yang didapatkan sebagai berikut :
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Positif</label>
|
||||
<div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($callReport['fakta']['fakta_positif']))
|
||||
@foreach ($callReport['fakta']['fakta_positif'] as $index => $positif)
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old("fakta_positif.$index", $positif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old('fakta_positif.0', '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
<button type="button" class="btn btn-primary btn-sm mt-5"
|
||||
onclick="addClonableItem('fakta-positif-container', 'fakta_positif')">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Negatif</label>
|
||||
<div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($callReport['fakta']['fakta_negatif']))
|
||||
@foreach ($callReport['fakta']['fakta_negatif'] as $index => $negatif)
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old("fakta_negatif.$index", $negatif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old('fakta_negatif.0', $callReport['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
<em id="error-fakta_negatif" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
@endif
|
||||
<button type="button" class="btn btn-primary btn-sm mt-5"
|
||||
onclick="addClonableItem('fakta-negatif-container', 'fakta_negatif')">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()">
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
</button>
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
<a class="btn btn-primary"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Print
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
{{-- <script type="text/javascript">
|
||||
const callReport = @json($forminspeksi ?? '');
|
||||
console.log('callReport', callReport)
|
||||
|
||||
function updateAlamatFields(status) {
|
||||
// Ambil elemen formulir
|
||||
const addressForm = document.getElementById('alamat_form');
|
||||
const inputs = addressForm.querySelectorAll('input, select');
|
||||
const addressInput = document.getElementById('address');
|
||||
|
||||
if (status === 'sesuai') {
|
||||
addressInput.value = "{{ $dokumen->address ?? '' }}";
|
||||
inputs.forEach(element => {
|
||||
if (element.tagName === 'INPUT') {
|
||||
element.setAttribute('readonly', true);
|
||||
} else if (element.tagName === 'SELECT') {
|
||||
element.setAttribute('disabled', true);
|
||||
element.classList.add('disabled-input')
|
||||
}
|
||||
});
|
||||
|
||||
addressForm.style.display = 'grid';
|
||||
addressForm.disabled = true;
|
||||
addressForm.classList.add('disabled-input')
|
||||
|
||||
|
||||
} else if (status === 'tidak sesuai') {
|
||||
addressForm.style.display = 'grid';
|
||||
|
||||
addressForm.removeAttribute('disabled');
|
||||
addressForm.classList.remove('disabled-input')
|
||||
const formInspeksi = @json($forminspeksi);
|
||||
const addressInput = document.getElementById('address');
|
||||
|
||||
if (formInspeksi && formInspeksi.asset && formInspeksi.asset.alamat) {
|
||||
if (formInspeksi.asset.alamat['tidak sesuai'] && formInspeksi.asset.alamat['tidak sesuai'].address) {
|
||||
addressInput.value = formInspeksi.asset.alamat['tidak sesuai'].address;
|
||||
} else if (formInspeksi.asset.alamat['sesuai'] && formInspeksi.asset.alamat['sesuai'].address) {
|
||||
addressInput.value = formInspeksi.asset.alamat['sesuai'].address;
|
||||
} else {
|
||||
addressInput.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
inputs.forEach(element => {
|
||||
if (element.tagName === 'INPUT') {
|
||||
element.removeAttribute('readonly');
|
||||
} else if (element.tagName === 'SELECT') {
|
||||
element.removeAttribute('disabled');
|
||||
element.classList.remove('disabled-input')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function toggleFieldVisibility(fieldName, inputId, visibleValues = []) {
|
||||
const selectedValue = $(`[name="${fieldName}"]:checked`).val();
|
||||
const inputField = $(`#${inputId}`);
|
||||
|
||||
if (visibleValues.includes(selectedValue)) {
|
||||
inputField.show();
|
||||
} else {
|
||||
inputField.hide().val('');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleCheckboxVisibility(fieldName, inputId, visibleValues = []) {
|
||||
const selectedValues = $(`[name="${fieldName}[]"]:checked`)
|
||||
.map(function() {
|
||||
return $(this).val().toLowerCase(); // Konversi nilai ke huruf kecil
|
||||
})
|
||||
.get();
|
||||
|
||||
const inputField = $(`#${inputId}`);
|
||||
|
||||
// Cek apakah salah satu nilai yang dipilih cocok dengan visibleValues
|
||||
const shouldShow = visibleValues.some(value => selectedValues.includes(value.toLowerCase()));
|
||||
|
||||
if (shouldShow) {
|
||||
inputField.show();
|
||||
} else {
|
||||
inputField.hide().val('');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleMultipleFields(fieldName, mappings) {
|
||||
// Ambil semua nilai checkbox yang dicentang
|
||||
const selectedValues = $(`[name="${fieldName}[]"]:checked`)
|
||||
.map(function() {
|
||||
return $(this).val().toLowerCase(); // Konversi nilai ke huruf kecil
|
||||
})
|
||||
.get();
|
||||
|
||||
// Iterasi melalui setiap mapping
|
||||
for (const [key, inputId] of Object.entries(mappings)) {
|
||||
const inputField = $(`#${inputId}`);
|
||||
|
||||
// Tampilkan input jika nilai yang relevan dipilih
|
||||
if (selectedValues.includes(key.toLowerCase())) {
|
||||
inputField.show();
|
||||
} else {
|
||||
inputField.hide().val(''); // Sembunyikan dan reset nilai
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleAlamatVisibility(idSesuai, idTidakSesuai, selectedValue) {
|
||||
// Ambil elemen berdasarkan ID
|
||||
const alamatSesuai = document.getElementById(idSesuai);
|
||||
const alamatTidakSesuai = document.getElementById(idTidakSesuai);
|
||||
|
||||
// Periksa nilai yang dipilih dan tampilkan elemen yang sesuai
|
||||
if (selectedValue === 'sesuai') {
|
||||
alamatSesuai.style.display = 'grid'; // Tampilkan "Alamat Sesuai"
|
||||
alamatTidakSesuai.style.display = 'none'; // Sembunyikan "Alamat Tidak Sesuai"
|
||||
} else if (selectedValue === 'tidak sesuai') {
|
||||
alamatSesuai.style.display = 'none'; // Sembunyikan "Alamat Sesuai"
|
||||
alamatTidakSesuai.style.display = 'grid'; // Tampilkan "Alamat Tidak Sesuai"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function submitData() {
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
const form = document.querySelector('form');
|
||||
const formData = new FormData(form);
|
||||
console.log('Form data entries:', Array.from(formData.entries()));
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeRap') }}?permohonanId=${permohonanId}&inspeksiId=${inspeksiId}&documentId=${documentId}`;
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
hideLoadingSwal();
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
// window.location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
toastrErrorBuild(value[0]);
|
||||
});
|
||||
// toastrErrorBuild(error);
|
||||
}
|
||||
hideLoadingSwal();
|
||||
console.log(errors);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Ensure existing remove buttons are functional
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const removeButtons = document.querySelectorAll('.remove-btn');
|
||||
removeButtons.forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
this.closest('.perwakilan').remove();
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('.number-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatNumber(this);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function updateAnalisa(params) {
|
||||
const inputMap = {
|
||||
jenis_asset: 'jenis_asset_tidak_sesuai',
|
||||
analisa_tanah: 'analisa_tanah_tidak_sesuai',
|
||||
analisa_unit: 'analisa_luas_unit_tidak_sesuai',
|
||||
analisa_bangunan: 'analisa_bangunan_tidak_sesuai',
|
||||
};
|
||||
|
||||
// Pastikan elemen ID ada di inputMap
|
||||
if (!inputMap[params]) {
|
||||
console.error('Parameter tidak valid:', params);
|
||||
return;
|
||||
}
|
||||
|
||||
// Ambil nilai berdasarkan parameter
|
||||
const inputValue = document.getElementById(inputMap[params]).value;
|
||||
const data = {
|
||||
[params === 'jenis_asset' ? 'jenis_asset' : params.replace('analisa_', 'luas_')]: inputValue,
|
||||
types: params
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '{{ route('surveyor.update_analisa', ['id' => $permohonan->id]) }}',
|
||||
type: 'POST',
|
||||
data: data,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if (response.success) {
|
||||
// window.location.href =
|
||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
toastrSuccessBuild(response.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Terjadi error:', error);
|
||||
console.log('Status:', status);
|
||||
console.log('Response:', xhr.responseText);
|
||||
if (xhr.responseJSON.message) {
|
||||
toastrErrorBuild(xhr.responseJSON.message);
|
||||
} else {
|
||||
toastrErrorBuild('Terjadi kesalahan');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script> --}}
|
||||
@include('lpj::surveyor.js.utils')
|
||||
@endpush
|
||||
@@ -30,21 +30,21 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Harga Penawaran</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>Rp. {{ $item['harga_diskon'] }}</span>
|
||||
<span>Rp. {{ $item['harga'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Penjualan (HP)</label>
|
||||
<label class="form-label max-w-56">Penjual (HP)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>Rp. {{ $item['harga'] }}</span>
|
||||
<span>{{ $item['telepon'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Ditawarkan sejak</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>Rp. {{ $item['harga'] }}</span>
|
||||
<span>{{ $item['penawaran'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -862,9 +862,31 @@
|
||||
D. ASURANSI
|
||||
</td>
|
||||
</tr>
|
||||
@if (!empty($lpjData['asuransi_luas_bangunan']))
|
||||
<tr>
|
||||
<td><table border="1" style="width: 100%; border-collapse: collapse; margin-bottom: 10px;">
|
||||
<tr>
|
||||
|
||||
<td style="border: 1px solid #000; padding: 4px;">Luas Bangunan</td>
|
||||
<td style="border: 1px solid #000; padding: 4px;">Harga</td>
|
||||
<td style="border: 1px solid #000; padding: 4px;">Nilai Pasar Wajar (Rp)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px;">{{ $lpjData['asuransi_luas_bangunan'] ?? '' }}</td>
|
||||
|
||||
<td style="border: 1px solid #000; padding: 4px;">{{ formatRupiah($lpjData['asuransi_nilai_1']) ?? '' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px;">{{ formatRupiah($lpjData['asuransi_nilai_2']) ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<td>Tidak Ada</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
||||
<table style="width: 100%">
|
||||
@@ -1035,7 +1057,7 @@
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000;">
|
||||
G. CATATAN YANG PERLU DI PERHATIKAN
|
||||
G. ANALISA FAKTA
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1068,6 +1090,65 @@
|
||||
@endisset
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Batas batas</strong></td>
|
||||
<td>
|
||||
@foreach ($forminspeksi['fakta']['batas_batas_input'] ?? [] as $arah => $batas)
|
||||
@if ($batas)
|
||||
<p> - {{ $arah }} : {{ $batas }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Informasi Dinas Tata Ruang</strong>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$informasi = [
|
||||
'peruntukan',
|
||||
'kdb',
|
||||
'kdh',
|
||||
'gsb',
|
||||
'max_lantai',
|
||||
'klb',
|
||||
'gss',
|
||||
'pelebaran_jalan',
|
||||
'nama_petugas',
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}:
|
||||
{{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if (!empty($forminspeksi['fakta']['keterangan']))
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Catatan yang Perlu Diperhatikan</strong></td>
|
||||
<td>
|
||||
@php
|
||||
$keterangan = $forminspeksi['fakta']['keterangan'] ?? '';
|
||||
if (is_array($keterangan)) {
|
||||
$keterangan = implode(', ', array_filter($keterangan));
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (!empty($keterangan))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td>{{ $keterangan }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
<title>Laporan Penilai jaminan</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
* {
|
||||
font-size: 8px;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -497,15 +497,16 @@
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style=" padding: 2px;">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style=" padding: 2px;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
|
||||
<td style=" padding: 2px;">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
<td style=" padding: 2px;">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@@ -521,16 +522,16 @@
|
||||
|
||||
<tr>
|
||||
@php
|
||||
// Ambil nilai hub_cadeb langsung
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb'])
|
||||
? $forminspeksi['asset']['hub_cadeb']
|
||||
: null;
|
||||
// Ambil nilai hub_cadeb langsung
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb'])
|
||||
? $forminspeksi['asset']['hub_cadeb']
|
||||
: null;
|
||||
|
||||
// Jika nilai adalah array dengan key 'sesuai', ambil nilainya
|
||||
if (is_array($hubCadeb) && isset($hubCadeb['sesuai'])) {
|
||||
$hubCadeb = $hubCadeb['sesuai'];
|
||||
}
|
||||
@endphp
|
||||
// Jika nilai adalah array dengan key 'sesuai', ambil nilainya
|
||||
if (is_array($hubCadeb) && isset($hubCadeb['sesuai'])) {
|
||||
$hubCadeb = $hubCadeb['sesuai'];
|
||||
}
|
||||
@endphp
|
||||
<td style="vertical-align: top;"><strong>Hubungan Pemilik Jaminan dengan Debitur</strong>
|
||||
</td>
|
||||
<td>
|
||||
@@ -549,19 +550,20 @@
|
||||
@php $count++; @endphp
|
||||
|
||||
@if ($count % 3 === 0)
|
||||
</tr><tr>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($count % 3 !== 0)
|
||||
@for ($i = 0; $i < 3 - ($count % 3); $i++)
|
||||
<td></td>
|
||||
@endfor
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
@endif
|
||||
</td>
|
||||
@endforeach
|
||||
|
||||
@if ($count % 3 !== 0)
|
||||
@for ($i = 0; $i < 3 - ($count % 3); $i++)
|
||||
<td></td>
|
||||
@endfor
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -1318,11 +1320,31 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<table class="checkbox-table">
|
||||
<tr>
|
||||
<td><input type="checkbox" checked> Tidak Ada</td>
|
||||
<td><input type="checkbox"> Ada</td>
|
||||
</tr>
|
||||
<table>
|
||||
@if (!empty($lpjData['asuransi_luas_bangunan']))
|
||||
<tr>
|
||||
|
||||
<td width="25%">Luas Bangunan</td>
|
||||
<td style="">
|
||||
{{ $lpjData['asuransi_luas_bangunan'] ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="">Harga</td>
|
||||
<td style="">
|
||||
{{ formatRupiah($lpjData['asuransi_nilai_1']) ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="">Nilai Pasar Wajar (Rp)</td>
|
||||
|
||||
<td style="">
|
||||
{{ formatRupiah($lpjData['asuransi_nilai_2']) ?? '' }}</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<td>Tidak Ada</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1386,33 +1408,54 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{{-- Lain-lain --}}
|
||||
@if (!empty($forminspeksi['fakta']['rute_menuju']))
|
||||
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Lain - lain :</strong></td>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Rute Menuju</strong></td>
|
||||
<td>
|
||||
@foreach ($forminspeksi['fakta']['keterangan'] ?? [] as $keterangan)
|
||||
<p>{!! nl2br(e($keterangan)) !!}</p>
|
||||
@endforeach
|
||||
<p>{{ $forminspeksi['fakta']['rute_menuju'] ?? '' }}</p>
|
||||
|
||||
@foreach ($forminspeksi['fakta']['informasi_dokument'] ?? [] as $informasi)
|
||||
<p>{!! nl2br(e($informasi)) !!}</p>
|
||||
@endforeach
|
||||
|
||||
@foreach ($forminspeksi['fakta']['kondisi_lingkungan'] ?? [] as $kondisi)
|
||||
<p>{!! nl2br(e($kondisi)) !!}</p>
|
||||
@endforeach
|
||||
{!! nl2br(e($forminspeksi['fakta']['rute_menuju'] ?? '')) !!}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (!empty($forminspeksi['fakta']['batas_batas_input']))
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Batas batas</strong></td>
|
||||
<td>
|
||||
@foreach ($forminspeksi['fakta']['batas_batas_input'] ?? [] as $arah => $batas)
|
||||
@if ($batas)
|
||||
<p> - {{ $arah }} : {{ $batas }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@foreach ($forminspeksi['fakta']['kondisi_lain_bangunan'] ?? [] as $kondisiLain)
|
||||
<p>{!! nl2br(e($kondisiLain)) !!}</p>
|
||||
@endforeach
|
||||
@if (!empty($forminspeksi['fakta']['kondisi_lingkungan']))
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Kondisi Lingkungan</strong></td>
|
||||
<td>
|
||||
@foreach ($forminspeksi['fakta']['kondisi_lingkungan'] ?? [] as $kondisi)
|
||||
<p>{!! nl2br(e($kondisi)) !!}</p>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if (!empty($forminspeksi['fakta']['informasi_dokument']))
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Informasi Lain terkait Dokumen</strong></td>
|
||||
<td>
|
||||
@foreach ($forminspeksi['fakta']['informasi_dokument'] ?? [] as $informasi)
|
||||
<p>{!! nl2br(e($informasi)) !!}</p>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Informasi Dinas Tata Ruang</strong>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$informasi = [
|
||||
'peruntukan',
|
||||
@@ -1434,10 +1477,32 @@
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if (!empty($forminspeksi['fakta']['keterangan']))
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Catatan yang Perlu Diperhatikan</strong></td>
|
||||
<td>
|
||||
@php
|
||||
$keterangan = $forminspeksi['fakta']['keterangan'] ?? '';
|
||||
if (is_array($keterangan)) {
|
||||
$keterangan = implode(', ', array_filter($keterangan));
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (!empty($keterangan))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td>{{ $keterangan }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
{{-- Lain-lain --}}
|
||||
|
||||
<tr>
|
||||
<td>2. Informasi Harga:</td>
|
||||
</tr>
|
||||
@@ -1522,14 +1587,14 @@
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
@if (isset($lpjData['luas_' . $key]))
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:10%; ">
|
||||
<td style="padding: 3px; text-align: right; width:45%; ">
|
||||
{{ $label }} {{ $lpjData['luas_' . $key] ?? '' }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px; width:10%;">
|
||||
<td style="padding: 3px; width:5%;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_1'] ?? '' }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:70%;">
|
||||
<td style="padding: 3px; text-align: left; width:60%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_2'] ?? '' }}
|
||||
</td>
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
@isset($resumeData['fakta']['fakta_positif'])
|
||||
@foreach ($resumeData['fakta']['fakta_positif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{{ $item }}</td>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endisset
|
||||
@@ -298,7 +298,7 @@
|
||||
@isset($resumeData['fakta']['fakta_negatif'])
|
||||
@foreach ($resumeData['fakta']['fakta_negatif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{{ $item }}</td>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endisset
|
||||
@@ -404,7 +404,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $resumeData['keterangan'] ?? '' }}</td>
|
||||
<td>{!! nl2br(e($resumeData['keterangan'] ?? '' )) !!}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user