diff --git a/app/components/app/division/entry-form.vue b/app/components/app/division/entry-form.vue index d6f7556f..118d1b6c 100644 --- a/app/components/app/division/entry-form.vue +++ b/app/components/app/division/entry-form.vue @@ -35,7 +35,7 @@ const { defineField, errors, meta } = useForm({ initialValues: { code: '', name: '', - division_id: '', + division_id: 0, } as Partial, }) @@ -57,7 +57,7 @@ const resetForm = () => { } // Form submission handler -function onSubmitForm(values: any) { +function onSubmitForm() { const formData: DivisionFormData = { name: name.value || '', code: code.value || '', diff --git a/app/components/content/division/list.vue b/app/components/content/division/list.vue index 482fd84b..d759192e 100644 --- a/app/components/content/division/list.vue +++ b/app/components/content/division/list.vue @@ -32,6 +32,7 @@ import { divisions, getDivisionParentList } from '~/handlers/_shared.handler' // Services import { getDivisions, getDivisionDetail } from '~/services/division.service' +import { getDivisionPositions } from '~/services/division-position.service' const title = ref('') @@ -114,10 +115,15 @@ watch([recId, recAction], () => { } }) -onMounted(async () => { - await getDivisionList() +watch(() => data.value, async () => { + if (!data.value) return await getDivisionParentList(false, data.value || []) }) + +onMounted(async () => { + await getDivisionPositions() + await getDivisionList() +})