From 20649c5917581b1cc92b77f327bfcfccd2ed07e4 Mon Sep 17 00:00:00 2001 From: Andrian Roshandy Date: Sun, 16 Nov 2025 19:52:22 +0700 Subject: [PATCH] feat/prescription: finalize #1 + integration + non mix entry --- .../app/prescription-item/list-entry.cfg.ts | 18 +- .../app/prescription-item/mix-entry.vue | 52 +-- .../app/prescription-item/non-mix-entry.vue | 14 +- app/components/app/prescription/entry.vue | 18 +- app/components/content/prescription/entry.vue | 312 +++++++++++++++--- app/components/content/prescription/list.vue | 89 +---- 6 files changed, 329 insertions(+), 174 deletions(-) diff --git a/app/components/app/prescription-item/list-entry.cfg.ts b/app/components/app/prescription-item/list-entry.cfg.ts index 19b2f3d8..cfc6bdbd 100644 --- a/app/components/app/prescription-item/list-entry.cfg.ts +++ b/app/components/app/prescription-item/list-entry.cfg.ts @@ -11,16 +11,17 @@ export const config: Config = { headers: [ [ { label: 'Nama' }, + { label: 'Cara Buat' }, { label: 'Bentuk' }, { label: 'Freq' }, { label: 'Dosis' }, - { label: 'Interval' }, + // { label: 'Interval' }, { label: 'Total' }, { label: '' }, ], ], - keys: ['medicine.name', 'medicine.medicineForm.name', 'frequency', 'dose', 'interval', 'total', 'action'], + keys: ['medicine.name', 'isMix', 'medicine.medicineForm.name', 'frequency', 'dose', 'quantity', 'action'], // delKeyNames: [ { key: 'code', label: 'Kode' }, @@ -28,17 +29,8 @@ export const config: Config = { ], parses: { - cateogry: (rec: unknown): unknown => { - return (rec as SmallDetailDto).medicineCategory?.name || '-' - }, - group: (rec: unknown): unknown => { - return (rec as SmallDetailDto).medicineGroup?.name || '-' - }, - method: (rec: unknown): unknown => { - return (rec as SmallDetailDto).medicineMethod?.name || '-' - }, - unit: (rec: unknown): unknown => { - return (rec as SmallDetailDto).medicineUnit?.name || '-' + isMix: (rec: unknown): unknown => { + return (rec as SmallDetailDto).isMix ? 'Racikan' : 'Non Racikan' }, }, diff --git a/app/components/app/prescription-item/mix-entry.vue b/app/components/app/prescription-item/mix-entry.vue index 5a3c74fd..05960307 100644 --- a/app/components/app/prescription-item/mix-entry.vue +++ b/app/components/app/prescription-item/mix-entry.vue @@ -18,7 +18,6 @@ const props = defineProps<{ const { medicines } = toRefs(props) const medicineItems = ref([]) -const selectedMedicine_code = ref(props.data.medicine?.code || '') type ClickType = 'close' | 'save' @@ -54,35 +53,39 @@ function addItem() { function searchMedicineText(value: string) { emit('update:searchText', value) } + +function deleteItem(idx: number) { + props.items.splice(idx, 1) +}