fix: list integration

This commit is contained in:
riefive
2025-10-02 14:12:10 +07:00
parent 6feb480a51
commit 3c046a4d82
13 changed files with 91 additions and 22 deletions
@@ -4,6 +4,7 @@ import Block from '~/components/pub/custom-ui/doc-entry/block.vue'
import Cell from '~/components/pub/custom-ui/doc-entry/cell.vue'
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
import Label from '~/components/pub/custom-ui/doc-entry/label.vue'
import Combobox from '~/components/pub/custom-ui/form/combobox.vue'
// Types
import type { DivisionFormData } from '~/schemas/division.schema.ts'
@@ -15,6 +16,7 @@ import { useForm } from 'vee-validate'
interface Props {
schema: z.ZodSchema<any>
divisions: any[]
values: any
isLoading?: boolean
isReadonly?: boolean
@@ -85,6 +87,21 @@ function onCancelForm() {
<Input id="name" v-model="name" v-bind="nameAttrs" :disabled="isLoading || isReadonly" />
</Field>
</Cell>
<Cell>
<Label height="compact">Divisi Induk</Label>
<Field :errMessage="errors.division">
<Combobox
id="division"
v-model="division"
v-bind="divisionAttrs"
:items="divisions"
:disabled="isLoading || isReadonly"
placeholder="Pilih Divisi Induk"
search-placeholder="Cari divisi"
empty-message="Divisi tidak ditemukan"
/>
</Field>
</Cell>
</Block>
<div class="my-2 flex justify-end gap-2 py-2">
<Button type="button" variant="secondary" class="w-[120px]" @click="onCancelForm"> Kembali </Button>
+4 -8
View File
@@ -12,11 +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: 'Kode' }, { label: 'Nama' }, { label: 'Divisi Induk' }, { label: '' }]]
export const keys = ['code', 'name', 'ancestor', 'action']
export const keys = ['code', 'name', 'parent', 'action']
export const delKeyNames: KeyLabel[] = [
{ key: 'code', label: 'Kode' },
@@ -24,13 +24,9 @@ export const delKeyNames: KeyLabel[] = [
]
export const funcParsed: RecStrFuncUnknown = {
ancestor: (rec: unknown): unknown => {
parent: (rec: unknown): unknown => {
const recX = rec as SmallDetailDto
if (recX.meta === null) {
return '-'
}
return recX.meta.name
return recX.parent?.name || '-'
},
}
+3
View File
@@ -28,6 +28,7 @@ import {
handleActionRemove,
handleCancelForm,
} from '~/handlers/division.handler'
import { divisions, getDivisionParentList } from '~/handlers/_shared.handler'
// Services
import { getDivisions, getDivisionDetail } from '~/services/division.service'
@@ -111,6 +112,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
await getDivisionList()
await getDivisionParentList(false, data.value || [])
})
</script>
@@ -127,6 +129,7 @@ onMounted(async () => {
<Dialog v-model:open="isFormEntryDialogOpen" :title="!!recItem ? title : 'Tambah Divisi'" size="lg" prevent-outside>
<AppDivisionEntryForm
:schema="DivisionSchema"
:divisions="divisions"
:values="recItem"
:is-loading="isProcessing"
:is-readonly="isReadonly"
+2 -2
View File
@@ -29,7 +29,7 @@ import {
handleActionRemove,
handleCancelForm,
} from '~/handlers/material.handler'
import { uoms, getUomList } from "~/handlers/_shared.handler"
import { uoms, getUomList } from '~/handlers/_shared.handler'
// Services
import { getMaterials, getMaterialDetail } from '~/services/material.service'
@@ -112,8 +112,8 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
await getUomList()
await getEquipmentList()
await getUomList()
})
</script>
+1 -1
View File
@@ -111,8 +111,8 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
await getEncounterClassConstants()
await getInstallationList()
await getEncounterClassConstants()
})
</script>
+6 -2
View File
@@ -55,7 +55,11 @@ const {
fetchData: getMedicineList,
} = usePaginatedList({
fetchFn: async (params: any) => {
const result = await getMedicines({ search: params.search, page: params['page-number'] || 0, includes: 'medicineGroup,medicineMethod,uom' })
const result = await getMedicines({
search: params.search,
page: params['page-number'] || 0,
includes: 'medicineGroup,medicineMethod,uom',
})
return { success: result.success || false, body: result.body || {} }
},
entityName: 'medicine',
@@ -120,10 +124,10 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
await getMedicineList()
await getMedicineGroupList()
await getMedicineMethodList()
await getUomList()
await getMedicineList()
})
</script>
+1 -1
View File
@@ -112,8 +112,8 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
await getUnitList()
await getSpecialistList()
await getUnitList()
})
</script>
@@ -111,8 +111,8 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
await getSpecialistsList()
await getSubSpecialistList()
await getSpecialistsList()
})
</script>
+1 -1
View File
@@ -116,8 +116,8 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
await getUomList()
await getToolsList()
await getUomList()
})
</script>
+1 -1
View File
@@ -111,8 +111,8 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
await getInstallationList()
await getUnitList()
await getInstallationList()
})
</script>