refactor: edit name value filName -> nameField

This commit is contained in:
Thanaphon Frappet 2024-10-24 10:27:03 +07:00
parent 6284b399bc
commit fbc47c7d86
4 changed files with 39 additions and 38 deletions

View file

@ -1113,6 +1113,7 @@ function storeDataLocal() {
</DialogForm>
<!-- add product service -->
<ProductServiceForm
v-model="pageState.productServiceModal"
v-model:nodes="productServiceNodes"
@ -1314,8 +1315,8 @@ function storeDataLocal() {
if (group === 'passport') {
const fullName = allMeta['full_name'].split(' ');
let tempValue: {
oldData: { filName: string; value: string }[];
newData: { filName: string; value: string }[];
oldData: { nameField: string; value: string }[];
newData: { nameField: string; value: string }[];
} = { oldData: [], newData: [] };
if (
@ -1323,55 +1324,55 @@ function storeDataLocal() {
formDataEmployee.gender !== allMeta['sex']
) {
tempValue.oldData.push({
filName: $t('form.gender'),
nameField: $t('form.gender'),
value: $t(`general.${formDataEmployee.gender}`),
});
tempValue.newData.push({
filName: $t('form.gender'),
nameField: $t('form.gender'),
value: $t(`general.${allMeta['sex']}`),
});
}
if (formDataEmployee.firstName !== '') {
tempValue.oldData.push({
filName: $t('personnel.form.firstName'),
nameField: $t('personnel.form.firstName'),
value: formDataEmployee.firstName,
});
tempValue.newData.push({
filName: $t('personnel.form.firstName'),
nameField: $t('personnel.form.firstName'),
value: fullName[0],
});
}
if (formDataEmployee.lastName !== '') {
tempValue.oldData.push({
filName: $t('personnel.form.lastName'),
nameField: $t('personnel.form.lastName'),
value: formDataEmployee.lastName,
});
tempValue.newData.push({
filName: $t('personnel.form.lastName'),
nameField: $t('personnel.form.lastName'),
value: fullName[1],
});
}
if (formDataEmployee.passportNo !== '') {
tempValue.oldData.push({
filName: $t('customerEmployee.form.passportNo'),
nameField: $t('customerEmployee.form.passportNo'),
value: formDataEmployee.passportNo || '',
});
tempValue.newData.push({
filName: $t('customerEmployee.form.passportNo'),
nameField: $t('customerEmployee.form.passportNo'),
value: allMeta['doc_number'],
});
}
if (formDataEmployee.nationality !== '') {
tempValue.oldData.push({
filName: $t('general.nationality'),
nameField: $t('general.nationality'),
value: formDataEmployee.nationality || '',
});
tempValue.newData.push({
filName: $t('general.nationality'),
nameField: $t('general.nationality'),
value: allMeta['nationality'],
});
}