You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
385 lines
18 KiB
385 lines
18 KiB
<!DOCTYPE html>
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
<head>
|
|
<th:block th:include="include :: header('修改用户')" />
|
|
<th:block th:include="include :: select2-css" />
|
|
<th:block th:include="include :: datetimepicker-css" />
|
|
<th:block th:include="include :: jasny-bootstrap-css" />
|
|
</head>
|
|
<body>
|
|
<div class="main-content">
|
|
<form class="form-horizontal" id="form-user-edit" th:object="${user}">
|
|
<input name="userId" type="hidden" th:field="*{userId}" />
|
|
<input name="deptId" type="hidden" th:field="*{deptId}" id="treeId"/>
|
|
<h4 class="form-header h4">基本信息</h4>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">人员姓名:</label>
|
|
<div class="col-sm-8">
|
|
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" th:field="*{userName}" required>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">所属单位:</label>
|
|
<div class="col-sm-8">
|
|
<div class="input-group">
|
|
<input class="form-control" required type="text" name="deptName" onclick="selectDeptTree()" id="treeName" th:field="*{dept.deptName}">
|
|
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">登录账号:</label>
|
|
<div class="col-sm-8">
|
|
<input class="form-control" required type="text" readonly="true" th:field="*{loginName}"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">身份证号码:</label>
|
|
<div class="col-sm-8">
|
|
<input name="cerno" placeholder="请输入身份证号码" class="form-control" type="text" maxlength="30" th:field="*{cerno}" required isIdentity>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" id="status">
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">岗位:</label>
|
|
<div class="col-sm-8">
|
|
<select id="post" required class="form-control select2-multiple" multiple>
|
|
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">用户性别:</label>
|
|
<div class="col-sm-8">
|
|
<select name="sex" required class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
|
|
<option value="">---请选择---</option>
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">角色:</label>
|
|
<div class="col-sm-8">
|
|
<label th:each="role:${roles}" required class="check-box">
|
|
<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}" th:disabled="${role.status == '1'}">
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">健康状况:</label>
|
|
<div class="col-sm-8">
|
|
<input name="helthy" class="form-control" th:field="*{helthy}" type="text">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">籍贯:</label>
|
|
<div class="col-sm-8">
|
|
<input name="userarea" required class="form-control" th:field="*{userarea}" type="text">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">民族:</label>
|
|
<div class="col-sm-8">
|
|
<select name="nation" class="form-control m-b" th:with="type=${@dict.getType('sys_user_nation')}">
|
|
<option value="">---请选择---</option>
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{nation}"></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">手机号码:</label>
|
|
<div class="col-sm-8">
|
|
<div class="input-group">
|
|
<input name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phonenumber}">
|
|
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">邮箱:</label>
|
|
<div class="col-sm-8">
|
|
<div class="input-group">
|
|
<input name="email" class="form-control email" type="text" maxlength="50" placeholder="请输入邮箱" th:field="*{email}">
|
|
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">出生年月:</label>
|
|
<div class="col-sm-8">
|
|
<div class="input-group date">
|
|
<input name="birthday" th:value="${#dates.format(user.birthday, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">政治面貌:</label>
|
|
<div class="col-sm-8">
|
|
<select name="politics" class="form-control m-b" th:with="type=${@dict.getType('sys_user_politics')}">
|
|
<option value="">---请选择---</option>
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{politics}"></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">是否持有护照或港澳通行证:</label>
|
|
<div class="col-sm-8">
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_user_passport')}">
|
|
<input type="radio" required th:id="${dict.dictCode}" name="havePassport" th:value="${dict.dictValue}" th:field="*{havePassport}">
|
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">是否具有出入境备案:</label>
|
|
<div class="col-sm-8">
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_user_passport')}">
|
|
<input type="radio" required th:id="${dict.dictCode}" name="entryexitFiling" th:value="${dict.dictValue}" th:field="*{entryexitFiling}">
|
|
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label is-required">涉密程度:</label>
|
|
<div class="col-sm-8">
|
|
<select name="shemichengdu" required class="form-control m-b" th:with="type=${@dict.getType('sys_user_shemi')}">
|
|
<option value="">---请选择---</option>
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{shemichengdu}"></option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">学历:</label>
|
|
<div class="col-sm-8">
|
|
<input name="graduate" th:field="*{graduate}" class="form-control" type="text">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label is-required">保密协议签订书:</label>
|
|
<br/>
|
|
<div class="fileinput fileinput-new" data-provides="fileinput">
|
|
<span class="btn btn-white btn-file">
|
|
<span class="fileinput-new">选择文件</span>
|
|
<span class="fileinput-exists">更改</span>
|
|
<input type="file" id="fileUrlId" name="..." >
|
|
<input type="hidden" id="fileUrl" name="confAgreement" th:field="*{confAgreement}" >
|
|
<input type="hidden" id="fileName" name="confName" th:field="*{confName}">
|
|
</span>
|
|
<span class="fileinput-filename">[[*{confName}]]</span>
|
|
<a href="#" class="close fileinput-exists" data-dismiss="fileinput" style="float: none">×</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<h4 class="form-header h4">其他信息</h4>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="form-group">
|
|
<label class="col-xs-2 control-label">备注:</label>
|
|
<div class="col-xs-10">
|
|
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-offset-5 col-sm-10">
|
|
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
|
|
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
|
|
</div>
|
|
</div>
|
|
<th:block th:include="include :: footer" />
|
|
<th:block th:include="include :: select2-js" />
|
|
<th:block th:include="include :: datetimepicker-js" />
|
|
<th:block th:include="include :: jasny-bootstrap-js" />
|
|
<script type="text/javascript">
|
|
var prefix = ctx + "system/user";
|
|
|
|
$("#form-user-edit").validate({
|
|
onkeyup: false,
|
|
rules:{
|
|
email:{
|
|
email:true,
|
|
remote: {
|
|
url: prefix + "/checkEmailUnique",
|
|
type: "post",
|
|
dataType: "json",
|
|
data: {
|
|
"userId": function() {
|
|
return $("#userId").val();
|
|
},
|
|
"email": function() {
|
|
return $.common.trim($("#email").val());
|
|
}
|
|
}
|
|
}
|
|
},
|
|
phonenumber:{
|
|
isPhone:true,
|
|
remote: {
|
|
url: prefix + "/checkPhoneUnique",
|
|
type: "post",
|
|
dataType: "json",
|
|
data: {
|
|
"userId": function() {
|
|
return $("#userId").val();
|
|
},
|
|
"phonenumber": function() {
|
|
return $.common.trim($("#phonenumber").val());
|
|
}
|
|
}
|
|
}
|
|
},
|
|
cerno:{
|
|
isIdentity18:true,
|
|
},
|
|
},
|
|
messages: {
|
|
"email": {
|
|
remote: "Email已经存在"
|
|
},
|
|
"phonenumber":{
|
|
remote: "手机号码已经存在"
|
|
}
|
|
},
|
|
focusCleanup: true
|
|
});
|
|
|
|
function submitHandler() {
|
|
if ($.validate.form()) {
|
|
var data = $("#form-user-edit").serializeArray();
|
|
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
|
|
var roleIds = $.form.selectCheckeds("role");
|
|
var postIds = $.form.selectSelects("post");
|
|
data.push({"name": "status", "value": status});
|
|
data.push({"name": "roleIds", "value": roleIds});
|
|
data.push({"name": "postIds", "value": postIds});
|
|
$.operate.saveTab(prefix + "/edit", data);
|
|
}
|
|
}
|
|
|
|
/* 用户管理-修改-选择部门树 */
|
|
function selectDeptTree() {
|
|
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
|
var url = ctx + "system/user/selectDeptTree/" + deptId;
|
|
var options = {
|
|
title: '选择部门',
|
|
width: "380",
|
|
url: url,
|
|
callBack: doSubmit
|
|
};
|
|
$.modal.openOptions(options);
|
|
}
|
|
|
|
function doSubmit(index, layero){
|
|
var body = $.modal.getChildFrame(index);
|
|
$("#treeId").val(body.find('#treeId').val());
|
|
$("#treeName").val(body.find('#treeName').val());
|
|
$.modal.close(index);
|
|
}
|
|
$("input[name='birthday']").datetimepicker({
|
|
format: "yyyy-mm-dd",
|
|
minView: "month",
|
|
autoclose: true
|
|
});
|
|
|
|
$(function() {
|
|
$('#post').select2({
|
|
placeholder: "请选择岗位",
|
|
allowClear: true
|
|
});
|
|
})
|
|
|
|
|
|
//文件上传
|
|
$('#fileUrlId').on('change.bs.fileinput ', function (e) {
|
|
// 处理自己的业务
|
|
var file = e.target.files[0];
|
|
var data = new FormData();
|
|
data.append("file", file);
|
|
$.ajax({
|
|
type: "POST",
|
|
url: ctx + "common/upload",
|
|
data: data,
|
|
cache: false,
|
|
contentType: false,
|
|
processData: false,
|
|
dataType: 'json',
|
|
success: function(result) {
|
|
if (result.code == web_status.SUCCESS) {
|
|
$("#fileUrl").val(result.url);
|
|
$("#fileName").val(result.originalFilename);
|
|
} else {
|
|
$("#fileUrl").val("");
|
|
$("#fileName").val("");
|
|
}
|
|
},
|
|
error: function(error) {
|
|
$.modal.alertWarning("文件上传失败。");
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|