This commit is contained in:
Dwi Swandhana
2026-03-10 13:53:06 +07:00
parent 2e0461b528
commit 5aed126889
8 changed files with 217 additions and 33 deletions
@@ -37,31 +37,7 @@
<span class="badge badge-danger badge-pill noti-icon-badge" id="notificationcount">{{ $criticalNotificationCount }}</span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-lg" id="notifikasi-verifikasi-bell">
<div class="dropdown-item noti-title">
<h5 class="m-0">
<span class="float-right">
<a href="{{ route('criticalValueNotifications') }}" class="text-dark"><small>Lihat Semua</small></a>
</span>
Nilai Kritis
</h5>
</div>
<div style="max-height: 320px; overflow-y: auto;">
@if($criticalNotificationItems->isEmpty())
<div class="dropdown-item text-muted">Tidak ada sample nilai kritis yang perlu dilaporkan.</div>
@else
@foreach($criticalNotificationItems as $criticalItem)
<a href="{{ route('criticalValueNotificationOpen', $criticalItem->id) }}" class="dropdown-item notify-item">
<div class="notify-icon bg-warning"><i class="fa fa-exclamation-triangle"></i></div>
<p class="notify-details">
{{ $criticalItem->nofoto ?? '-' }} - {{ $criticalItem->nmpasien ?? 'Tanpa Nama' }}
<small class="text-muted">
Set: {{ $criticalItem->critical_set_at ? \Carbon\Carbon::parse($criticalItem->critical_set_at)->format('d-m-Y H:i:s') : '-' }}
</small>
</p>
</a>
@endforeach
@endif
</div>
@include('notifications.partials.critical-bell', ['count' => $criticalNotificationCount, 'items' => $criticalNotificationItems])
</div>
</li>
@if(Session::get('id') !== null)
@@ -272,3 +248,48 @@
</div>
</div>
</header>
@if(Session::get('id') !== null)
@push('script')
<script type="text/javascript">
(function () {
var refreshUrl = "{{ route('criticalValueNotificationSummary') }}";
var refreshIntervalMs = 20000;
var inFlight = null;
function setBadge(count) {
var $badge = $('#notificationcount');
$badge.text(count);
if (count > 0) $badge.show();
else $badge.hide();
}
function refreshCriticalBell() {
if (inFlight && inFlight.readyState !== 4) {
try { inFlight.abort(); } catch (e) {}
}
inFlight = $.ajax({
url: refreshUrl,
type: 'GET',
dataType: 'json',
cache: false,
success: function (data) {
var count = parseInt((data && data.count) ? data.count : 0, 10) || 0;
setBadge(count);
if (data && typeof data.menu_html === 'string') {
$('#notifikasi-verifikasi-bell').html(data.menu_html);
}
}
});
}
$(function () {
setBadge(parseInt($('#notificationcount').text(), 10) || 0);
refreshCriticalBell();
setInterval(refreshCriticalBell, refreshIntervalMs);
$('#notification-bell-icon').closest('.dropdown').on('shown.bs.dropdown', refreshCriticalBell);
});
})();
</script>
@endpush
@endif
@@ -18,6 +18,13 @@
</div>
</div>
@endif
@if (session('error'))
<div class="row">
<div class="col-12">
<div class="alert alert-danger">{{ session('error') }}</div>
</div>
</div>
@endif
<div class="row">
<div class="col-12">
@@ -36,6 +43,7 @@
<th>No Foto</th>
<th>No Register</th>
<th>Pasien</th>
<th>Asal Pasien</th>
<th>Spesimen</th>
<th>Waktu Set Nilai Kritis</th>
<th>Waktu Ditindaklanjuti</th>
@@ -49,6 +57,7 @@
<td>{{ $item->nofoto ?? '-' }}</td>
<td>{{ $item->noregister ?? '-' }}</td>
<td>{{ $item->nmpasien ?? '-' }}</td>
<td>{{ $item->asalpasien ?? '-' }}</td>
<td>{{ $item->nm_spesimen ?? '-' }}</td>
<td>
{{ $item->critical_set_at ? \Carbon\Carbon::parse($item->critical_set_at)->format('d-m-Y H:i:s') : '-' }}
@@ -60,6 +69,24 @@
<td>
<form action="{{ route('criticalValueNotificationMarkRead', $item->id) }}" method="POST" class="mb-0">
@csrf
<div class="form-group">
<label for="caratindaklanjut" class="col-form-label">Melalui <font color="red">*</font></label>
<select class="form-control" id="caratindaklanjut" name="caratindaklanjut">
<option value="">Belum di Laporkan</option>
<option value="Telpon">Telpon</option>
<option value="Whatshap">Whatshap</option>
<option value="Email">Email</option>
<option value="Ketemu di Jalan">Ketemu di Jalan</option>
</select>
</div>
<div class="form-group">
<label for="penerima_laporan" class="col-form-label">Penerima Laporan <font color="red">*</font></label>
<input type="text" id="penerima_laporan" name="penerima_laporan" class="form-control">
</div>
<div class="form-group">
<label for="alasan_belum_laporkan" class="col-form-label">Alasan Belum di Laporkan <font color="red">*</font></label>
<input type="text" id="alasan_belum_laporkan" name="alasan_belum_laporkan" class="form-control" placeholder="Isi jika belum di laporkan (Meninggal / Pindah Rumah Sakit / dll)">
</div>
<button type="submit" class="btn btn-sm btn-warning">Mark as Read</button>
</form>
</td>
@@ -0,0 +1,25 @@
<div class="dropdown-item noti-title">
<h5 class="m-0">
<span class="float-right">
<a href="{{ route('criticalValueNotifications') }}" class="text-dark"><small>Lihat Semua</small></a>
</span>
Nilai Kritis
</h5>
</div>
<div style="max-height: 320px; overflow-y: auto;">
@if(($items ?? collect())->isEmpty())
<div class="dropdown-item text-muted">Tidak ada sample nilai kritis yang perlu dilaporkan.</div>
@else
@foreach($items as $criticalItem)
<a href="{{ route('criticalValueNotificationOpen', $criticalItem->id) }}" class="dropdown-item notify-item">
<div class="notify-icon bg-warning"><i class="fa fa-exclamation-triangle"></i></div>
<p class="notify-details">
{{ $criticalItem->nofoto ?? '-' }} - {{ $criticalItem->nmpasien ?? 'Tanpa Nama' }}
<small class="text-muted">
Set: {{ $criticalItem->critical_set_at ? \Carbon\Carbon::parse($criticalItem->critical_set_at)->format('d-m-Y H:i:s') : '-' }}
</small>
</p>
</a>
@endforeach
@endif
</div>
@@ -58,6 +58,7 @@
<th>Kode</th>
<th>Spesimen</th>
<th>Status</th>
<th>Batal Aksi</th>
</tr>
</thead>
<tbody></tbody>
@@ -130,6 +131,11 @@
$('#gridkiriman').DataTable().ajax.reload();
});
}
function btnBatal(id){
$.post('{{ route("batalPeriksa") }}', { id: id, _token: '{{ csrf_token() }}'},function(data){
$('#gridkiriman').DataTable().ajax.reload();
});
}
$(document).ready(function () {
$("#tglreport").datepicker({format: 'yyyy-mm-dd'});
$("#mulai").datepicker({format: 'yyyy-mm-dd'});
@@ -213,6 +219,8 @@
{ data: 'kd_spesimen', name: 'kd_spesimen' },
{ data: 'nm_spesimen', name: 'nm_spesimen' },
{ data: 'tlsstatus', name: 'status' },
{ data: 'batalaksi', name: 'batalaksi', orderable: false, searchable: false },
],
language: {
lengthMenu : "Tampilkan _MENU_ data per halaman",