From 421159971e0e1adad3e564519ff86fa2169a1f45 Mon Sep 17 00:00:00 2001 From: Andrian Roshandy Date: Mon, 6 Oct 2025 04:41:21 +0700 Subject: [PATCH] feat/prescription-56: wip --- app/components/app/medicine-mix/list-entry.ts | 50 +++++++++++ .../app/medicine-mix/list-entry.vue | 35 ++++++++ .../app/prescription-item/mix-entry.vue | 32 +++++++ .../app/prescription-item/non-mix-entry.vue | 0 .../app/prescription/list-entry.vue | 84 +++++++++++++++++++ .../app/prescription/list-with-sub.vue | 56 +++++++++++++ app/components/app/prescription/list.vue | 42 ---------- app/components/content/prescription/list.vue | 6 +- app/services/prescription.service.ts | 23 +++++ 9 files changed, 283 insertions(+), 45 deletions(-) create mode 100644 app/components/app/medicine-mix/list-entry.ts create mode 100644 app/components/app/medicine-mix/list-entry.vue create mode 100644 app/components/app/prescription-item/mix-entry.vue create mode 100644 app/components/app/prescription-item/non-mix-entry.vue create mode 100644 app/components/app/prescription/list-entry.vue create mode 100644 app/components/app/prescription/list-with-sub.vue delete mode 100644 app/components/app/prescription/list.vue create mode 100644 app/services/prescription.service.ts diff --git a/app/components/app/medicine-mix/list-entry.ts b/app/components/app/medicine-mix/list-entry.ts new file mode 100644 index 00000000..03202670 --- /dev/null +++ b/app/components/app/medicine-mix/list-entry.ts @@ -0,0 +1,50 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/my-ui/data/types' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue')) + +export const cols: Col[] = [{}, {}, {}, {}, {}, {}, { width: 50 }] + +export const header: Th[][] = [ + [ + { label: 'Nama' }, + { label: "Dosis" }, + { label: 'Satuan' }, + { label: '' }, + ], +] + +export const keys = ['name', 'dose', 'uom.name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = { + group: (rec: unknown): unknown => { + return (rec as SmallDetailDto).medicineGroup_code || '-' + }, +} + +export const funcComponent: RecStrFuncComponent = { + action: (rec: unknown, idx: number): RecComponent => { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = {} diff --git a/app/components/app/medicine-mix/list-entry.vue b/app/components/app/medicine-mix/list-entry.vue new file mode 100644 index 00000000..ba0fa689 --- /dev/null +++ b/app/components/app/medicine-mix/list-entry.vue @@ -0,0 +1,35 @@ + + + diff --git a/app/components/app/prescription-item/mix-entry.vue b/app/components/app/prescription-item/mix-entry.vue new file mode 100644 index 00000000..9f94f280 --- /dev/null +++ b/app/components/app/prescription-item/mix-entry.vue @@ -0,0 +1,32 @@ + + + diff --git a/app/components/app/prescription-item/non-mix-entry.vue b/app/components/app/prescription-item/non-mix-entry.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/prescription/list-entry.vue b/app/components/app/prescription/list-entry.vue new file mode 100644 index 00000000..8231dd84 --- /dev/null +++ b/app/components/app/prescription/list-entry.vue @@ -0,0 +1,84 @@ + + + + + + diff --git a/app/components/app/prescription/list-with-sub.vue b/app/components/app/prescription/list-with-sub.vue new file mode 100644 index 00000000..14bc1785 --- /dev/null +++ b/app/components/app/prescription/list-with-sub.vue @@ -0,0 +1,56 @@ + + + diff --git a/app/components/app/prescription/list.vue b/app/components/app/prescription/list.vue deleted file mode 100644 index 6fe27d39..00000000 --- a/app/components/app/prescription/list.vue +++ /dev/null @@ -1,42 +0,0 @@ - diff --git a/app/components/content/prescription/list.vue b/app/components/content/prescription/list.vue index ad260ad0..c87953c3 100644 --- a/app/components/content/prescription/list.vue +++ b/app/components/content/prescription/list.vue @@ -6,7 +6,7 @@ import Header from '~/components/pub/my-ui/nav-header/prep.vue' import ListEntry from '~/components/app/prescription/list-entry.vue' import PrescriptionItemListEntry from '~/components/app/prescription-item/list-entry.vue' -import { prescriptionSvc } from '~/services/prescription.service' +import { getList } from '~/services/prescription.service' import { usePaginatedList } from '~/composables/usePaginatedList' import MixEntry from '~/components/app/prescription-item/mix-entry.vue' @@ -21,7 +21,7 @@ const { fetchData: getMedicineList, } = usePaginatedList({ fetchFn: async ({ page, search }) => { - const result = await prescriptionSvc.getList({ search, page }) + const result = await getList({ search, page }) return { success: result.success || false, body: result.body || {} } }, entityName: 'medicine', @@ -90,7 +90,7 @@ function addMedicineMix() {