Integrasikan data memo ke form memo penilai
- Memperbaiki binding data memo ke input form mengenai memo penilai. - Menambahkan logika untuk menampilkan pilihan kota, kecamatan, dan kelurahan berdasarkan provinsi, kota, dan kecamatan yang dipilih. - Menyesuaikan tampilan memo dengan data dari database, termasuk hasil survey, kesimpulan saran, dan file terlampir. - Melakukan perbaikan minor pada struktur kode untuk konsistensi.
This commit is contained in:
@@ -26,31 +26,30 @@
|
||||
<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="">
|
||||
value=" {{ $memo->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="">
|
||||
value="{{ $memo->dari ?? "" }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Memo</label>
|
||||
<div class="flex flex-wrap items-base line w-full">
|
||||
<input type="text" name="nomor_memo" class="input w-full" placeholder="Masukkan..."
|
||||
value="">
|
||||
value="{{ $memo->nomor_memo ?? "" }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<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="">
|
||||
value="{{ $memo->tanggal ?? "" }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +57,7 @@
|
||||
<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="">
|
||||
value="{{ $memo->perihal ?? "" }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,9 +66,8 @@
|
||||
<div class="card w-full bg-white rounded-lg shadow-md ">
|
||||
<div class="card-header">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Sehubungan dengan permintaan BAGI Cabang
|
||||
............., untuk dilakukan survey untuk penilaian baru/review, calon debitur/debitur an
|
||||
….............,
|
||||
dengan deskripsi sebagai berikut :
|
||||
<b>{{ $permohonan->branch->name }}</b>, untuk dilakukan survey untuk penilaian baru/review, calon debitur/debitur an
|
||||
<b>{{ $permohonan->debiture->name }}</b>,dengan deskripsi sebagai berikut :
|
||||
</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -82,15 +80,12 @@
|
||||
<select id="jenis_asset_tidak_sesuai" class="input w-full" name="jenis_asset_tidak_sesuai">
|
||||
<option value="">Select Jenis asset</option>
|
||||
@foreach ($basicData['jenisJaminan'] as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
<option value="{{ $item->name }}" {{ ($memo->jenis_asset_tidak_sesuai ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -99,7 +94,7 @@
|
||||
<label for="address" class="form-label max-w-56">Lokasi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="address" name="address" class="input w-full"
|
||||
placeholder="Masukkan Jl." value="{{ old('address') }}">
|
||||
placeholder="Masukkan Jl." value="{{ $memo->address ?? old('address') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -109,7 +104,7 @@
|
||||
<select id="province_code" name="province_code" class="input w-full">
|
||||
<option value="">Pilih Provinsi</option>
|
||||
@foreach ($provinces as $item)
|
||||
<option value="{{ $item->code }}">{{ $item->name }}</option>
|
||||
<option value="{{ $item->code }}" {{ ($memo->province_code ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@@ -120,6 +115,11 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full">
|
||||
<option value="">Pilih Kota/Kabupaten</option>
|
||||
@if(isset($cities))
|
||||
@foreach ($cities as $item)
|
||||
<option value="{{ $item->code }}" {{ ($memo->city_code?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -129,6 +129,11 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full">
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if(isset($districts))
|
||||
@foreach ($districts as $item)
|
||||
<option value="{{ $item->code }}" {{ ($memo->district_code?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -138,23 +143,36 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code" class="select w-full">
|
||||
<option value="">Pilih Kelurahan</option>
|
||||
@if(isset($villages))
|
||||
@foreach ($villages as $item)
|
||||
<option value="{{ $item->code }}" {{ ($memo->village_code ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="address" class="form-label max-w-56">Tanggal Survey</label>
|
||||
<label for="address" class="form-label max-w-56">Address</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="date" id="address" name="address" class="input w-full"
|
||||
placeholder="Masukkan Jl." value="{{ old('address') }}">
|
||||
<input type="text" id="address" name="address" class="input w-full"
|
||||
placeholder="Masukkan Jl." value="{{ $memo->address ?? old('address') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="address" class="form-label max-w-56">Penilai</label>
|
||||
<label for="tanggal_survey" class="form-label max-w-56">Tanggal Survey</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="address" name="address" class="input w-full"
|
||||
placeholder="Masukkan Jl." value="{{ old('address') }}">
|
||||
<input type="date" id="tanggal_survey" name="tanggal_survey" class="input w-full"
|
||||
placeholder="Masukkan Tanggal Survey" value="{{ $memo->tanggal_survey ?? old('tanggal_survey') }}">
|
||||
</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">Penilai</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->penilai ?? old('penilai') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -167,7 +185,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
@@ -181,7 +198,7 @@
|
||||
<div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<div class="terlampir flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="terlampir[]" rows="3">{{ old('terlampir', '') }}</textarea>
|
||||
<textarea class="textarea mt-2" name="terlampir[]" rows="3">{{ $memo->terlampir[0] ?? old('terlampir', '') }}</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -190,12 +207,12 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Berdasarkan hasil survey dapat disampaikan sbb:</label>
|
||||
<div id="hasil_survey" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($forminspeksi['hasil_survey']))
|
||||
@foreach ($forminspeksi['hasil_survey'] as $index => $positif)
|
||||
@if (!empty($memo->hasil_survey))
|
||||
@foreach ($memo->hasil_survey as $index => $positif)
|
||||
<div class="hasil_survey flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="hasil_survey[]" rows="3">{{ old("hasil_survey.$index", $positif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -204,13 +221,13 @@
|
||||
<div class="hasil_survey flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="hasil_survey[]" rows="3">{{ old('hasil_survey.0', '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
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('hasil_survey', 'hasil_survey')">
|
||||
onclick="addClonableItem('hasil_survey', 'hasil_survey')">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -220,28 +237,28 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kesimpulan dan saran</label>
|
||||
<div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($forminspeksi['kesimpulan_saran']))
|
||||
@foreach ($forminspeksi['kesimpulan_saran'] as $index => $negatif)
|
||||
@if (!empty($memo->kesimpulan_saran))
|
||||
@foreach ($memo->kesimpulan_saran as $index => $negatif)
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="kesimpulan_saran[]" rows="3">{{ old("kesimpulan_saran.$index", $negatif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="kesimpulan_saran flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="kesimpulan_saran[]" rows="3">{{ old('kesimpulan_saran.0', $forminspeksi['kesimpulan_saran'][0] ?? '') }}</textarea>
|
||||
<textarea class="textarea mt-2" name="kesimpulan_saran[]" rows="3">{{ old('kesimpulan_saran.0') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
<em id="error-kesimpulan_saran" 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', 'kesimpulan_saran')">
|
||||
onclick="addClonableItem('fakta-negatif-container', 'kesimpulan_saran')">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -250,7 +267,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
@@ -279,7 +295,7 @@
|
||||
</h2>
|
||||
<div class="flex items-center mt-5">
|
||||
<img src="{{ Storage::url($formPeta[$item]) }}"
|
||||
alt="{{ $item }}">
|
||||
alt="{{ $item }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -315,10 +331,7 @@
|
||||
{{ $item['name_rute'] . ' ' . $loop->index + 1 }}
|
||||
</h2>
|
||||
<div class="flex items-center">
|
||||
|
||||
|
||||
<img src="{{ Storage::url($item['foto_rute']) }}" alt="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -449,8 +462,6 @@
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
|
||||
<script>
|
||||
function saveMemo() {
|
||||
const form = document.getElementById('form-memo');
|
||||
@@ -496,7 +507,7 @@
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
hideLoadingSwal();
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
@@ -520,11 +531,11 @@
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
error: function (xhr, status, error) {
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$.each(errors, function (key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
toastrErrorBuild(value[0]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user