84 lines
3.2 KiB
Plaintext
84 lines
3.2 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@page import="com.sipai.entity.process.TestTask" %>
|
|||
|
|
<% request.setAttribute("PlanType_0", TestTask.PlanType_0); %>
|
|||
|
|
<% request.setAttribute("PlanType_1", TestTask.PlanType_1); %>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/process/testTask/dosave.do", $("#subForm").serialize()+"&planType=${PlanType_1}", function (data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
} else if (data.code == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.code);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '指标名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function selectTestindexmanage(){
|
|||
|
|
$.post(ext.contextPath + '/process/testTask/selectTestindexmanage.do',{formId:'subForm',hiddenId:'testindexmanageid',textId:'testindexmanagename',checkid:$('#testindexmanageid').val()}, function (data) {
|
|||
|
|
$("#subTestindexmanageDiv").html(data);
|
|||
|
|
openModal('subTestindexmanageModal');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
</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="unitid" id="unitid" value="${param.unitId}" />
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">检验指标</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<input type="hidden" name="testindexmanageid" id="testindexmanageid" value="${testTask.testindexmanageid}" />
|
|||
|
|
<input type="text" class="form-control" onclick="selectTestindexmanage();" id="testindexmanagename" name="testindexmanagename" placeholder="检验指标"
|
|||
|
|
value="${testTask.testindexmanagename}" readonly>
|
|||
|
|
</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>
|