first commit
This commit is contained in:
85
src/main/webapp/jsp/sparepart/channelsAdd.jsp
Normal file
85
src/main/webapp/jsp/sparepart/channelsAdd.jsp
Normal file
@ -0,0 +1,85 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<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">
|
||||
var showChannels4SelectFun = function() {
|
||||
$.post(ext.contextPath + '/sparepart/channels/showList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname"} , function(data) {
|
||||
$("#fault4SelectDiv").html(data);
|
||||
openModal('fault4SelectModal');
|
||||
});
|
||||
};
|
||||
function dosave() {
|
||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||
$.post(ext.contextPath + "/sparepart/channels/save.do", $("#subForm").serialize(), function(result) {
|
||||
if (result.res == 1) {
|
||||
initTreeView();
|
||||
}else{
|
||||
showAlert('d','保存失败');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
//输入框验证
|
||||
$("#subForm").bootstrapValidator({
|
||||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||||
fields: {
|
||||
brand: {
|
||||
name: {
|
||||
notEmpty: {
|
||||
message: '名称不能为空'
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
</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">
|
||||
<!-- 界面提醒div强制id为alertDiv -->
|
||||
<div id="alertDiv"></div>
|
||||
<div id="fault4SelectDiv"></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" >
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">上级菜单</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="pname" name ="pname" placeholder="上级菜单" onclick="showChannels4SelectFun();" value="${pname}"></input>
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</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="morder" name ="morder" placeholder="顺序" value=0>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">状态</label>
|
||||
<div class="col-sm-4">
|
||||
<select id ="active" name="active" class="form-control select2">
|
||||
<option value=true selected="selected">可用</option>
|
||||
<option value=false >审核中</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user