193 lines
7.9 KiB
Plaintext
193 lines
7.9 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="com.sipai.entity.process.LibraryProcessManage" %>
|
|||
|
|
<% request.setAttribute("ControlLogic_H", LibraryProcessManage.ControlLogic_H); %>
|
|||
|
|
<% request.setAttribute("ControlLogic_L", LibraryProcessManage.ControlLogic_L); %>
|
|||
|
|
<% request.setAttribute("ControlLogic_I", LibraryProcessManage.ControlLogic_I); %>
|
|||
|
|
<% request.setAttribute("Cycle_Day", LibraryProcessManage.Cycle_Day); %>
|
|||
|
|
<% request.setAttribute("Cycle_Month", LibraryProcessManage.Cycle_Month); %>
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/process/libraryProcessManage/dosave.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
code: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '指标编号不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '指标名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$(function (){
|
|||
|
|
$("#cycle").select2({minimumResultsForSearch: -1}).val("${Cycle_Day}").trigger("change");
|
|||
|
|
$("#controlLogic").select2({minimumResultsForSearch: -1}).val("${ControlLogic_H}").trigger("change");
|
|||
|
|
$("#controlLogic").on("select2:select",function(){
|
|||
|
|
var data = $(this).val();
|
|||
|
|
if(data=='${ControlLogic_H}'||data=='${ControlLogic_L}'){
|
|||
|
|
$('#targetValueSt1').css('display','block');
|
|||
|
|
$('#targetValueSt2').css('display','none');
|
|||
|
|
}else if(data=='${ControlLogic_I}'){
|
|||
|
|
$('#targetValueSt1').css('display','none');
|
|||
|
|
$('#targetValueSt2').css('display','block');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var selectMPint = function() {
|
|||
|
|
$.post(ext.contextPath + '/achievement/acceptanceModelMPoint/showlistForSelect.do', {formId:'subForm',hiddenId:'mpid',textId:'mpname'} , function(data) {
|
|||
|
|
$("#mpSubDiv").html(data);
|
|||
|
|
openModal('mpSubModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// $('#month').datepicker({
|
|||
|
|
// language: 'zh-CN',
|
|||
|
|
// autoclose: true,
|
|||
|
|
// todayHighlight: true,
|
|||
|
|
// format: 'yyyy-mm',
|
|||
|
|
// }).on('hide', function (e) {
|
|||
|
|
// //当日期选择框关闭时,执行刷新校验
|
|||
|
|
// $('#subForm').data('bootstrapValidator')
|
|||
|
|
// .updateStatus('month', 'NOT_VALIDATED', null)
|
|||
|
|
// .validateField('month');
|
|||
|
|
// });
|
|||
|
|
|
|||
|
|
</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强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm" autocomplete="off">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" name="id" id="id" value="${id}" />
|
|||
|
|
<input type="hidden" name="unitId" id="unitId" value="${param.unitId}" />
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*指标编号</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="code" name="code" placeholder="指标编号"
|
|||
|
|
value="${libraryProcessManage.code}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">*指标名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="name" name="name" placeholder="指标名称"
|
|||
|
|
value="${libraryProcessManage.name}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">控制区</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="area" name="area" placeholder="控制区"
|
|||
|
|
value="${libraryProcessManage.area}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">单位</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="unit" name="unit" placeholder="单位"
|
|||
|
|
value="${libraryProcessManage.unit}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">周期</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="cycle" name="cycle" style="width: 170px;">
|
|||
|
|
<option value="${Cycle_Day}">天</option>
|
|||
|
|
<option value="${Cycle_Month}">月</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">额定分值</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="baseHours" name="baseHours" placeholder="额定工分"
|
|||
|
|
value="${libraryProcessManage.baseHours}" step="0.01">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">测量点</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="hidden" name="mpname" id="mpname" />
|
|||
|
|
<input type="text" class="form-control" id="mpid" name="mpid" placeholder="单击选择" onclick="selectMPint();"
|
|||
|
|
value="${libraryProcessManage.mpid}" >
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">控制逻辑</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select class="form-control select2" id="controlLogic" name="controlLogic" style="width: 170px;">
|
|||
|
|
<option value="${ControlLogic_H}">高于</option>
|
|||
|
|
<option value="${ControlLogic_L}">低于</option>
|
|||
|
|
<option value="${ControlLogic_I}">区间内</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<div id="targetValueSt1" style="display: block;">
|
|||
|
|
<label class="col-sm-2 control-label">目标值</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="targetValue" name="targetValue" placeholder="目标值"
|
|||
|
|
value="${libraryProcessManage.targetValue}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="targetValueSt2" class="form-group" style="display: none;">
|
|||
|
|
<label class="col-sm-2 control-label">最小值</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="minValue" name="minValue" placeholder="最小值"
|
|||
|
|
value="${libraryProcessManage.minValue}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">最大值</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="maxValue" name="maxValue" placeholder="最大值"
|
|||
|
|
value="${libraryProcessManage.maxValue}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|