Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/process/dataPatrolAdd.jsp

120 lines
4.7 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import="com.sipai.entity.base.ServerObject" %>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
<%@page import="com.sipai.entity.data.DataCurve" %>
<% request.setAttribute("Type_group", DataCurve.Type_group);%>
<% request.setAttribute("Type_sys", DataCurve.Type_sys);%>
<% request.setAttribute("Type_user", DataCurve.Type_user);%>
<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_Add").bootstrapValidator('validate');//提交验证
if ($("#subForm_Add").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$.post(ext.contextPath + "/process/dataPatrol/doSave.do", $("#subForm_Add ").serialize(), function (result) {
var data = $.parseJSON(result);
if (data.code == 1) {
initTreeView();
// showAlert('s','保存成功');
} else {
showAlert('d', result.msg);
}
});
}
}
$("#subForm_interfaceAdd").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
}
}
}
}
});
$(function () {
if ($('#type').val() == 0) {
$('#mpid').hide()
$('#mpidtag').hide()
} else {
$('#mpid').show()
$('#mpidtag').show()
}
$('#type').change(function () {
if ($('#type').val() == 0) {
$('#mpid').hide()
$('#mpidtag').hide()
} else {
$('#mpid').show()
$('#mpidtag').show()
}
})
});
var selectMPint = function(pid) {
$.post(ext.contextPath + '/work/mpoint/showlistForSelect.do', {formId:'subForm_Add',hiddenId:'mpid',codeId:'mpcode',textId:'name', valueId :'value',mpid:$("#mpid").val()} , function(data) {
$("#mpSubDiv").html(data);
openModal('mpSubModal');
});
};
</script>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">新增</h3>
<div class="box-tools pull-right">
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
class="glyphicon glyphicon-floppy-disk"></i></a>
</div>
</div>
<!-- /.box-header -->
<div class="box-body ">
<form class="form-horizontal " id="subForm_Add">
<input id="unitId" name="unitId" type="hidden" value="${param.unitId}"/>
<input id="pid" name="pid" type="hidden" value="${pid}"/>
<!-- 界面提醒div强制id为alertDiv -->
<div id="alertDiv"></div>
<div id="menu4SelectDiv"></div>
<div class="form-group">
<label class="col-sm-2 control-label">节点类型</label>
<div class="col-sm-4">
<select id="type" name="type" class="form-control select2">
<option value="0">节点</option>
<option value="1">测量点节点</option>
</select>
</div>
<label class="col-sm-2 control-label">顺序</label>
<div class="col-sm-4">
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序">
</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="name" name="name" placeholder="名称">
</div>
<label class="col-sm-2 control-label" id="mpidtag">测量点</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="mpid" name="mpid" onclick="selectMPint()" placeholder="测量点" readonly>
</div>
</div>
</form>
</div>
</div>