diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 14264ade..23f92526 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -84,12 +84,14 @@ const employeeFormStore = useEmployeeForm(); const optionStore = useOptionStore(); const ocrStore = useOcrStore(); -const filtdRequire = ref<{ [key: string]: (keyof CustomerBranchCreate)[] }>({ - main: ['citizenId', 'legalPersonNo', 'registerName'], - address: ['address', 'addressEN', 'provinceId', 'districtId'], - business: [], - contact: ['contactName', 'telephoneNo'], -}); +const tabFieldRequired = ref<{ [key: string]: (keyof CustomerBranchCreate)[] }>( + { + main: ['citizenId', 'legalPersonNo', 'registerName'], + address: ['address', 'addressEN', 'provinceId', 'districtId'], + business: [], + contact: ['contactName', 'telephoneNo'], + }, +); const { state: customerFormState, currentFormData: customerFormData } = storeToRefs(customerFormStore); @@ -1951,7 +1953,7 @@ const emptyCreateDialog = ref(false); if (!customerFormState.editCustomerId) return; if (customerFormData.customerType === 'CORP') { - filtdRequire.main = [ + tabFieldRequired.main = [ 'legalPersonNo', 'registerName', 'address', @@ -1959,12 +1961,12 @@ const emptyCreateDialog = ref(false); ]; } if (customerFormData.customerType === 'PERS') { - filtdRequire.main = ['citizenId']; + tabFieldRequired.main = ['citizenId']; } let tapIsUndefined = validateTabField( customerFormData.customerBranch?.[idx], - filtdRequire, + tabFieldRequired, ); if (tapIsUndefined.length > 0) { @@ -3122,15 +3124,18 @@ const emptyCreateDialog = ref(false); if (!customerFormState.editCustomerId) return; if (customerFormData.customerType === 'CORP') { - filtdRequire.main = ['legalPersonNo', 'registerName']; + tabFieldRequired.main = [ + 'legalPersonNo', + 'registerName', + ]; } if (customerFormData.customerType === 'PERS') { - filtdRequire.main = ['citizenId']; + tabFieldRequired.main = ['citizenId']; } let tapIsUndefined = validateTabField( customerFormData.customerBranch?.[idx], - filtdRequire, + tabFieldRequired, ); if (tapIsUndefined.length > 0) {