diff --git a/app/components/app/doctor/entry-form.vue b/app/components/app/doctor/entry-form.vue index 2c7ecac2..5aec1ba3 100644 --- a/app/components/app/doctor/entry-form.vue +++ b/app/components/app/doctor/entry-form.vue @@ -3,7 +3,6 @@ import Block from '~/components/pub/custom-ui/form/block.vue' import FieldGroup from '~/components/pub/custom-ui/form/field-group.vue' import Field from '~/components/pub/custom-ui/form/field.vue' import Label from '~/components/pub/custom-ui/form/label.vue' -import Action from '~/components/pub/custom-ui/nav-footer/ba-dr-su.vue' const props = defineProps<{ modelValue: any }>() const emit = defineEmits(['update:modelValue', 'event']) @@ -12,19 +11,10 @@ const data = computed({ get: () => props.modelValue, set: (val) => emit('update:modelValue', val), }) - -function onClick(type: string) { - emit('event', type) -} - - - Tambah Dokter - - @@ -94,24 +84,7 @@ function onClick(type: string) { - - - Username - - - - - - Password - - - - - - - - diff --git a/app/components/app/patient/entry-form.vue b/app/components/app/patient/entry-form.vue index a9ab8c6b..bf0284ec 100644 --- a/app/components/app/patient/entry-form.vue +++ b/app/components/app/patient/entry-form.vue @@ -8,11 +8,6 @@ import Action from '~/components/pub/custom-ui/nav-footer/ba-dr-su.vue' - - - Tambah Pasien - - diff --git a/app/components/app/user/entry-form.vue b/app/components/app/user/entry-form.vue new file mode 100644 index 00000000..b1456460 --- /dev/null +++ b/app/components/app/user/entry-form.vue @@ -0,0 +1,53 @@ + + + + + + + + + Username + + + + + + Password + + + + + + Status + + + + + + Tipe + + + + + + + + + diff --git a/app/components/app/user/list-cfg.ts b/app/components/app/user/list-cfg.ts new file mode 100644 index 00000000..f697dc88 --- /dev/null +++ b/app/components/app/user/list-cfg.ts @@ -0,0 +1,109 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/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 '-' + }, +} diff --git a/app/components/app/user/list.vue b/app/components/app/user/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/user/list.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/app/components/app/user/picker.vue b/app/components/app/user/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/user/search.vue b/app/components/app/user/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/flow/doctor/add.vue b/app/components/flow/doctor/add.vue deleted file mode 100644 index 98632f5c..00000000 --- a/app/components/flow/doctor/add.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/app/components/flow/patient/add.vue b/app/components/flow/patient/add.vue index fd48eeba..fd42e0a6 100644 --- a/app/components/flow/patient/add.vue +++ b/app/components/flow/patient/add.vue @@ -1,5 +1,9 @@ + + + Tambah Pasien + diff --git a/app/components/flow/user/entry.vue b/app/components/flow/user/entry.vue new file mode 100644 index 00000000..7fb4d66d --- /dev/null +++ b/app/components/flow/user/entry.vue @@ -0,0 +1,34 @@ + + + + + + Tambah Dokter + + + + + + + + + diff --git a/app/components/flow/doctor/list.vue b/app/components/flow/user/list.vue similarity index 93% rename from app/components/flow/doctor/list.vue rename to app/components/flow/user/list.vue index 98a6a6c9..4b77cf12 100644 --- a/app/components/flow/doctor/list.vue +++ b/app/components/flow/user/list.vue @@ -26,11 +26,11 @@ const recAction = ref('') const recItem = ref(null) const headerPrep: HeaderPrep = { - title: 'Dokter', - icon: 'i-lucide-network', + title: 'User', + icon: 'i-lucide-users', addNav: { label: 'Tambah', - onClick: () => navigateTo('/doctor/add'), + onClick: () => navigateTo('/human-src/user/add'), }, } diff --git a/app/components/pub/custom-ui/form/field-group.vue b/app/components/pub/custom-ui/form/field-group.vue index d24d153b..bb2ed72a 100644 --- a/app/components/pub/custom-ui/form/field-group.vue +++ b/app/components/pub/custom-ui/form/field-group.vue @@ -20,7 +20,7 @@ const wrapperClass = computed(() => [ 'w-full flex-shrink-0', props.column === 1 && props.side !== 'break' ? 'pe-4 md:w-1/1 ' : '', - props.column === 2 && props.side !== 'break' ? 'pe-4 md:w-1/2 ' : '', + props.column === 2 && props.side !== 'break' ? 'pe-4 md:w-1/2 my-3' : '', props.column === 3 && props.side !== 'break' ? 'pe-4 md:w-1/3' : '', props.column === 2 && props.side === 'break' ? 'md:w-1/2' : '', props.column === 3 && props.side === 'break' ? 'md:w-1/3' : '', diff --git a/app/components/pub/ui/select/Select.vue b/app/components/pub/ui/select/Select.vue index adc42fdf..3020ed97 100644 --- a/app/components/pub/ui/select/Select.vue +++ b/app/components/pub/ui/select/Select.vue @@ -1,8 +1,29 @@ + + + + + + + diff --git a/app/pages/(features)/human-src/user/index.vue b/app/pages/(features)/human-src/user/index.vue new file mode 100644 index 00000000..2c0f921f --- /dev/null +++ b/app/pages/(features)/human-src/user/index.vue @@ -0,0 +1,40 @@ + + + + + + + + + + diff --git a/app/pages/_dev/index.vue b/app/pages/_dev/index.vue new file mode 100644 index 00000000..b1afab26 --- /dev/null +++ b/app/pages/_dev/index.vue @@ -0,0 +1,97 @@ + + + + + + + + + + + + {{ navMenu.heading }} + + + + {{ item.title }} + + + + + + + + + + + + + + + + Playground untuk testing component + + + + diff --git a/app/pages/_dev/user/entry.vue b/app/pages/_dev/user/entry.vue new file mode 100644 index 00000000..6888d3af --- /dev/null +++ b/app/pages/_dev/user/entry.vue @@ -0,0 +1,10 @@ + + + + test tambah user + diff --git a/app/pages/_dev/user/list.vue b/app/pages/_dev/user/list.vue new file mode 100644 index 00000000..4c5edc33 --- /dev/null +++ b/app/pages/_dev/user/list.vue @@ -0,0 +1,9 @@ + + + + test list user + diff --git a/eslint.config.js b/eslint.config.js index 4879bee5..42a5d851 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -18,14 +18,15 @@ export default withNuxt( { rules: { // Basic rules - 'quotes': ['error', 'single', { avoidEscape: true }], + quotes: ['error', 'single', { avoidEscape: true }], + 'style/quote-props': 'off', 'style/no-trailing-spaces': ['error', { ignoreComments: true }], 'no-console': 'off', // Relax strict formatting rules 'style/brace-style': 'off', // Allow inline if - 'curly': ['error', 'multi-line'], // Only require braces for multi-line + curly: ['error', 'multi-line'], // Only require braces for multi-line 'style/arrow-parens': 'off', // UnoCSS - make it warning instead of error, or disable completely diff --git a/public/side-menu-items/sys.json b/public/side-menu-items/sys.json index 18bbd3dc..2b803fc0 100644 --- a/public/side-menu-items/sys.json +++ b/public/side-menu-items/sys.json @@ -30,6 +30,17 @@ } ] }, + { + "title": "Karyawan", + "icon": "i-lucide-users", + "children": [ + { + "title": "User", + "icon": "i-lucide-user", + "link": "/human-src/user" + } + ] + }, { "title": "Dokter", "icon": "i-lucide-cross",