fix bug
This commit is contained in:
@@ -1309,6 +1309,11 @@ export default {
|
||||
},
|
||||
normalizeBirthday(value = '') {
|
||||
const birthday = String(value || '').trim();
|
||||
const compactMatch = birthday.match(/^(\d{4})(\d{2})(\d{2})$/);
|
||||
if (compactMatch) {
|
||||
const [, year, month, day] = compactMatch;
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
const match = birthday.match(/^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?$/);
|
||||
if (!match) return birthday;
|
||||
const [, year, month, day] = match;
|
||||
@@ -1343,6 +1348,10 @@ export default {
|
||||
}
|
||||
const row = {
|
||||
...this.driverForm,
|
||||
birthday: this.normalizeBirthday(this.driverForm.birthday),
|
||||
drivingLicenseStartDate: this.normalizeBirthday(this.driverForm.drivingLicenseStartDate),
|
||||
drivingLicenseEndDate: this.normalizeBirthday(this.driverForm.drivingLicenseEndDate),
|
||||
qualificationEndDate: this.normalizeBirthday(this.driverForm.qualificationEndDate),
|
||||
qualificationNo: this.driverForm.qualificationNo || this.driverForm.idCardNo,
|
||||
posts: this.driverForm.postList.join(','),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user