322 lines
13 KiB
PHP
322 lines
13 KiB
PHP
@extends('layouts.main')
|
|
|
|
@section('css')
|
|
<style>
|
|
#table-belum-diklaim td, #table-belum-diklaim th,
|
|
#table-sudah-diklaim td, #table-sudah-diklaim th {
|
|
border-color: #ced4da !important;
|
|
}
|
|
|
|
#table-belum-diklaim thead th,
|
|
#table-sudah-diklaim thead th {
|
|
background: #2563eb !important; background-color: #2563eb !important;
|
|
color: #fff !important;
|
|
border-color: #2563eb !important;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
#table-belum-diklaim tbody tr,
|
|
#table-sudah-diklaim tbody tr {
|
|
cursor: pointer;
|
|
}
|
|
|
|
#table-belum-diklaim tbody tr > *,
|
|
#table-sudah-diklaim tbody tr > * {
|
|
transition: background-color 0.25s ease;
|
|
}
|
|
|
|
#table-belum-diklaim tbody tr:hover > *,
|
|
#table-sudah-diklaim tbody tr:hover > * {
|
|
background-color: rgba(13, 110, 253, 0.08) !important;
|
|
}
|
|
|
|
#table-belum-diklaim tbody tr:active > *,
|
|
#table-sudah-diklaim tbody tr:active > * {
|
|
background-color: rgba(13, 110, 253, 0.22) !important;
|
|
transition: background-color 0s;
|
|
}
|
|
|
|
@include('verifikasi.sk._kolom_sk_css')
|
|
|
|
#table-belum-diklaim tbody .btn-primary,
|
|
#table-sudah-diklaim tbody .btn-primary {
|
|
transition: transform 0.1s ease, box-shadow 0.1s ease;
|
|
}
|
|
|
|
#table-belum-diklaim tbody .btn-primary:active,
|
|
#table-sudah-diklaim tbody .btn-primary:active {
|
|
transform: scale(0.88);
|
|
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
}
|
|
</style>
|
|
@endsection
|
|
|
|
@section('breadcrumb')
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="javascript:void(0);">Verifikasi</a></li>
|
|
<li class="breadcrumb-item"><a href="javascript:void(0);">SK</a></li>
|
|
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
|
</ol>
|
|
@endsection
|
|
|
|
@section('content')
|
|
@if ($periode && !$periode->canVerifySk() && !auth()->user()->hasRole('Superuser'))
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="alert alert-warning" role="alert">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
<strong>Perhatian!</strong> {{ $periode->getSkVerificationErrorMessage() ?? 'Periode verifikasi SK tidak aktif.' }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
@if(count($units) > 0)
|
|
<div class="card border">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="mb-2">
|
|
<label for="unit_kerja_filter" class="form-label">Unit Kerja</label>
|
|
<select class="form-select select2" id="unit_kerja_filter" name="unit_kerja_filter" data-placeholder="Pilih Unit Kerja...">
|
|
<option value=""></option>
|
|
@foreach($units as $unit)
|
|
<option value="{{ $unit['id'] }}" {{ request('unit_id') == $unit['id'] ? 'selected' : '' }}>{{ $unit['nama'] }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="card border">
|
|
<div class="card-body">
|
|
@include('components.datatable-header', [
|
|
'title' => 'Daftar SK Klaim Ulang',
|
|
'description' => 'Berikut adalah daftar Surat Keputusan (SK) yang dapat diklaim ulang'
|
|
])
|
|
|
|
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3" id="statusTab" role="tablist">
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link rounded-0 active" id="belum-diklaim-tab" data-bs-toggle="tab"
|
|
data-bs-target="#belum-diklaim" type="button" role="tab" aria-expanded="true">
|
|
<i class="uil-exclamation-triangle d-md-none d-block"></i>
|
|
<span class="d-none d-md-block">Belum Diklaim</span>
|
|
</button>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link rounded-0" id="sudah-diklaim-tab" data-bs-toggle="tab"
|
|
data-bs-target="#sudah-diklaim" type="button" role="tab" aria-expanded="false">
|
|
<i class="uil-check-circle d-md-none d-block"></i>
|
|
<span class="d-none d-md-block">Sudah Diklaim</span>
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
<div class="tab-pane show active" id="belum-diklaim" role="tabpanel">
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered w-100" id="table-belum-diklaim">
|
|
<thead>
|
|
<tr>
|
|
<th>SK</th>
|
|
<th>Nomor SK</th>
|
|
<th>Tentang</th>
|
|
<th>Tanggal</th>
|
|
<th>Periode Terakhir Klaim</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-pane" id="sudah-diklaim" role="tabpanel">
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered w-100" id="table-sudah-diklaim">
|
|
<thead>
|
|
<tr>
|
|
<th>SK</th>
|
|
<th>Nomor SK</th>
|
|
<th>Tentang</th>
|
|
<th>Tanggal</th>
|
|
<th>Periode Terakhir Klaim</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('js')
|
|
<script>
|
|
$('.si-sk').addClass('menuitem-active');
|
|
$('.ni-sk').addClass('badge-primary-lighten');
|
|
$('.li-sk').addClass('show');
|
|
$('.li-sk-klaim-ulang').addClass('active badge-primary-lighten');
|
|
|
|
$('#unit_kerja_filter').select2({
|
|
placeholder: 'Pilih Unit Kerja...',
|
|
allowClear: true,
|
|
width: '100%'
|
|
});
|
|
|
|
// Konfigurasi kolom untuk DataTable
|
|
var columns = [
|
|
{
|
|
data: 'pdf',
|
|
name: 'pdf',
|
|
className: 'text-center',
|
|
orderable: false,
|
|
searchable: false
|
|
},
|
|
{
|
|
data: 'no_sk',
|
|
name: 'no_sk',
|
|
className: 'text-start'
|
|
},
|
|
{
|
|
data: 'tentang',
|
|
name: 'tentang'
|
|
},
|
|
{
|
|
data: 'tanggal_sk',
|
|
name: 'tanggal_sk',
|
|
className: 'text-center',
|
|
width: '100px'
|
|
},
|
|
{
|
|
data: 'periode_terakhir_klaim',
|
|
name: 'periode_terakhir_klaim',
|
|
className: 'text-center',
|
|
width: '150px'
|
|
},
|
|
{
|
|
data: 'status_klaim',
|
|
name: 'status_klaim',
|
|
className: 'text-center',
|
|
orderable: false,
|
|
searchable: false
|
|
},
|
|
];
|
|
|
|
// Inisialisasi DataTable untuk Belum Diklaim
|
|
pasangSkeletonSk('#table-belum-diklaim');
|
|
var tableBelumDiklaim = $('#table-belum-diklaim').DataTable({
|
|
processing: false,
|
|
serverSide: true,
|
|
ajax: {
|
|
url: "{{ route('sk.klaim-ulang.data') }}",
|
|
data: function (d) {
|
|
d.unit_id = $('#unit_kerja_filter').val();
|
|
d.status_klaim = 'belum';
|
|
}
|
|
},
|
|
columns: columns,
|
|
@can('Verifikasi SK Klaim Ulang')
|
|
createdRow: function(row, data) {
|
|
$(row).attr('data-url', data.url_detail)
|
|
.attr('data-bs-toggle', 'tooltip')
|
|
.attr('data-bs-placement', 'top')
|
|
.attr('title', 'Klik untuk detail');
|
|
},
|
|
@endcan
|
|
drawCallback: function() {
|
|
@can('Verifikasi SK Klaim Ulang')
|
|
document.querySelectorAll('body > .tooltip').forEach(function(el) { el.remove(); });
|
|
document.querySelectorAll('#table-belum-diklaim tbody [data-bs-toggle="tooltip"]').forEach(function(el) {
|
|
var existing = bootstrap.Tooltip.getInstance(el);
|
|
if (existing) { existing.dispose(); }
|
|
new bootstrap.Tooltip(el, { trigger: 'hover' });
|
|
});
|
|
@endcan
|
|
initKolomSk('#table-belum-diklaim');
|
|
},
|
|
language: {
|
|
processing: "<div class='spinner'></div> Sedang Memuat...",
|
|
},
|
|
order: [[2, 'asc']]
|
|
});
|
|
|
|
// Inisialisasi DataTable untuk Sudah Diklaim
|
|
pasangSkeletonSk('#table-sudah-diklaim');
|
|
var tableSudahDiklaim = $('#table-sudah-diklaim').DataTable({
|
|
processing: false,
|
|
serverSide: true,
|
|
ajax: {
|
|
url: "{{ route('sk.klaim-ulang.data') }}",
|
|
data: function (d) {
|
|
d.unit_id = $('#unit_kerja_filter').val();
|
|
d.status_klaim = 'sudah';
|
|
}
|
|
},
|
|
columns: columns,
|
|
@can('Verifikasi SK Klaim Ulang')
|
|
createdRow: function(row, data) {
|
|
$(row).attr('data-url', data.url_detail)
|
|
.attr('data-bs-toggle', 'tooltip')
|
|
.attr('data-bs-placement', 'top')
|
|
.attr('title', 'Klik untuk detail');
|
|
},
|
|
@endcan
|
|
drawCallback: function() {
|
|
@can('Verifikasi SK Klaim Ulang')
|
|
document.querySelectorAll('body > .tooltip').forEach(function(el) { el.remove(); });
|
|
document.querySelectorAll('#table-sudah-diklaim tbody [data-bs-toggle="tooltip"]').forEach(function(el) {
|
|
var existing = bootstrap.Tooltip.getInstance(el);
|
|
if (existing) { existing.dispose(); }
|
|
new bootstrap.Tooltip(el, { trigger: 'hover' });
|
|
});
|
|
@endcan
|
|
initKolomSk('#table-sudah-diklaim');
|
|
},
|
|
language: {
|
|
processing: "<div class='spinner'></div> Sedang Memuat...",
|
|
},
|
|
order: [[2, 'asc']]
|
|
});
|
|
|
|
@include('verifikasi.sk._kolom_sk_js')
|
|
|
|
// Event listener untuk filter unit kerja (Select2)
|
|
$('#unit_kerja_filter').on('select2:select select2:clear', function() {
|
|
tableBelumDiklaim.ajax.reload();
|
|
tableSudahDiklaim.ajax.reload();
|
|
});
|
|
|
|
// Event listener untuk tab change - reload tabel saat tab di-klik
|
|
$('button[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|
if (e.target.id === 'belum-diklaim-tab') {
|
|
tableBelumDiklaim.columns.adjust().responsive.recalc();
|
|
} else if (e.target.id === 'sudah-diklaim-tab') {
|
|
tableSudahDiklaim.columns.adjust().responsive.recalc();
|
|
}
|
|
});
|
|
|
|
@can('Verifikasi SK Klaim Ulang')
|
|
$('#table-belum-diklaim, #table-sudah-diklaim').on('click', 'tbody tr', function(e) {
|
|
if ($(e.target).closest('a, button').length) { return; }
|
|
var url = $(this).data('url');
|
|
if (!url) { return; }
|
|
var unitId = $('#unit_kerja_filter').val();
|
|
if ($('#unit_kerja_filter').length > 0 && !unitId) {
|
|
showWarning('Peringatan!', 'Pilih Unit Kerja terlebih dahulu sebelum membuka detail SK.');
|
|
return;
|
|
}
|
|
if (unitId) { url += '?unit_id=' + unitId; }
|
|
var tooltipInstance = bootstrap.Tooltip.getInstance(this);
|
|
if (tooltipInstance) { tooltipInstance.dispose(); }
|
|
$('body').css('cursor', 'wait');
|
|
$(this).css('cursor', 'wait');
|
|
window.location.href = url;
|
|
});
|
|
@endcan
|
|
</script>
|
|
@endsection
|