diff --git a/components/TabelData.vue b/components/TabelData.vue index bebda64..ec0e0aa 100644 --- a/components/TabelData.vue +++ b/components/TabelData.vue @@ -4,7 +4,10 @@ - + {{ title }} @@ -44,19 +47,25 @@ {{ (currentPage - 1) * itemsPerPage + index + 1 }} + + + + {{ item.jamPanggil }} + + + + + + {{ item.barcode }} + + + + + + {{ item.noAntrian.split(' |')[0] }} + + {{ item.noAntrian.split(' |')[1] }} + + + + + + + {{ item.klinik }} + + + + + + + {{ item.fastTrack }} + + + + + + + {{ item.pembayaran }} + + + @@ -89,7 +145,7 @@ - Showing {{ currentPageStart }} to {{ currentPageEnd }} of {{ totalEntries }} entries + Showing {{ currentPageStart }} to {{ currentPageEnd }} of {{ filteredTotal }} entries props.items.length); -const totalPages = computed(() => Math.ceil(totalEntries.value / itemsPerPage.value)); - -// Filter items based on search and pagination +// Filter items based on search const filteredItems = computed(() => { - let filtered = props.items; - - if (search.value) { - const searchLower = search.value.toLowerCase(); - filtered = props.items.filter(item => { - return Object.values(item).some(value => - String(value).toLowerCase().includes(searchLower) - ); - }); + if (!search.value) { + return props.items; } + const searchLower = search.value.toLowerCase(); + return props.items.filter(item => { + return Object.values(item).some(value => + String(value).toLowerCase().includes(searchLower) + ); + }); +}); + +const filteredTotal = computed(() => filteredItems.value.length); +const totalPages = computed(() => Math.ceil(filteredTotal.value / itemsPerPage.value)); + +// Paginate the filtered items +const paginatedItems = computed(() => { const start = (currentPage.value - 1) * itemsPerPage.value; const end = start + itemsPerPage.value; - return filtered.slice(start, end); + return filteredItems.value.slice(start, end); }); const currentPageStart = computed(() => { - if (totalEntries.value === 0) return 0; + if (filteredTotal.value === 0) return 0; return (currentPage.value - 1) * itemsPerPage.value + 1; }); const currentPageEnd = computed(() => { const end = currentPage.value * itemsPerPage.value; - return Math.min(end, totalEntries.value); + return Math.min(end, filteredTotal.value); }); // Method untuk mendapatkan warna status @@ -169,11 +228,43 @@ const getStatusColor = (status) => { return 'green'; case 'Batal': return 'red'; + case 'Aktif': + return 'success'; + case 'Menunggu': + return 'warning'; default: return 'grey'; } }; +// Method untuk mendapatkan warna klinik +const getKlinikColor = (klinik) => { + switch (klinik) { + case 'KANDUNGAN': + return 'pink'; + case 'IPD': + return 'blue'; + case 'THT': + return 'orange'; + case 'SARAF': + return 'purple'; + default: + return 'grey'; + } +}; + +// Method untuk mendapatkan class title +const getTitleClass = (title) => { + if (title.includes('TERLAMBAT')) { + return 'text-warning'; + } else if (title.includes('PENDING')) { + return 'text-info'; + } else if (title.includes('DI LOKET')) { + return 'text-success'; + } + return 'text-primary'; +}; + // Watch untuk reset halaman ketika items per page berubah watch(itemsPerPage, () => { currentPage.value = 1; @@ -192,6 +283,65 @@ watch(search, () => { \ No newline at end of file diff --git a/pages/Loket-Admin.vue b/pages/Loket-Admin.vue index d097a0a..f2348dc 100644 --- a/pages/Loket-Admin.vue +++ b/pages/Loket-Admin.vue @@ -9,145 +9,208 @@ mdi-view-dashboard - Loket 12 + Loket Admin Rabu, 13 Agustus 2025 - Pelayanan - - Total 2 Pasien + + Total {{ totalPasien }} Pasien - + Max 150 Pasien - - - - - - - - Panggil Pasien: - - 1 - - - 5 - - - 10 - - - 20 - - - - - - Total Quota Terpakai: 5 - - - - - - - - - - - mdi-account-arrow-right - PASIEN SELANJUTNYA - - - UM1004 - - - Klik tombol hijau untuk memanggil - - + + + + mdi-account-arrow-right + PASIEN SELANJUTNYA + + + {{ nextPatient ? nextPatient.noAntrian.split(" |")[0] : "UM1004" }} + + + Klik tombol hijau untuk memanggil + + + mdi-microphone + PANGGIL NEXT + + + + + + + + + + - mdi-microphone - PANGGIL NEXT - - - + + + + + mdi-account-clock + SEDANG DIPROSES + + + {{ currentProcessingPatient.noAntrian.split(" |")[0] }} + + + {{ currentProcessingPatient.barcode }} | + {{ currentProcessingPatient.klinik }} + + + + + mdi-check-circle + Check In + + + mdi-clock-alert + Terlambat + + + mdi-pause-circle + Pending + + + + + + - + + + + + + + + + Panggil Antrean Anjungan + + + + Kuota + 150 + + + Tersedia + + {{ 150 - quotaUsed }} + + + + + Total Quota Terpakai: {{ quotaUsed }} + + + + Panggil Pasien: + + + 1 + + + 5 + + + 10 + + + 20 + + + + + + + + + + - - Panggil + Aktifkan - - Cancel - - - Selesai + Proses @@ -157,23 +220,56 @@ - - + + + > + + + + Aktifkan + + + + - - + + + :headers="pendingHeaders" + :items="pendingPatients" + title="INFO PASIEN PENDING" + > + + + + Proses + + + + @@ -184,7 +280,7 @@ location="top right" > {{ snackbarText }} - + mdi-close @@ -195,29 +291,18 @@ \ No newline at end of file +
Rabu, 13 Agustus 2025 - Pelayanan