93 lines
3.8 KiB
Plaintext
93 lines
3.8 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<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 dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/report/customReportMPoint/save.do", $("#subForm").serialize(), function(result) {
|
|||
|
|
// console.log(result);
|
|||
|
|
var data= $.parseJSON(result);
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
closeModal('addsubModal');
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
// showAlert('s','保存成功');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d',data.msg);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//输入框验证
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
mpid: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '测量点不能为空'
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var selectMPint = function(pid) {
|
|||
|
|
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm',hiddenId:'mpid',codeId:'mpcode',unitId:'unitId',textId:'txt',valueId :'value',mpid:$("#mpid").val()} , function(data) {
|
|||
|
|
$("#mpSubDiv").html(data);
|
|||
|
|
openModal('mpSubModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<div class="modal fade" id="addsubModal">
|
|||
|
|
<div class="modal-dialog modal-md">
|
|||
|
|
<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强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">测量点编号</label>
|
|||
|
|
<div class="col-sm-7">
|
|||
|
|
<input type="hidden" class="form-control" style="cursor: pointer" id="unitId" name="unitId" value="" >
|
|||
|
|
<input type="hidden" class="form-control" style="cursor: pointer" id="mpcode" >
|
|||
|
|
<input type="text" class="form-control" id="mpid" name ="mpointId" onclick="selectMPint('${param.pid}')" placeholder="单击选择" readonly>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-3 control-label">顺序</label>
|
|||
|
|
<div class="col-sm-7">
|
|||
|
|
<input type="text" class="form-control" id="morder" name ="morder" placeholder="顺序" value="">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default pull-left" 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>
|