维护个人资料
parent
5c84e8e2d4
commit
5629cc5ecd
@ -0,0 +1,98 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: ljx
|
||||
Date: 2019/5/13
|
||||
Time: 17:02
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>个人资料</title>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
</head>
|
||||
<body>
|
||||
<fieldset>
|
||||
<legend style="text-align: center;font-weight: bold;font-size: 25px">个人资料</legend>
|
||||
</fieldset>
|
||||
<form class="form-horizontal" id="form">
|
||||
<input name="userId" hidden value="${user.userId}">
|
||||
<div class="form-group">
|
||||
<label for="userName" class="col-sm-2 control-label">账号</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" id="userName" class="form-control input input-sm" disabled value="${user.userName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">姓名</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control input input-sm" id="name" name="name"
|
||||
placeholder="请输入姓名" maxlength="16" value="${user.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userSex" class="col-sm-2 control-label">性别</label>
|
||||
<div class="col-sm-5">
|
||||
<select class="form-control input-sm" id="userSex" name="userSex">
|
||||
<option value="">不限</option>
|
||||
<option value="0" <c:if test="${user.userSex == 0}">selected</c:if>>男</option>
|
||||
<option value="1" <c:if test="${user.userSex == 1}">selected</c:if>>女</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userAge" class="col-sm-2 control-label">年龄</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="number" class="form-control input input-sm sexInput" id="userAge" name="userAge" oninput="if(value.length>3)value=value.slice(0,3)" value="${user.userAge}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userTel" class="col-sm-2 control-label">移动电话</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control input input-sm" id="userTel" name="userTel"
|
||||
oninput="if(value.length>11)value=value.slice(0,11)" placeholder="请输入移动电话" value="${user.userTel}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userWechat" class="col-sm-2 control-label">微信号</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control input input-sm" id="userWechat" name="userWechat"
|
||||
placeholder="请输入微信号" maxlength="50" value="${user.userWechat}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userEmail" class="col-sm-2 control-label">邮箱地址</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control input input-sm" id="userEmail" name="userEmail"
|
||||
placeholder="请输入邮箱地址" maxlength="50" value="${user.userEmail}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userPosition" class="col-sm-2 control-label">职位</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control input input-sm" id="userPosition" name="userPosition" placeholder="请输入职位" maxlength="16" value="${user.userPosition}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属科室</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control input input-sm" disabled value="${user.powerDepts}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">所属角色</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control input input-sm" disabled value="${user.roleName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="button" class="btn btn-primary" id="btn_submit">提交更改</button>
|
||||
<button type="reset" class="btn btn-default">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
<script src="${path}/static/js/updatePersonal.js"></script>
|
||||
</html>
|
@ -0,0 +1,29 @@
|
||||
//提交更改
|
||||
$('#btn_submit').click(function () {
|
||||
if($("#name").val() == ""){
|
||||
toastr.warning("姓名不能为空!")
|
||||
return false;
|
||||
}
|
||||
//验证手机号码
|
||||
if($("#userTel").val() != ''){
|
||||
if(!$("#userTel").val().match(/^1[34578]\d{9}$/)){
|
||||
toastr.warning("移动电话格式不正确!");
|
||||
$("#userTel").val("");
|
||||
$("#userTel").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: path+"/user/updatePersonal",
|
||||
data:$("#form").serialize(),
|
||||
dataType:'json',
|
||||
success: function(data){
|
||||
if(data.code == 100){
|
||||
toastr.success("修改成功!");
|
||||
}else{
|
||||
toastr.error(data.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue