Merge branch 'dev' of github.com:dikstub-rssa/simrs-fe into feat/satusehat

This commit is contained in:
Khafid Prayoga
2025-08-19 11:05:03 +07:00
23 changed files with 1125 additions and 742 deletions
+106
View File
@@ -0,0 +1,106 @@
<script setup lang="ts">
import Block from '~/components/pub/form/block.vue'
import FieldGroup from '~/components/pub/form/field-group.vue'
import Field from '~/components/pub/form/field.vue'
import Label from '~/components/pub/form/label.vue'
</script>
<template>
<form id="entry-form">
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg xl:text-xl">
<Icon name="i-lucide-user" class="me-2" />
<span class="font-semibold">Tambah</span> Dokter
</div>
<div class="mb-5 border-b border-b-slate-300 pb-3 text-lg xl:text-xl">
<div class="flex flex-col justify-between">
<Block>
<FieldGroup :column="1">
<Label>Nama dan Gelar</Label>
<Field>
<Input type="text" name="name" default-value="dr." />
</Field>
<Field>
<Input type="text" name="name" />
</Field>
<Field>
<Input type="text" name="name" />
</Field>
</FieldGroup>
</Block>
<Block>
<FieldGroup :column="2">
<Label>NIK</Label>
<Field>
<Input type="text" name="identity_number" />
</Field>
</FieldGroup>
<FieldGroup :column="2">
<Label>NO SIP</Label>
<Field name="sip_number">
<Input type="text" name="sip_no" />
</Field>
</FieldGroup>
</Block>
<Block>
<FieldGroup :column="2">
<Label>Telepon / HP</Label>
<Field name="phone">
<Input type="text" name="phone" />
</Field>
</FieldGroup>
<FieldGroup :column="2">
<Label>Kode BPJS</Label>
<Field>
<Input type="text" name="bpjs_code" />
</Field>
</FieldGroup>
</Block>
<Block>
<FieldGroup :column="2">
<Label>Fee Rajal</Label>
<Field>
<Input type="number" name="outPatient_rate" />
</Field>
</FieldGroup>
<FieldGroup :column="2">
<Label>Fee Ranap</Label>
<Field>
<Input type="number" name="inPatient_rate" />
</Field>
</FieldGroup>
</Block>
<Block>
<FieldGroup :column="3">
<Label>Status</Label>
<Field>
<Input type="select" name="status">
<option value="active">Aktif</option>
<option value="inactive">Tidak Aktif</option>
</Input>
</Field>
</FieldGroup>
</Block>
<Block>
<FieldGroup :column="2">
<Label>Username</Label>
<Field>
<Input type="text" name="username" />
</Field>
</FieldGroup>
<FieldGroup :column="2">
<Label>Password</Label>
<Field>
<Input type="password" name="password" />
</Field>
</FieldGroup>
</Block>
</div>
</div>
<div class="my-2 flex justify-end py-2">
<PubNavFooterCsd />
</div>
</form>
</template>
+102
View File
@@ -0,0 +1,102 @@
import type { Col, KeyLabel, RecComponent, RecStrFuncComponent, RecStrFuncUnknown, Th } from '../../pub/nav/types'
import { defineAsyncComponent } from 'vue'
type SmallDetailDto = any
const action = defineAsyncComponent(() => import('~/components/pub/nav/dropdown-action-dud.vue'))
const doctorStatus = {
0: 'Tidak Aktif',
1: 'Aktif',
}
export const cols: Col[] = [
{ width: 100 },
{ width: 250 },
{},
{ width: 100 },
{ width: 100 },
{},
{},
{},
{ width: 100 },
{ width: 100 },
{ width: 100 },
{ width: 50 },
]
export const header: Th[][] = [
[
{ label: 'Kode JKN' },
{ label: 'Nama' },
{ label: 'No KTP' },
{ label: 'No SIP' },
{ label: 'No IHS' },
{ label: 'Telpon' },
{ label: 'Fee Ranap' },
{ label: 'Fee Rajal' },
{ label: 'Status' },
],
]
export const keys = [
'bpjs_code',
'name',
'identity_number',
'sip_no',
'ihs_number',
'phone',
'inPatient_itemPrice',
'outPatient_itemPrice',
'status',
'action',
]
export const delKeyNames: KeyLabel[] = [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
]
export const funcParsed: RecStrFuncUnknown = {
name: (rec: unknown): unknown => {
console.log(rec)
const recX = rec as SmallDetailDto
return `${recX.frontTitle} ${recX.name} ${recX.endTitle}`.trim()
},
identity_number: (rec: unknown): unknown => {
const recX = rec as SmallDetailDto
if (recX.identity_number?.substring(0, 5) === 'BLANK') {
return '(TANPA NIK)'
}
return recX.identity_number
},
inPatient_itemPrice: (rec: unknown): unknown => {
const recX = rec as SmallDetailDto
return Number(recX.inPatient_itemPrice.price).toLocaleString('id-ID')
},
outPatient_itemPrice: (rec: unknown): unknown => {
const recX = rec as SmallDetailDto
return Number(recX.outPatient_itemPrice.price).toLocaleString('id-ID')
},
status: (rec: unknown): unknown => {
const recX = rec as SmallDetailDto
return doctorStatus[recX.status_code as keyof typeof doctorStatus]
},
}
export const funcComponent: RecStrFuncComponent = {
action(rec, idx) {
const res: RecComponent = {
idx,
rec: rec as object,
component: action,
}
return res
},
}
export const funcHtml: RecStrFuncUnknown = {
patient_address(_rec) {
return '-'
},
}
+19
View File
@@ -0,0 +1,19 @@
<script setup lang="ts">
import { cols, funcComponent, funcHtml, funcParsed, header, keys } from './list-cfg'
defineProps<{
data: any[]
}>()
</script>
<template>
<PubBaseDataTable
:rows="data"
:cols="cols"
:header="header"
:keys="keys"
:func-parsed="funcParsed"
:func-html="funcHtml"
:func-component="funcComponent"
/>
</template>
+185
View File
@@ -0,0 +1,185 @@
<script setup lang="ts">
import { Activity, CreditCard, DollarSign, Users, UserCheck, UsersRound, Calendar, Hospital } from 'lucide-vue-next'
definePageMeta({
roles: ['sys', 'doc'],
})
const dataCard = ref({
totalRevenue: 0,
totalRevenueDesc: 0,
subscriptions: 0,
subscriptionsDesc: 0,
sales: 0,
salesDesc: 0,
activeNow: 0,
activeNowDesc: 0,
})
const dataRecentSales = [
{
name: 'Olivia Martin',
email: 'olivia.martin@email.com',
amount: 1999,
},
{
name: 'Jackson Lee',
email: 'jackson.lee@email.com',
amount: 39,
},
{
name: 'Isabella Nguyen',
email: 'isabella.nguyen@email.com',
amount: 299,
},
{
name: 'William Kim',
email: 'will@email.com',
amount: 99,
},
{
name: 'Sofia Davis',
email: 'sofia.davis@email.com',
amount: 39,
},
]
const summaryData: any[] = [
{
title: 'Total Pasien Hari Ini',
icon: UsersRound,
metric: 23,
trend: 15,
timeframe: 'daily',
},
{
title: 'Rehabilitasi Medik',
icon: UserCheck,
metric: 100,
trend: 9,
timeframe: 'daily',
},
{
title: 'VClaim BPJS',
icon: Calendar,
metric: 52,
trend: 1,
timeframe: 'daily',
},
{
title: 'SATUSEHAT Sync',
icon: Hospital,
metric: 71,
trend: -3,
timeframe: 'daily',
},
]
const linkItems = [
{
title: 'Daftar Pasien',
link: '/patient',
icon: 'i-lucide-users',
},
{
title: 'Rawat Jalan',
link: '/outpatient/registration-queue',
icon: 'i-lucide-stethoscope',
},
{
title: 'Rawat Inap',
link: '/outpatient/registration-queue',
icon: 'i-lucide-hospital',
},
{
title: 'Rehabilitasi',
link: '/patient',
icon: 'i-lucide-heart',
},
]
onMounted(() => {
dataCard.value = {
totalRevenue: 45231.89,
totalRevenueDesc: 20.1 / 100,
subscriptions: 2350,
subscriptionsDesc: 180.5 / 100,
sales: 12234,
salesDesc: 45 / 100,
activeNow: 573,
activeNowDesc: 201,
}
})
</script>
<template>
<div class="flex w-full flex-col gap-4">
<div class="mt-4 flex flex-wrap items-center justify-between gap-2">
<h2 class="text-2xl font-bold tracking-tight">Dashboard SIMRS</h2>
<div class="flex items-center gap-4 space-x-2">
<div class="bg-primary rounded-xl border p-1 text-white">Status: Aktif</div>
<Button class="bg-primary p-2 text-white" size="lg">
<Icon name="i-lucide-refresh-ccw" class="h-6 w-6" />
Sinkronisasi
</Button>
</div>
</div>
<main class="my-6 flex flex-1 flex-col gap-4 md:gap-8">
<div class="grid gap-4 md:grid-cols-2 md:gap-8 lg:grid-cols-4">
<PubBaseSummaryCard v-for="card in summaryData" :key="card.title" :stat="card" />
</div>
<div class="grid gap-4 md:gap-8 lg:grid-cols-1 xl:grid-cols-3">
<Card v-for="n in 3" :key="n">
<CardHeader>
<CardTitle>Recent Sales</CardTitle>
</CardHeader>
<CardContent class="grid gap-8">
<div v-for="recentSales in dataRecentSales" :key="recentSales.name" class="flex items-center gap-4">
<Avatar class="hidden h-9 w-9 sm:flex">
<AvatarFallback>{{
recentSales.name
.split(' ')
.map((n) => n[0])
.join('')
}}</AvatarFallback>
</Avatar>
<div class="grid gap-1">
<p class="text-sm font-medium leading-none">
{{ recentSales.name }}
</p>
<p class="text-muted-foreground text-sm">
{{ recentSales.email }}
</p>
</div>
<div class="ml-auto font-medium"></div>
</div>
</CardContent>
</Card>
</div>
<div>
<Card>
<CardHeader>
<div class="flex flex-wrap items-center gap-2">
<Icon name="i-lucide-activity" class="text-primary me-2 h-6 w-6" />
<h2 class="text-xl font-semibold tracking-tight">Aksi Cepat</h2>
</div>
</CardHeader>
<CardContent class="grid cursor-pointer gap-8 md:grid-cols-4 md:gap-8">
<Card
v-for="item in linkItems"
:key="item"
class="border-primary hover:bg-primary my-2 h-32 border transition-colors duration-200 hover:bg-gray-200"
>
<NuxtLink :to="item.link">
<CardContent class="my-2 grid h-full grid-rows-2 place-items-center">
<Icon :name="item.icon" class="text-primary h-9 w-[60px]" />
<h1>{{ item.title }}</h1>
</CardContent>
</NuxtLink>
</Card>
</CardContent>
</Card>
</div>
</main>
</div>
</template>
+6
View File
@@ -0,0 +1,6 @@
<script setup lang="ts">
</script>
<template>
<AppDoctorEntryForm />
</template>
+52
View File
@@ -0,0 +1,52 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '~/components/pub/nav/types'
const data = ref([])
const refSearchNav: RefSearchNav = {
onClick: () => {
// open filter modal
},
onInput: (_val: string) => {
// filter patient list
},
onClear: () => {
// clear url param
},
}
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const headerPrep: HeaderPrep = {
title: 'Dokter',
icon: 'i-lucide-network',
addNav: {
label: 'Tambah',
onClick: () => navigateTo('/doctor/add'),
},
}
useAsyncData('getDoctor', () => xfetch('/api/v1/doctor'), { server: false, immediate: true })
async function getDoctorList() {
const resp = await xfetch('/api/v1/doctor')
if (resp.success) {
data.value = (resp.body as Record<string, any>).data
}
}
onMounted(() => {
getDoctorList()
})
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
</script>
<template>
<PubNavHeaderPrep :prep="{ ...headerPrep }" :ref-search-nav="refSearchNav" />
<AppDoctorList :data="data" />
</template>
+10 -20
View File
@@ -12,12 +12,12 @@ const teams: {
logo: string
plan: string
}[] = [
{
name: 'SIMRS - RSSA',
logo: '/rssa-logo.png',
plan: 'Saiful Anwar Hospital',
},
]
{
name: 'SIMRS - RSSA',
logo: '/rssa-logo.png',
plan: 'Saiful Anwar Hospital',
},
]
const sidebar = {
collapsible: 'offcanvas', // 'offcanvas' | 'icon' | 'none'
side: 'left', // 'left' | 'right'
@@ -59,13 +59,8 @@ async function setMenu() {
<SidebarGroupLabel>
{{ navMenu.heading }}
</SidebarGroupLabel>
<component
:is="resolveNavItemComponent(item)"
v-for="(item, index) in navMenu.items"
:key="index"
:item="item"
class="my-2 mb-2"
/>
<component :is="resolveNavItemComponent(item)" v-for="(item, index) in navMenu.items" :key="index" :item="item"
class="my-2 mb-2" />
</SidebarGroup>
<template v-else>
<div class="p-5">
@@ -73,13 +68,8 @@ async function setMenu() {
</div>
</template>
<SidebarGroup class="mt-auto">
<component
:is="resolveNavItemComponent(item)"
v-for="(item, index) in navMenuBottom"
:key="index"
:item="item"
size="sm"
/>
<component :is="resolveNavItemComponent(item)" v-for="(item, index) in navMenuBottom" :key="index" :item="item"
size="sm" />
</SidebarGroup>
</SidebarContent>
<SidebarFooter>
+2 -2
View File
@@ -44,10 +44,10 @@ const isTrending = computed<boolean>(() => (props.stat?.trend ?? 0) > 0)
<Skeleton v-if="props.stat?.trend" class="h-4 w-64 bg-gray-100 text-xs font-medium" />
</CardContent>
</Card>
<Card v-else-if="props.stat && !props.isSkeleton">
<Card v-else-if="props.stat && !props.isSkeleton" class="h-42">
<CardHeader class="flex flex-row items-center justify-between pb-2">
<CardTitle class="text-sm font-medium"> {{ props.stat.title }} </CardTitle>
<component :is="props.stat.icon" class="text-muted-foreground h-4 w-4" />
<component :is="props.stat.icon" class="bg-primary h-[40px] w-auto rounded-md p-2 text-white" />
</CardHeader>
<CardContent>
<div class="text-2xl font-bold">