Pembaruan UI Menu SK
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Verifikasi\SK;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Verifikasi\SK\Concerns\FormatKolomSk;
|
||||
use App\Models\Verifikator\Periode;
|
||||
use App\Models\Verifikator\Sk;
|
||||
use App\Models\Verifikator\Team;
|
||||
@@ -14,6 +15,8 @@ use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
class BelumVerifikasiController extends Controller
|
||||
{
|
||||
use FormatKolomSk;
|
||||
|
||||
private $siskaService;
|
||||
|
||||
private $auth;
|
||||
@@ -107,6 +110,26 @@ class BelumVerifikasiController extends Controller
|
||||
|
||||
return DataTables::of($data)
|
||||
->addIndexColumn()
|
||||
->editColumn('no_sk', function ($row) use ($visibleDuplicateIds, $finalizedPreviouslyIds) {
|
||||
$peringatan = [];
|
||||
if (empty($row['anggota'])) {
|
||||
$peringatan[] = $this->peringatanSk('SK ini tidak memiliki anggota');
|
||||
}
|
||||
if (in_array($row['id'], $visibleDuplicateIds)) {
|
||||
$peringatan[] = $this->peringatanSk('Nomor SK ini terindikasi duplikat');
|
||||
}
|
||||
if (in_array($row['id'], $finalizedPreviouslyIds)) {
|
||||
$peringatan[] = $this->peringatanSk('Nomor SK ini sudah difinalisasi sebelumnya');
|
||||
}
|
||||
|
||||
return $this->kolomNoSk(
|
||||
$row['no_sk'] ?? null,
|
||||
$row['id_unit_penandatangan'] ?? $row['id_unit'] ?? null,
|
||||
$peringatan,
|
||||
true,
|
||||
$row['unit']['nama'] ?? $row['nama_unit'] ?? null
|
||||
);
|
||||
})
|
||||
->addColumn('tanggal_sk', function ($row) {
|
||||
return $row['tanggal_sk'] ? Carbon::parse($row['tanggal_sk'])->format('d/m/Y') : '-';
|
||||
})
|
||||
@@ -144,19 +167,8 @@ class BelumVerifikasiController extends Controller
|
||||
->addColumn('is_finalized_previously', function ($row) use ($finalizedPreviouslyIds) {
|
||||
return in_array($row['id'], $finalizedPreviouslyIds);
|
||||
})
|
||||
->addColumn('tentang', function ($row) use ($visibleDuplicateIds, $finalizedPreviouslyIds) {
|
||||
$tentang = e($row['tentang'] ?? '-');
|
||||
if (empty($row['anggota'])) {
|
||||
$tentang .= '<br><small class="text-warning fw-bold"><i class="uil-exclamation-triangle"></i> SK ini tidak memiliki anggota</small>';
|
||||
}
|
||||
if (in_array($row['id'], $visibleDuplicateIds)) {
|
||||
$tentang .= '<br><small class="text-warning fw-bold"><i class="uil-exclamation-triangle"></i> Nomor SK ini terindikasi duplikat</small>';
|
||||
}
|
||||
if (in_array($row['id'], $finalizedPreviouslyIds)) {
|
||||
$tentang .= '<br><small class="text-warning fw-bold"><i class="uil-exclamation-triangle"></i> Nomor SK ini sudah difinalisasi sebelumnya</small>';
|
||||
}
|
||||
|
||||
return $tentang;
|
||||
->addColumn('tentang', function ($row) {
|
||||
return $this->kolomTentang($row['tentang'] ?? null, $row['id']);
|
||||
})
|
||||
->escapeColumns([])
|
||||
->make(true);
|
||||
|
||||
Reference in New Issue
Block a user