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