Files
RuoYi/src/main/resources/templates/system/post/add.html

104 lines
3.3 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" >
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add">
<div class="form-group">
2018-08-05 11:05:26 +08:00
<label class="col-sm-3 control-label">岗位名称:</label>
2018-07-09 08:44:52 +08:00
<div class="col-sm-8">
2018-08-05 11:05:26 +08:00
<input class="form-control" type="text" name="postName" id="postName">
2018-07-09 08:44:52 +08:00
</div>
</div>
<div class="form-group">
2018-08-05 11:05:26 +08:00
<label class="col-sm-3 control-label ">岗位编码:</label>
2018-07-09 08:44:52 +08:00
<div class="col-sm-8">
2018-08-05 11:05:26 +08:00
<input class="form-control" type="text" name="postCode" id="postCode"/>
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="postSort" id="postSort">
</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.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
2018-07-09 08:44:52 +08:00
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
2018-08-23 20:34:23 +08:00
<textarea id="remark" name="remark" class="form-control"></textarea>
2018-07-09 08:44:52 +08:00
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
2018-10-03 21:44:14 +08:00
var prefix = ctx + "system/post";
2018-07-09 08:44:52 +08:00
$("#form-post-add").validate({
rules:{
2018-08-05 11:05:26 +08:00
postName:{
2018-07-09 08:44:52 +08:00
required:true,
2018-08-05 11:05:26 +08:00
remote: {
url: ctx + "system/post/checkPostNameUnique",
type: "post",
dataType: "json",
data: {
"postName" : function() {
2018-08-23 17:06:31 +08:00
return $.common.trim($("#postName").val());
2018-08-05 11:05:26 +08:00
}
},
dataFilter: function(data, type) {
2018-08-23 17:06:31 +08:00
return $.validate.unique(data);
2018-08-05 11:05:26 +08:00
}
}
2018-07-09 08:44:52 +08:00
},
2018-08-05 11:05:26 +08:00
postCode:{
2018-07-09 08:44:52 +08:00
required:true,
2018-08-05 11:05:26 +08:00
remote: {
url: ctx + "system/post/checkPostCodeUnique",
type: "post",
dataType: "json",
data: {
"postCode" : function() {
2018-08-23 17:06:31 +08:00
return $.common.trim($("#postCode").val());
2018-08-05 11:05:26 +08:00
}
},
dataFilter: function(data, type) {
2018-08-23 17:06:31 +08:00
return $.validate.unique(data);
2018-08-05 11:05:26 +08:00
}
}
2018-07-09 08:44:52 +08:00
},
postSort:{
required:true,
digits:true
},
},
2018-08-05 11:05:26 +08:00
messages: {
"postCode": {
remote: "岗位编码已经存在"
},
"postName": {
remote: "岗位名称已经存在"
}
2018-10-03 21:44:14 +08:00
}
2018-07-09 08:44:52 +08:00
});
2018-10-03 21:44:14 +08:00
function submitHandler() {
if ($.validate.form("#form-post-add")) {
$.operate.save(prefix + "/add", $('#form-post-add').serialize());
}
}
2018-07-09 08:44:52 +08:00
</script>
</body>
</html>