feat (encounter): add small entry form for sep

This commit is contained in:
Abizrh
2025-09-23 21:15:59 +07:00
parent 4a480548df
commit 03697f9cea
6 changed files with 308 additions and 7 deletions

No files matched your search

@@ -1,9 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/base/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
roles: ['sys', 'doc'],
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Tambah Kunjungan',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
if (!hasAccess) {
throw createError({
statusCode: 403,
statusMessage: 'Access denied',
})
}
// Define permission-based computed properties
const canCreate = hasCreateAccess(roleAccess)
</script>
<template>
<div>detail pasien</div>
<div v-if="canCreate">
<ContentEncounterEntry :id="1" form-type="Detail" />
</div>
<Error v-else :status-code="403" />
</template>
@@ -1,9 +1,41 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/base/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
roles: ['sys', 'doc'],
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Tambah Kunjungan',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
if (!hasAccess) {
throw createError({
statusCode: 403,
statusMessage: 'Access denied',
})
}
// Define permission-based computed properties
const canCreate = hasCreateAccess(roleAccess)
</script>
<template>
<div>edit pasien</div>
<div v-if="canCreate">
<ContentEncounterEntry :id="1" form-type="Edit" />
</div>
<Error v-else :status-code="403" />
</template>
+1 -1
View File
@@ -35,7 +35,7 @@ const canCreate = hasCreateAccess(roleAccess)
<template>
<div v-if="canCreate">
<ContentEncounterEntry />
<ContentEncounterEntry form-type="Tambah" />
</div>
<Error v-else :status-code="403" />
</template>