214 lines
9.0 KiB
Plaintext
214 lines
9.0 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 select_Data = jQuery.parseJSON('${enableTypeList}');
|
|||
|
|
var select_3 = $("#status3").select2({
|
|||
|
|
data: select_Data,
|
|||
|
|
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'});
|
|||
|
|
|
|||
|
|
select_3.val('${kpiDimension.status}').trigger("change");
|
|||
|
|
|
|||
|
|
var selectData2 = jQuery.parseJSON('${jobTypeList}');
|
|||
|
|
var select_2 = $("#jobType").select2({
|
|||
|
|
data: selectData2,
|
|||
|
|
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;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
select_2.val('${kpiDimension.jobType}').trigger("change");
|
|||
|
|
|
|||
|
|
var selectData1 = jQuery.parseJSON('${periodTypeList}');
|
|||
|
|
var select_1 = $("#periodType").select2({
|
|||
|
|
data: selectData1,
|
|||
|
|
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;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
select_1.val('${kpiDimension.periodType}').trigger("change");
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function updateFun() {
|
|||
|
|
$("#editForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/kpi/KpiDimension/update.do", $("#editForm").serialize(), function (data) {
|
|||
|
|
if (data == 0) {
|
|||
|
|
showAlert('d', '用户信息保存失败');
|
|||
|
|
} else if (data == 9) {
|
|||
|
|
showAlert('d', '考核维度名称重复!');}
|
|||
|
|
else {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal('subModal');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#editForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
dimensionName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '维度名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
status: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '状态不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
jobType: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '职位类型不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
periodType: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '周期类型不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
morder: {
|
|||
|
|
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="editForm">
|
|||
|
|
<input type="hidden" name="id" value="${kpiDimension.id}"/>
|
|||
|
|
<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">
|
|||
|
|
<input type="text" name="dimensionName" class="form-control" placeholder=""
|
|||
|
|
value="${kpiDimension.dimensionName}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<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: 100%">
|
|||
|
|
</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: 100%">
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">* 排序:</label>
|
|||
|
|
<div class="col-sm-9">
|
|||
|
|
<input type="number" name="morder" class="form-control" placeholder="" value="${kpiDimension.morder}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">* 状态:</label>
|
|||
|
|
<div class="col-sm-9">
|
|||
|
|
<select class="form-control" name="status" id="status3" style="width: 100%;">
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">备注:</label>
|
|||
|
|
<div class="col-sm-9">
|
|||
|
|
<textarea type="text" id="remark" name="remark" class="form-control"
|
|||
|
|
placeholder="">${kpiDimension.remark}</textarea>
|
|||
|
|
</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/KpiDimension/update.do">
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="updateFun()">保存</button>
|
|||
|
|
</security:authorize>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|