175 lines
7.6 KiB
Plaintext
175 lines
7.6 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 () {
|
||
|
||
});
|
||
|
||
function updateFun() {
|
||
$("#editFrom").bootstrapValidator('validate');//提交验证
|
||
if ($("#editFrom").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/kpi/KpiIndicatorLibDetail/update.do", $("#editFrom").serialize(), function (data) {
|
||
if (data.res == 0) {
|
||
showAlert('d', '信息保存失败');
|
||
} else {
|
||
$("#table").bootstrapTable('refresh');
|
||
closeModal('subModal');
|
||
}
|
||
}, 'json');
|
||
}
|
||
}
|
||
|
||
$("#editFrom").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
indicatorName: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '考核指标不能为空'
|
||
}
|
||
}
|
||
},
|
||
contentA: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '等级不能为空'
|
||
}
|
||
}
|
||
},
|
||
contentB: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '等级不能为空'
|
||
}
|
||
}
|
||
},
|
||
contentC: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '等级不能为空'
|
||
}
|
||
}
|
||
},
|
||
contentD: {
|
||
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强制为editFrom -->
|
||
<form class="form-horizontal" id="editFrom">
|
||
<div id="alertDiv"></div>
|
||
<input type="hidden" name="id" value="${KpiIndicatorLibDetail.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="indicatorName" class="form-control" placeholder=""
|
||
value="${KpiIndicatorLibDetail.indicatorName}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">* A级:</label>
|
||
<div class="col-sm-9">
|
||
<input type="text" name="contentA" class="form-control" placeholder=""
|
||
value="${KpiIndicatorLibDetail.contentA}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">* B级:</label>
|
||
<div class="col-sm-9">
|
||
<input type="text" name="contentB" class="form-control" placeholder=""
|
||
value="${KpiIndicatorLibDetail.contentB}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">* C级:</label>
|
||
<div class="col-sm-9">
|
||
<input type="text" name="contentC" class="form-control" placeholder=""
|
||
value="${KpiIndicatorLibDetail.contentC}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">* D级:</label>
|
||
<div class="col-sm-9">
|
||
<input type="text" name="contentD" class="form-control" placeholder=""
|
||
value="${KpiIndicatorLibDetail.contentD}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">* 排序:</label>
|
||
<div class="col-sm-9">
|
||
<input type="text" name="morder" class="form-control" placeholder=""
|
||
value="${KpiIndicatorLibDetail.morder}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-3 control-label">指标解释:</label>
|
||
<div class="col-sm-9">
|
||
<textarea type="text" name="indicatorDetail" class="form-control"
|
||
placeholder="">${KpiIndicatorLibDetail.indicatorDetail}</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之间的数字" value="${KpiIndicatorLibDetail.indicatorWeight}">
|
||
</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/KpiIndicatorLibDetail/update.do">
|
||
<button type="button" class="btn btn-primary" onclick="updateFun()">保存</button>
|
||
</security:authorize>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|