|
|
|
@ -7,15 +7,15 @@
|
|
|
|
|
<form class="form-horizontal m" id="form-post-edit" th:object="${post}">
|
|
|
|
|
<input id="postId" name="postId" type="hidden" th:field="*{postId}"/>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label ">岗位编码:</label>
|
|
|
|
|
<label class="col-sm-3 control-label">岗位名称:</label>
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
|
<input class="form-control" type="text" name="postCode" id="postCode" th:field="*{postCode}"/>
|
|
|
|
|
<input class="form-control" type="text" name="postName" id="postName" th:field="*{postName}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">岗位名称:</label>
|
|
|
|
|
<label class="col-sm-3 control-label ">岗位编码:</label>
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
|
<input class="form-control" type="text" name="postName" id="postName" th:field="*{postName}">
|
|
|
|
|
<input class="form-control" type="text" name="postCode" id="postCode" th:field="*{postCode}"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
@ -53,16 +53,58 @@
|
|
|
|
|
|
|
|
|
|
$("#form-post-edit").validate({
|
|
|
|
|
rules:{
|
|
|
|
|
postCode:{
|
|
|
|
|
postName:{
|
|
|
|
|
required:true,
|
|
|
|
|
remote: {
|
|
|
|
|
url: ctx + "system/post/checkPostNameUnique",
|
|
|
|
|
type: "post",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
data: {
|
|
|
|
|
"postId": function() {
|
|
|
|
|
return $("input[name='postId']").val();
|
|
|
|
|
},
|
|
|
|
|
postName:{
|
|
|
|
|
"postName" : function() {
|
|
|
|
|
return $.trim($("#postName").val());
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataFilter: function(data, type) {
|
|
|
|
|
if (data == "0") return true;
|
|
|
|
|
else return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
postCode:{
|
|
|
|
|
required:true,
|
|
|
|
|
remote: {
|
|
|
|
|
url: ctx + "system/post/checkPostCodeUnique",
|
|
|
|
|
type: "post",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
data: {
|
|
|
|
|
"postId": function() {
|
|
|
|
|
return $("input[name='postId']").val();
|
|
|
|
|
},
|
|
|
|
|
"postCode" : function() {
|
|
|
|
|
return $.trim($("#postCode").val());
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataFilter: function(data, type) {
|
|
|
|
|
if (data == "0") return true;
|
|
|
|
|
else return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
postSort:{
|
|
|
|
|
required:true,
|
|
|
|
|
digits:true
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
messages: {
|
|
|
|
|
"postCode": {
|
|
|
|
|
remote: "岗位编码已经存在"
|
|
|
|
|
},
|
|
|
|
|
"postName": {
|
|
|
|
|
remote: "岗位名称已经存在"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
submitHandler:function(form){
|
|
|
|
|
$.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
|
|
|
|
|