fix: variable name

This commit is contained in:
Methapon Metanipat 2024-09-16 14:41:59 +07:00
parent 0ab67596c3
commit 66a8d0a8b9

View file

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