修改用户账号并更改手机号码和邮箱(否则有bug);修改教师信息:根据证件号码生成出生日期

This commit is contained in:
zhanglipeng 2021-08-03 15:45:41 +08:00
parent 67692aad0f
commit 6a05ae4624
2 changed files with 19 additions and 1 deletions

View File

@ -200,6 +200,7 @@
v-model="form.zjhm" v-model="form.zjhm"
placeholder="请输入证件号码" placeholder="请输入证件号码"
maxlength="18" maxlength="18"
@blur.prevent="changeZjhm()"
/> />
</el-form-item> </el-form-item>
<el-form-item label="出生日期" prop="csrq"> <el-form-item label="出生日期" prop="csrq">
@ -419,7 +420,7 @@ export default {
// //
rules: { rules: {
zjhm: [ zjhm: [
{ required: true, message: '请输入身份证号', trigger: 'blur' }, { required: true, message: "请输入身份证号", trigger: "blur" },
{ {
pattern: /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, pattern: /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,
message: "请输入正确的身份证号", message: "请输入正确的身份证号",
@ -443,6 +444,21 @@ export default {
}); });
}, },
methods: { methods: {
//
changeZjhm() {
//console.log(this.form.zjhm);
let idCard = this.form.zjhm;
let birthday = "";
if (idCard != null && idCard !== "") {
if (idCard.length === 15) {
birthday = "19" + idCard.substr(6, 6);
} else if (idCard.length === 18) {
birthday = idCard.substr(6, 8);
}
birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
}
this.form.csrq = birthday;
},
/** 查询教师基本信息列表 */ /** 查询教师基本信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;

View File

@ -306,6 +306,8 @@ public class SysUserController extends BaseController {
} }
} }
user.setPhonenumber(user.getUserName());
user.setEmail(user.getUserName()+"@benyi.com");
user.setUpdateBy(SecurityUtils.getUsername()); user.setUpdateBy(SecurityUtils.getUsername());
return toAjax(userService.updateUser(user)); return toAjax(userService.updateUser(user));
} }