<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	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>职位管理</title>

<%@include file="/WEB-INF/views/common_base_css.jsp"%>	
</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"> 
							<form action="${pageContext.request.contextPath}/sysPosition/getPositionManagement" method="post"   id="submit_form" >
								<input type="hidden" id="pageNo" name="pageNo" value="1">
								<div class="ibox-content m-b-sm border-bottom">
									<div class="row">
										<div class="col-sm-3">
											<div class="form-group">
												<label class="control-label" for="PCode">职位编码</label> <input
													class="form-control" data-val="true"
													data-val-maxlength="字段 职位编码 必须是最大长度为“15”的字符串或数组类型。"
													data-val-maxlength-max="15" id="positioncode" name="positioncode"
													type="text">

											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group">
												<label class="control-label" for="PName">职位名称</label> <input
													class="form-control" data-val="true"
													data-val-maxlength="字段 职位名称 必须是最大长度为“10”的字符串或数组类型。"
													data-val-maxlength-max="10" id="positionname" name="positionname"
													type="text">
											</div>
										</div>
										
										<div class="col-sm-3">
											<div class="form-group">
												<label class="control-label" for="DID">所属部门</label> <select
													class="form-control" id="depname" name="depname">
														<option  value="-1">请选择</option>
														<c:forEach items="${sysDepartmentlist}" var="u">
															<option value="${u.depid }">${u.depname}</option>
															<c:forEach items="${u.childSysDepartment}" var="u1" >
																<option value="u1.depid"> ${u1.depname }</option>
															</c:forEach>
														</c:forEach>
												</select>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group">
												<label class="control-label" for="search">查询</label>
												<button type="submit"
													class="btn btn-w-m btn-success form-control">
													<i class="fa fa-search"></i>&nbsp;&nbsp;查询
												</button>

											</div>
										</div>
									</div>
								</div>
							</form>
										<div class="ibox float-e-margins">
											<div class="ibox-title">
												<a
													href="${pageContext.request.contextPath}/sysPosition/getQuerySysDepartment"
													class="btn btn-w-m btn-primary"> <i
													class="fa fa-plus-square"></i>&nbsp;&nbsp;新增
												</a>
											</div>
											<div class="ibox-content" id="positionListPartial">
												<table id="MenuTable" class="table table-hover">
													<thead>
														<tr>
															<th>职位名称</th>
															<th>职位编码</th>
															<th>所属部门</th>
															<th>创建用户</th>
															<th>操作</th>
														</tr>
													</thead>
													<tbody>

														<c:forEach items="${list.dataList}" var="l1" varStatus="vs">
															<tr>
																<td>${l1.positionname}</td>
																<td>${l1.positioncode}</td>
																<td>${l1.depname}</td>
																<td>${l1.employeeno}</td>
																<td>
																	<div class="dropdown">
																		<a data-toggle="dropdown" class="dropdown-toggle"
																			href="#"> <span class="text-muted text-xs block">操作
																				<b class="caret"></b>
																		</span>
																		</a>

																		<ul class="dropdown-menu animated fadeInRight m-t-xs">
																			<li><a
																				href="${pageContext.request.contextPath}/sysPosition/getSelectSysPosition?positionid=${l1.positionid}">编辑</a></li>
																			<li><a  href="javascript:void(0)"
																		onclick="Delete('${l1.positionid}');">删除</a></li>
																			<li class="divider"></li>
																		</ul>

																	</div>
																</td>
															</tr>

														</c:forEach>


													</tbody>
												</table>

												 <%@include file="/WEB-INF/views/page.jsp"%> 

											</div>





										</div>


	            <!-- row结束 -->	
			</div>

       <!-- 页面主题内容 结束 -->

        </div>

		</div>
	</div>


<%@include file="/WEB-INF/views/common_base_script.jsp"%>
<script type="text/javascript">
//删除
		function Delete(Id){
			 swal({
		            title: "系统提示",
		            text: "确认要删除吗？",
		            type: "warning",
		            showCancelButton: true,
		            confirmButtonColor: "#DD6B55",
		            confirmButtonText: "确定",
		            cancelButtonText: "取消",
		            closeOnConfirm: false
		        },function () {
		            $.post("getDeleteSysPosition", { positionid: Id }, function (data) {
		            	debugger;
		                if (data.success==true) {
		                    swal("删除成功!", "删除完成！", "success");
		                    window.location.reload();
		                    
		                } else {
		                	swal("删除失败!", "请重试！", "error");
		                }
		            })
		        });
	}

</script>
</body>

</html>
