feat(laporan-user): refactor user report to display user data instead of permohonan

- Change data source from Permohonan to User model
- Simplify search functionality to only search by name and NIK
- Update table columns to show user information (NIK, name, roles)
- Remove date range filters and complex search conditions
- Add helper function getFilePath to handle storage paths
This commit is contained in:
majid
2025-07-21 10:13:47 +07:00
parent 32eab5f089
commit 142257d18d
3 changed files with 77 additions and 150 deletions

View File

@@ -6,63 +6,27 @@
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<!-- Filter Card -->
<div class="card border border-agi-100">
<div class="card-header bg-agi-50 py-5">
<h3 class="card-title"> Laporan User Penilai</h3>
</div>
<div class="card-body grid gap-4">
<!-- Search field at the top, full width -->
<div class="flex flex-col w-full">
<label class="text-sm font-medium mb-1">Pencarian</label>
<label class="input input-sm">
<i class="ki-filled ki-magnifier"></i>
<input placeholder="Search Laporan User" id="search" type="text" value="">
</label>
</div>
<!-- Other filter fields in grid layout -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
<div class="flex flex-col">
<label class="text-base font-medium mb-1">Tanggal Awal</label>
<label class="input">
<input placeholder="Tanggal Awal" id="start_date" type="date">
</label>
</div>
<div class="flex flex-col">
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
<label class="input">
<input placeholder="Tanggal Akhir" id="end_date" type="date">
</label>
</div>
<div class="flex flex-col">
<label class="text-base font-medium mb-1">User</label>
<select class="select tomselect" id="user_id" name="user_id">
</select>
</div>
</div>
<!-- Buttons row at the bottom -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
<button class="btn btn-sm btn-primary" id="filter_tanggal">
<i class="ki-outline ki-filter fs-2 me-1"></i>
Terapkan Filter
</button>
<a class="btn btn-sm btn-light" href="{{ route('laporan-user.export') }}" id="export-btn">
<i class="ki-outline ki-file-down fs-2 me-1"></i>
Export to Excel
</a>
</div>
</div>
</div>
<!-- Data Table Card -->
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-user-table" data-api-url="{{ route('laporan-user.datatables') }}">
<div class="card-header bg-agi-50 py-5 flex-wrap">
<h3 class="card-title">
Laporan User Pemohon
Laporan User
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex flex-wrap gap-2 lg:gap-5">
<label class="input input-sm">
<i class="ki-filled ki-magnifier"></i>
<input placeholder="Search Laporan User" id="search" type="text" value="">
</label>
</div>
<a class="btn btn-sm btn-light" href="{{ route('laporan-user.export') }}" id="export-btn">
<i class="ki-outline ki-file-down fs-2 me-1"></i>
Export to Excel
</a>
</div>
</div>
<div class="card-body">
@@ -73,41 +37,20 @@
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
<th class="min-w-[150px]" data-datatable-column="nik">
<span class="sort"> <span class="sort-label"> NIK</span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="branch">
<span class="sort"> <span class="sort-label"> Cabang </span>
<th class="min-w-[150px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Nama User</span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
<th class="min-w-[150px]" data-datatable-column="level">
<span class="sort"> <span class="sort-label"> Level Group </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="pemohon">
<span class="sort"> <span class="sort-label"> Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
<span class="sort"> <span class="sort-label"> Tgl Terima </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
<span class="sort"> <span class="sort-label"> Penilai </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
<span class="sort"> <span class="sort-label"> Tgl Laporan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="catatan">
<span class="sort"> <span class="sort-label"> Nilai Pasar Wajar </span>
<th class="min-w-[150px]" data-datatable-column="approval_limit">
<span class="sort"> <span class="sort-label"> Approval Limit </span>
<span class="sort-icon"> </span> </span>
</th>
</tr>
@@ -155,40 +98,21 @@
return checkbox.outerHTML.trim();
},
},
nomor_registrasi: {
nik: {
title: 'Nomor Registrasi',
},
branch: {
title: 'Cabang',
},
name: {
title: 'Nama Debitur',
title: 'Nama',
},
pemohon: {
title: 'Pemohon',
level: {
title: 'level',
},
tanggal_permohonan: {
title: 'Tanggal Permohonan',
approval_limit: {
title: 'Approval Limit',
render: (item, data) => {
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
},
},
nama_penilai: {
title: 'Nama Penilai',
},
tanggal_laporan: {
title: 'Tanggal Dokumen Diterima',
render: (item, data) => {
return data.tanggal_laporan ? window.formatTanggalIndonesia(data.tanggal_laporan) : '-';
},
},
nilai_pasar_wajar: {
title: 'Nilai Pasar Wajar',
render: (item, data) => {
return data.nilai_pasar_wajar ?? '-';
},
}
}
};
@@ -209,7 +133,6 @@
if (startDate) {
filters.start_date = startDate;
}
if (endDate) {
filters.end_date = endDate;
}
@@ -219,7 +142,6 @@
}
dataTable.search(filters);
}