Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/process/meterCheckLibraryAdd.jsp

164 lines
7.0 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8" %>
<%@page import="com.sipai.entity.process.MeterCheckLibrary" %>
<%request.setAttribute("Targetvalue_Type_Percent", MeterCheckLibrary.Targetvalue_Type_Percent); %>
<%request.setAttribute("Targetvalue_Type_Value", MeterCheckLibrary.Targetvalue_Type_Value); %>
<!-- bootstrap switch -->
<link rel="stylesheet"
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
<script type="text/javascript"
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
charset="utf-8"></script>
<style type="text/css">
</style>
<script type="text/javascript">
function dosave() {
$("#subForm").bootstrapValidator('validate');//提交验证
if ($("#subForm").data('bootstrapValidator').isValid()) {
//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/process/meterCheckLibrary/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: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
},
mpid: {
validators: {
notEmpty: {
message: '测量点不能为空'
}
}
}
}
});
function selectmpids() {
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
// mpids: mpids,
mpids: '',
fucname: 'ckmpidDone'
}, function (data) {
$("#mpSelectDiv").html(data);
openModal('subModalMpoint');
});
}
function ckmpidDone(data) {
data = JSON.parse(data);
$('#subForm #mpid').val(data[0].mpid);
closeModal('subModalMpoint');
}
function selectmpids2() {
$.post(ext.contextPath + '/work/mpoint/mpointListSingle4LayerES.do', {
// mpids: mpids,
mpids: '',
fucname: 'ckmpidDone2'
}, function (data) {
$("#mpSelectDiv").html(data);
openModal('subModalMpoint');
});
}
function ckmpidDone2(data) {
data = JSON.parse(data);
$('#subForm #mpidRg').val(data[0].mpid);
closeModal('subModalMpoint');
}
</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">&times;</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="name" name="name" placeholder="名称"
value="${meterCheckLibrary.name}">
</div>
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
value="${meterCheckLibrary.morder}">
</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="mpid" name="mpid" placeholder="自控点"
value="${meterCheckLibrary.mpid}" onclick="selectmpids();">
</div>
<label class="col-sm-2 control-label">人工点</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="mpidRg" name="mpidRg" placeholder="人工点"
value="${meterCheckLibrary.mpidRg}" onclick="selectmpids2();">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">比值类型</label>
<div class="col-sm-4">
<select id="targetvaluetype" name="targetvaluetype" class="form-control select2">
<option value="${Targetvalue_Type_Percent}">偏差率</option>
<option value="${Targetvalue_Type_Value}">偏差值</option>
</select>
</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="targetvalue" name="targetvalue" placeholder="上限"
value="${meterCheckLibrary.targetvalue}">
</div>
<label class="col-sm-2 control-label">下限</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="targetvalue2" name="targetvalue2"
placeholder="下限"
value="${meterCheckLibrary.targetvalue2}">
</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>