diff --git a/app/components/app/control-letter/history-dialog.vue b/app/components/app/control-letter/history-dialog.vue new file mode 100644 index 00000000..7e5a2304 --- /dev/null +++ b/app/components/app/control-letter/history-dialog.vue @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/app/components/app/control-letter/history-list.cfg.ts b/app/components/app/control-letter/history-list.cfg.ts new file mode 100644 index 00000000..443bf237 --- /dev/null +++ b/app/components/app/control-letter/history-list.cfg.ts @@ -0,0 +1,85 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import type { Patient } from '~/models/patient' +import { defineAsyncComponent } from 'vue' +import { educationCodes, genderCodes } from '~/lib/constants' +import { calculateAge } from '~/lib/utils' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/print-btn.vue')) + +export const config: Config = { + cols: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {width: 130}, {width: 30},], + + headers: [ + [ + { label: 'NAMA PASIEN' }, + { label: 'NO.SURAT KONTROL' }, + { label: 'NO.SEP' }, + { label: 'TANGGAL RENCANA KONTROL' }, + { label: 'TANGGAL TERBIT' }, + { label: 'DPJP' }, + { label: 'SPESIALIS' }, + { label: 'SUBSPESIALIS' }, + { label: 'TIPE RAWAT' }, + { label: 'DIBUAT OLEH' }, + { label: 'DIEDIT OLEH' }, + { label: 'STATUS' }, + { label: 'AKSI' }, + ], + ], + + keys: [ + 'date', + 'name', + 'name', + 'name', + 'name', + 'name', + 'name', + 'name', + 'name', + 'name', + 'name', + 'status', + 'action', + ], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + date: (rec: unknown): unknown => { + const date = (rec as any).date + if (typeof date == 'object' && date) { + return (date as Date).toLocaleDateString('id-ID') + } else if (typeof date == 'string') { + return (date as string).substring(0, 10) + } + return date + }, + specialist_subspecialist: (rec: unknown): unknown => { + return '-' + }, + dpjp: (rec: unknown): unknown => { + // const { person } = rec as Patient + return '-' + }, + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + }, + + htmls: { + sep_status(_rec) { + return 'SEP Internal' + }, + }, +} diff --git a/app/components/app/diagnose-src/list.vue b/app/components/app/diagnose-src/list.vue index 1be60a60..9b603f6b 100644 --- a/app/components/app/diagnose-src/list.vue +++ b/app/components/app/diagnose-src/list.vue @@ -4,6 +4,7 @@ import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vu // Types import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type' +import type { Config, } from '~/components/pub/my-ui/data-table' // Configs import { config } from './list-cfg' @@ -11,9 +12,11 @@ import { config } from './list-cfg' interface Props { data: any[] paginationMeta: PaginationMeta + tableConfig?: Config } - -defineProps() +const props = withDefaults(defineProps(), { + tableConfig: () => config, +}) const emit = defineEmits<{ pageChange: [page: number] @@ -27,7 +30,7 @@ function handlePageChange(page: number) {