diff --git a/src/constants/employers.ts b/src/constants/employers.ts index a170f44..c64bfc9 100644 --- a/src/constants/employers.ts +++ b/src/constants/employers.ts @@ -23,7 +23,7 @@ export const EMPLOYERS = [ }, { name: 'Xtra Biz Sdn Bhd (XBSB)', - address: "Lot 241, Jalan Dato' Cik Arif, Taman Mutiara 1, 15000 Kota Bharu, Kelantan.", + address: "-", }, { name: 'Pesara', diff --git a/src/modules/membership-application/pages/MembershipApplicationEdit.vue b/src/modules/membership-application/pages/MembershipApplicationEdit.vue index 9949187..aef9d75 100644 --- a/src/modules/membership-application/pages/MembershipApplicationEdit.vue +++ b/src/modules/membership-application/pages/MembershipApplicationEdit.vue @@ -58,6 +58,7 @@ import { ADMIN_ATTACHMENT_DOCUMENT_TYPE } from '../types/membership-application. import { APPLICANT_DOCUMENT_UPLOAD_TYPES, DOCUMENT_TYPE_LABELS, + EMPLOYER_OPTIONS, GENDER_OPTIONS, MARRIAGE_STATUS_OPTIONS, RELATIONSHIP_OPTIONS, @@ -67,6 +68,7 @@ import { createEmptyFormState, createSelectCollection, detailToFormState, + getEmployerAddress, labelToApiValue, } from '../utils/membership-application-form.utils' @@ -112,6 +114,7 @@ const referenceLookupLoading = reactive({ const genderCollection = createSelectCollection(GENDER_OPTIONS) const marriageStatusCollection = createSelectCollection(MARRIAGE_STATUS_OPTIONS) const relationshipCollection = createSelectCollection(RELATIONSHIP_OPTIONS) +const employerCollection = createSelectCollection(EMPLOYER_OPTIONS) const canEdit = computed( () => @@ -123,6 +126,7 @@ const genderInitial = computed(() => apiValueToLabel(GENDER_OPTIONS, form.applic const marriageStatusInitial = computed(() => apiValueToLabel(MARRIAGE_STATUS_OPTIONS, form.applicant.marriage_status), ) +const employerInitial = computed(() => apiValueToLabel(EMPLOYER_OPTIONS, form.applicant.employer_name)) const workflowProgress = computed(() => application.value ? getWorkflowProgress(application.value.status) : null, @@ -309,6 +313,14 @@ function setMarriageStatusValue(details: { value: string[] }) { delete fieldErrors['applicant.marriage_status'] } +function setEmployerValue(details: { value: string[] }) { + const employerName = labelToApiValue(EMPLOYER_OPTIONS, details.value[0]) + form.applicant.employer_name = employerName + form.applicant.employer_address = getEmployerAddress(employerName) + delete fieldErrors['applicant.employer_name'] + delete fieldErrors['applicant.employer_address'] +} + function setHeirRelationshipValue(index: number, details: { value: string[] }) { const heir = form.heirs[index] if (!heir) return @@ -859,8 +871,24 @@ onUnmounted(() => {
- Nama Majikan - + Nama Majikan + + + + + + + + + Nama Majikan + + {{ item.label }} + + + + {{ fieldErrors['applicant.employer_name'] }} @@ -872,7 +900,7 @@ onUnmounted(() => { Alamat Majikan -