diff --git a/app/assets/svg/wavey-fingerprint.svg b/app/assets/svg/wavey-fingerprint.svg new file mode 100644 index 00000000..b281297f --- /dev/null +++ b/app/assets/svg/wavey-fingerprint.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/components/app/device-order-item/entry-form.vue b/app/components/app/device-order-item/entry-form.vue new file mode 100644 index 00000000..3ae2d200 --- /dev/null +++ b/app/components/app/device-order-item/entry-form.vue @@ -0,0 +1,73 @@ + + + \ No newline at end of file diff --git a/app/components/app/device-order-item/list-entry.config.ts b/app/components/app/device-order-item/list-entry.config.ts index f2f3ef86..d47c4368 100644 --- a/app/components/app/device-order-item/list-entry.config.ts +++ b/app/components/app/device-order-item/list-entry.config.ts @@ -1,36 +1,35 @@ import { defineAsyncComponent } from 'vue' -import type { Config } from '~/components/pub/my-ui/data-table' - +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue')) export const config: Config = { - cols: [{}, {}, { width: 50 }], + cols: [{}, { width: 200 }, { width: 100 }], headers: [[{ label: 'Nama' }, { label: 'Jumlah' }, { label: '' }]], - keys: ['name', 'count', 'action'], + keys: ['device.name', 'quantity', 'action'], delKeyNames: [ { key: 'name', label: 'Nama' }, { key: 'count', label: 'Jumlah' }, ], - skeletonSize: 10 + skeletonSize: 10, // funcParsed: { // parent: (rec: unknown): unknown => { // const recX = rec as SmallDetailDto // return recX.parent?.name || '-' // }, // }, - // funcComponent: { - // action(rec: object, idx: any) { - // const res: RecComponent = { - // idx, - // rec: rec as object, - // component: action, - // props: { - // size: 'sm', - // }, - // } - // return res - // }, - // } + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + props: { + size: 'sm', + }, + } + return res + }, + } } diff --git a/app/components/app/device-order-item/list-entry.vue b/app/components/app/device-order-item/list-entry.vue index 26f6691d..b6031228 100644 --- a/app/components/app/device-order-item/list-entry.vue +++ b/app/components/app/device-order-item/list-entry.vue @@ -1,13 +1,23 @@ diff --git a/app/components/app/device-order/confirmation-info.vue b/app/components/app/device-order/confirmation-info.vue new file mode 100644 index 00000000..6711091f --- /dev/null +++ b/app/components/app/device-order/confirmation-info.vue @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/app/components/app/device-order/entry-form.vue b/app/components/app/device-order/entry-form.vue index bea2b6eb..4e66c441 100644 --- a/app/components/app/device-order/entry-form.vue +++ b/app/components/app/device-order/entry-form.vue @@ -1,6 +1,25 @@ diff --git a/app/components/app/device-order/list.config.ts b/app/components/app/device-order/list.config.ts index 7580c576..04a6c9fc 100644 --- a/app/components/app/device-order/list.config.ts +++ b/app/components/app/device-order/list.config.ts @@ -1,13 +1,18 @@ -import type { Config } from '~/components/pub/my-ui/data-table' +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' import type { DeviceOrder } from '~/models/device-order' -import { defineAsyncComponent } from 'vue' +import type { DeviceOrderItem } from '~/models/device-order-item' -const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue')) +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dsd.vue')) export const config: Config = { - cols: [{ width: 120 }, { }, { }, { width: 50 }], - headers: [[{ label: 'Tanggal' }, { label: 'DPJP' }, { label: 'Alat Kesehatan' }, { label: '' }]], - keys: ['createdAt', 'encounter.doctor.person.name', 'items', 'action'], + cols: [{ width: 120 }, { }, { }, { }, { width: 50 }], + headers: [[ + { label: 'Tanggal' }, + { label: 'DPJP' }, + { label: 'Alat Kesehatan' }, + { label: 'Status' }, + { label: '' }]], + keys: ['createdAt', 'doctor.employee.person.name', 'items', 'status_code', 'action'], delKeyNames: [ { key: 'code', label: 'Kode' }, { key: 'name', label: 'Nama' }, @@ -16,27 +21,45 @@ export const config: Config = { htmls: { items: (rec: unknown): unknown => { const recX = rec as DeviceOrder - return recX.items?.length || 0 + if (recX.items?.length > 0) { + let output = '' + recX.items.forEach((item: DeviceOrderItem) => { + output += '' + + ''+ + `` + + '' + + `` + + '' + }) + output += '
${item.device?.name}:${item.quantity}
' + return output + } else { + return '-' + } + }, + }, + parses: { + createdAt: (rec: unknown): unknown => { + const recX = rec as DeviceOrder + return recX.createdAt ? new Date(recX.createdAt).toLocaleDateString() : '-' + }, + // 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, + props: { + size: 'sm', + }, + } + return res }, } - // funcParsed: { - // parent: (rec: unknown): unknown => { - // const recX = rec as SmallDetailDto - // return recX.parent?.name || '-' - // }, - // }, - // funcComponent: { - // action(rec: object, idx: any) { - // const res: RecComponent = { - // idx, - // rec: rec as object, - // component: action, - // props: { - // size: 'sm', - // }, - // } - // return res - // }, - // } } diff --git a/app/components/app/device-order/list.vue b/app/components/app/device-order/list.vue index 37b24ea3..83f57dd6 100644 --- a/app/components/app/device-order/list.vue +++ b/app/components/app/device-order/list.vue @@ -8,12 +8,10 @@ import type { PaginationMeta } from '~/components/pub/my-ui/pagination/paginatio // Configs import { config } from './list.config' -interface Props { +defineProps<{ data: any[] paginationMeta: PaginationMeta -} - -defineProps() +}>() const emit = defineEmits<{ pageChange: [page: number] @@ -28,7 +26,7 @@ function handlePageChange(page: number) {
diff --git a/app/components/app/document-upload/_common/select-doc-type.vue b/app/components/app/document-upload/_common/select-doc-type.vue new file mode 100644 index 00000000..70f78a7b --- /dev/null +++ b/app/components/app/document-upload/_common/select-doc-type.vue @@ -0,0 +1,71 @@ + + + diff --git a/app/components/app/document-upload/entry-form.vue b/app/components/app/document-upload/entry-form.vue new file mode 100644 index 00000000..f97a5161 --- /dev/null +++ b/app/components/app/document-upload/entry-form.vue @@ -0,0 +1,73 @@ + + + diff --git a/app/components/app/document-upload/list.cfg.ts b/app/components/app/document-upload/list.cfg.ts new file mode 100644 index 00000000..979c916d --- /dev/null +++ b/app/components/app/document-upload/list.cfg.ts @@ -0,0 +1,43 @@ +import type { Config } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' +import { docTypeCode, docTypeLabel, type docTypeCodeKey } from '~/lib/constants' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dd.vue')) + +export const config: Config = { + cols: [{}, {}, {}, {width: 50},], + + headers: [ + [ + { label: 'Nama Dokumen' }, + { label: 'Tipe Dokumen' }, + { label: 'Petugas Upload' }, + { label: 'Action' }, + ], + ], + + keys: ['fileName', 'type_code', 'employee.name', 'action'], + + delKeyNames: [ + + ], + + parses: { + type_code: (v: unknown) => { + return docTypeLabel[v?.type_code as docTypeCodeKey] + }, + }, + + components: { + action(rec, idx) { + return { + idx, + rec: rec as object, + component: action, + } + }, + }, + + htmls: { + }, +} diff --git a/app/components/app/document-upload/list.vue b/app/components/app/document-upload/list.vue new file mode 100644 index 00000000..8274e752 --- /dev/null +++ b/app/components/app/document-upload/list.vue @@ -0,0 +1,31 @@ + + + diff --git a/app/components/app/general-consent/entry.vue b/app/components/app/general-consent/entry.vue new file mode 100644 index 00000000..75e30cec --- /dev/null +++ b/app/components/app/general-consent/entry.vue @@ -0,0 +1,214 @@ + + + diff --git a/app/components/app/general-consent/list.cfg.ts b/app/components/app/general-consent/list.cfg.ts new file mode 100644 index 00000000..c2f57c54 --- /dev/null +++ b/app/components/app/general-consent/list.cfg.ts @@ -0,0 +1,82 @@ +import type { Config, RecComponent, RecStrFuncComponent, RecStrFuncUnknown } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' +import type { GeneralConsent } from '~/models/general-consent' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue')) +export const config: Config = { + cols: [{ width: 100 }, {}, {}, {}, { width: 50 }], + headers: [ + [ + { label: 'Tanggal' }, + { label: 'Anggota Keluarga' }, + { label: 'Penanggung Jawab' }, + { label: 'Pemberi Informasi' }, + { label: 'Saksi 1' }, + { label: 'Saksi 2' }, + { label: '' }, + ], + ], + keys: ['date', 'relatives', 'responsible', 'informant', 'witness1', 'witness2', 'action'], + delKeyNames: [ + { key: 'data', label: 'Tanggal' }, + { key: 'dstDoctor.name', label: 'Dokter' }, + ], + parses: { + date(rec) { + const recX = rec as GeneralConsent + return recX?.createdAt?.substring(0, 10) || '-' + }, + relatives(rec) { + const recX = rec as GeneralConsent + const parsed = JSON.parse(recX?.value || '{}') + return parsed?.relatives?.join(', ') || '-' + }, + responsible(rec) { + const recX = rec as GeneralConsent + const parsed = JSON.parse(recX?.value || '{}') + return parsed?.responsible || '-' + }, + informant(rec) { + const recX = rec as GeneralConsent + const parsed = JSON.parse(recX?.value || '{}') + return parsed?.informant || '-' + }, + witness1(rec) { + const recX = rec as GeneralConsent + const parsed = JSON.parse(recX?.value || '{}') + return parsed?.witness1 || '-' + }, + witness2(rec) { + const recX = rec as GeneralConsent + const parsed = JSON.parse(recX?.value || '{}') + return parsed?.witness2 || '-' + }, + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + props: { + size: 'sm', + }, + } + return res + }, + }, + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + props: { + size: 'sm', + }, + } + return res + }, + } as RecStrFuncComponent, + htmls: {} as RecStrFuncUnknown, +} diff --git a/app/components/app/general-consent/list.vue b/app/components/app/general-consent/list.vue new file mode 100644 index 00000000..46f595f5 --- /dev/null +++ b/app/components/app/general-consent/list.vue @@ -0,0 +1,34 @@ + + + diff --git a/app/components/app/medicine-form/entry-form.vue b/app/components/app/medicine-form/entry-form.vue new file mode 100644 index 00000000..fb26631e --- /dev/null +++ b/app/components/app/medicine-form/entry-form.vue @@ -0,0 +1,119 @@ + + + diff --git a/app/components/app/medicine-form/list-cfg.ts b/app/components/app/medicine-form/list-cfg.ts new file mode 100644 index 00000000..5b66812a --- /dev/null +++ b/app/components/app/medicine-form/list-cfg.ts @@ -0,0 +1,38 @@ +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue')) + +export const config: Config = { + cols: [{}, {}, { width: 50 }], + + headers: [ + [ + { label: 'Kode' }, + { label: 'Nama' }, + { label: 'Aksi' }, + ], + ], + + keys: ['code', 'name', 'action'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: {}, + + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, + }, + + htmls: {}, +} diff --git a/app/components/app/medicine-form/list.vue b/app/components/app/medicine-form/list.vue new file mode 100644 index 00000000..e4544c2f --- /dev/null +++ b/app/components/app/medicine-form/list.vue @@ -0,0 +1,35 @@ + + + diff --git a/app/components/app/medicine/entry-form.vue b/app/components/app/medicine/entry-form.vue index 42989fcb..af4df34f 100644 --- a/app/components/app/medicine/entry-form.vue +++ b/app/components/app/medicine/entry-form.vue @@ -18,6 +18,7 @@ interface Props { isReadonly?: boolean medicineGroups?: { value: string; label: string }[] medicineMethods?: { value: string; label: string }[] + medicineForms?: { value: string; label: string }[] uoms?: { value: string; label: string }[] } @@ -36,6 +37,7 @@ const { defineField, errors, meta } = useForm({ name: '', medicineGroup_code: '', medicineMethod_code: '', + medicineForm_code: '', uom_code: '', stock: 0, }, @@ -45,6 +47,7 @@ const [code, codeAttrs] = defineField('code') const [name, nameAttrs] = defineField('name') const [medicineGroup_code, medicineGroupAttrs] = defineField('medicineGroup_code') const [medicineMethod_code, medicineMethodAttrs] = defineField('medicineMethod_code') +const [medicineForm_code, medicineFormAttrs] = defineField('medicineForm_code') const [uom_code, uomAttrs] = defineField('uom_code') const [stock, stockAttrs] = defineField('stock') @@ -53,6 +56,7 @@ if (props.values) { if (props.values.name !== undefined) name.value = props.values.name if (props.values.medicineGroup_code !== undefined) medicineGroup_code.value = props.values.medicineGroup_code if (props.values.medicineMethod_code !== undefined) medicineMethod_code.value = props.values.medicineMethod_code + if (props.values.medicineForm_code !== undefined) medicineForm_code.value = props.values.medicineForm_code if (props.values.uom_code !== undefined) uom_code.value = props.values.uom_code if (props.values.stock !== undefined) stock.value = props.values.stock } @@ -62,6 +66,7 @@ const resetForm = () => { name.value = '' medicineGroup_code.value = '' medicineMethod_code.value = '' + medicineForm_code.value = '', uom_code.value = '' stock.value = 0 } @@ -72,6 +77,7 @@ function onSubmitForm() { name: name.value || '', medicineGroup_code: medicineGroup_code.value || '', medicineMethod_code: medicineMethod_code.value || '', + medicineForm_code: medicineForm_code.value || '', uom_code: uom_code.value || '', stock: stock.value || 0, } @@ -138,6 +144,20 @@ function onCancelForm() { /> + + + +