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 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) {