first commit
This commit is contained in:
123
WebRoot/jsp/visit/safeAreaAdd.jsp
Normal file
123
WebRoot/jsp/visit/safeAreaAdd.jsp
Normal file
@ -0,0 +1,123 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||||
<%@page import="com.sipai.entity.visit.VisitCommString"%>
|
||||
<%request.setAttribute("START", VisitCommString.STATUS_VISIT_START); %>
|
||||
<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() {
|
||||
$("#bizId").val(unitId);
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/visit/safeArea/dosave.do", $("#subForm").serialize(), function(data) {
|
||||
if (data.res == 1){
|
||||
$("#table").bootstrapTable('refresh');
|
||||
editFun(data.id)
|
||||
}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: '安全区域名称不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
securityLevel: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: '安全区域级别不能为空'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||||
var userIds= $("#"+hiddenId).val();
|
||||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
});
|
||||
};
|
||||
$(function(){
|
||||
$.post(ext.contextPath + '/user/getUnitFromID.do', {id : unitId}, function(data) {
|
||||
data = $.parseJSON(data);
|
||||
if (data!=null && data.length>0){
|
||||
var Lng = data[0].longitude;
|
||||
var Lat = data[0].latitude;
|
||||
$("#longitude").val(Lng);
|
||||
$("#latitude").val(Lat);
|
||||
}
|
||||
});
|
||||
})
|
||||
</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 ">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<input id="bizId" name="bizId" type="hidden" value=""/>
|
||||
<input type="hidden" class="form-control" id="longitude" name="longitude" value="${safeArea.longitude}">
|
||||
<input type="hidden" class="form-control" id="latitude" name="latitude" value="${safeArea.latitude}">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></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="安全区域名称"
|
||||
value="${safeArea.name}"/>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">*安全级别</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="number" class="form-control" id="securityLevel" name ="securityLevel" placeholder="安全级别"
|
||||
value="${safeArea.securityLevel}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">*人群类型</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control select2" id="type"
|
||||
name="type" style="width: 100%;">
|
||||
<option value="adult">成人</option>
|
||||
<option value="children">青少年</option>
|
||||
</select>
|
||||
</div>
|
||||
<%--<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${safeArea.stateName}</p>
|
||||
<input id="state" name="state" type="hidden" value="${START}"/>
|
||||
</div>--%>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${safeArea.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user