|
@@ -77,6 +77,7 @@ import UploadExcelDialog from "@/components/upload-excel-dialog";
|
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
|
import {getToken} from "@/util/auth";
|
|
import {getToken} from "@/util/auth";
|
|
|
import {downloadXls} from "@/util/util";
|
|
import {downloadXls} from "@/util/util";
|
|
|
|
|
+import { isAlphanumericCombination } from "@/util/regex";
|
|
|
|
|
|
|
|
|
|
|
|
|
export default window.$crudCommon({
|
|
export default window.$crudCommon({
|
|
@@ -121,6 +122,9 @@ export default window.$crudCommon({
|
|
|
if (!this.form.number && !this.form.identityCard) {
|
|
if (!this.form.number && !this.form.identityCard) {
|
|
|
this.$message.warning("工号和身份证号必须填写一项!");
|
|
this.$message.warning("工号和身份证号必须填写一项!");
|
|
|
return false;
|
|
return false;
|
|
|
|
|
+ } else if (this.form.number && !isAlphanumericCombination(this.form.number)) {
|
|
|
|
|
+ this.$message.warning("工号必须是英文字母加数字组合!");
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
@@ -198,6 +202,8 @@ export default window.$crudCommon({
|
|
|
res: ({ data }) => {
|
|
res: ({ data }) => {
|
|
|
data.records = data.records.map(item => {
|
|
data.records = data.records.map(item => {
|
|
|
item.gender = item.gender ? String(item.gender) : '';
|
|
item.gender = item.gender ? String(item.gender) : '';
|
|
|
|
|
+ item.birthday = item.birthday ? moment(item.birthday).format('yyyy-MM-DD') : '';
|
|
|
|
|
+ item.hireDate = item.birthday ? moment(item.hireDate).format('yyyy-MM-DD') : '';
|
|
|
return item;
|
|
return item;
|
|
|
});
|
|
});
|
|
|
return data;
|
|
return data;
|