update form data surveyor
This commit is contained in:
@@ -4,22 +4,21 @@
|
||||
{{ Breadcrumbs::render('surveyor') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card pb-2.5">
|
||||
@@ -113,152 +112,159 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" data-modal="true" id="modal_revisi" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Kunjungan</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form
|
||||
action=""
|
||||
method="POST" enctype="multipart/form-data" id="revisiForm">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<input type="hidden" name="action" value="revisi">
|
||||
{{-- <input type="hidden" name="nomor_registrasi"
|
||||
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}"> --}}
|
||||
|
||||
<div class="pl-1 grid gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Kunjungan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<input class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
|
||||
type="datetime-local" name="tanggal_kunjungan"
|
||||
value="">
|
||||
@error('tanggal_kunjungan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Catatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea id="keterangan" class="textarea @error('keterangan') border-danger bg-danger-light @enderror"
|
||||
rows="3" name="keterangan"></textarea>
|
||||
@error('keterangan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer justify-end mt-2">
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const statusFilter = document.getElementById('status-filter'); // Dropdown filter element
|
||||
<script>
|
||||
function jadwal(id){
|
||||
document.getElementById('ids').value = id ;
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
} // Default order by 'nomor_registrasi' ascending
|
||||
],
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Assigned',
|
||||
// render: (item, data) => {
|
||||
// const createdAt = convertDate(data.penilaian.created_at);
|
||||
// return createdAt;
|
||||
// },
|
||||
const element = document.querySelector('#permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const statusFilter = document.getElementById('status-filter');
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
}], // Default order by 'nomor_registrasi' ascending
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Assigned',
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => `${data.user.name}`,
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => `${data.branch.name}`,
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => `${data.debiture.name}`,
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => `${data.tujuan_penilaian.name}`,
|
||||
},
|
||||
jenis_fasilitas_kredit_id: {
|
||||
title: 'Fasilitas Kredit',
|
||||
render: (item, data) => `${data.jenis_fasilitas_kredit.name}`,
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
let actionHtml = '';
|
||||
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => `${data.user.name}`,
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => `${data.branch.name}`,
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => `${data.debiture.name}`,
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => `${data.tujuan_penilaian.name}`,
|
||||
},
|
||||
jenis_fasilitas_kredit_id: {
|
||||
title: 'Fasilitas Kredit',
|
||||
render: (item, data) => `${data.jenis_fasilitas_kredit.name}`,
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show?form=inspeksi">
|
||||
if (data.penilaian.waktu_penilaian == null && data.penilaian.authorized_status == null) {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary" data-modal-toggle="#modal_jadwal" onclick="jadwal(${data.penilaian.id})">
|
||||
<i class="ki-filled ki-calendar-edit"></i>
|
||||
</a>
|
||||
`;
|
||||
} else {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show?form=inspeksi">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
</div>`,
|
||||
`;
|
||||
}
|
||||
return actionHtml;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
// statusFilter.addEventListener('change', function() {
|
||||
// const selectedStatus = this.value;
|
||||
// dataTable.search(selectedStatus);
|
||||
// });
|
||||
|
||||
function convertDate(date) {
|
||||
const createdAt = new Date(date);
|
||||
const day = String(createdAt.getDate()).padStart(2, '0');
|
||||
const month = String(createdAt.getMonth() + 1).padStart(2, '0');
|
||||
const year = createdAt.getFullYear();
|
||||
return `${day}-${month}-${year}`;
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
// statusFilter.addEventListener('change', function() {
|
||||
// const selectedStatus = this.value;
|
||||
// dataTable.search(selectedStatus);
|
||||
// });
|
||||
|
||||
function convertDate(date) {
|
||||
const createdAt = new Date(date);
|
||||
const day = String(createdAt.getDate()).padStart(2, '0');
|
||||
const month = String(createdAt.getMonth() + 1).padStart(2, '0');
|
||||
const year = createdAt.getFullYear();
|
||||
return `${day}-${month}-${year}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
<div class="modal fade" data-modal="true" id="modal_jadwal" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Kunjungan</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('surveyor.storeJadwal')}}" method="POST" enctype="multipart/form-data" id="revisiForm">
|
||||
@method('put')
|
||||
@csrf
|
||||
<input id="ids" type="text" name="id">
|
||||
|
||||
<div class="pl-1 grid gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Kunjungan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('waktu_penilaian') border-danger bg-danger-light @enderror"
|
||||
type="datetime-local" name="waktu_penilaian" value="">
|
||||
@error('waktu_penilaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Catatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea id="deskripsi_penilaian" class="textarea @error('deskripsi_penilaian') border-danger bg-danger-light @enderror"
|
||||
rows="3" name="deskripsi_penilaian"></textarea>
|
||||
@error('deskripsi_penilaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer justify-end mt-2">
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user