Perubahan UI Halaman Laporan Kegiatan
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Verifikasi\LaporanKegiatan;
|
||||
|
||||
use App\Helpers\BeritaAcaraHelper;
|
||||
use App\Helpers\KolomPegawaiHelper;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Jobs\Remunerasi\HitungRemunerasi;
|
||||
use App\Models\DokSiremun\CatatanPengajuan;
|
||||
@@ -507,33 +508,25 @@ class KegiatanPenunjangController extends Controller
|
||||
->get()
|
||||
->groupBy('noteable_id');
|
||||
|
||||
$kolomPegawai = new KolomPegawaiHelper($anggota);
|
||||
|
||||
return DataTables::of($anggota)
|
||||
->addIndexColumn()
|
||||
->addColumn('info_pegawai', function ($row) use ($kolomPegawai, $catatanDitolak) {
|
||||
$catatan = null;
|
||||
if (in_array(data_get($row, 'status_verifikasi_id'), [2, 5, 8])) {
|
||||
$catatan = $catatanDitolak->get(data_get($row, 'id'))?->first()?->message;
|
||||
}
|
||||
|
||||
return $kolomPegawai->html($row, $catatan);
|
||||
})
|
||||
->addColumn('pencarian_pegawai', fn ($row) => $kolomPegawai->teksPencarian($row))
|
||||
->addColumn('checkbox', function ($row) {
|
||||
$id = $row['id'] ?? ($row->id ?? '');
|
||||
$status = is_array($row) ? ($row['status_verifikasi_id'] ?? 0) : ($row->status_verifikasi_id ?? 0);
|
||||
|
||||
return '<div class="d-flex justify-content-center"><div class="form-check"><input type="checkbox" class="form-check-input select-item" value="'.$id.'" data-id="'.$id.'" data-status="'.$status.'"></div></div>';
|
||||
})
|
||||
->addColumn('nama_pelaksana', function ($row) use ($catatanDitolak) {
|
||||
$nama = e($row['nama_pelaksana'] ?? ($row->nama_pelaksana ?? ''));
|
||||
|
||||
$statusId = is_array($row) ? ($row['status_verifikasi_id'] ?? 0) : ($row->status_verifikasi_id ?? 0);
|
||||
if (in_array($statusId, [2, 5, 8])) {
|
||||
$rowId = is_array($row) ? ($row['id'] ?? null) : ($row->id ?? null);
|
||||
$note = $catatanDitolak->get($rowId)?->first();
|
||||
if ($note) {
|
||||
$nama .= '<br><small class="text-danger fw-bold d-inline-block" style="line-height: 1.3;">Alasan: '.e($note->message).'</small>';
|
||||
}
|
||||
}
|
||||
|
||||
return $nama;
|
||||
})
|
||||
->addColumn('id_pelaksana', function ($row) {
|
||||
$nip = $row['id_pelaksana'] ?? ($row->id_pelaksana ?? '');
|
||||
|
||||
return '<span class="font-monospace">'.$nip.'</span>';
|
||||
})
|
||||
->addColumn('posisi', function ($row) {
|
||||
return $row['posisi'] ?? ($row->posisi ?? '');
|
||||
})
|
||||
@@ -721,7 +714,7 @@ class KegiatanPenunjangController extends Controller
|
||||
><i class="fa fa-eye"></i> Detail</button>
|
||||
';
|
||||
})
|
||||
->rawColumns(['checkbox', 'aksi', 'status_verifikasi_id', 'jumlah_satuan', 'syarat', 'id_pelaksana', 'nama_pelaksana'])
|
||||
->rawColumns(['checkbox', 'aksi', 'status_verifikasi_id', 'jumlah_satuan', 'syarat', 'info_pegawai', 'pencarian_pegawai'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user