145 lines
6.4 KiB
Plaintext
145 lines
6.4 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@page import="com.sipai.entity.process.TestIndexManage" %>
|
||
<% request.setAttribute("CycleType_hour", TestIndexManage.CycleType_hour); %>
|
||
<% request.setAttribute("CycleType_day", TestIndexManage.CycleType_day); %>
|
||
|
||
<% request.setAttribute("Active_true", TestIndexManage.Active_true); %>
|
||
<% request.setAttribute("Active_false", TestIndexManage.Active_false); %>
|
||
<style type="text/css">
|
||
|
||
</style>
|
||
<script type="text/javascript">
|
||
$(function() {
|
||
$("#cycletype").select2({minimumResultsForSearch: -1}).val("${testIndexManage.cycletype}").trigger("change");
|
||
$("#active").select2({minimumResultsForSearch: -1}).val("${testIndexManage.active}").trigger("change");
|
||
});
|
||
|
||
function dosave() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
||
//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/process/testIndexManage/doupdate.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: {
|
||
name: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '指标名称不能为空'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
function selectMethods(){
|
||
$.post(ext.contextPath + '/process/testIndexManage/selectMethods.do',{formId:'subForm',hiddenId:'method',textId:'methodname'}, function (data) {
|
||
$("#subMethodsDiv").html(data);
|
||
openModal('subMethodsModal');
|
||
});
|
||
}
|
||
|
||
</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="${testIndexManage.id}" />
|
||
|
||
<div class="form-group">
|
||
<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="${testIndexManage.name}" >
|
||
</div>
|
||
<label class="col-sm-2 control-label">参考值范围</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control" id="referencerange" name="referencerange" placeholder="参考值范围"
|
||
value="${testIndexManage.referencerange}" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">周期类别</label>
|
||
<div class="col-sm-4">
|
||
<select id ="cycletype" name="cycletype" class="form-control select2">
|
||
<option value="${CycleType_hour}" >小时</option>
|
||
<option value="${CycleType_day}" >天</option>
|
||
</select>
|
||
</div>
|
||
<label class="col-sm-2 control-label">周期数值</label>
|
||
<div class="col-sm-4">
|
||
<input type="number" class="form-control" id="cycle" name="cycle" placeholder="周期数值"
|
||
value="${testIndexManage.cycle}" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">检验方法</label>
|
||
<div class="col-sm-10">
|
||
<input type="hidden" name="method" id="method" value="${testIndexManage.method}" />
|
||
<textarea class="form-control" id="methodname" name="methodname"
|
||
placeholder="检验方法" onclick="selectMethods();" readonly>${testIndexManage.methodname}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">检验仪器</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" id="instrument" name="instrument"
|
||
placeholder="检验仪器">${testIndexManage.instrument}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">检验药剂</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" id="medicament" name="medicament"
|
||
placeholder="检验药剂">${testIndexManage.medicament}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">注意事项</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" id="matters" name="matters"
|
||
placeholder="注意事项">${testIndexManage.matters}</textarea>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">启用</label>
|
||
<div class="col-sm-4">
|
||
<select id ="active" name="active" class="form-control select2">
|
||
<option value="${Active_true}" >启用</option>
|
||
<option value="${Active_false}" >禁用</option>
|
||
</select>
|
||
</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> |