refactor: set value full name at ocr
This commit is contained in:
parent
75f726cf4d
commit
2c91afe162
1 changed files with 39 additions and 0 deletions
|
|
@ -1144,6 +1144,20 @@ watch(
|
|||
newData: { filName: string; value: string }[];
|
||||
} = { oldData: [], newData: [] };
|
||||
|
||||
if (
|
||||
formDataEmployee.gender !== '' &&
|
||||
formDataEmployee.gender !== allMeta['sex']
|
||||
) {
|
||||
tempValue.oldData.push({
|
||||
filName: $t('form.gender'),
|
||||
value: $t(`general.${formDataEmployee.gender}`),
|
||||
});
|
||||
tempValue.newData.push({
|
||||
filName: $t('form.gender'),
|
||||
value: $t(`general.${allMeta['sex']}`),
|
||||
});
|
||||
}
|
||||
|
||||
if (formDataEmployee.firstName !== '') {
|
||||
tempValue.oldData.push({
|
||||
filName: $t('personnel.form.firstName'),
|
||||
|
|
@ -1177,16 +1191,35 @@ watch(
|
|||
});
|
||||
}
|
||||
|
||||
if (formDataEmployee.nationality !== '') {
|
||||
tempValue.oldData.push({
|
||||
filName: $t('general.nationality'),
|
||||
value: formDataEmployee.nationality || '',
|
||||
});
|
||||
tempValue.newData.push({
|
||||
filName: $t('general.nationality'),
|
||||
value: allMeta['nationality'],
|
||||
});
|
||||
}
|
||||
|
||||
dialogCheckData({
|
||||
action: async () => {
|
||||
formDataEmployee.gender = allMeta['sex'];
|
||||
formDataEmployee.firstName = fullName[0];
|
||||
formDataEmployee.lastName = fullName[1];
|
||||
formDataEmployee.passportNo = allMeta['doc_number'];
|
||||
formDataEmployee.nationality = allMeta['nationality'];
|
||||
},
|
||||
checkData: () => {
|
||||
return tempValue;
|
||||
},
|
||||
cancel: () => {
|
||||
if (!formDataEmployee.firstName) {
|
||||
formDataEmployee.gender = allMeta['gender'];
|
||||
}
|
||||
if (!formDataEmployee.firstName) {
|
||||
formDataEmployee.firstName = fullName[0];
|
||||
}
|
||||
if (!formDataEmployee.firstName) {
|
||||
formDataEmployee.firstName = fullName[0];
|
||||
}
|
||||
|
|
@ -1196,6 +1229,9 @@ watch(
|
|||
if (!formDataEmployee.passportNo) {
|
||||
formDataEmployee.passportNo = allMeta['doc_number'];
|
||||
}
|
||||
if (!formDataEmployee.nationality) {
|
||||
formDataEmployee.nationality = allMeta['nationality'];
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -1284,6 +1320,9 @@ watch(
|
|||
:readonly="!isEdit"
|
||||
v-model:passport-type="meta.type"
|
||||
v-model:passport-number="meta.number"
|
||||
v-model:gender="meta.gender"
|
||||
v-model:first-name="meta.firstName"
|
||||
v-model:last-name="meta.lastName"
|
||||
v-model:passport-issue-date="meta.issueDate"
|
||||
v-model:passport-expiry-date="meta.expireDate"
|
||||
v-model:passport-issuing-place="meta.issuePlace"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue