feat: auto pull data from headoffice

This commit is contained in:
Methapon Metanipat 2024-09-26 10:09:53 +07:00
parent d740a48c7f
commit 7fcae06d4d

View file

@ -249,25 +249,33 @@ export const useCustomerForm = defineStore('form-customer', () => {
? ''
: currentFormData.value.customerBranch?.[0].citizenId
: '',
namePrefix: '',
firstName: '',
lastName: '',
firstNameEN: '',
lastNameEN: '',
telephoneNo: '',
gender: '',
birthDate: '',
namePrefix: currentFormData.value.customerBranch?.at(0)?.namePrefix || '',
firstName: currentFormData.value.customerBranch?.at(0)?.firstName || '',
lastName: currentFormData.value.customerBranch?.at(0)?.lastName || '',
firstNameEN:
currentFormData.value.customerBranch?.at(0)?.firstNameEN || '',
lastNameEN: currentFormData.value.customerBranch?.at(0)?.lastNameEN || '',
telephoneNo:
currentFormData.value.customerBranch?.at(0)?.telephoneNo || '',
gender: currentFormData.value.customerBranch?.at(0)?.gender || '',
birthDate: currentFormData.value.customerBranch?.at(0)?.birthDate || '',
businessType: '',
jobPosition: '',
jobDescription: '',
payDate: '',
payDateEN: '',
wageRate: 0,
wageRateText: '',
homeCode: '',
employmentOffice: '',
employmentOfficeEN: '',
businessType:
currentFormData.value.customerBranch?.at(0)?.businessType || '',
jobPosition:
currentFormData.value.customerBranch?.at(0)?.jobPosition || '',
jobDescription:
currentFormData.value.customerBranch?.at(0)?.jobDescription || '',
payDate: currentFormData.value.customerBranch?.at(0)?.payDate || '',
payDateEN: currentFormData.value.customerBranch?.at(0)?.payDateEN || '',
wageRate: currentFormData.value.customerBranch?.at(0)?.wageRate || 0,
wageRateText:
currentFormData.value.customerBranch?.at(0)?.wageRateText || '',
homeCode: currentFormData.value.customerBranch?.at(0)?.homeCode || '',
employmentOffice:
currentFormData.value.customerBranch?.at(0)?.employmentOffice || '',
employmentOfficeEN:
currentFormData.value.customerBranch?.at(0)?.employmentOfficeEN || '',
address: '',
addressEN: '',
@ -281,20 +289,28 @@ export const useCustomerForm = defineStore('form-customer', () => {
districtId: '',
subDistrictId: '',
contactName: '',
email: '',
contactTel: '',
officeTel: '',
agent: '',
contactName:
currentFormData.value.customerBranch?.at(0)?.contactTel || '',
email: currentFormData.value.customerBranch?.at(0)?.email || '',
contactTel: currentFormData.value.customerBranch?.at(0)?.contactTel || '',
officeTel: currentFormData.value.customerBranch?.at(0)?.officeTel || '',
agent: currentFormData.value.customerBranch?.at(0)?.agent || '',
status: 'CREATED',
customerName: '',
registerName: '',
registerNameEN: '',
registerDate: null,
authorizedCapital: '',
authorizedName: '',
authorizedNameEN: '',
customerName:
currentFormData.value.customerBranch?.at(0)?.customerName || '',
registerName:
currentFormData.value.customerBranch?.at(0)?.registerName || '',
registerNameEN:
currentFormData.value.customerBranch?.at(0)?.registerNameEN || '',
registerDate:
currentFormData.value.customerBranch?.at(0)?.registerDate || null,
authorizedCapital:
currentFormData.value.customerBranch?.at(0)?.authorizedCapital || '',
authorizedName:
currentFormData.value.customerBranch?.at(0)?.authorizedName || '',
authorizedNameEN:
currentFormData.value.customerBranch?.at(0)?.authorizedNameEN || '',
file: [],
});
state.value.branchIndex =