From c3c9154d0ef7be33c6de454022f0cbb6a7273eb0 Mon Sep 17 00:00:00 2001 From: Abizrh Date: Sun, 7 Sep 2025 20:37:24 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9A=A0=EF=B8=8F=20refactor=20(medicine-metho?= =?UTF-8?q?d):=20simplify=20entry=20form=20and=20list=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/medicine-method/entry-form.vue | 65 ++-------------- .../app/medicine-method/list-cfg.ts | 76 +------------------ .../app/medicine-method/status-badge.vue | 29 ------- app/components/flow/medicine-method/add.vue | 9 --- app/components/flow/medicine-method/list.vue | 76 ++++--------------- app/pages/_dev/index.vue | 2 +- 6 files changed, 24 insertions(+), 233 deletions(-) delete mode 100644 app/components/app/medicine-method/status-badge.vue delete mode 100644 app/components/flow/medicine-method/add.vue diff --git a/app/components/app/medicine-method/entry-form.vue b/app/components/app/medicine-method/entry-form.vue index 5aec1ba3..e4f0b60a 100644 --- a/app/components/app/medicine-method/entry-form.vue +++ b/app/components/app/medicine-method/entry-form.vue @@ -18,69 +18,16 @@ const data = computed({
- - + + - - - - - - - + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/app/components/app/medicine-method/list-cfg.ts b/app/components/app/medicine-method/list-cfg.ts index 0cff0cce..e2c72f9c 100644 --- a/app/components/app/medicine-method/list-cfg.ts +++ b/app/components/app/medicine-method/list-cfg.ts @@ -8,85 +8,25 @@ import type { } 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 statusBadge = defineAsyncComponent(() => import('./status-badge.vue')) const _doctorStatus = { 0: 'Tidak Aktif', 1: 'Aktif', } -export const cols: Col[] = [ - { width: 100 }, - { width: 250 }, - {}, - { width: 100 }, - { width: 100 }, - {}, - {}, - {}, - { width: 120 }, - { width: 100 }, - {}, - {}, -] +export const cols: Col[] = [{}, {}, { 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' }, - { label: '' }, - ], -] +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]] -export const keys = [ - 'bpjs_code', - 'name', - 'identity_number', - 'sip_no', - 'ihs_number', - 'phone', - 'inPatient_itemPrice', - 'outPatient_itemPrice', - 'status', - 'action', -] +export const keys = ['code', 'name', 'action'] export const delKeyNames: KeyLabel[] = [ { key: 'code', label: 'Kode' }, { key: 'name', label: 'Nama' }, ] -export const funcParsed: RecStrFuncUnknown = { - name: (rec: unknown): unknown => { - 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') - }, -} +export const funcParsed: RecStrFuncUnknown = {} export const funcComponent: RecStrFuncComponent = { action(rec, idx) { @@ -97,14 +37,6 @@ export const funcComponent: RecStrFuncComponent = { } return res }, - status(rec, idx) { - const res: RecComponent = { - idx, - rec: rec as object, - component: statusBadge, - } - return res - }, } export const funcHtml: RecStrFuncUnknown = { diff --git a/app/components/app/medicine-method/status-badge.vue b/app/components/app/medicine-method/status-badge.vue deleted file mode 100644 index 32cdfbca..00000000 --- a/app/components/app/medicine-method/status-badge.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/app/components/flow/medicine-method/add.vue b/app/components/flow/medicine-method/add.vue deleted file mode 100644 index fd42e0a6..00000000 --- a/app/components/flow/medicine-method/add.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/components/flow/medicine-method/list.vue b/app/components/flow/medicine-method/list.vue index 7c849395..e05419e5 100644 --- a/app/components/flow/medicine-method/list.vue +++ b/app/components/flow/medicine-method/list.vue @@ -1,12 +1,11 @@