Fix: refactor constList Uplaod Doc
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import type { FormErrors } from '~/types/error'
|
||||
import Combobox from '~/components/pub/my-ui/combobox/combobox.vue'
|
||||
import { cn, mapToComboboxOptList } from '~/lib/utils'
|
||||
import { supportingDocTypeCode, supportingDocOpt, type supportingDocTypeCodeKey } from '~/lib/constants'
|
||||
import { docTypeCode, supportingDocOpt, type docTypeCodeKey } from '~/lib/constants'
|
||||
import { getValueLabelList as getDoctorLabelList } from '~/services/doctor.service'
|
||||
import { getValueLabelList as getUnitLabelList } from '~/services/unit.service'
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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'))
|
||||
|
||||
@@ -22,6 +23,10 @@ export const config: Config = {
|
||||
],
|
||||
|
||||
parses: {
|
||||
type_code: (v: unknown) => {
|
||||
console.log(v)
|
||||
return docTypeLabel[v as docTypeCodeKey]
|
||||
},
|
||||
},
|
||||
|
||||
components: {
|
||||
|
||||
@@ -405,17 +405,21 @@ export const encounterDocOpt: { label: string; value: encounterDocTypeCodeKey }[
|
||||
]
|
||||
|
||||
|
||||
export const supportingDocTypeCode = {
|
||||
export const docTypeCode = {
|
||||
"encounter-patient": 'encounter-patient',
|
||||
"encounter-support": 'encounter-support',
|
||||
"encounter-other": 'encounter-other',
|
||||
"vclaim-sep": 'vclaim-sep',
|
||||
"vclaim-sipp": 'vclaim-sipp',
|
||||
} as const
|
||||
export const supportingDocTypeLabel = {
|
||||
export const docTypeLabel = {
|
||||
"encounter-patient": 'Data Pasien',
|
||||
"encounter-support": 'Data Penunjang',
|
||||
"encounter-other": 'Lain - Lain',
|
||||
"vclaim-sep": 'SEP',
|
||||
"vclaim-sipp": 'SIPP',
|
||||
} as const
|
||||
export type supportingDocTypeCodeKey = keyof typeof supportingDocTypeCode
|
||||
export type docTypeCodeKey = keyof typeof docTypeCode
|
||||
export const supportingDocOpt = [
|
||||
{ label: 'Data Pasien', value: 'encounter-patient' },
|
||||
{ label: 'Data Penunjang', value: 'encounter-support' },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type Base, genBase } from "./_base"
|
||||
import { supportingDocOpt, supportingDocTypeCode, supportingDocTypeLabel, type supportingDocTypeCodeKey } from '~/lib/constants'
|
||||
import { docTypeLabel, } from '~/lib/constants'
|
||||
import { genEmployee, type Employee } from "./employee"
|
||||
import { genEncounter, type Encounter } from "./encounter"
|
||||
|
||||
@@ -21,7 +21,7 @@ export function genEncounterDocument(): EncounterDocument {
|
||||
encounter: genEncounter(),
|
||||
upload_employee_id: 0,
|
||||
employee: genEmployee(),
|
||||
type_code: supportingDocTypeLabel["encounter-patient"],
|
||||
type_code: docTypeLabel["encounter-patient"],
|
||||
name: 'example',
|
||||
filePath: 'https://bing.com',
|
||||
fileName: 'example',
|
||||
|
||||
Reference in New Issue
Block a user