diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts index e5cb6b9d..4f501ed5 100644 --- a/src/pages/03_customer-management/form.ts +++ b/src/pages/03_customer-management/form.ts @@ -194,7 +194,7 @@ export const useCustomerForm = defineStore('form-customer', () => { homeCode: v.homeCode, contactTel: v.contactTel, officeTel: v.officeTel, - agentUserId: v.agentUserId, + agentUserId: v.agentUserId || undefined, customerName: v.customerName, authorizedName: v.authorizedName, authorizedNameEN: v.authorizedNameEN, @@ -295,7 +295,7 @@ export const useCustomerForm = defineStore('form-customer', () => { contactTel: currentFormData.value.customerBranch?.at(0)?.contactTel || '', officeTel: currentFormData.value.customerBranch?.at(0)?.officeTel || '', agentUserId: - currentFormData.value.customerBranch?.at(0)?.agentUserId || '', + currentFormData.value.customerBranch?.at(0)?.agentUserId || undefined, status: 'CREATED', customerName: @@ -509,7 +509,7 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => { wageRateText: _data.wageRateText, contactTel: _data.contactTel, officeTel: _data.officeTel, - agentUserId: _data.agentUserId, + agentUserId: _data.agentUserId || undefined, codeCustomer: _data.codeCustomer, customerName: _data.customerName, homeCode: _data.homeCode, @@ -642,7 +642,7 @@ export const useEmployeeForm = defineStore('form-employee', () => { id: '', code: '', customerBranchId: '', - nrcNo: '', + nrcNo: undefined, dateOfBirth: null, gender: '', nationality: '', @@ -1126,6 +1126,7 @@ export const useEmployeeForm = defineStore('form-employee', () => { currentFromDataEmployee.value = structuredClone(resetEmployeeData); + state.value.currentIndexPassport = (currentFromDataEmployee.value.employeePassport?.length || 0) - 1;