104 lines
4.1 KiB
Plaintext
104 lines
4.1 KiB
Plaintext
|
|
<%@ 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 showDocument4SelectFun = function() {
|
|||
|
|
$.post(ext.contextPath + '/document/showDocumentList4Select.do', {formId:"subForm",hiddenId:"pid",textId:"pname",doctype:"${param.doctype}",companyId:'${param.companyId}'} , function(data) {
|
|||
|
|
$("#doc4SelectDiv").html(data);
|
|||
|
|
openModal('doc4SelectModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + '/document/dosave.do', $("#subForm").serialize(), function(result) {
|
|||
|
|
if (result.res == 1) {
|
|||
|
|
initFun();
|
|||
|
|
editFileFun(result.id,result.name);
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
$(function() {
|
|||
|
|
$("#st").select2({minimumResultsForSearch: 10});
|
|||
|
|
});
|
|||
|
|
//输入框验证
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
docname: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
number: {
|
|||
|
|
validators: {
|
|||
|
|
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 ">
|
|||
|
|
<form class="form-horizontal " id="subForm">
|
|||
|
|
<input id="id" name="id" type="hidden" />
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div id="fault4SelectDiv"></div>
|
|||
|
|
<input type="hidden" id="doctype" name ="doctype" value="${param.doctype}" >
|
|||
|
|
<input type="hidden" id="bizId" name ="bizId" value="${param.companyId}" >
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="docname" name ="docname" placeholder="名称" >
|
|||
|
|
</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="showDocument4SelectFun();" value="${pname}">
|
|||
|
|
<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="number" name ="number" placeholder="编号">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">启用</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id ="st" name="st" class="form-control select2">
|
|||
|
|
<option value="1" >启用</option>
|
|||
|
|
<option value="0" >禁用</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">简要说明</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control " id="details" name="details" rows="2"></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|