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

This commit is contained in:
Abizrh
2025-11-21 14:14:53 +07:00
64 changed files with 900 additions and 412 deletions
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [division, divisionAttrs] = defineField('division_id')
const [division, divisionAttrs] = defineField('division_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed<string>({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.division_id !== undefined)
division.value = props.values.division_id ? Number(props.values.division_id) : null
if (props.values.division_code !== undefined)
division.value = props.values.division_code ? String(props.values.division_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -72,7 +72,7 @@ if (props.values) {
const resetForm = () => {
code.value = ''
name.value = ''
division.value = null
division.value = ''
employee.value = null
headStatus.value = false
}
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
division_id: division.value || null,
division_code: division.value || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
</Cell>
<Cell>
<Label height="compact">Posisi Divisi</Label>
<Field :errMessage="errors.division_id">
<Field :errMessage="errors.division_code">
<Combobox
id="division"
v-model="division"
@@ -18,7 +18,7 @@ import { genDivisionPosition } from '~/models/division-position'
interface Props {
schema: z.ZodSchema<any>
divisionId: number
divisionId: string
employees: any[]
values: any
isLoading?: boolean
+6 -6
View File
@@ -36,25 +36,25 @@ const { defineField, errors, meta } = useForm({
initialValues: {
code: '',
name: '',
parent_id: null,
parent_code: null,
} as Partial<DivisionFormData>,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [parent, parentAttrs] = defineField('parent_id')
const [parent, parentAttrs] = defineField('parent_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.parent_id !== undefined) parent.value = String(props.values.parent_id)
if (props.values.parent_code !== undefined) parent.value = String(props.values.parent_code)
}
const resetForm = () => {
code.value = ''
name.value = ''
parent.value = null
parent.value = ''
}
// Form submission handler
@@ -63,7 +63,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
parent_id: parent.value || null,
parent_code: parent.value || '',
}
emit('submit', formData, resetForm)
}
@@ -108,7 +108,7 @@ function onCancelForm() {
</Cell>
<Cell>
<Label height="compact">Divisi Induk</Label>
<Field :errMessage="errors.parent_id">
<Field :errMessage="errors.parent_code">
<TreeSelect
id="parent"
v-model="parent"
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [installation, installationAttrs] = defineField('installation_id')
const [installation, installationAttrs] = defineField('installation_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed<string>({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.installation_id !== undefined)
installation.value = props.values.installation_id ? Number(props.values.installation_id) : null
if (props.values.installation_code !== undefined)
installation.value = props.values.installation_code ? String(props.values.installation_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
installation_id: installation.value || null,
installation_code: String(installation.value) || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
</Cell>
<Cell>
<Label height="compact">Instalasi</Label>
<Field :errMessage="errors.installation_id">
<Field :errMessage="errors.installation_code">
<Combobox
id="installation"
v-model="installation"
@@ -18,7 +18,7 @@ import { genSpecialistPosition } from '~/models/specialist-position'
interface Props {
schema: z.ZodSchema<any>
specialistId: number
specialistId: string
employees: any[]
values: any
isLoading?: boolean
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [specialist, specialistAttrs] = defineField('specialist_id')
const [specialist, specialistAttrs] = defineField('specialist_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed<string>({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.specialist_id !== undefined)
specialist.value = props.values.specialist_id ? Number(props.values.specialist_id) : null
if (props.values.specialist_code !== undefined)
specialist.value = props.values.specialist_code ? String(props.values.specialist_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -72,7 +72,7 @@ if (props.values) {
const resetForm = () => {
code.value = ''
name.value = ''
specialist.value = null
specialist.value = ''
employee.value = null
headStatus.value = false
}
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
specialist_id: specialist.value || null,
specialist_code: specialist.value || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
</Cell>
<Cell>
<Label height="compact">Spesialis</Label>
<Field :errMessage="errors.specialist_id">
<Field :errMessage="errors.specialist_code">
<Combobox
id="specialist"
v-model="specialist"
+4 -4
View File
@@ -36,19 +36,19 @@ const { defineField, errors, meta } = useForm({
initialValues: {
code: '',
name: '',
unit_id: 0,
unit_code: '',
} as Partial<SpecialistFormData>,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [unit, unitAttrs] = defineField('unit_id')
const [unit, unitAttrs] = defineField('unit_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.unit_id !== undefined) unit.value = props.values.unit_id ? String(props.values.unit_id) : null
if (props.values.unit_code !== undefined) unit.value = props.values.unit_code ? String(props.values.unit_code) : null
}
const resetForm = () => {
@@ -63,7 +63,7 @@ function onSubmitForm(values: any) {
...genBase(),
name: name.value || '',
code: code.value || '',
unit_id: unit.value ? Number(unit.value) : null,
unit_code: unit.value ? String(unit.value) : null,
}
emit('submit', formData, resetForm)
}
@@ -18,7 +18,7 @@ import { genSubSpecialistPosition } from '~/models/subspecialist-position'
interface Props {
schema: z.ZodSchema<any>
subspecialistId: number
subspecialistId: string
employees: any[]
values: any
isLoading?: boolean
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [subSpecialist, subSpecialistAttrs] = defineField('subspecialist_id')
const [subSpecialist, subSpecialistAttrs] = defineField('subspecialist_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,8 +62,8 @@ const headStatusStr = computed<string>({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.subspecialist_id !== undefined)
subSpecialist.value = props.values.subspecialist_id ? Number(props.values.subspecialist_id) : null
if (props.values.subspecialist_code !== undefined)
subSpecialist.value = props.values.subspecialist_code ? String(props.values.subspecialist_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -83,7 +83,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
subspecialist_id: subSpecialist.value || null,
subspecialist_code: subSpecialist.value || null,
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -130,7 +130,7 @@ function onCancelForm() {
</Cell>
<Cell>
<Label height="compact">Sub Spesialis</Label>
<Field :errMessage="errors.subspecialist_id">
<Field :errMessage="errors.subspecialist_code">
<Combobox
id="specialist"
v-model="subSpecialist"
@@ -36,20 +36,20 @@ const { defineField, errors, meta } = useForm({
initialValues: {
code: '',
name: '',
specialist_id: 0,
specialist_code: '',
} as Partial<SubspecialistFormData>,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [specialist, specialistAttrs] = defineField('specialist_id')
const [specialist, specialistAttrs] = defineField('specialist_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.specialist_id !== undefined)
specialist.value = props.values.specialist_id ? String(props.values.specialist_id) : null
if (props.values.specialist_code !== undefined)
specialist.value = props.values.specialist_code ? String(props.values.specialist_code) : null
}
const resetForm = () => {
@@ -64,7 +64,7 @@ function onSubmitForm(values: any) {
...genBase(),
name: name.value || '',
code: code.value || '',
specialist_id: specialist.value ? Number(specialist.value) : null,
specialist_code: specialist.value ? String(specialist.value) : "",
}
emit('submit', formData, resetForm)
}
@@ -1,192 +0,0 @@
<script setup lang="ts">
// Components
import Block from '~/components/pub/my-ui/doc-entry/block.vue'
import Cell from '~/components/pub/my-ui/doc-entry/cell.vue'
import Field from '~/components/pub/my-ui/doc-entry/field.vue'
import Label from '~/components/pub/my-ui/doc-entry/label.vue'
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
// Types
import type { UnitPositionFormData } from '~/schemas/unit-position.schema'
// Helpers
import type z from 'zod'
import { toTypedSchema } from '@vee-validate/zod'
import { useForm } from 'vee-validate'
import { genBase } from '~/models/_base'
import { genUnitPosition } from '~/models/unit-position'
interface Props {
schema: z.ZodSchema<any>
unitId: number
employees: any[]
values: any
isLoading?: boolean
isReadonly?: boolean
}
const props = defineProps<Props>()
const isLoading = props.isLoading !== undefined ? props.isLoading : false
const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false
const emit = defineEmits<{
submit: [values: UnitPositionFormData, resetForm: () => void]
cancel: [resetForm: () => void]
}>()
const { defineField, errors, meta } = useForm({
validationSchema: toTypedSchema(props.schema),
initialValues: genUnitPosition() as Partial<UnitPositionFormData>,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
// RadioGroup uses string values; expose a string computed that maps to the boolean field
const headStatusStr = computed<string>({
get() {
if (headStatus.value === true) return 'true'
if (headStatus.value === false) return 'false'
return ''
},
set(v: string) {
if (v === 'true') headStatus.value = true
else if (v === 'false') headStatus.value = false
else headStatus.value = undefined
},
})
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
}
const resetForm = () => {
code.value = ''
name.value = ''
employee.value = null
headStatus.value = false
}
// Form submission handler
function onSubmitForm() {
const formData: UnitPositionFormData = {
...genBase(),
name: name.value || '',
code: code.value || '',
// readonly based on detail unit
unit_id: props.unitId,
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
emit('submit', formData, resetForm)
}
// Form cancel handler
function onCancelForm() {
emit('cancel', resetForm)
}
</script>
<template>
<form
id="form-unit-position"
@submit.prevent
>
<Block
labelSize="thin"
class="!mb-2.5 !pt-0 xl:!mb-3"
:colCount="1"
>
<Cell>
<Label height="compact">Kode Jabatan</Label>
<Field :errMessage="errors.code">
<Input
id="code"
v-model="code"
v-bind="codeAttrs"
:disabled="isLoading || isReadonly"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">Nama Jabatan</Label>
<Field :errMessage="errors.name">
<Input
id="name"
v-model="name"
v-bind="nameAttrs"
:disabled="isLoading || isReadonly"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">Pengisi Jabatan</Label>
<Field :errMessage="errors.employee_id">
<Combobox
id="employee"
v-model="employee"
v-bind="employeeAttrs"
:items="employees"
:is-disabled="isLoading || isReadonly"
placeholder="Pilih Karyawan"
search-placeholder="Cari Karyawan"
empty-message="Item tidak ditemukan"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">Status Kepala</Label>
<Field :errMessage="errors.headStatus">
<RadioGroup
v-model="headStatusStr"
v-bind="headStatusAttrs"
class="flex gap-4"
>
<div class="flex items-center space-x-2">
<RadioGroupItem
id="head-yes"
value="true"
/>
<Label for="head-yes">Ya</Label>
</div>
<div class="flex items-center space-x-2">
<RadioGroupItem
id="head-no"
value="false"
/>
<Label for="head-no">Tidak</Label>
</div>
</RadioGroup>
</Field>
</Cell>
</Block>
<div class="my-2 flex justify-end gap-2 py-2">
<Button
type="button"
variant="secondary"
class="w-[120px]"
@click="onCancelForm"
>
Kembali
</Button>
<Button
v-if="!isReadonly"
type="button"
class="w-[120px]"
:disabled="isLoading || !meta.valid"
@click="onSubmitForm"
>
Simpan
</Button>
</div>
</form>
</template>
@@ -40,7 +40,7 @@ const { defineField, errors, meta } = useForm({
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [unit, unitAttrs] = defineField('unit_id')
const [unit, unitAttrs] = defineField('unit_code')
const [employee, employeeAttrs] = defineField('employee_id')
const [headStatus, headStatusAttrs] = defineField('headStatus')
@@ -62,7 +62,7 @@ const headStatusStr = computed<string>({
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.unit_id !== undefined) unit.value = props.values.unit_id ? Number(props.values.unit_id) : null
if (props.values.unit_code !== undefined) unit.value = props.values.unit_code ? String(props.values.unit_code) : null
if (props.values.employee_id !== undefined)
employee.value = props.values.employee_id ? Number(props.values.employee_id) : null
if (props.values.headStatus !== undefined) headStatus.value = !!props.values.headStatus
@@ -82,7 +82,7 @@ function onSubmitForm() {
...genBase(),
name: name.value || '',
code: code.value || '',
unit_id: unit.value || null,
unit_code: unit.value || '',
employee_id: employee.value || null,
headStatus: headStatus.value !== undefined ? headStatus.value : undefined,
}
@@ -129,7 +129,7 @@ function onCancelForm() {
</Cell>
<Cell>
<Label height="compact">Unit</Label>
<Field :errMessage="errors.unit_id">
<Field :errMessage="errors.unit_code">
<Combobox
id="unit"
v-model="unit"
+5 -5
View File
@@ -35,20 +35,20 @@ const { defineField, errors, meta } = useForm({
initialValues: {
code: '',
name: '',
installation_id: 0,
installation_code: '',
} as Partial<UnitFormData>,
})
const [code, codeAttrs] = defineField('code')
const [name, nameAttrs] = defineField('name')
const [installation, installationAttrs] = defineField('installation_id')
const [installation, installationAttrs] = defineField('installation_code')
// Fill fields from props.values if provided
if (props.values) {
if (props.values.code !== undefined) code.value = props.values.code
if (props.values.name !== undefined) name.value = props.values.name
if (props.values.installation_id !== undefined)
installation.value = props.values.installation_id ? Number(props.values.installation_id) : null
if (props.values.installation_code !== undefined)
installation.value = props.values.installation_code ? String(props.values.installation_code) : null
}
const resetForm = () => {
@@ -62,7 +62,7 @@ function onSubmitForm() {
const formData: UnitFormData = {
name: name.value || '',
code: code.value || '',
installation_id: installation.value ? Number(installation.value) : null,
installation_code: installation.value ? String(installation.value) : "",
}
emit('submit', formData, resetForm)
}
@@ -105,12 +105,12 @@ const getCurrentDivisionDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
getCurrentDivisionDetail(recId.value)
getCurrentDivisionDetail(recItem.value.code)
title.value = 'Detail Divisi Position'
isReadonly.value = true
break
case ActionEvents.showEdit:
getCurrentDivisionDetail(recId.value)
getCurrentDivisionDetail(recItem.value.code)
title.value = 'Edit Divisi Position'
isReadonly.value = false
break
@@ -122,7 +122,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
divisions.value = await getDivisionLabelList({ sort: 'createdAt:asc', 'page-size': 100 })
divisions.value = await getDivisionLabelList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
await getDivisionList()
} catch (err) {
@@ -172,9 +172,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: DivisionPositionFormData | Record<string, any>, resetForm: () => void) => {
console.log(values)
if (recId > 0) {
handleActionEdit(recId, values, getDivisionList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getDivisionList, resetForm, toast)
return
}
handleActionSave(values, getDivisionList, resetForm, toast)
@@ -189,7 +188,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getDivisionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getDivisionList, toast)"
@cancel=""
>
<template #default="{ record }">
+5 -5
View File
@@ -47,7 +47,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
divisionId: number
divisionId: string
}>()
const division = ref<Division>({} as Division)
// #endregion
@@ -152,7 +152,7 @@ watch([recId, recAction], () => {
console.log(recId, recAction)
switch (recAction.value) {
case ActionEvents.showEdit:
getDetailDivisionPosition(recId.value)
getDetailDivisionPosition(recItem.value.code)
title.value = 'Edit Jabatan'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -201,8 +201,8 @@ watch([recId, recAction], () => {
@submit="
(values: DivisionPositionFormData | Record<string, any>, resetForm: () => void) => {
console.log(values)
if (recId > 0) {
handleActionEdit(recId, values, getDivisionPositionList, onResetState, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getDivisionPositionList, onResetState, toast)
return
}
handleActionSave(values, getDivisionPositionList, onResetState, toast)
@@ -215,7 +215,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getDivisionPositionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getDivisionPositionList, toast)"
@cancel=""
>
<template #default="{ record }">
+13 -16
View File
@@ -105,26 +105,23 @@ const getCurrentDivisionDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
if (Number(recId.value) > 0) {
const id = Number(recId.value)
if (recItem.value.code.length > 0) {
navigateTo({
name: 'org-src-division-id',
params: {
id: recItem.value.code,
},
})
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
navigateTo({
name: 'org-src-division-id',
params: {
id,
},
})
}
break
case ActionEvents.showEdit:
getCurrentDivisionDetail(recId.value)
getCurrentDivisionDetail(recItem.value.code)
title.value = 'Edit Divisi'
isReadonly.value = false
break
@@ -146,7 +143,7 @@ watch(
if (result.success) {
const currentData = result.body.data || []
const normalizedData = currentData.filter((division: Division) => !division.parent_id)
divisionsTrees.value = getValueTreeItems(normalizedData)
divisionsTrees.value = getValueTreeItems(normalizedData, true)
}
},
)
@@ -190,9 +187,9 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: DivisionFormData | Record<string, any>, resetForm: () => void) => {
console.log(values)
if (recId > 0) {
handleActionEdit(recId, values, getDivisionList, resetForm, toast)
// console.log(values)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getDivisionList, resetForm, toast)
return
}
handleActionSave(values, getDivisionList, resetForm, toast)
@@ -207,7 +204,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getDivisionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getDivisionList, toast)"
@cancel=""
>
<template #default="{ record }">
@@ -87,8 +87,6 @@ const tabs: TabItem[] = [
{ value: 'mcu-result', label: 'Hasil Penunjang' },
{ value: 'consultation', label: 'Konsultasi', component: Consultation, props: { encounter: data } },
{ value: 'resume', label: 'Resume', component: ResumeList, props: { encounter: data } },
{ value: 'control', label: 'Surat Kontrol' },
{ value: 'resume', label: 'Resume' },
{ value: 'control', label: 'Surat Kontrol', component: ControlLetterList, props: { encounter: data } },
{ value: 'screening', label: 'Skrinning MPP' },
{
@@ -108,7 +108,7 @@ watch([recId, recAction], () => {
isReadonly.value = true
break
case ActionEvents.showEdit:
getCurrentInstallationDetail(recId.value)
getCurrentInstallationDetail(recItem.value.code)
title.value = 'Edit Instalasi - Posisi'
isReadonly.value = false
break
@@ -120,7 +120,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
installations.value = await getInstallationLabelList({ sort: 'createdAt:asc', 'page-size': 100 })
installations.value = await getInstallationLabelList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -169,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: InstallationPositionFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getInstallationPositionList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getInstallationPositionList, resetForm, toast)
return
}
handleActionSave(values, getInstallationPositionList, resetForm, toast)
@@ -185,7 +185,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getInstallationPositionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getInstallationPositionList, toast)"
@cancel=""
>
<template #default="{ record }">
@@ -47,7 +47,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
installationId: number
installationId: string
}>()
const installation = ref<Installation>({} as Installation)
// #endregion
@@ -153,7 +153,7 @@ watch([recId, recAction], () => {
console.log(recId, recAction)
switch (recAction.value) {
case ActionEvents.showEdit:
getDetailInstallationPosition(recId.value)
getDetailInstallationPosition(recItem.value.code)
title.value = 'Edit Jabatan'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -202,8 +202,8 @@ watch([recId, recAction], () => {
@submit="
(values: InstallationPositionFormData | Record<string, any>, resetForm: () => void) => {
console.log(values)
if (recId > 0) {
handleActionEdit(recId, values, getInstallationPositionList, onResetState, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getInstallationPositionList, onResetState, toast)
return
}
handleActionSave(values, getInstallationPositionList, onResetState, toast)
@@ -216,7 +216,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getInstallationPositionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getInstallationPositionList, toast)"
@cancel=""
>
<template #default="{ record }">
+11 -14
View File
@@ -102,26 +102,23 @@ const getCurrentInstallationDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
if (Number(recId.value) > 0) {
const id = Number(recId.value)
if (recItem.value.code.length > 0) {
navigateTo({
name: 'org-src-installation-id',
params: {
id: recItem.value.code,
},
})
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
navigateTo({
name: 'org-src-installation-id',
params: {
id,
},
})
}
break
case ActionEvents.showEdit:
getCurrentInstallationDetail(recId.value)
getCurrentInstallationDetail(recItem.value.code)
title.value = 'Edit Instalasi'
isReadonly.value = false
break
@@ -171,8 +168,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: InstallationFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getInstallationList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getInstallationList, resetForm, toast)
return
}
handleActionSave(values, getInstallationList, resetForm, toast)
@@ -187,7 +184,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getInstallationList, toast)"
@confirm="() => handleActionRemove(recItem.code, getInstallationList, toast)"
@cancel=""
>
<template #default="{ record }">
@@ -105,12 +105,12 @@ const getCurrentSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
getCurrentSpecialistDetail(recId.value)
getCurrentSpecialistDetail(recItem.value.code)
title.value = 'Detail Spesialis Posisi'
isReadonly.value = true
break
case ActionEvents.showEdit:
getCurrentSpecialistDetail(recId.value)
getCurrentSpecialistDetail(recItem.value.code)
title.value = 'Edit Spesialis Posisi'
isReadonly.value = false
break
@@ -122,7 +122,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
specialists.value = await getValueLabelSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 })
specialists.value = await getValueLabelSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -169,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SpecialistPositionFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getSpecialistList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getSpecialistList, resetForm, toast)
return
}
handleActionSave(values, getSpecialistList, resetForm, toast)
@@ -184,7 +184,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getSpecialistList, toast)"
@confirm="() => handleActionRemove(recItem.code, getSpecialistList, toast)"
@cancel=""
>
<template #default="{ record }">
+5 -5
View File
@@ -48,7 +48,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
specialistId: number
specialistId: string
}>()
const specialist = ref<Specialist>({} as Specialist)
// #endregion
@@ -154,7 +154,7 @@ provide('table_data_loader', isLoading)
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showEdit:
getDetailSpecialistPosition(recId.value)
getDetailSpecialistPosition(recItem.value.code)
title.value = 'Edit Posisi'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -203,8 +203,8 @@ watch([recId, recAction], () => {
@submit="
(values: SpecialistPositionFormData | Record<string, any>, resetForm: () => void) => {
console.log(values)
if (recId > 0) {
handleActionEdit(recId, values, getPositionList, onResetState, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getPositionList, onResetState, toast)
return
}
handleActionSave(values, getPositionList, onResetState, toast)
@@ -217,7 +217,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getPositionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getPositionList, toast)"
@cancel=""
>
<template #default="{ record }">
+12 -15
View File
@@ -103,26 +103,23 @@ const getCurrentSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
if (Number(recId.value) > 0) {
const id = Number(recId.value)
if (recItem.value.code.length > 0) {
navigateTo({
name: 'org-src-specialist-id',
params: {
id: recItem.value.code,
},
})
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
navigateTo({
name: 'org-src-specialist-id',
params: {
id,
},
})
}
break
case ActionEvents.showEdit:
getCurrentSpecialistDetail(recId.value)
getCurrentSpecialistDetail(recItem.value.code)
title.value = 'Edit Spesialis'
isReadonly.value = false
break
@@ -133,7 +130,7 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
units.value = await getUnitList()
units.value = await getUnitList({}, true)
await getSpecialistList()
})
</script>
@@ -172,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SpecialistFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getSpecialistList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getSpecialistList, resetForm, toast)
return
}
handleActionSave(values, getSpecialistList, resetForm, toast)
@@ -188,7 +185,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getSpecialistList, toast)"
@confirm="() => handleActionRemove(recItem.code, getSpecialistList, toast)"
@cancel=""
>
<template #default="{ record }">
@@ -110,12 +110,12 @@ const getCurrentSubSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
getCurrentSubSpecialistDetail(recId.value)
getCurrentSubSpecialistDetail(recItem.value.code)
title.value = 'Detail Sub Spesialis Posisi'
isReadonly.value = true
break
case ActionEvents.showEdit:
getCurrentSubSpecialistDetail(recId.value)
getCurrentSubSpecialistDetail(recItem.value.code)
title.value = 'Edit Sub Spesialis Posisi'
isReadonly.value = false
break
@@ -127,7 +127,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
subSpecialists.value = await getValueLabelSubSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 })
subSpecialists.value = await getValueLabelSubSpecialistList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -176,8 +176,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SubSpecialistPositionFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getSubSpecialistList, onResetState, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getSubSpecialistList, onResetState, toast)
return
}
handleActionSave(values, getSubSpecialistList, onResetState, toast)
@@ -192,7 +192,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getSubSpecialistList, toast)"
@confirm="() => handleActionRemove(recItem.code, getSubSpecialistList, toast)"
@cancel=""
>
<template #default="{ record }">
@@ -51,7 +51,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
subspecialistId: number
subspecialistId: string
}>()
const subSpecialist = ref<Subspecialist>({} as Subspecialist)
// #endregion
@@ -157,7 +157,7 @@ provide('table_data_loader', isLoading)
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showEdit:
getDetailSubSpecialistPosition(recId.value)
getDetailSubSpecialistPosition(recItem.value.code)
title.value = 'Edit Posisi'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -206,8 +206,8 @@ watch([recId, recAction], () => {
@submit="
(values: SubSpecialistPositionFormData | Record<string, any>, resetForm: () => void) => {
console.log(values)
if (recId > 0) {
handleActionEdit(recId, values, getPositionList, onResetState, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getPositionList, onResetState, toast)
return
}
handleActionSave(values, getPositionList, onResetState, toast)
@@ -220,7 +220,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getPositionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getPositionList, toast)"
@cancel=""
>
<template #default="{ record }">
+12 -15
View File
@@ -103,26 +103,23 @@ const getCurrentSubSpecialistDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
if (Number(recId.value) > 0) {
const id = Number(recId.value)
if (recItem.value.code.length > 0) {
navigateTo({
name: 'org-src-subspecialist-id',
params: {
id: recItem.value.code,
},
})
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
navigateTo({
name: 'org-src-subspecialist-id',
params: {
id,
},
})
}
break
case ActionEvents.showEdit:
getCurrentSubSpecialistDetail(recId.value)
getCurrentSubSpecialistDetail(recItem.value.code)
title.value = 'Edit Sub Spesialis'
isReadonly.value = false
break
@@ -133,7 +130,7 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
specialists.value = await getSpecialistsList()
specialists.value = await getSpecialistsList({}, true)
await getSubSpecialistList()
})
</script>
@@ -172,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: SubspecialistFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getSubSpecialistList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getSubSpecialistList, resetForm, toast)
return
}
handleActionSave(values, getSubSpecialistList, resetForm, toast)
@@ -188,7 +185,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getSubSpecialistList, toast)"
@confirm="() => handleActionRemove(recItem.code, getSubSpecialistList, toast)"
@cancel=""
>
<template #default="{ record }">
@@ -106,12 +106,12 @@ const getCurrentUnitDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
getCurrentUnitDetail(recId.value)
getCurrentUnitDetail(recItem.value.code)
title.value = 'Detail Unit Posisi'
isReadonly.value = true
break
case ActionEvents.showEdit:
getCurrentUnitDetail(recId.value)
getCurrentUnitDetail(recItem.value.code)
title.value = 'Edit Unit Posisi'
isReadonly.value = false
break
@@ -123,7 +123,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
units.value = await getValueLabelUnitList({ sort: 'createdAt:asc', 'page-size': 100 })
units.value = await getValueLabelUnitList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -172,8 +172,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: UnitPositionFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getListUnit, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getListUnit, resetForm, toast)
return
}
handleActionSave(values, getListUnit, resetForm, toast)
@@ -187,7 +187,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getListUnit, toast)"
@confirm="() => handleActionRemove(recItem.code, getListUnit, toast)"
@cancel=""
>
<template #default="{ record }">
+5 -5
View File
@@ -47,7 +47,7 @@ const title = ref('')
// #region Props & Emits
const props = defineProps<{
unitId: number
unitId: string
}>()
const unit = ref<Unit>({} as Unit)
// #endregion
@@ -152,7 +152,7 @@ watch([recId, recAction], () => {
console.log(recId, recAction)
switch (recAction.value) {
case ActionEvents.showEdit:
getDetailUnitPosition(recId.value)
getDetailUnitPosition(recItem.value.code)
title.value = 'Edit Posisi'
isReadonly.value = false
isFormEntryDialogOpen.value = true
@@ -201,8 +201,8 @@ watch([recId, recAction], () => {
@submit="
(values: UnitPositionFormData | Record<string, any>, resetForm: () => void) => {
console.log(values)
if (recId > 0) {
handleActionEdit(recId, values, getPositionList, onResetState, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getPositionList, onResetState, toast)
return
}
handleActionSave(values, getPositionList, onResetState, toast)
@@ -215,7 +215,7 @@ watch([recId, recAction], () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getPositionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getPositionList, toast)"
@cancel=""
>
<template #default="{ record }">
+12 -16
View File
@@ -103,26 +103,22 @@ const getCurrentUnitDetail = async (id: number | string) => {
watch([recId, recAction], () => {
switch (recAction.value) {
case ActionEvents.showDetail:
if (Number(recId.value) > 0) {
const id = Number(recId.value)
if (recItem.value.code.length > 0) {
navigateTo({
name: 'org-src-unit-id',
params: {
id: recItem.value.code,
},
})
recAction.value = ''
recItem.value = null
recId.value = 0
isFormEntryDialogOpen.value = false
isReadonly.value = false
navigateTo({
name: 'org-src-unit-id',
params: {
id,
},
})
}
break
case ActionEvents.showEdit:
getCurrentUnitDetail(recId.value)
getCurrentUnitDetail(recItem.value.code)
title.value = 'Edit Unit'
isReadonly.value = false
break
@@ -133,7 +129,7 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
installations.value = await getInstallationList()
installations.value = await getInstallationList({}, true)
await getUnitList()
})
</script>
@@ -172,8 +168,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: UnitFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getUnitList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getUnitList, resetForm, toast)
return
}
handleActionSave(values, getUnitList, resetForm, toast)
@@ -188,7 +184,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getUnitList, toast)"
@confirm="() => handleActionRemove(recItem.code, getUnitList, toast)"
@cancel=""
>
<template #default="{ record }">
@@ -22,7 +22,7 @@ const selected = ref<any[]>([])
function toggleSelection(row: any, event?: Event) {
if (event) event.stopPropagation() // cegah event bubble ke TableRow
const isMultiple = props.selectMode === 'multiple' // props.selectMode === 'multi' ||
const isMultiple = props.selectMode === 'multiple' // props.selectMode === 'multi' ||
// gunakan pembanding berdasarkan id atau stringify data
const findIndex = selected.value.findIndex((r) => JSON.stringify(r) === JSON.stringify(row))
@@ -85,7 +85,7 @@ function handleActionCellClick(event: Event, _cellRef: string) {
v-for="(th, idx) in headers[hrIdx]"
:key="`head-${idx}`"
:class="`border ${th.classVal || ''}`"
:style="{ width: cols[idx]?.width ? `${cols[idx].width}px` : undefined }"
:style="{ width: cols[idx]?.width ? `${cols[idx].width}${cols[idx].widthUnit ?? 'px'}` : '' }"
>
{{ th.label }}
</TableHead>
@@ -128,7 +128,7 @@ function handleActionCellClick(event: Event, _cellRef: string) {
'bg-green-50':
props.selectMode === 'single' && selected.some((r) => JSON.stringify(r) === JSON.stringify(row)),
'bg-blue-50':
(props.selectMode === 'multiple') && // props.selectMode === 'multi' ||
(props.selectMode === 'multiple') && // props.selectMode === 'multi' ||
selected.some((r) => JSON.stringify(r) === JSON.stringify(row)),
}"
@click="toggleSelection(row)"
+6
View File
@@ -42,6 +42,12 @@ export interface RefSearchNav {
onClear: () => void
}
export interface RefExportNav {
onExportPdf?: () => void
onExportCsv?: () => void
onExportExcel?: () => void
}
// prepared header for relatively common usage
export interface HeaderPrep {
title?: string
+226
View File
@@ -0,0 +1,226 @@
export type SubjectCode = 'detail' | 'pri-complain' | 'sec-complain' | 'cur-disea-hist' | 'pas-disea-hist' | 'fam-disea-hist' | 'alg-hist' | 'alg-react' | 'med-hist' | 'blood-type'
export type ObjectCode = 'detail' | 'consc-level' | 'consc-level-det' | 'syst-bp' | 'diast-bp' | 'pulse' | 'resp-rate' | 'hear-rt' | 'neuro-cranialis' | 'sensoris' | 'reflect-fisio' | 'reflect-pato' | 'autonom-neuron' | 'neck-rom' | 'body-rom' | 'aga-rom' | 'agb-rom' | 'neck-mmt' | 'body-mmt' | 'aga-mmt' | 'agb-mmt' | 'localis' | 'medical-trouble' | 'rehab-medic-trouble' | 'temp' | 'spo2' | 'weight' | 'height' | 'head-to-toe'
export type AssessmentCode = 'detail' | 'early-med-diag' | 'late-med-diag' | 'sec-med-diag' | 'early-func-diag' | 'late-func-diag' | 'sec-func-diag' | 'patient-dev'
export type PlanCode = 'detail' | 'plan'
export type InstructionCode = 'detail' | 'medical-act' | 'supporting-exam' | 'therapy' | 'medication' | 'material' | 'rehab-program' | 'physic-modal' | 'exercise' | 'ortes-protesa' | 'education' | 'other'
export type HeadToToeCode = 'head' | 'eye' | 'ear' | 'nose' | 'mouth-throat' | 'head-others' | 'thorax' | 'heart' | 'lung' | 'abdomen' | 'liver' | 'back' | 'ekstremitas' | 'gender' | 'rectum' | 'neuron' | 'body-others'
export type McuUrgencyLevelCode = 'cito' | 'cito-igd' | 'ponek' | 'blood-gas' | 'priority-form' | 'routine'
export type McuScopeCode = 'cp-lab' | 'mic-lab' | 'ap-lab' | 'rad'
export type SoapiTypeCode = 'early-medic' | 'early-rehab' | 'function' | 'progress' | 'dev-record' | 'kfr-adm' | 'kfr-series'
export type MedicalActionTypeCode = 'chemo' | 'hemo' | 'thalasemia' | 'echocardio' | 'spirometry'
export type VehicleTypeCode = 'ambulance' | 'transport' | 'hearse'
export type GeneralEduCode = 'right-obg' | 'general-consent' | 'service' | 'alt-care-src' | 'home-plan' | 'home-care' | 'orientation' | 'fall-risk-prevention' | 'alt-care' | 'act-delay' | 'others'
export type SpecialEduCode = 'disease-diag-dev' | 'safe-med-usage' | 'side-effect' | 'diet' | 'pain-mgmt' | 'medical-eq-usage' | 'rehab-technique' | 'prevention-act'
export type EduAssessmentCode = 'learn-ability' | 'learn-will' | 'obstacle' | 'learn-method' | 'lang' | 'lang-obstacle' | 'belief'
export type AbilityCode = 'able' | 'not-able'
export type WillCode = 'ready' | 'interested' | 'not-interested'
export type MedObstacleCode = 'hearing' | 'sight' | 'physical' | 'emotional' | 'cognitif'
export type LearnMethodCode = 'demo' | 'discuss-leaflet'
export type LangClassCode = 'ind' | 'region' | 'foreign'
export type TranslatorSrcCode = 'team' | 'family'
export const subjectCodes: Record<SubjectCode, string> = {
detail: 'Detail',
'pri-complain': 'Keluhan Utama',
'sec-complain': 'Secondary Complaint',
'cur-disea-hist': 'Current Disease History',
'pas-disea-hist': 'Past Disease History',
'fam-disea-hist': 'Family Disease History',
'alg-hist': 'Allergic Hist',
'alg-react': 'Allergic Reaction',
'med-hist': 'Medication Hist',
'blood-type': 'Golongan Darah',
}
export const objectCodes: Record<ObjectCode, string> = {
detail: 'Detail',
'consc-level': 'Tingkat Kesadaran',
'consc-level-det': 'Detail Tingkat Kesadaran',
'syst-bp': 'Tekanan Darah Systolic',
'diast-bp': 'Tekanan Darah Diastolic',
'pulse': 'Nadi',
'resp-rate': 'Pernafasan',
'hear-rt': 'Detak Jantung',
'neuro-cranialis': 'Neurologist Cranialist',
'sensoris': 'Sensoris',
'reflect-fisio': 'Refleks Fisiologi',
'reflect-pato': 'Refleks Patologi',
'autonom-neuron': 'Saraf Otonom',
'neck-rom': 'ROM - Leher',
'body-rom': 'ROM - Batang Tubuh',
'aga-rom': 'ROM - AGA',
'agb-rom': 'ROM - AGB',
'neck-mmt': 'MMT - Leher',
'body-mmt': 'MMT - Batang Tubuh',
'aga-mmt': 'MMT - AGA',
'agb-mmt': 'MMT - AGB',
'localis': 'Status Lokalis',
'medical-trouble': 'Masalah Medis',
'rehab-medic-trouble': 'Masalah Rehab Medik',
'temp': 'Suhu',
'spo2': 'SpO2',
'weight': 'Berat Badan',
'height': 'Tinggi Badan',
'head-to-toe': 'Kepala Sampai Kaki',
}
export const assessmentCodes: Record<AssessmentCode, string> = {
detail: 'Detail',
'early-med-diag': 'Diagnosis Medis Awal',
'late-med-diag': 'Diagnosis Medis Akhir',
'sec-med-diag': 'Diagnosis Medis Sekunder',
'early-func-diag': 'Diagnosis Fungsi Awal',
'late-func-diag': 'Diagnosis Fungsi Akhir',
'sec-func-diag': 'Diagnosis Fungsi Sekunder',
'patient-dev': 'Catatan Perkembangan Patient',
}
export const planCodes: Record<PlanCode, string> = {
detail: 'Detail',
'plan': 'Rencana',
}
export const instructionCodes: Record<InstructionCode, string> = {
detail: 'Detail Instruksi',
'medical-act': 'Tindakan medis',
'supporting-exam': 'Pemeriksaan Penunjang',
'therapy': 'Terapi',
'medication': 'Obat',
'material': 'BMHP',
'rehab-program': 'Program Rehab',
'physic-modal': 'Modalitas Fisik',
'exercise': 'Latihan',
'ortes-protesa': 'Ortesa Protesa',
'education': 'Edukasi',
'other': 'Lain-lain',
}
export const headToToeCodes: Record<HeadToToeCode, string> = {
head: 'Kepala',
eye: 'Mata',
ear: 'Telinga',
nose: 'Hidung',
'mouth-throat': 'Mulut - Tenggorokan',
'head-others': 'Kepala - Lainnya',
thorax: 'Toraks',
heart: 'Jantung',
lung: 'Paru',
abdomen: 'Perut',
liver: 'Hati',
back: 'Punggung',
ekstremitas: 'Ekstermitas',
gender: 'Kelamin',
rectum: 'Dubur',
neuron: 'Syaraf',
'body-others': 'Badan - Lainnya',
}
export const mcuUrgencyLevelCodes: Record<McuUrgencyLevelCode, string> = {
cito: 'CITO',
'cito-igd': 'CITO IGD',
ponek: 'PONEK',
'blood-gas': 'Analisa Gas Darah',
'priority-form': 'Form Prioritas',
routine: 'Pemeriksaan Rutin',
}
export const mcuScopeCodes: Record<McuScopeCode, string> = {
'cp-lab': 'Laboratorium',
'mic-lab': 'Microbacterial Laboratorium',
'ap-lab': 'Patology Anatomy Laboratorium',
rad: 'Radiology',
}
export const soapiTypeCodes: Record<SoapiTypeCode, string> = {
'early-medic': 'Kajian Awal Medis',
'early-rehab': 'Kajian Awal Rehab Medik',
'function': 'Assessmen Fungsi',
'progress': 'CPPT',
'dev-record': 'Catatan Perkembangan',
'kfr-adm': 'Soapi Untuk KFR',
'kfr-series': 'Soapi Untuk KFR',
}
export const medicalActionTypeCodes: Record<MedicalActionTypeCode, string> = {
chemo: 'Kemoterapi',
hemo: 'Hemofilia',
thalasemia: 'Talasemi',
echocardio: 'Echokardio',
spirometry: 'Spirometri',
}
export const vehicleTypeCodes: Record<VehicleTypeCode, string> = {
ambulance: 'Ambulans',
transport: 'Transport',
hearse: 'Jenazah',
}
export const generalEduCodes: Record<GeneralEduCode, string> = {
'right-obg': 'Hak dan kewajiban pasien dan keluarga',
'general-consent': 'General Consent',
'service': 'Pelayanan yang disediakan (jam pelayanan, akses pelayanan dan proses pelayanan)',
'alt-care-src': 'Sumber alternatif asuhan di tempat lain/faskes lain',
'home-plan': 'Rencana tindakan di rumah',
'home-care': 'Kebutuhan perawatan di rumah',
'orientation': 'Orientasi ruangan',
'fall-risk-prevention': 'Pencegahan risiko jatuh',
'alt-care': 'Alternatif pelayanan',
'act-delay': 'Penundaan Tindakan',
'others': 'Lain - lain',
}
export const specialEduCodes: Record<SpecialEduCode, string> = {
'disease-diag-dev': 'Diagnosa penyakit dan perkembangannya',
'safe-med-usage': 'Penggunaan obat yang aman,',
'side-effect': 'efek samping dan reaksi obat',
'diet': 'Diet/Nutrisi',
'pain-mgmt': 'Managemen nyeri',
'medical-eq-usage': 'Penggunaan Peralatan Medis',
'rehab-technique': 'Tehnik Rehabilitasi',
'prevention-act': 'Tindakan pencegahan (cuci tangan, pemasangan gelang)',
}
export const eduAssessmentCodes: Record<EduAssessmentCode, string> = {
'learn-ability': 'Kemampuan Belajar',
'learn-will': 'Kemauan Belajar',
'obstacle': 'Hambatan',
'learn-method': 'Metode Pembelajaran',
'lang': 'Bahasa',
'lang-obstacle': 'Hambatan Bahasa',
'belief': 'Keyakinan',
}
export const abilityCodes: Record<AbilityCode, string> = {
able: 'Mampu',
'not-able': 'Tidak Mampu',
}
export const willCodes: Record<WillCode, string> = {
ready: 'Siap',
interested: 'Tertarik',
'not-interested': 'Tidak Tertarik',
}
export const medObstacleCodes: Record<MedObstacleCode, string> = {
hearing: 'Pendengaran',
sight: 'Penglihatan',
physical: 'Fisik',
emotional: 'Emosional',
cognitif: 'Kognitif',
}
export const learnMethodCodes: Record<LearnMethodCode, string> = {
demo: 'Demonstrasi',
'discuss-leaflet': 'Diskusi Leaflet',
}
export const langClassCodes: Record<LangClassCode, string> = {
ind: 'Indonesia',
region: 'Daerah',
foreign: 'Asing',
}
export const translatorSrcCodes: Record<TranslatorSrcCode, string> = {
team: 'Tim Penerjemah',
family: 'Keluarga',
}
+84
View File
@@ -0,0 +1,84 @@
export type ActiveStatusCode = 'active' | 'inactive'
export type DataStatusCode = 'new' | 'review' | 'process' | 'done' | 'canceled' | 'rejected' | 'skipped'
export type DataApprovalCode = 'new' | 'approved' | 'rejected'
export type DataAvailabilityCode = 'review' | 'available' | 'unavailble'
export type DataVerifiedCode = 'new' | 'verified' | 'rejected'
export type UserStatusCode = 'new' | 'active' | 'inactive' | 'blocked' | 'suspended'
export type ProcessStatusCode = 'success' | 'failed'
export type TimeUnitCode = 'sec' | 'min' | 'hour' | 'day' | 'week' | 'month' | 'year'
export type DayCode = '0' | '1' | '2' | '3' | '4' | '5' | '6'
export type PaymentMethodCode = 'cash' | 'debit' | 'credit' | 'insurance' | 'membership'
export const activeStatusCodes: Record<ActiveStatusCode, string> = {
active: 'Aktif',
inactive: 'Tidak Aktif',
}
export const dataStatusCodes: Record<DataStatusCode, string> = {
new: 'Baru',
review: 'Review',
process: 'Proses',
done: 'Selesai',
canceled: 'Dibatalkan',
rejected: 'Ditolak',
skipped: 'Dilewati',
}
export const dataApprovalCodes: Record<DataApprovalCode, string> = {
new: 'Baru',
approved: 'Diterima',
rejected: 'Ditolak',
}
export const dataAvailabilityCodes: Record<DataAvailabilityCode, string> = {
review: 'Konfirmasi',
available: 'Tersedia',
unavailble: 'Tidak Tersedia',
}
export const dataVerifiedCodes: Record<DataVerifiedCode, string> = {
new: 'Baru',
verified: 'Terverifikasi',
rejected: 'Ditolak',
}
export const userStatusCodes: Record<UserStatusCode, string> = {
new: 'Baru',
active: 'Aktif',
inactive: 'Tidak Aktif',
blocked: 'Diblokir',
suspended: 'Dibekukan',
}
export const processStatusCodes: Record<ProcessStatusCode, string> = {
success: 'Sukses',
failed: 'Gagal',
}
export const timeUnitCodes: Record<TimeUnitCode, string> = {
sec: 'Detik',
min: 'Menit',
hour: 'Jam',
day: 'Hari',
week: 'Minggu',
month: 'Bulan',
year: 'Tahun',
}
export const dayCodes: Record<DayCode, string> = {
'0': 'Minggu',
'1': '',
'2': '',
'3': '',
'4': '',
'5': '',
'6': 'Sabtu',
}
export const paymentMethodCodes: Record<PaymentMethodCode, string> = {
cash: 'Cash',
debit: 'Debit',
credit: 'Kredit',
insurance: 'Asuransi',
membership: 'Membership',
}
+141
View File
@@ -0,0 +1,141 @@
export type QueueStatusCode = 'wait' | 'proc' | 'done' | 'cancel' | 'skip'
export type EncounterClassCode = 'ambulatory' | 'emergency' | 'inpatient'
export type DischargeMethodCode = 'home' | 'home-request' | 'consul-back' | 'consul-poly' | 'consul-executive' | 'consul-ch-day' | 'emergency' | 'emergency-covid' | 'inpatient' | 'external' | 'death' | 'death-on-arrival' | 'run-away'
export type PolySwitchCode = 'consul-poly' | 'consul-executive'
export type RefTypeCode = 'none' | 'gov' | 'private' | 'bpjs'
export type TransportationCode = 'ambulance' | 'car' | 'motor-cycle' | 'other'
export type PersonConditionCode = 'res' | 'emg' | 'urg' | 'lurg' | 'nurg' | 'doa'
export type AmbulatoryClassCode = 'reg' | 'rehab' | 'chemo'
export type EmergencyClassCode = 'emg' | 'eon'
export type InpatientClassCode = 'op' | 'icu' | 'hcu' | 'vk'
export type ChemoClassCode = 'adm' | 'act'
export type AmbulanceFacilityCode = 'std' | 'icu'
export type AmbulanceNeedsCode = 'assist' | 'non-assist'
export type DocTypeCode = 'person-resident-number' | 'person-driving-license' | 'person-passport' | 'person-family-card' | 'encounter-patient' | 'encounter-suport' | 'encounter-other' | 'mcu-item-result' | 'vclaim-sep' | 'vclaim-sipp' | 'general-consent'
export type AltPaymentMethodCode = 'jkn' | 'jkmm' | 'spm' | 'pks' | 'umum'
export type SEPRefTypCode = 'internal' | 'external'
export type VisitModeCode = 'adm' | 'readm' | 'series'
export const queueStatusCodes: Record<QueueStatusCode, string> = {
wait: 'Tunggu',
proc: 'Proses',
done: 'Selesai',
cancel: 'Batal',
skip: 'Dilewati',
}
export const encounterClassCodes: Record<EncounterClassCode, string> = {
ambulatory: 'Rawat Jalan',
emergency: 'Gawat Darurat',
inpatient: 'Rawat Inap',
}
export const dischageMethodCodes: Record<DischargeMethodCode, string> = {
home: 'Pulang',
'home-request': 'Pulang Atas Permintaan Sendiri',
'consul-back': 'Konsultasi Balik / Lanjutan',
'consul-poly': 'Konsultasi Poliklinik Lain',
'consul-executive': 'Konsultasi Antar Dokter Eksekutif',
'consul-ch-day': 'Konsultasi Hari Lain',
emergency: 'Rujuk IGD',
'emergency-covid': 'Rujuk IGD Covid',
inpatient: 'Rujuk Rawat Inap',
external: 'Rujuk Faskes Lain',
death: 'Meninggal',
'death-on-arrival': 'Meninggal Saat Tiba',
'run-away': 'Kabur / Lari',
}
export const polySwitchCode: Record<PolySwitchCode, string> = {
'consul-poly': 'Konsultasi Poliklinik Lain',
'consul-executive': 'Konsultasi Antar Dokter Eksekutif',
}
export const refTypeCode: Record<RefTypeCode, string> = {
none: 'Tidak Ada',
gov: 'Pemerintah',
private: 'Swasta',
bpjs: 'BPJS',
}
export const transportationCode: Record<TransportationCode, string> = {
ambulance: 'Ambulans',
car: 'Mobil',
'motor-cycle': 'Motor',
other: 'Lainnya',
}
export const personConditionCode: Record<PersonConditionCode, string> = {
res: 'Resutiasi',
emg: 'Darurat',
urg: 'Mendesak',
lurg: 'Kurang Mendesak',
nurg: 'Mendesak',
doa: 'Meninggal Saat Tiba',
}
export const ambulatoryClassCode: Record<AmbulatoryClassCode, string> = {
reg: 'Reguler',
rehab: 'Rehab Medik',
chemo: 'Kemoterapi',
}
export const emergencyClassCode: Record<EmergencyClassCode, string> = {
emg: 'Darurat',
eon: 'Ponek',
}
export const inpatientClassCode: Record<InpatientClassCode, string> = {
op: 'Rawat Inap',
icu: 'ICU',
hcu: 'HCU',
vk: 'Kamar Bersalin',
}
export const chemoClassCode: Record<ChemoClassCode, string> = {
adm: 'Administrasi',
act: 'Tindakan',
}
export const ambulanceFacilityCode: Record<AmbulanceFacilityCode, string> = {
std: 'Standar',
icu: 'ICU',
}
export const ambulanceNeedsCode: Record<AmbulanceNeedsCode, string> = {
assist: 'Dengan Pendampingan',
'non-assist': 'Tanpa Pendampingan',
}
export const docTypeCode: Record<DocTypeCode, string> = {
'person-resident-number': '',
'person-driving-license': '',
'person-passport': '',
'person-family-card': '',
'encounter-patient': '',
'encounter-suport': '',
'encounter-other': '',
'mcu-item-result': '',
'vclaim-sep': '',
'vclaim-sipp': '',
'general-consent': '',
}
export const altPaymentMethodCode: Record<AltPaymentMethodCode, string> = {
jkn: 'JKN',
jkmm: 'JKMM',
spm: 'SPM',
pks: 'PKS',
umum: 'Umum',
}
export const sepRefTypCode: Record<SEPRefTypCode, string> = {
internal: 'Rujukan Internal',
external: 'Faskes Lain',
}
export const visitModeCode: Record<VisitModeCode, string> = {
adm: 'Administrasi',
readm: 'Administrasi',
series: 'Tindakan',
}
+69
View File
@@ -0,0 +1,69 @@
export type InfragroupCode = 'building' | 'floor' | 'warehouse' | 'room' | 'chamber' | 'bed' | 'counter' | 'public-screen'
export type ItemGroupCode = 'infra' | 'medicine' | 'device' | 'material' | 'employee-fee' | 'doctor-fee'
export type UnitTypeCode = 'reg' | 'exa' | 'pay' | 'pha' | 'lab' | 'rad'
export type ContractStatusCode = 'system' | 'employee' | 'intern' | 'other'
export type EmployeePositionCode = 'reg' | 'nur' | 'doc' | 'miw' | 'thr' | 'nut' | 'lab' | 'pha' | 'nom'
export type InternPositionCode = 'specialist' | 'nurse' | 'non-medic'
export type DoctorFeeTypeCodes = 'outpatient' | 'emergency' | 'inpatient' | 'medic-rehab'
export const infragroupCodes: Record<InfragroupCode, string> = {
building: 'Bangunan',
floor: 'Lantai',
warehouse: 'Gudang / Depo',
room: 'Ruang',
chamber: 'Kamar',
bed: 'Ranjang',
counter: 'Counter',
'public-screen': 'Public Screen',
}
export const itemGroupCodes: Record<ItemGroupCode, string> = {
infra: 'Infrastruktur',
medicine: 'Obat',
device: 'Peralatan',
material: 'Perlengkapan',
'employee-fee': 'Gaji Karyawan',
'doctor-fee': 'Gaji Dokter',
}
export const unitTypeCodes: Record<UnitTypeCode, string> = {
reg: 'Registrasi',
exa: 'Pemeriksaan',
pay: 'Pembayaran',
pha: 'Farmasai',
lab: 'Laboratorium',
rad: 'Radiologi',
}
export const contractStatusCodes: Record<ContractStatusCode, string> = {
system: 'Sistem',
employee: 'Pegawai',
intern: 'Magang',
other: 'Lainnya',
}
export const employeePositionCodes: Record<EmployeePositionCode, string> = {
reg: 'Admisi / Pendaftaran',
nur: 'Perawat',
doc: 'Dokter',
miw: 'Bidan',
thr: 'Terapis',
nut: 'Ahli Gisi',
lab: 'Laboran',
pha: 'Farmasi',
nom: 'Non Medis',
}
export const internPositionCodes: Record<InternPositionCode, string> = {
specialist: 'PPDS',
nurse: 'Perawat',
'non-medic': 'Non Medis',
}
export const doctorFeeTypeCodes: Record<DoctorFeeTypeCodes, string> = {
outpatient: 'Rawat Jalan',
emergency: 'Darurat',
inpatient: 'Rawat Inap',
'medic-rehab': 'Rehab Medik',
}
+80
View File
@@ -0,0 +1,80 @@
export type GenderCode = 'male' | 'female' | 'not-stated' | 'unknown'
export type ReligionCode = 'islam' | 'protestan' | 'katolik' | 'hindu' | 'buda' | 'konghucu'
export type EducationCode = 'TS' | 'TK' | 'SD' | 'SMP' | 'SMA' | 'D1' | 'D2' | 'D3' | 'S1' | 'S2' | 'S3'
export type OccupationCode = 'tidak-bekerja' | 'pns' | 'polisi' | 'tni' | 'guru' | 'wiraswasta' | 'kary-swasta' | 'lainnya'
export type AddressLocationTypeCode = 'identity' | 'domicile'
export type PersonContactType = 'phone' | 'm-phone' | 'email' | 'fax'
export type RelationshipCode = 'mother' | 'father' | 'uncle' | 'aunt' | 'sibling' | 'gd-mother' | 'gd-father' | 'child' | 'nephew' | 'gd-child' | 'friend' | 'spouse' | 'self' | 'other'
export type MaritalStatus_Code = 'S' | 'M' | 'D' | 'W'
export const genderCodes: Record<GenderCode, string> = {
male: 'Laki',
female: 'Perempuan',
'not-stated': 'Tidak Disebutkan',
unknown: 'Tidak Diketahui',
}
export const religionCodes: Record<ReligionCode, string> = {
islam: 'Islam',
protestan: 'Protestan',
katolik: 'Katolik',
hindu: 'Hindu',
buda: 'Buda',
konghucu: 'Konghucu',
}
export const educationCodes: Record<EducationCode, string> = {
TS: 'TS',
TK: 'TK',
SD: 'SD',
SMP: 'SMP',
SMA: 'SMA',
D1: 'D1',
D2: 'D2',
D3: 'D3',
S1: 'S1',
S2: 'S2',
S3: 'S3',
}
export const occupationCodes: Record<OccupationCode, string> = {
'tidak-bekerja': 'Tidak Bekerja',
pns: 'Pegawai Negeri Sipil',
polisi: 'Polisi',
tni: 'TNI',
guru: 'Guru',
wiraswasta: 'Wiraswasta',
'kary-swasta': 'Karyawan Swasta',
lainnya: 'Lainnya',
}
export const personContactTypes: Record<PersonContactType, string> = {
phone: 'Telepon',
'm-phone': 'HP / Ponsel',
email: 'Email',
fax: 'Fax',
}
export const relationshipCodes: Record<RelationshipCode, string> = {
mother: 'Ibu',
father: 'Ayah',
uncle: 'Paman',
aunt: 'Bibi',
sibling: 'Saudara',
'gd-mother': 'Nenek',
'gd-father': 'Kakek',
child: 'Anak',
nephew: 'Keponakan',
'gd-child': 'Cucu',
friend: 'Teman',
spouse: 'Pasangan (Suami / Istri)',
self: 'Diri sendiri',
other: 'Lainnya',
}
export const maritalStatusCodes: Record<MaritalStatus_Code, string> = {
S: 'Single (Belum Kawin)',
M: 'Married (Kawin)',
D: 'Divorced (Cerai Hidup)',
W: 'Widowed (Cerai Mati)',
}
+2 -2
View File
@@ -4,7 +4,7 @@ export interface DivisionPosition extends Base {
code: string
name: string
headStatus?: boolean
division_id: number
division_id: string
employee_id?: number
employee?: Employee | null
@@ -16,7 +16,7 @@ export function genDivisionPosition(): DivisionPosition {
code: '',
name: '',
headStatus: false,
division_id: 0,
division_id: '',
employee_id: 0,
}
}
+2 -2
View File
@@ -2,7 +2,7 @@ import { type Base, genBase } from './_base'
import type { Employee } from './employee'
export interface SpecialistPosition extends Base {
specialist_id: number
specialist_id: string
code: string
name: string
headStatus?: boolean
@@ -13,7 +13,7 @@ export interface SpecialistPosition extends Base {
export function genSpecialistPosition(): SpecialistPosition {
return {
...genBase(),
specialist_id: 0,
specialist_id: '',
code: '',
name: '',
headStatus: false,
+1 -1
View File
@@ -14,6 +14,6 @@ export function genSpecialist(): Specialist {
...genBase(),
code: '',
name: '',
unit_id: 0,
unit_id: '',
}
}
+2 -2
View File
@@ -3,7 +3,7 @@ import type { Employee } from './employee'
import type { Subspecialist } from './subspecialist'
export interface SubSpecialistPosition extends Base {
subspecialist_id: number
subspecialist_id: string
code: string
name: string
headStatus?: boolean
@@ -16,7 +16,7 @@ export interface SubSpecialistPosition extends Base {
export function genSubSpecialistPosition(): SubSpecialistPosition {
return {
...genBase(),
subspecialist_id: 0,
subspecialist_id: '',
code: '',
name: '',
headStatus: false,
+2 -2
View File
@@ -2,7 +2,7 @@ import { type Base, genBase } from './_base'
import type { Employee } from './employee'
export interface UnitPosition extends Base {
unit_id: number
unit_code: string
code: string
name: string
headStatus?: boolean
@@ -14,7 +14,7 @@ export interface UnitPosition extends Base {
export function genUnitPosition(): UnitPosition {
return {
...genBase(),
unit_id: 0,
unit_code: '',
code: '',
name: '',
headStatus: false,
@@ -33,7 +33,7 @@ const canRead = true
<template>
<template v-if="canRead">
<ContentDivisionDetail :division-id="Number(route.params.id)" />
<ContentDivisionDetail :division-id="String(route.params.id)" />
</template>
<Error
v-else
@@ -33,7 +33,7 @@ const canRead = true
<template>
<template v-if="canRead">
<ContentInstallationDetail :installation-id="Number(route.params.id)" />
<ContentInstallationDetail :installation-id="String(route.params.id)" />
</template>
<Error
v-else
@@ -33,7 +33,7 @@ const canRead = true
<template>
<template v-if="canRead">
<ContentSpecialistDetail :specialist-id="Number(route.params.id)" />
<ContentSpecialistDetail :specialist-id="String(route.params.id)" />
</template>
<Error
v-else
@@ -33,7 +33,7 @@ const canRead = true
<template>
<template v-if="canRead">
<ContentSubspecialistDetail :subspecialist-id="Number(route.params.id)" />
<ContentSubspecialistDetail :subspecialist-id="String(route.params.id)" />
</template>
<Error
v-else
@@ -33,7 +33,7 @@ const canRead = true
<template>
<template v-if="canRead">
<ContentUnitDetail :unit-id="Number(route.params.id)" />
<ContentUnitDetail :unit-id="String(route.params.id)" />
</template>
<Error
v-else
@@ -0,0 +1,47 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
import ContentChemotherapyAdminList from '~/components/content/chemotherapy/admin-list.vue'
import ContentChemotherapyVerification from '~/components/content/chemotherapy/verification.vue'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Kemoterapi Admin',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => 'Verifikasi Jadwal Pasien',
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor'] || {}
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
if (!hasAccess) {
navigateTo('/403')
}
// Define permission-based computed properties
const canRead = true // hasReadAccess(roleAccess)
const mode = computed(() => route.params.mode as string)
</script>
<template>
<div>
<div v-if="canRead">
<ContentChemotherapyVerification />
</div>
<Error
v-else
:status-code="403"
/>
</div>
</template>
@@ -0,0 +1,40 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Daftar Kempterapi',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
if (!hasAccess) {
navigateTo('/403')
}
// Define permission-based computed properties
const canRead = true // hasReadAccess(roleAccess)
</script>
<template>
<div>
<div v-if="canRead">
<ContentChemotherapyList />
</div>
<Error v-else :status-code="403" />
</div>
</template>
+1 -1
View File
@@ -5,7 +5,7 @@ const DivisionPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
division_id: z.union([
division_code: z.union([
z.string({ required_error: 'Divisi Induk harus diisi' }),
z.number({ required_error: 'Divisi Induk harus diisi' })
]).optional().nullable(),
+1 -1
View File
@@ -4,7 +4,7 @@ import type { Division } from '~/models/division'
const DivisionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
parent_id: z.union([
parent_code: z.union([
z.string({ required_error: 'Divisi Induk harus diisi' }),
z.number({ required_error: 'Divisi Induk harus diisi' })
]).optional().nullable(),
+1 -1
View File
@@ -5,7 +5,7 @@ const InstallationPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
installation_id: z.union([
installation_code: z.union([
z.string({ required_error: 'Instalasi Induk harus diisi' }),
z.number({ required_error: 'Instalasi Induk harus diisi' }),
]),
+1 -1
View File
@@ -5,7 +5,7 @@ const SpecialistPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
specialist_id: z
specialist_code: z
.union([
z.string({ required_error: 'Spesialis harus diisi' }),
z.number({ required_error: 'Spesialis harus diisi' }),
+1 -1
View File
@@ -4,7 +4,7 @@ import type { Specialist } from '~/models/specialist'
const SpecialistSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
unit_id: z
unit_code: z
.union([z.string({ required_error: 'Unit harus diisi' }), z.number({ required_error: 'Unit harus diisi' })])
.optional()
.nullable(),
+1 -1
View File
@@ -5,7 +5,7 @@ const SubSpecialistPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
subspecialist_id: z
subspecialist_code: z
.union([
z.string({ required_error: 'Spesialis harus diisi' }),
z.number({ required_error: 'Spesialis harus diisi' }),
+1 -1
View File
@@ -4,7 +4,7 @@ import type { Subspecialist } from '~/models/subspecialist'
const SubspecialistSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
specialist_id: z
specialist_code: z
.union([
z.string({ required_error: 'Spesialis harus diisi' }),
z.number({ required_error: 'Spesialis harus diisi' }),
+1 -1
View File
@@ -5,7 +5,7 @@ const UnitPositionSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
headStatus: z.boolean().optional().nullable(),
unit_id: z
unit_code: z
.union([
z.string({ required_error: 'Unit Induk harus diisi' }),
z.number({ required_error: 'Unit Induk harus diisi' }),
+1 -1
View File
@@ -4,7 +4,7 @@ import type { Unit } from '~/models/unit'
const UnitSchema = z.object({
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter'),
installation_id: z
installation_code: z
.union([
z.string({ required_error: 'Instalasi harus diisi' }),
z.number({ required_error: 'Instalasi harus diisi' }),
+8 -4
View File
@@ -28,13 +28,15 @@ export function remove(id: number | string) {
return base.remove(path, id, name)
}
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
export async function getValueLabelList(params: any = null, useCodeAsValue = false): Promise<{ value: string; label: string }[]> {
let data: { value: string; label: string }[] = []
const result = await getList(params)
if (result.success) {
const resultData = result.body?.data || []
data = resultData.map((item: Division) => ({
value: item.id ? Number(item.id) : item.code,
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
: item.code,
label: item.name,
}))
}
@@ -46,10 +48,12 @@ export async function getValueLabelList(params: any = null): Promise<{ value: st
* @param divisions Array of division objects from API
* @returns TreeItem[]
*/
export function getValueTreeItems(divisions: any[]): TreeItem[] {
export function getValueTreeItems(divisions: any[], byCode = true): TreeItem[] {
return divisions
.map((division: Division) => ({
value: division.id ? String(division.id) : division.code,
value: byCode ? String(division.code)
: String(division.id) ? String(division.id)
: division.code,
label: division.name,
hasChildren: Array.isArray(division.childrens) && division.childrens.length > 0,
children:
+4 -2
View File
@@ -27,13 +27,15 @@ export function remove(id: number | string) {
return base.remove(path, id, name)
}
export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
export async function getValueLabelList(params: any = null, useCodeAsValue = false): Promise<{ value: string; label: string }[]> {
let data: { value: string; label: string }[] = []
const result = await getList(params)
if (result.success) {
const resultData = result.body?.data || []
data = resultData.map((item: Installation) => ({
value: item.id ? Number(item.id) : item.code,
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
: item.code,
label: item.name,
}))
}
+1 -1
View File
@@ -36,7 +36,7 @@ export async function getValueLabelList(params: any = null, useCodeAsValue = fal
data = resultData.map((item: Specialist) => ({
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
: item.id,
: item.code,
label: item.name,
parent: item.unit_id ? Number(item.unit_id) : null,
}))
+2 -2
View File
@@ -33,9 +33,9 @@ export async function getValueLabelList(params: any = null, useCodeAsValue = fal
if (result.success) {
const resultData = result.body?.data || []
data = resultData.map((item: Subspecialist) => ({
value: useCodeAsValue ? item.code
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
: item.id,
: item.code,
label: item.name,
parent: item.specialist_id ? Number(item.specialist_id) : null,
}))
+1 -1
View File
@@ -35,7 +35,7 @@ export async function getValueLabelList(params: any = null, useCodeAsValue = fal
data = resultData.map((item: Unit) => ({
value: useCodeAsValue ? item.code
: item.id ? Number(item.id)
: item.id,
: item.code,
label: item.name,
}))
}
+1 -1
View File
@@ -369,4 +369,4 @@
}
]
}
]
]
+1 -1
View File
@@ -389,4 +389,4 @@
}
]
}
]
]