📄 setposition.jsp
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; UTF-8">
<title>Y6高级销售管理平台</title>
<link href="${pageContext.request.contextPath}/css/global.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/treeViewMgr.js'></script>
<script type='text/javascript' src='${pageContext.request.contextPath}/dwr/engine.js'> </script>
<style type="text/css">
<!--
.style1 {font-size: 14px}
-->
</style>
<script type="text/javascript">
function selectDept(){
var path = "${pageContext.request.contextPath}/admin/user/deptTree.jsp";
winopen(400,500,path);
}
//弹出窗口
function winopen(width, height, path){
var left = (screen.width/2) - width/2;
var top = (screen.height/2) - height/2;
var styleStr = 'toolbar=no,location=no,directories=auto,status=no,menubar=no,scrollbars=yes resizable=no,z-lock=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
window.open(path,'',styleStr);
}
function changePosition(deptId){
//DWR获取该部门底下所有岗位
treeViewMgr.getPositionByDeptId(deptId, callback);
}
function callback(positions){
var positionObj = document.getElementById("positionId");
//删除下拉框中除第一项外的所有项,全部删除=0
positionObj.length=1;
//添加新获取的数据
for(var i=0; i<positions.length; i++){
var opt = new Option();
opt.value = positions[i].id;
opt.text = positions[i].positionName;
positionObj.add(opt);
}
}
function changeCheck(allCheck,userSize){
for(var i = 0; i < userSize ; i++){
document.getElementById('user'+i).checked = allCheck.checked;
}
}
function submitForm(userSize){
var flag = false;
var positionId = document.getElementById("positionId").value;
if(positionId == null || positionId ==""){
alert("请选择岗位");
return;
}
for(var i = 0; i < userSize ; i++){
var flag = document.getElementById('user'+i).checked;
if(flag){
break;
}
}
if(flag){
document.forms[0].submit();
}else{
alert("请选择用户");
}
}
</script>
</head>
<body>
<br/>
<table width="98%" border="0" cellspacing="0" cellpadding="0" background="${pageContext.request.contextPath}/images/tiao.gif" align="center">
<tr >
<td align="left" height="27" > 当前节点:${treeview.name }</td>
</tr>
</table>
<form action="${pageContext.request.contextPath}/admin/treeView.do?method=setPosition" method="post">
<table width="98%" border="0" cellspacing="0" cellpadding="0"
align="center">
<tr>
<td bgcolor="#CCCCCC" width="2" height="2"></td>
<td height="2" bgcolor="#F3F7FA"><br/>
调往部门:<input type="text" id="dept" name="dept" value="" onclick="selectDept();" readonly>
调往岗位:<select id="positionId" name="positionId" >
<option>请选择。。</option>
</select>
<input type="button" class="userButton" value="调岗" onclick="javascript: submitForm('${userSize }');">
</td>
<td bgcolor="#CCCCCC" width="2" height="2"></td>
<tr>
<td bgcolor="#CCCCCC" width="2" height="2"></td>
<td height="2" bgcolor="#F3F7FA">
<br/>
<div id="myContacts" style="text-align: center;">
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr align="center" bgcolor="#941DCB">
<td width="5%" height="30">
<input type="checkbox" onClick="changeCheck(this,'${userSize }');">
</td>
<td width="5%" height="30">序号</td>
<td width="12%" >登录名</td>
<td width="10%" >姓名</td>
<td width="10%" >岗位</td>
<td width="15%" >电子邮件</td>
<td width="12%" >手机号码</td>
<td width="12%" >类型</td>
</tr>
<tr><td colspan="7" height="10"></td></tr>
<logic:notEmpty name="users">
<logic:iterate id="user" name="users" indexId="i">
<tr align="center" class="dataTr">
<td width="5%" height="40">
<input name="userId" id="user${i }" type="checkbox" value="${user.id }">
</td>
<td width="5%" height="40">${i+1 }</td>
<td width="12%" >${user.userName }</td>
<td width="10%" >${user.familyName }</td>
<td width="10%" >${user.position }</td>
<td width="10%" >${user.email }</td>
<td width="12%" >${user.phone }</td>
<td width="12%" >
<c:choose>
<c:when test="${user.type=='1'}">管理员</c:when>
<c:otherwise>普通用户</c:otherwise>
</c:choose>
</td>
</tr>
<tr bgcolor="#941DCB" ><td colspan="8"></td></tr>
</logic:iterate>
</logic:notEmpty>
</table>
</div>
</td>
<td bgcolor="#CCCCCC" width="2" height="2"></td>
</tr>
</table>
</form>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="8" height="5" valign="top">
<img src="${pageContext.request.contextPath}/images/left.gif" width="8" height="11">
</td>
<td background="${pageContext.request.contextPath}/images/ht.gif" height="11">
</td>
<td width="8" height="5" valign="top">
<img src="${pageContext.request.contextPath}/images/rg.gif" width="8" height="11">
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -