Files
RuoYi/ruoyi-admin/src/main/resources/templates/system/dept/add.html

129 lines
4.1 KiB
HTML
Raw Normal View History

2018-07-09 08:44:52 +08:00
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
2019-03-31 12:56:04 +08:00
<head>
<th:block th:include="include :: header('新增部门')" />
</head>
2018-07-09 08:44:52 +08:00
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-dept-add">
<input id="treeId" name="parentId" type="hidden" th:value="${dept.deptId}" />
<div class="form-group">
2019-12-31 16:34:24 +08:00
<label class="col-sm-3 control-label">上级部门:</label>
2018-07-09 08:44:52 +08:00
<div class="col-sm-8">
2019-02-25 13:19:06 +08:00
<div class="input-group">
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.deptName}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
2018-07-09 08:44:52 +08:00
</div>
</div>
<div class="form-group">
2019-12-31 16:34:24 +08:00
<label class="col-sm-3 control-label is-required">部门名称:</label>
2018-07-09 08:44:52 +08:00
<div class="col-sm-8">
2019-02-25 13:19:06 +08:00
<input class="form-control" type="text" name="deptName" id="deptName" required>
2018-07-09 08:44:52 +08:00
</div>
</div>
<div class="form-group">
2019-12-31 16:34:24 +08:00
<label class="col-sm-3 control-label is-required">显示排序:</label>
2018-07-09 08:44:52 +08:00
<div class="col-sm-8">
2019-02-25 13:19:06 +08:00
<input class="form-control" type="text" name="orderNum" required>
2018-07-09 08:44:52 +08:00
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">负责人:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="leader">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系电话:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="phone">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">邮箱:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="email">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门状态:</label>
2018-08-23 17:06:31 +08:00
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
2018-08-23 17:06:31 +08:00
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
2018-07-09 08:44:52 +08:00
</div>
</div>
</div>
</form>
</div>
2019-03-31 12:56:04 +08:00
<th:block th:include="include :: footer" />
2018-07-09 08:44:52 +08:00
<script type="text/javascript">
2018-10-03 21:44:14 +08:00
var prefix = ctx + "system/dept";
2018-07-09 08:44:52 +08:00
$("#form-dept-add").validate({
onkeyup: false,
2018-07-09 08:44:52 +08:00
rules:{
deptName:{
remote: {
url: prefix + "/checkDeptNameUnique",
type: "post",
dataType: "json",
data: {
2018-09-03 08:45:08 +08:00
"parentId": function() {
return $("input[name='parentId']").val();
},
2018-07-09 08:44:52 +08:00
"deptName" : function() {
2018-08-23 17:06:31 +08:00
return $.common.trim($("#deptName").val());
2018-07-09 08:44:52 +08:00
}
},
dataFilter: function(data, type) {
2018-08-23 17:06:31 +08:00
return $.validate.unique(data);
2018-07-09 08:44:52 +08:00
}
}
},
orderNum:{
digits:true
},
2018-08-19 13:23:51 +08:00
email:{
email:true,
},
phone:{
isPhone:true,
},
2018-07-09 08:44:52 +08:00
},
messages: {
"deptName": {
remote: "部门已经存在"
}
2019-02-25 13:19:06 +08:00
},
focusCleanup: true
2018-07-09 08:44:52 +08:00
});
2018-10-03 21:44:14 +08:00
function submitHandler() {
2018-10-03 23:11:09 +08:00
if ($.validate.form()) {
2018-10-03 21:44:14 +08:00
$.operate.save(prefix + "/add", $('#form-dept-add').serialize());
}
}
2018-07-09 08:44:52 +08:00
/*部门管理-新增-选择父部门树*/
function selectDeptTree() {
2018-09-03 08:45:08 +08:00
var options = {
title: '部门选择',
width: "380",
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
2018-07-09 08:44:52 +08:00
}
</script>
</body>
</html>