142 lines
5.7 KiB
Plaintext
142 lines
5.7 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<%@page import="com.sipai.tools.CommString"%>
|
|||
|
|
<%request.setAttribute("Active_True", CommString.Active_True); %>
|
|||
|
|
<%request.setAttribute("Active_False", CommString.Active_False); %>
|
|||
|
|
|
|||
|
|
<%@page import="com.sipai.entity.administration.OrganizationClass"%>
|
|||
|
|
<%request.setAttribute("Type_0", OrganizationClass.Type_0); %>
|
|||
|
|
<%request.setAttribute("Type_1", OrganizationClass.Type_1); %>
|
|||
|
|
|
|||
|
|
<%request.setAttribute("Attribute_0", OrganizationClass.Attribute_0); %>
|
|||
|
|
<%request.setAttribute("Attribute_1", OrganizationClass.Attribute_1); %>
|
|||
|
|
<%request.setAttribute("Attribute_2", OrganizationClass.Attribute_2); %>
|
|||
|
|
<%request.setAttribute("Attribute_3", OrganizationClass.Attribute_3); %>
|
|||
|
|
|
|||
|
|
<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 showOrganizationClass4SelectFun = function() {
|
|||
|
|
$.post(ext.contextPath + '/administration/organizationClass/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 + "/administration/organizationClass/save.do", $("#subForm").serialize(), function(result) {
|
|||
|
|
if (result == 1) {
|
|||
|
|
initTreeView();
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
$(function() {
|
|||
|
|
$("#active").select2({minimumResultsForSearch: 10});
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
code: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '编号不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/* pname: {
|
|||
|
|
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="type" name="type" type="hidden" value="${param.type}"/>
|
|||
|
|
|
|||
|
|
<!-- 界面提醒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" 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="showOrganizationClass4SelectFun();" value="${pname}" readonly></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="code" name="code" placeholder="编号"
|
|||
|
|
value="">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<c:if test="${param.type==Type_0}">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">岗位属性</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id ="attribute" name="attribute" class="form-control select2">
|
|||
|
|
<option value="${Attribute_0}" >运行</option>
|
|||
|
|
<option value="${Attribute_1}" >行政</option>
|
|||
|
|
<option value="${Attribute_2}" >维修</option>
|
|||
|
|
<option value="${Attribute_3}" >化验</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</c:if>
|
|||
|
|
<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="${Active_True}" selected="selected">启用</option>
|
|||
|
|
<option value="${Active_False}" >禁用</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" rows="2" id ="remarks" name ="remarks" placeholder="描述..."></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|