232 lines
10 KiB
Plaintext
232 lines
10 KiB
Plaintext
|
|
<!DOCTYPE html
|
|||
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|||
|
|
<%@ page language="java" 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_1Data = jQuery.parseJSON('${jobTypeList}');
|
|||
|
|
var selelct_1 = $("#jobType").select2({
|
|||
|
|
data: selelct_1Data,
|
|||
|
|
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_1.val('0').trigger("change");
|
|||
|
|
|
|||
|
|
// 考核周期类型数据填充
|
|||
|
|
var selelct_2Data = jQuery.parseJSON('${periodTypeList}');
|
|||
|
|
var selelct_2 = $("#periodType").select2({
|
|||
|
|
data: selelct_2Data,
|
|||
|
|
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;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
}).on('select2:select', function (evt) {
|
|||
|
|
|
|||
|
|
showPeriodNo();
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
|||
|
|
selelct_2.val('0').trigger("change");
|
|||
|
|
|
|||
|
|
// 考核年份
|
|||
|
|
var selelct_4Data =
|
|||
|
|
jQuery.parseJSON('[{"id":"2020","text":"2020"},{"id":"2021","text":"2021"},{"id":"2022","text":"2022"},{"id":"2023","text":"2023"},{"id":"2024","text":"2024"},{"id":"2025","text":"2025"},{"id":"2026","text":"2026"},{"id":"2027","text":"2027"},{"id":"2028","text":"2028"},{"id":"2029","text":"2029"},{"id":"2030","text":"2030"},{"id":"2031","text":"2031"},{"id":"2032","text":"2032"},{"id":"2033","text":"2033"},{"id":"2034","text":"2034"},{"id":"2035","text":"2035"},{"id":"2036","text":"2036"},{"id":"2037","text":"2037"},{"id":"2038","text":"2038"},{"id":"2039","text":"2039"},{"id":"2040","text":"2040"},{"id":"2041","text":"2041"},{"id":"2042","text":"2042"},{"id":"2043","text":"2043"},{"id":"2044","text":"2044"},{"id":"2045","text":"2045"},{"id":"2046","text":"2046"},{"id":"2047","text":"2047"},{"id":"2048","text":"2048"},{"id":"2049","text":"2049"},{"id":"2050","text":"2050"}]');
|
|||
|
|
var selelct_4 = $("#periodYear").select2({
|
|||
|
|
data: selelct_4Data,
|
|||
|
|
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'});
|
|||
|
|
var date = new Date();
|
|||
|
|
selelct_4.val(date.getFullYear()).trigger("change");
|
|||
|
|
|
|||
|
|
// 考核周期初始化数据
|
|||
|
|
showPeriodNo();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//考核周期初始化
|
|||
|
|
function showPeriodNo() {
|
|||
|
|
var periodType = $("#periodType").val();
|
|||
|
|
$.post(ext.contextPath + "/kpi/KpiPeriodInstance/periodNoList.do?periodType=" + periodType, function (data) {
|
|||
|
|
if ($('#periodNo').data('select2')) {
|
|||
|
|
$('#periodNo').select2('destroy').empty()
|
|||
|
|
}
|
|||
|
|
let temp = $("#periodNo").select2({
|
|||
|
|
data: data,
|
|||
|
|
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'});
|
|||
|
|
temp.val(data[0].id).trigger("change")
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function saveFun() {
|
|||
|
|
|
|||
|
|
$("#addForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/kpi/KpiPeriodInstance/save.do", $("#addForm").serialize(), function (data) {
|
|||
|
|
if (data.code != 1) {
|
|||
|
|
showAlert('d', data.msg);
|
|||
|
|
} else {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal('subModal');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#addForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
jobType: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '绩效类型不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
periodYear: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '考核年份不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
periodType: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '考核周期类型不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
periodNo: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '考核周期不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
</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>
|
|||
|
|
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
|||
|
|
<!-- 界面提醒div强制id为alertdiv -->
|
|||
|
|
<div class="col-md-12">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">绩效(岗位)类型:</label>
|
|||
|
|
<div class="col-sm-9">
|
|||
|
|
<select class="form-control" name="jobType" id="jobType" style="width: 200px"></select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">考核年份:</label>
|
|||
|
|
<div class="col-sm-9">
|
|||
|
|
<select class="form-control" id="periodYear" name="periodYear"
|
|||
|
|
style="width: 200px"></select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">考核周期类型:</label>
|
|||
|
|
<div class="col-sm-9">
|
|||
|
|
<select class="form-control" name="periodType" id="periodType"
|
|||
|
|
style="width: 200px"></select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">考核周期:</label>
|
|||
|
|
<div class="col-sm-9">
|
|||
|
|
<select class="form-control" name="periodNo" id="periodNo"
|
|||
|
|
style="width: 200px"></select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
|
|||
|
|
<security:authorize buttonUrl="kpi/KpiPeriodInstance/save.do">
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="saveFun()">保存</button>
|
|||
|
|
</security:authorize>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|