diff --git a/app/components/app/installation/entry-form-prev.vue b/app/components/app/installation/entry-form-prev.vue new file mode 100644 index 00000000..8272fc27 --- /dev/null +++ b/app/components/app/installation/entry-form-prev.vue @@ -0,0 +1,125 @@ + + + + + onSubmitForm(values, { resetForm }))"> + + + + Nama + + + + + + + + + + + + + + Kode + + + + + + + + + + + + + + Encounter Class + + + + + + + + + + + + + + + + + + Batal + + + Simpan + + + + + diff --git a/app/components/app/installation/entry-form.vue b/app/components/app/installation/entry-form.vue index 8272fc27..c32b9ad9 100644 --- a/app/components/app/installation/entry-form.vue +++ b/app/components/app/installation/entry-form.vue @@ -1,125 +1,102 @@ - - onSubmitForm(values, { resetForm }))"> - - - - Nama - - - - - - - - - - - - - - Kode - - - - - - - - - - - - - - Encounter Class - - - - - - - - - - - - - - - - - - Batal - - - Simpan - - - - + + + + Kode + + + + + + Nama + + + + + + + Kembali + + Simpan + + + diff --git a/app/components/app/installation/list-cfg.ts b/app/components/app/installation/list-cfg.ts index 6b8dc5ea..c0bff58e 100644 --- a/app/components/app/installation/list-cfg.ts +++ b/app/components/app/installation/list-cfg.ts @@ -12,13 +12,11 @@ type SmallDetailDto = any const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-ud.vue')) -export const cols: Col[] = [{ width: 100 }, {}, {}, {}, { width: 50 }] +export const cols: Col[] = [{}, {}, {}, { width: 50 }] -export const header: Th[][] = [ - [{ label: 'Id' }, { label: 'Nama' }, { label: 'Kode' }, { label: 'Encounter Class' }, { label: '' }], -] +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Encounter Class' }, { label: '' }]] -export const keys = ['id', 'name', 'cellphone', 'religion_code', 'action'] +export const keys = ['code', 'name', 'encounterClass_code', 'action'] export const delKeyNames: KeyLabel[] = [ { key: 'code', label: 'Kode' }, @@ -28,22 +26,7 @@ export const delKeyNames: KeyLabel[] = [ export const funcParsed: RecStrFuncUnknown = { name: (rec: unknown): unknown => { const recX = rec as SmallDetailDto - return `${recX.firstName} ${recX.lastName || ''}`.trim() - }, - identity_number: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - if (recX.identity_number?.substring(0, 5) === 'BLANK') { - return '(TANPA NIK)' - } - return recX.identity_number - }, - inPatient_itemPrice: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - return Number(recX.inPatient_itemPrice.price).toLocaleString('id-ID') - }, - outPatient_itemPrice: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - return Number(recX.outPatient_itemPrice.price).toLocaleString('id-ID') + return `${recX.name}`.trim() }, } @@ -65,4 +48,4 @@ export const funcHtml: RecStrFuncUnknown = { patient_address(_rec) { return '-' }, -} +} \ No newline at end of file diff --git a/app/components/app/installation/list.vue b/app/components/app/installation/list.vue index e9489ef1..cde2a4ce 100644 --- a/app/components/app/installation/list.vue +++ b/app/components/app/installation/list.vue @@ -22,10 +22,15 @@ function handlePageChange(page: number) { - diff --git a/app/components/content/installation/list-prev.vue b/app/components/content/installation/list-prev.vue new file mode 100644 index 00000000..59a96c00 --- /dev/null +++ b/app/components/content/installation/list-prev.vue @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + ID: {{ record?.id }} + Nama: {{ record.firstName }} + Kode: {{ record.cellphone }} + + + + + + diff --git a/app/components/content/installation/list.vue b/app/components/content/installation/list.vue index baeab8c9..d70db2f4 100644 --- a/app/components/content/installation/list.vue +++ b/app/components/content/installation/list.vue @@ -1,31 +1,39 @@ - + - - + + , resetForm: () => void) => { + if (recId > 0) { + handleActionEdit(recId, values, getInstallationList, resetForm, toast) + return + } + handleActionSave(values, getInstallationList, resetForm, toast) + } + " + @cancel="handleCancelForm" + /> - + handleActionRemove(recId, getInstallationList, toast)" + @cancel="" + > ID: {{ record?.id }} - Nama: {{ record.firstName }} - Kode: {{ record.cellphone }} + Nama: {{ record.name }} + Kode: {{ record.code }} - - diff --git a/app/models/installation.ts b/app/models/installation.ts index c662714e..3b027962 100644 --- a/app/models/installation.ts +++ b/app/models/installation.ts @@ -1,5 +1,5 @@ export interface Installation { code: string name: string - encounterClass_code: string + encounterClass_code?: string | null } diff --git a/app/schemas/installation.schema.ts b/app/schemas/installation.schema.ts new file mode 100644 index 00000000..75e18074 --- /dev/null +++ b/app/schemas/installation.schema.ts @@ -0,0 +1,9 @@ +import { z } from 'zod' + +export const InstallationSchema = z.object({ + code: z.string().min(1, 'Kode wajib diisi'), + name: z.string().min(1, 'Nama wajib diisi'), + encounterClass_code: z.string().min(1, 'Encounter Class wajib diisi').optional(), +}) + +export type InstallationFormData = z.infer
ID: {{ record?.id }}
Nama: {{ record.firstName }}
Kode: {{ record.cellphone }}
Nama: {{ record.name }}
Kode: {{ record.code }}