first commit
This commit is contained in:
175
WebRoot/jsp/user/jobAdd.jsp
Normal file
175
WebRoot/jsp/user/jobAdd.jsp
Normal file
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var selelct_3Data = jQuery.parseJSON('${positionTypeList}');
|
||||
var selelct_3 = $("#levelType0").select2({
|
||||
data: selelct_3Data,
|
||||
// cache: false,
|
||||
placeholder: '请选择',//默认文字提示
|
||||
// allowClear: true,//允许清空
|
||||
escapeMarkup: function (markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
// language: "zh-CN",
|
||||
// minimumInputLength: 0,
|
||||
// minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||
formatResult: function formatRepo(repo) {
|
||||
return repo.text;
|
||||
}, // 函数用来渲染结果
|
||||
formatSelection: function formatRepoSelection(repo) {
|
||||
return repo.text;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||
selelct_3.val('').trigger("change");
|
||||
});
|
||||
|
||||
function dosave() {
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
setTimeout(function () {
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/user/saveJob.do", $("#addForm").serialize(), function (data) {
|
||||
if (data.res >= 1) {
|
||||
companyId = $("#pid").val();
|
||||
$("#table").bootstrapTable('refresh');
|
||||
closeModal("subModal");
|
||||
} else {
|
||||
showAlert('d', '保存失败');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
positionName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '职位名称不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
userName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '人员不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var showUnit4SelectFun = function () {
|
||||
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', {
|
||||
formId: "addForm",
|
||||
hiddenId: "pid",
|
||||
textId: "_pname"
|
||||
}, function (data) {
|
||||
$("#unit4SelectDiv").html(data);
|
||||
openModal("unit4SelectModal_Limited");
|
||||
});
|
||||
};
|
||||
|
||||
var showUser4SelectsFun = function () {
|
||||
var userIds = $("#userId").val();
|
||||
$.post(ext.contextPath + '/user/layerUser.do', {
|
||||
formId: "addForm",
|
||||
hiddenId: "userId",
|
||||
textId: "userName",
|
||||
userIds: userIds
|
||||
// fucname: 'aa'
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">新增职位界面</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为addForm -->
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<div id="alertDiv"></div>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">公司/部门</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="_pname" name="_pname" placeholder="公司/部门"
|
||||
style="border-radius:4px;background-color:white"
|
||||
onclick="showUnit4SelectFun();" value="${unit.name}" readonly/>
|
||||
<input id="pid" name="pid" type="hidden" value="${unit.id}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">职位编号</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="positionID" name="positionID"
|
||||
value="${positionID}" style="border-radius:4px" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*职位名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="positionName" name="positionName"
|
||||
placeholder="职位" style="border-radius:4px">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group ">
|
||||
<label class="col-sm-2 control-label">职位类型</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2 " id="levelType0" name="levelType"
|
||||
style="width:200px;"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*人员</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control " id="userName" name="userName" rows="3" placeholder="点击选择"
|
||||
onclick="showUser4SelectsFun();"></textarea>
|
||||
<input id="userId" name="userId" type="hidden" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" onclick="dosave()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user