update migration file, dan laporan
This commit is contained in:
@@ -87,18 +87,11 @@
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
|
||||
<label class="text-base font-medium mb-1">Laporan</label>
|
||||
<label class="text-base font-medium mb-1">Laporan</label>
|
||||
<select class="select tomselect" name="laporan[]" id="laporan" multiple>
|
||||
<option value="">Semua Laporan</option>
|
||||
@php
|
||||
$status_laporan = [
|
||||
'Standar',
|
||||
'Sederhana',
|
||||
'Memo',
|
||||
'Resume',
|
||||
'Call Report',
|
||||
'RAP',
|
||||
];
|
||||
$status_laporan = ['Standar', 'Sederhana', 'Memo', 'Resume', 'Call Report', 'RAP'];
|
||||
@endphp
|
||||
@foreach ($status_laporan as $item)
|
||||
<option value="{{ strtolower($item) }}">{{ $item }}</option>
|
||||
@@ -115,8 +108,7 @@
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<button class="btn btn-sm btn-light"
|
||||
id="export-btn">
|
||||
<button class="btn btn-sm btn-light" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</button>
|
||||
@@ -142,7 +134,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" id="check-all"/>
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"
|
||||
id="check-all" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"><span class="sort-label">Nomor Registrasi</span>
|
||||
@@ -158,12 +151,12 @@
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"><span class="sort-label">User Pemohon</span>
|
||||
<span class="sort"><span class="sort-label">Pemohon</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"><span class="sort-label">Debitur</span>
|
||||
<span class="sort"><span class="sort-label">Nama Debitur</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
@@ -210,9 +203,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Form tersembunyi untuk export -->
|
||||
<form id="export-form"
|
||||
action="{{ route('laporan-penilai-jaminan.export') }}"
|
||||
method="GET" class="hidden">
|
||||
<form id="export-form" action="{{ route('laporan-penilai-jaminan.export') }}" method="GET" class="hidden">
|
||||
<input type="hidden" name="start_date" id="export_tanggal_awal">
|
||||
<input type="hidden" name="end_date" id="export_tanggal_akhir">
|
||||
<input type="hidden" name="status" id="export_status">
|
||||
@@ -220,6 +211,7 @@
|
||||
<input type="hidden" name="laporan" id="export_laporan">
|
||||
<input type="hidden" name="selected_ids" id="export_selected_ids">
|
||||
<input type="hidden" name="export_type" id="export_type" value="all">
|
||||
<input type="hidden" id="export_search" name="search">
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@@ -248,7 +240,7 @@
|
||||
const exportStatus = document.getElementById('export_status');
|
||||
const exportSelectedIds = document.getElementById('export_selected_ids');
|
||||
const exportType = document.getElementById('export_type');
|
||||
|
||||
const exportSearch = document.getElementById('export_search');
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
@@ -360,13 +352,17 @@
|
||||
['done'].includes(status) ?
|
||||
dokumenjaminan.map(dokumen => {
|
||||
return `
|
||||
<a class="btn btn-sm btn-primary" href="surveyor/print-out-inspeksi/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}">
|
||||
<i class="ki-outline ki-printer"></i>Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-sm btn-success" onclick="checkLaporan('${data.id}', '${dokumen.id}', '${dokumen.jenis_jaminan_id}', 0)">
|
||||
<i class="ki-filled ki-printer"></i>Laporan
|
||||
</a>
|
||||
`;
|
||||
<a class="btn btn-sm btn-primary" href="surveyor/print-out-inspeksi/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}">
|
||||
<i class="ki-outline ki-printer"></i>Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-sm btn-info" href="laporan-penilai-jaminan/show/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}" >
|
||||
<i class="ki-filled ki-eye"></i>Lihat
|
||||
</a>
|
||||
<a class="btn btn-sm btn-success" onclick="checkLaporan('${data.id}', '${dokumen.id}', '${dokumen.jenis_jaminan_id}', 0)">
|
||||
<i class="ki-filled ki-printer"></i>Laporan
|
||||
</a>
|
||||
|
||||
`;
|
||||
}).join('') : ''
|
||||
}
|
||||
</div>
|
||||
@@ -414,7 +410,7 @@
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
if (laporan.length > 0) {
|
||||
if (laporan.length > 0) {
|
||||
filters.laporan = laporan;
|
||||
}
|
||||
|
||||
@@ -476,8 +472,16 @@
|
||||
branch_id: branchFilter.value,
|
||||
laporan: Array.from(laporanFilter.selectedOptions).map(option => option.value),
|
||||
status: getSelectedStatuses(),
|
||||
search: searchInput.value,
|
||||
export_type: 'filtered'
|
||||
});
|
||||
} else if (searchInput.value) {
|
||||
// If only search is applied, export filtered results
|
||||
exportData({
|
||||
search: searchInput.value,
|
||||
export_type: 'filtered'
|
||||
});
|
||||
|
||||
} else {
|
||||
// If no selection and no filters, export all
|
||||
exportData({
|
||||
@@ -495,6 +499,7 @@
|
||||
exportLaporan.value = filters.laporan ? filters.laporan.join(',') : '';
|
||||
exportSelectedIds.value = filters.selected_ids ? filters.selected_ids.join(',') : '';
|
||||
exportType.value = filters.export_type || 'all';
|
||||
exportSearch.value = filters.search || '';
|
||||
// Submit the form
|
||||
exportForm.submit();
|
||||
}
|
||||
@@ -512,37 +517,37 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function checkLaporan(permohonanId, documentId, statusLpj) {
|
||||
// showLoadingSwal('Tunggu...');
|
||||
fetch(
|
||||
`{{ url('/penilai/check-laporan') }}?permohonanId=${permohonanId}&documentId=${documentId}`
|
||||
)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status) {
|
||||
window.location.href =
|
||||
`{{ route('penilai.print-out') }}?permohonanId=${permohonanId}&documentId=${documentId}&statusLpj=${0}&type=${data.status}`;
|
||||
} else {
|
||||
// Jika laporan belum ada, tampilkan pesan peringatan
|
||||
function checkLaporan(permohonanId, documentId, statusLpj) {
|
||||
// showLoadingSwal('Tunggu...');
|
||||
fetch(
|
||||
`{{ url('/penilai/check-laporan') }}?permohonanId=${permohonanId}&documentId=${documentId}`
|
||||
)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status) {
|
||||
window.location.href =
|
||||
`{{ route('penilai.print-out') }}?permohonanId=${permohonanId}&documentId=${documentId}&statusLpj=${0}&type=${data.status}`;
|
||||
} else {
|
||||
// Jika laporan belum ada, tampilkan pesan peringatan
|
||||
Swal.fire({
|
||||
title: 'Laporan Belum Ada',
|
||||
text: data.message,
|
||||
icon: 'warning',
|
||||
confirmButtonText: 'OK',
|
||||
confirmButtonColor: '#3085d6',
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire({
|
||||
title: 'Laporan Belum Ada',
|
||||
text: data.message,
|
||||
icon: 'warning',
|
||||
title: 'Terjadi Kesalahan',
|
||||
text: 'Tidak dapat memproses permintaan. Silakan coba lagi nanti.',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK',
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonColor: '#d33',
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire({
|
||||
title: 'Terjadi Kesalahan',
|
||||
text: 'Tidak dapat memproses permintaan. Silakan coba lagi nanti.',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK',
|
||||
confirmButtonColor: '#d33',
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user