From be0a761170afd9cbbb1f163bbe9ed6520b71816e Mon Sep 17 00:00:00 2001 From: riefive Date: Tue, 4 Nov 2025 13:23:52 +0700 Subject: [PATCH] feat(cemo): change flow admin --- .../chemotherapy/dropdown-action-process.vue | 63 +++++++++++++++ .../app/chemotherapy/list-cfg.admin.ts | 80 +++++++++++++++++++ .../content/chemotherapy/admin-list.vue | 22 ++++- .../content/chemotherapy/verification.vue | 2 +- .../chemotherapy/[id]/index.vue | 42 ---------- .../chemotherapy/[mode]/[id]/verification.vue | 47 +++++++++++ .../chemotherapy/[mode]/index.vue | 6 +- 7 files changed, 215 insertions(+), 47 deletions(-) create mode 100644 app/components/app/chemotherapy/dropdown-action-process.vue create mode 100644 app/components/app/chemotherapy/list-cfg.admin.ts delete mode 100644 app/pages/(features)/outpation-action/chemotherapy/[id]/index.vue create mode 100644 app/pages/(features)/outpation-action/chemotherapy/[mode]/[id]/verification.vue diff --git a/app/components/app/chemotherapy/dropdown-action-process.vue b/app/components/app/chemotherapy/dropdown-action-process.vue new file mode 100644 index 00000000..56e14886 --- /dev/null +++ b/app/components/app/chemotherapy/dropdown-action-process.vue @@ -0,0 +1,63 @@ + + + diff --git a/app/components/app/chemotherapy/list-cfg.admin.ts b/app/components/app/chemotherapy/list-cfg.admin.ts new file mode 100644 index 00000000..38d77121 --- /dev/null +++ b/app/components/app/chemotherapy/list-cfg.admin.ts @@ -0,0 +1,80 @@ +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('./dropdown-action-process.vue')) + +export const config: Config = { + cols: [ + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 120 }, + { width: 50 }, + ], + + headers: [ + [ + { label: 'TANGGAL' }, + { label: 'NO. RM' }, + { label: 'NO. BILL' }, + { label: 'JK' }, + { label: 'ALAMAT' }, + { label: 'KLINIK ASAL' }, + { label: 'NAMA DOKTER' }, + { label: 'CARA BAYAR' }, + { label: 'RUJUKAN' }, + { label: 'KET. RUJUKAN' }, + { label: 'ASAL' }, + { label: '' }, + ], + ], + + keys: [ + 'tanggal', + 'noRm', + 'noBill', + 'jk', + 'alamat', + 'klinik', + 'dokter', + 'caraBayar', + 'rujukan', + 'ketRujukan', + 'asal', + 'action', + ], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + parent: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.parent?.name || '-' + }, + }, + + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, + }, + + htmls: {}, +} diff --git a/app/components/content/chemotherapy/admin-list.vue b/app/components/content/chemotherapy/admin-list.vue index ef4f2a89..be6d5810 100644 --- a/app/components/content/chemotherapy/admin-list.vue +++ b/app/components/content/chemotherapy/admin-list.vue @@ -13,7 +13,14 @@ import type { PaginationMeta } from '~/components/pub/my-ui/pagination/paginatio // Sample data - replace with actual API call import { sampleRows, type ChemotherapyData } from '~/components/app/chemotherapy/sample' + +const route = useRoute() +const recId = ref(0) +const recAction = ref('') +const recItem = ref(null) + const search = ref('') +const mode = route.params.mode as string || 'admin' const dateRange = ref<{ from: Date | null; to: Date | null }>({ from: null, to: null, @@ -65,6 +72,19 @@ function handleProses(rec: any) { navigateTo(`/outpation-action/chemotherapy/verification?id=${rec.id}`) } +watch([recId, recAction], () => { + switch (recAction.value) { + case 'Process': + navigateTo(`/outpation-action/chemotherapy/${mode}/${recId.value}/verification`) + break + case 'Verification': + break + } +}) + +provide('rec_id', recId) +provide('rec_action', recAction) +provide('rec_item', recItem) provide('proses-handler', handleProses) @@ -102,7 +122,7 @@ provide('proses-handler', handleProses) - + diff --git a/app/components/content/chemotherapy/verification.vue b/app/components/content/chemotherapy/verification.vue index 5d993ca0..3243547a 100644 --- a/app/components/content/chemotherapy/verification.vue +++ b/app/components/content/chemotherapy/verification.vue @@ -205,7 +205,7 @@ function handleBackToAdmin() { - + diff --git a/app/pages/(features)/outpation-action/chemotherapy/[id]/index.vue b/app/pages/(features)/outpation-action/chemotherapy/[id]/index.vue deleted file mode 100644 index edc1cd02..00000000 --- a/app/pages/(features)/outpation-action/chemotherapy/[id]/index.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - diff --git a/app/pages/(features)/outpation-action/chemotherapy/[mode]/[id]/verification.vue b/app/pages/(features)/outpation-action/chemotherapy/[mode]/[id]/verification.vue new file mode 100644 index 00000000..ef936ff2 --- /dev/null +++ b/app/pages/(features)/outpation-action/chemotherapy/[mode]/[id]/verification.vue @@ -0,0 +1,47 @@ + + + diff --git a/app/pages/(features)/outpation-action/chemotherapy/[mode]/index.vue b/app/pages/(features)/outpation-action/chemotherapy/[mode]/index.vue index 281939aa..cf33691a 100644 --- a/app/pages/(features)/outpation-action/chemotherapy/[mode]/index.vue +++ b/app/pages/(features)/outpation-action/chemotherapy/[mode]/index.vue @@ -19,8 +19,8 @@ useHead({ const mode = route.params.mode as string if (mode === 'admin') { return 'Administrasi Pasien Rawat Jalan Kemoterapi' - } else if (mode === 'verification') { - return 'Verifikasi Jadwal Pasien' + } else if (mode === 'series') { + return 'Proses Jadwal Pasien' } return route.meta.title as string }, @@ -46,7 +46,7 @@ const mode = computed(() => route.params.mode as string)
- +