<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", -10);
%>
<%@include file="/WEB-INF/views/base.jsp"%>
<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>DGT | 表单查询</title>

<link href="${cssPath }/bootstrap.min.css" rel="stylesheet">
<link href="${fontAwsPath }/css/font-awesome.css" rel="stylesheet">

<!-- Data Tables -->
<link href="${cssPath }/plugins/dataTables/dataTables.bootstrap.css"
	rel="stylesheet">
<link href="${cssPath }/plugins/dataTables/dataTables.responsive.css"
	rel="stylesheet">
<link
	href="${cssPath }/plugins/dataTables/dataTables.tableTools.min.css"
	rel="stylesheet">

<link href="${cssPath }/animate.css" rel="stylesheet">
<link href="${cssPath }/style.css" rel="stylesheet">

</head>

<body>

	<div id="wrapper">

		<jsp:include page="../menu.jsp"></jsp:include>

		<div id="page-wrapper" class="gray-bg">
			<jsp:include page="../head.jsp"></jsp:include>
			<jsp:include page="../pageNav.jsp"></jsp:include>
			<!-- 页面 主题内容  开始-->
	        <div class="wrapper wrapper-content animated fadeInRight">
	        <div class="row">
	        	<!-- row开始 -->
	           <div class="row">
                	<div class="col-lg-12">
	                    <div class="ibox float-e-margins">
	                        <div class="ibox-title">
	                            <h5>添加部门</h5>
	                        </div>
	                        <div class="ibox-content">
	                        	<form:form id="form" modelAttribute="sysDepartment" action="${pageContext.request.contextPath}/sysDepartment/getAddSysdepartment" class="form-horizontal" method="post" >
									<div class="form-group">
										<label class="col-sm-2 control-label" for="PositionName">部门名称</label>
										<div class="col-md-10">
											<form:input class="form-control placeholder-no-fix" path="depname" autocomplete="off" placeholder="部门名称" required="" />
 											<form:errors path="depname" class="field-has-error"></form:errors> 
										</div>

									</div>
									
									<div class="form-group">
										<label class="col-sm-2 control-label" for="PositionCode">部门编码</label>
										<div class="col-md-10">
											<input name="depcode" class="form-control placeholder-no-fix"/>
											<%-- <form:input class="form-control placeholder-no-fix" path="positioncode"  autocomplete="off" placeholder="部门编码" required="" />  --%>
										</div>
									</div>
									<div class="form-group">
									<label class="col-sm-2 control-label" for="PositionCode">上级部门</label>
										<div class="col-md-10">
											<select
											class="form-control" id="parentid" name="parentid"
											style="width: 100%">
											<option value="">请选择</option>
											<c:forEach items="${sysDepartmentlist}" var="s">
												<option value="${s.departmentid }" >${s.depname }</option>
												<c:forEach items="${s.childSysDepartment}" var="s1" >
													<option value="${s1.departmentid }" > ${s1.depname }</option>
												</c:forEach>
											</c:forEach>
										</select>
										</div>
									</div>
									<div class="form-group">
	                                    <div class="col-sm-4 col-sm-offset-2">
	                                        <button onclick="history.go(-1)" class="btn btn-warning" type="button"><i class="fa fa-mail-forward"></i>&nbsp;&nbsp;返回</button>
	                                        <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i>&nbsp;&nbsp;保存</button>
	                                    </div>
	                                </div>
								</form:form>
	                        </div>
	                    </div>
                	</div>
            	</div>
	            <!-- row结束 -->	
	        </div>    
	        </div>
	        <!-- 页面主题内容 结束 -->


		</div>
	</div>



	   <%@include file="/WEB-INF/views/common_base_script.jsp"%>
	
<script type="text/javascript">
$(function(){
	//前台js验证
	var ruleObj = {depname:{required:true}};
	var messageObj = {depname:{required:"请输入部门名称"}};
	CommonUtils.formValidate("form", ruleObj, messageObj);
})
</script>
</body>

</html>
