feat: enhance SEP entry form and detail handling with conditional disabling and improved data filtering
This commit is contained in:
@@ -393,7 +393,7 @@ onMounted(() => {
|
|||||||
id="cardNumber"
|
id="cardNumber"
|
||||||
v-model="cardNumber"
|
v-model="cardNumber"
|
||||||
v-bind="cardNumberAttrs"
|
v-bind="cardNumberAttrs"
|
||||||
:disabled="false"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
@@ -408,7 +408,7 @@ onMounted(() => {
|
|||||||
id="nationalId"
|
id="nationalId"
|
||||||
v-model="nationalId"
|
v-model="nationalId"
|
||||||
v-bind="nationalIdAttrs"
|
v-bind="nationalIdAttrs"
|
||||||
:disabled="false"
|
:disabled="isLoading || isReadonly"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
@@ -487,6 +487,7 @@ onMounted(() => {
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
v-if="!isReadonly"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
type="button"
|
type="button"
|
||||||
class="h-[40px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50"
|
class="h-[40px] rounded-md border-orange-400 text-orange-400 hover:bg-green-50"
|
||||||
|
|||||||
@@ -13,9 +13,12 @@ import RangeCalendar from '~/components/pub/ui/range-calendar/RangeCalendar.vue'
|
|||||||
// Icons
|
// Icons
|
||||||
import { X, Check } from 'lucide-vue-next'
|
import { X, Check } from 'lucide-vue-next'
|
||||||
|
|
||||||
// Libraries
|
// Handlers
|
||||||
import { useIntegrationSepList } from '~/handlers/integration-sep-list.handler'
|
import { useIntegrationSepList } from '~/handlers/integration-sep-list.handler'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { refDebounced } from '@vueuse/core'
|
||||||
|
|
||||||
// use handler to provide state and functions
|
// use handler to provide state and functions
|
||||||
const {
|
const {
|
||||||
recId,
|
recId,
|
||||||
@@ -42,30 +45,42 @@ const {
|
|||||||
handleRemove,
|
handleRemove,
|
||||||
} = useIntegrationSepList()
|
} = useIntegrationSepList()
|
||||||
|
|
||||||
|
const dataFiltered = ref<any>([])
|
||||||
|
const debouncedSearch = refDebounced(search, 500)
|
||||||
|
|
||||||
// expose provides so component can also use provide/inject if needed
|
// expose provides so component can also use provide/inject if needed
|
||||||
provide('rec_id', recId)
|
provide('rec_id', recId)
|
||||||
provide('rec_action', recAction)
|
provide('rec_action', recAction)
|
||||||
provide('rec_item', recItem)
|
provide('rec_item', recItem)
|
||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
|
|
||||||
watch(
|
watch([recId, recAction], () => {
|
||||||
[recId, recAction],
|
if (recAction.value === 'showConfirmDel') {
|
||||||
() => {
|
open.value = true
|
||||||
if (recAction.value === 'showConfirmDel') {
|
}
|
||||||
open.value = true
|
if (recAction.value === 'showDetail') {
|
||||||
}
|
navigateTo(`/integration/bpjs-vclaim/sep/${recItem.value?.letterNumber}/detail`)
|
||||||
if (recAction.value === 'showDetail') {
|
}
|
||||||
navigateTo(`/integration/bpjs-vclaim/sep/${recItem.value?.letterNumber}/detail`)
|
})
|
||||||
}
|
|
||||||
},
|
watch(debouncedSearch, (newValue) => {
|
||||||
)
|
if (newValue && newValue !== '-' && newValue.length >= 3) {
|
||||||
|
dataFiltered.value = data.value.filter(
|
||||||
|
(item: any) =>
|
||||||
|
item.patientName.toLowerCase().includes(newValue.toLowerCase()) ||
|
||||||
|
item.letterNumber.toLowerCase().includes(newValue.toLowerCase()) ||
|
||||||
|
item.cardNumber.toLowerCase().includes(newValue.toLowerCase()),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => dateSelection.value,
|
() => dateSelection.value,
|
||||||
(val) => {
|
async (val) => {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
setDateRange()
|
setDateRange()
|
||||||
getSepList()
|
await getSepList()
|
||||||
|
dataFiltered.value = [...data.value]
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
)
|
)
|
||||||
@@ -77,9 +92,10 @@ watch(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
setServiceTypes()
|
setServiceTypes()
|
||||||
getSepList()
|
await getSepList()
|
||||||
|
dataFiltered.value = [...data.value]
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -89,20 +105,35 @@ onMounted(() => {
|
|||||||
<!-- Filter Bar -->
|
<!-- Filter Bar -->
|
||||||
<div class="my-2 flex flex-wrap items-center gap-2">
|
<div class="my-2 flex flex-wrap items-center gap-2">
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
<Input v-model="search" placeholder="Cari No. SEP / No. Kartu BPJS..." class="w-72" />
|
<Input
|
||||||
|
v-model="search"
|
||||||
|
placeholder="Cari No. SEP / No. Kartu BPJS..."
|
||||||
|
class="w-72"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- Filter -->
|
<!-- Filter -->
|
||||||
<div class="w-72">
|
<div class="w-72">
|
||||||
<Select id="serviceType" icon-name="i-lucide-chevron-down" v-model="serviceType" :items="serviceTypesList"
|
<Select
|
||||||
placeholder="Pilih Pelayanan" />
|
id="serviceType"
|
||||||
|
icon-name="i-lucide-chevron-down"
|
||||||
|
v-model="serviceType"
|
||||||
|
:items="serviceTypesList"
|
||||||
|
placeholder="Pilih Pelayanan"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Date Range -->
|
<!-- Date Range -->
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger as-child>
|
<PopoverTrigger as-child>
|
||||||
<Button variant="outline" class="h-[40px] w-72 border-gray-400 bg-white text-right font-normal">
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
class="h-[40px] w-72 border-gray-400 bg-white text-right font-normal"
|
||||||
|
>
|
||||||
{{ dateRange }}
|
{{ dateRange }}
|
||||||
<Icon name="i-lucide-calendar" class="h-5 w-5" />
|
<Icon
|
||||||
|
name="i-lucide-calendar"
|
||||||
|
class="h-5 w-5"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent class="p-2">
|
<PopoverContent class="p-2">
|
||||||
@@ -113,9 +144,14 @@ onMounted(() => {
|
|||||||
<!-- Export -->
|
<!-- Export -->
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger as-child>
|
<DropdownMenuTrigger as-child>
|
||||||
<Button variant="outline"
|
<Button
|
||||||
class="ml-auto h-[40px] w-[120px] rounded-md border-green-600 text-green-600 hover:bg-green-50">
|
variant="outline"
|
||||||
<Icon name="i-lucide-download" class="h-5 w-5" />
|
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
|
Ekspor
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
@@ -127,13 +163,20 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<AppSepList v-if="!isLoading.dataListLoading" :data="data" @update:modelValue="handleRowSelected" />
|
<AppSepList
|
||||||
|
v-if="!isLoading.dataListLoading"
|
||||||
|
:data="dataFiltered"
|
||||||
|
@update:modelValue="handleRowSelected"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Pagination -->
|
<!-- Pagination -->
|
||||||
<template v-if="paginationMeta">
|
<template v-if="paginationMeta">
|
||||||
<div v-if="paginationMeta.totalPage > 1">
|
<div v-if="paginationMeta.totalPage > 1">
|
||||||
<PubMyUiPagination :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
<PubMyUiPagination
|
||||||
|
:pagination-meta="paginationMeta"
|
||||||
|
@page-change="handlePageChange"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -146,20 +189,39 @@ onMounted(() => {
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<DialogDescription class="text-gray-700">Apakah anda yakin ingin menghapus SEP dengan data:</DialogDescription>
|
<DialogDescription class="text-gray-700">Apakah anda yakin ingin menghapus SEP dengan data:</DialogDescription>
|
||||||
<div class="mt-4 space-y-2 text-sm">
|
<div class="mt-4 space-y-2 text-sm">
|
||||||
<p><strong>No. SEP:</strong> {{ sepData.sepNumber }}</p>
|
<p>
|
||||||
<p><strong>No. Kartu BPJS:</strong> {{ sepData.cardNumber }}</p>
|
<strong>No. SEP:</strong>
|
||||||
<p><strong>Nama Pasien:</strong> {{ sepData.patientName }}</p>
|
{{ sepData.sepNumber }}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>No. Kartu BPJS:</strong>
|
||||||
|
{{ sepData.cardNumber }}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>Nama Pasien:</strong>
|
||||||
|
{{ sepData.patientName }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<DialogFooter class="mt-6 flex justify-end gap-3">
|
<DialogFooter class="mt-6 flex justify-end gap-3">
|
||||||
<Button variant="outline" class="border-green-600 text-green-600 hover:bg-green-50" @click="() => {
|
<Button
|
||||||
recId = 0
|
variant="outline"
|
||||||
recAction = ''
|
class="border-green-600 text-green-600 hover:bg-green-50"
|
||||||
open = false
|
@click="
|
||||||
}">
|
() => {
|
||||||
|
recId = 0
|
||||||
|
recAction = ''
|
||||||
|
open = false
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
<X class="mr-1 h-4 w-4" />
|
<X class="mr-1 h-4 w-4" />
|
||||||
Tidak
|
Tidak
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="destructive" class="bg-red-600 hover:bg-red-700" @click="handleRemove">
|
<Button
|
||||||
|
variant="destructive"
|
||||||
|
class="bg-red-600 hover:bg-red-700"
|
||||||
|
@click="handleRemove"
|
||||||
|
>
|
||||||
<Check class="mr-1 h-4 w-4" />
|
<Check class="mr-1 h-4 w-4" />
|
||||||
Ya
|
Ya
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ export function useIntegrationSepDetail() {
|
|||||||
purposeOfVisitName: response.tujuanKunj?.nama || '-',
|
purposeOfVisitName: response.tujuanKunj?.nama || '-',
|
||||||
serviceAssessment: response.assestmenPel?.kode || '-',
|
serviceAssessment: response.assestmenPel?.kode || '-',
|
||||||
serviceAssessmentName: response.assestmenPel?.nama || '-',
|
serviceAssessmentName: response.assestmenPel?.nama || '-',
|
||||||
trafficAccident: response.nmstatusKecelakaan || '',
|
trafficAccident: response.kdStatusKecelakaan || '',
|
||||||
trafficAccidentCode: response.kdStatusKecelakaan || '',
|
trafficAccidentName: response.nmstatusKecelakaan || '',
|
||||||
lpNumber: response.kontrol?.noSurat || '-',
|
lpNumber: response.kontrol?.noSurat || '-',
|
||||||
accidentDate: response.lokasiKejadian?.tglKejadian || '-',
|
accidentDate: response.lokasiKejadian?.tglKejadian || '-',
|
||||||
accidentNote: response.lokasiKejadian?.ketKejadian || '-',
|
accidentNote: response.lokasiKejadian?.ketKejadian || '-',
|
||||||
|
|||||||
Reference in New Issue
Block a user