From f8c3816ca7ede39213fd0b4fa36cbd136abc75dd Mon Sep 17 00:00:00 2001 From: JokoPrasetio Date: Fri, 19 Jun 2026 17:26:33 +0700 Subject: [PATCH] done approval add mutu & turt -> review --- app/Http/Controllers/DashboardController.php | 5 +- public/js/pengajuanFile/index.js | 40 ++++ .../views/dataAkreditasi/index.blade.php | 195 +++++++++++++++++- resources/views/dataUmum/index.blade.php | 25 +++ resources/views/dataUnit/index.blade.php | 25 +++ .../views/layout/partials/sidenav.blade.php | 25 ++- resources/views/pengajuanFile/index.blade.php | 13 +- 7 files changed, 309 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 887c577..3ee9d16 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -1991,7 +1991,7 @@ class DashboardController extends Controller } $paginated = $query->paginate($perPage); - $data = $paginated->getCollection()->map(function($item) use($objectpegawaifk){ + $data = $paginated->getCollection()->map(function($item) use($objectpegawaifk, $pegawaiId){ $dataSlice = array_values(array_filter(explode('/', $item->file))); return [ 'file_directory_id' => $item->file_directory_id, @@ -3369,6 +3369,9 @@ class DashboardController extends Controller 'no_dokumen', 'file', 'entry_at', + 'tanggal_terbit', + 'permission_file', + 'pegawai_id_entry', 'id_unit_kerja', 'is_akre', ]) diff --git a/public/js/pengajuanFile/index.js b/public/js/pengajuanFile/index.js index aad39a9..99ed885 100644 --- a/public/js/pengajuanFile/index.js +++ b/public/js/pengajuanFile/index.js @@ -19,6 +19,9 @@ document.addEventListener('DOMContentLoaded', () => { const selectedCountEl = document.getElementById('selectedCount'); const bulkActionsEl = document.getElementById('pengajuanBulkActions'); const deleteDataEl = document.getElementById('deleteData'); + const pendingPersetujuanTabBadge = document.getElementById('pendingPersetujuanTabBadge'); + const pendingPersetujuanNotice = document.getElementById('pendingPersetujuanNotice'); + const pendingPersetujuanNoticeCount = document.getElementById('pendingPersetujuanNoticeCount'); const formCreate = document.getElementById('formFile'); const modalCreate = document.getElementById('modalCreateFile'); let colCount = 1; @@ -29,6 +32,7 @@ document.addEventListener('DOMContentLoaded', () => { const selectedIds = new Set(); const isKomiteMutu = !!window.isKomiteMutu; const isTurt = !!window.isTurt; + const isAtasan = !!window.isAtasan; let editFromQueryId = new URLSearchParams(window.location.search).get('edit'); if (pageSizeSelect) { @@ -493,6 +497,41 @@ document.addEventListener('DOMContentLoaded', () => { updateSelectionUI(); } + function updatePendingPersetujuanIndicators(total){ + const count = Number(total || 0); + if (pendingPersetujuanTabBadge) { + pendingPersetujuanTabBadge.textContent = String(count); + pendingPersetujuanTabBadge.classList.toggle('d-none', count <= 0); + } + if (pendingPersetujuanNotice && pendingPersetujuanNoticeCount) { + pendingPersetujuanNoticeCount.textContent = String(count); + pendingPersetujuanNotice.classList.toggle('d-none', count <= 0); + pendingPersetujuanNotice.classList.toggle('d-flex', count > 0); + } + } + + function fetchPendingPersetujuanCount(){ + if (!(isKomiteMutu || isTurt || isAtasan)) return; + + const params = new URLSearchParams({ + page: 1, + per_page: 1, + keyword: '', + start_date: '', + end_date: '', + mode: 'persetujuan' + }); + + fetch(`/datatable/pengajuan-file?${params.toString()}`) + .then(res => res.json()) + .then(data => { + updatePendingPersetujuanIndicators(data?.pagination?.total || 0); + }) + .catch(() => { + updatePendingPersetujuanIndicators(0); + }); + } + if (tabsEl) { tabsEl.addEventListener('click', (e) => { const btn = e.target.closest('[data-mode]'); @@ -584,6 +623,7 @@ document.addEventListener('DOMContentLoaded', () => { activeState.lastPage = data?.pagination?.last_page || 1; activeState.total = data?.pagination?.total || 0; renderTable(); + fetchPendingPersetujuanCount(); }) .catch(err => { console.error(err); diff --git a/resources/views/dataAkreditasi/index.blade.php b/resources/views/dataAkreditasi/index.blade.php index cbe0a44..a17468e 100644 --- a/resources/views/dataAkreditasi/index.blade.php +++ b/resources/views/dataAkreditasi/index.blade.php @@ -56,6 +56,49 @@ line-height: 1.2; border-radius: 999px; } + + #lastUpdatedTable { + table-layout: fixed; + } + + #lastUpdatedTable td, + #lastUpdatedTable th { + vertical-align: middle; + } + + .file-row-content { + display: flex; + align-items: flex-start; + gap: 8px; + min-width: 0; + width: 100%; + } + + .file-text-wrap { + min-width: 0; + flex: 1 1 auto; + } + + .file-name-trigger { + display: block; + width: 100%; + overflow: hidden; + line-height: 1.3; + white-space: normal; + word-break: break-word; + overflow-wrap: anywhere; + } + + .file-name-trigger strong { + display: block; + white-space: normal; + word-break: break-word; + overflow-wrap: anywhere; + } + + .file-meta-path { + display: none; + } @section('body_main')
@@ -167,6 +210,7 @@
@include('dataUnit.modal.create') + @include('dataUnit.modal.view') @if(Auth::guard('admin')->check()) + ${renderDeleteRecommendation(item)} ${item.nama_kategori || '-'} diff --git a/resources/views/layout/partials/sidenav.blade.php b/resources/views/layout/partials/sidenav.blade.php index 7f2a4a3..018f4dc 100644 --- a/resources/views/layout/partials/sidenav.blade.php +++ b/resources/views/layout/partials/sidenav.blade.php @@ -66,7 +66,7 @@ })->exists(); $isRoleApprover = in_array(51, $userUnitIds, true) || in_array(22, $userUnitIds, true); @endphp - @if($isAtasan || $isRoleApprover) + @if($isAtasan) @if(!Auth::guard('admin')->check()) @endif @@ -204,10 +208,11 @@