274 lines
6.8 KiB
Vue
274 lines
6.8 KiB
Vue
<script setup lang="ts">
|
|
// Components
|
|
import type { DataTableLoader } from '~/components/pub/my-ui/data-table/type'
|
|
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
|
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
|
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuTrigger,
|
|
DropdownMenuContent,
|
|
DropdownMenuItem,
|
|
} from '~/components/pub/ui/dropdown-menu'
|
|
import AppSepList from '~/components/app/sep/list.vue'
|
|
|
|
// Icons
|
|
import { X, Check } from 'lucide-vue-next'
|
|
|
|
// Types
|
|
import type { VclaimSepData } from '~/models/vclaim'
|
|
|
|
// Services
|
|
import { getList as geMonitoringVisitList } from '~/services/vclaim-monitoring-visit.service'
|
|
|
|
const search = ref('')
|
|
const dateRange = ref('12 Agustus 2025 - 31 Agustus 2025')
|
|
const open = ref(false)
|
|
|
|
const sepData = {
|
|
no_sep: 'SP23311224',
|
|
kartu: '001234',
|
|
nama: 'Kenzie',
|
|
}
|
|
|
|
const paginationMeta = reactive<PaginationMeta>({
|
|
recordCount: 0,
|
|
page: 1,
|
|
pageSize: 10,
|
|
totalPage: 5,
|
|
hasNext: false,
|
|
hasPrev: false,
|
|
})
|
|
|
|
function handlePageChange(page: number) {
|
|
console.log('pageChange', page)
|
|
}
|
|
|
|
const data = ref<VclaimSepData[]>([])
|
|
|
|
const refSearchNav: RefSearchNav = {
|
|
onClick: () => {
|
|
// open filter modal
|
|
},
|
|
onInput: (_val: string) => {
|
|
// filter patient list
|
|
},
|
|
onClear: () => {
|
|
// clear url param
|
|
},
|
|
}
|
|
|
|
const isLoading = reactive<DataTableLoader>({
|
|
isTableLoading: false,
|
|
})
|
|
|
|
const recId = ref<number>(0)
|
|
const recAction = ref<string>('')
|
|
const recItem = ref<any>(null)
|
|
|
|
const headerPrep: HeaderPrep = {
|
|
title: 'Daftar SEP Prosedur',
|
|
icon: 'i-lucide-panel-bottom',
|
|
addNav: {
|
|
label: 'Tambah',
|
|
onClick: () => {
|
|
navigateTo('/integration/bpjs/sep/add')
|
|
},
|
|
},
|
|
}
|
|
|
|
async function getMonitoringVisitMappers() {
|
|
isLoading.dataListLoading = true
|
|
data.value = []
|
|
|
|
const dateFirst = new Date()
|
|
const result = await geMonitoringVisitList({
|
|
date: dateFirst.toISOString().substring(0, 10),
|
|
serviceType: 1,
|
|
})
|
|
|
|
if (result && result.success && result.body) {
|
|
const visitsRaw = result.body?.response?.sep || []
|
|
|
|
if (!visitsRaw) {
|
|
isLoading.dataListLoading = false
|
|
return
|
|
}
|
|
|
|
visitsRaw.forEach((result: any) => {
|
|
// Format pelayanan: "R.Inap" -> "Rawat Inap", "1" -> "Rawat Jalan", dll
|
|
let serviceType = result.jnsPelayanan || '-'
|
|
if (serviceType === 'R.Inap') {
|
|
serviceType = 'Rawat Inap'
|
|
} else if (serviceType === '1' || serviceType === 'R.Jalan') {
|
|
serviceType = 'Rawat Jalan'
|
|
}
|
|
|
|
data.value.push({
|
|
letterDate: result.tglSep || '-',
|
|
letterNumber: result.noSep || '-',
|
|
serviceType: serviceType,
|
|
flow: '-',
|
|
medicalRecordNumber: '-',
|
|
patientName: result.nama || '-',
|
|
cardNumber: result.noKartu || '-',
|
|
controlLetterNumber: result.noRujukan || '-',
|
|
controlLetterDate: result.tglPlgSep || '-',
|
|
clinicDestination: result.poli || '-',
|
|
attendingDoctor: '-',
|
|
diagnosis: result.diagnosa || '-',
|
|
careClass: result.kelasRawat || '-',
|
|
})
|
|
})
|
|
}
|
|
|
|
isLoading.dataListLoading = false
|
|
}
|
|
|
|
async function getSepList() {
|
|
await getMonitoringVisitMappers()
|
|
}
|
|
|
|
function exportCsv() {
|
|
console.log('Ekspor CSV dipilih')
|
|
// tambahkan logic untuk generate CSV
|
|
}
|
|
|
|
function exportExcel() {
|
|
console.log('Ekspor Excel dipilih')
|
|
// tambahkan logic untuk generate Excel
|
|
}
|
|
|
|
function handleDelete() {
|
|
console.log('Data dihapus:', sepData)
|
|
open.value = false
|
|
}
|
|
|
|
watch(
|
|
() => recAction.value,
|
|
() => {
|
|
if (recAction.value === 'showConfirmDel') {
|
|
open.value = true
|
|
}
|
|
},
|
|
)
|
|
|
|
onMounted(() => {
|
|
getSepList()
|
|
})
|
|
|
|
provide('rec_id', recId)
|
|
provide('rec_action', recAction)
|
|
provide('rec_item', recItem)
|
|
provide('table_data_loader', isLoading)
|
|
</script>
|
|
|
|
<template>
|
|
<div class="p-4">
|
|
<Header :prep="{ ...headerPrep }" />
|
|
<!-- Filter Bar -->
|
|
<div class="my-2 flex flex-wrap items-center gap-2">
|
|
<!-- Search -->
|
|
<Input
|
|
v-model="search"
|
|
placeholder="Cari No. SEP / No. Kartu BPJS..."
|
|
class="w-72"
|
|
/>
|
|
|
|
<!-- Date Range -->
|
|
<Popover>
|
|
<PopoverTrigger as-child>
|
|
<Button
|
|
variant="outline"
|
|
class="h-[40px] w-72 border-gray-400 bg-white text-right font-normal"
|
|
>
|
|
{{ dateRange }}
|
|
<Icon
|
|
name="i-lucide-calendar"
|
|
class="h-5 w-5"
|
|
/>
|
|
</Button>
|
|
</PopoverTrigger>
|
|
<PopoverContent class="p-2">
|
|
<Calendar mode="range" />
|
|
</PopoverContent>
|
|
</Popover>
|
|
|
|
<!-- Export -->
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger as-child>
|
|
<Button
|
|
variant="outline"
|
|
class="ml-auto h-[40px] w-[120px] rounded-md border-green-600 text-green-600 hover:bg-green-50"
|
|
>
|
|
<Icon
|
|
name="i-lucide-download"
|
|
class="h-5 w-5"
|
|
/>
|
|
Ekspor
|
|
</Button>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent class="w-40">
|
|
<DropdownMenuItem @click="exportCsv">Ekspor CSV</DropdownMenuItem>
|
|
<DropdownMenuItem @click="exportExcel">Ekspor Excel</DropdownMenuItem>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
<AppSepList
|
|
v-if="!isLoading.dataListLoading"
|
|
:data="data"
|
|
/>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<template v-if="paginationMeta">
|
|
<div v-if="paginationMeta.totalPage > 1">
|
|
<PubMyUiPagination
|
|
:pagination-meta="paginationMeta"
|
|
@page-change="handlePageChange"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- Trigger button -->
|
|
<Dialog v-model:open="open">
|
|
<DialogTrigger as-child></DialogTrigger>
|
|
|
|
<DialogContent class="sm:max-w-md">
|
|
<DialogHeader>
|
|
<DialogTitle>Hapus SEP</DialogTitle>
|
|
</DialogHeader>
|
|
|
|
<DialogDescription class="text-gray-700">Apakah anda yakin ingin menghapus SEP dengan data:</DialogDescription>
|
|
|
|
<div class="mt-4 space-y-2 text-sm">
|
|
<p>No. SEP : {{ sepData.no_sep }}</p>
|
|
<p>No. Kartu BPJS : {{ sepData.kartu }}</p>
|
|
<p>Nama Pasien : {{ sepData.nama }}</p>
|
|
</div>
|
|
|
|
<DialogFooter class="mt-6 flex justify-end gap-3">
|
|
<Button
|
|
variant="outline"
|
|
class="border-green-600 text-green-600 hover:bg-green-50"
|
|
@click="open = false"
|
|
>
|
|
<X class="mr-1 h-4 w-4" />
|
|
Tidak
|
|
</Button>
|
|
<Button
|
|
variant="destructive"
|
|
class="bg-red-600 hover:bg-red-700"
|
|
@click="handleDelete"
|
|
>
|
|
<Check class="mr-1 h-4 w-4" />
|
|
Ya
|
|
</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
</div>
|
|
</template>
|