first commit
This commit is contained in:
173
WebRoot/jsp/kpi/planStaffDetailAdd.jsp
Normal file
173
WebRoot/jsp/kpi/planStaffDetailAdd.jsp
Normal file
@ -0,0 +1,173 @@
|
||||
<!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 () {
|
||||
// 考核维度下拉列表数据填充
|
||||
$("#dimensionId").select2({
|
||||
data: jQuery.parseJSON('${dimensionList}'),
|
||||
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;
|
||||
} // 函数用于呈现当前的选择
|
||||
});
|
||||
$("#dimensionId").val('').trigger("change");
|
||||
|
||||
});
|
||||
|
||||
function saveFun() {
|
||||
//console.log($("#addForm").serialize());
|
||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#addForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/kpi/KpiPlanStaffDetail/save.do", $("#addForm").serialize(), function (data) {
|
||||
if (data.res == 0) {
|
||||
showAlert('d', '用户信息保存失败');
|
||||
} else {
|
||||
totalWeightFun();
|
||||
$("#table2").bootstrapTable('refresh');
|
||||
closeModal('subModal');
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
}
|
||||
|
||||
$("#addForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
dimensionId: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考核维度不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
indicatorName: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考核指标不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
indicatorWeight: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '考核指标权重不能为空'
|
||||
},
|
||||
regexp: {
|
||||
regexp: /^(100|([1-9][0-9]?)|(0|[1-9][0-9]?)(?:\.\d{0,2}))?$/,
|
||||
message: '请输入0.01~100的数'
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</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="planStaffId" value="${planStaffId}"/>
|
||||
<!-- 界面提醒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" id="dimensionId" name="dimensionId" 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="indicatorName" name="indicatorName" class="form-control"
|
||||
placeholder="请输入文本"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">A级:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="contentA" name="contentA" class="form-control"
|
||||
placeholder="请输入文本">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">B级:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="contentB" name="contentB" class="form-control"
|
||||
placeholder="请输入文本">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">C级:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="contentC" name="contentC" class="form-control"
|
||||
placeholder="请输入文本">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">D级:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" id="contentD" name="contentD" class="form-control"
|
||||
placeholder="请输入文本">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">指标解释:</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea type="text" id="indicatorDetail" name="indicatorDetail" class="form-control"
|
||||
placeholder="请输入文本"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">权重:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="number" max="100" min="0.01" step="0.01" id="indicatorWeight" name="indicatorWeight" class="form-control"
|
||||
placeholder="请输入0.01~100之间的数字">
|
||||
</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/KpiPlanStaffDetail/save.do">
|
||||
<button type="button" class="btn btn-primary" onclick="saveFun()">保存</button>
|
||||
</security:authorize>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user