📄 persongroup.jsp
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*,oa.main.DealString"%>
<%
oa.bean.PersonGroupBean myBean = null;
try{
myBean = new oa.bean.PersonGroupBean();
DealString ds = new DealString();
//取得菜单类别
String strType = ds.toString((String)request.getParameter("txt_type"));
if(strType.equals(""))strType = "1";
//增删改类型
String strEdit = ds.toString((String)request.getParameter("txt_edit"));
//职工人员编号
String strPersonNo = ds.toString((String)session.getAttribute("zgbh"));
//取得当前群组编号(group_NO)
String strGroupNo = ds.toString((String)request.getParameter("txt_groupno"));
//取得行动代码
String strCMD = ds.toString((String)request.getParameter("txt_CMD"));
String strZGBHs = ds.toString((String)request.getParameter("ZGBHs"));
String strBH="";
String strMC="";
String strLXRs="";
//设置人员号
myBean.setPersonNO(strPersonNo);
//将数据写入库
if(strCMD.equals("WriteToDB")) {
//取得群组人员字符串
String strMemberValues = ds.toString((String)request.getParameter("txt_Member_Value"));
String strMembers="";
String [] strArry_Selected=strMemberValues.split(";");
//取出"LXRXH"组成串
Vector oVect=new Vector();
for(int i=0; i < strArry_Selected.length; i++){
String[] str=strArry_Selected[i].split(",");
oVect.add(str[0]);
//strMembers+=str[1];
}//end for
myBean.setPersonNO(strPersonNo);
myBean.setGroupNO(strGroupNo);
myBean.modRec_GroupInfo(oVect);
%>
<script>
document.all.txt_type.value = "4";
document.all.txt_edit.value = "0";
document.all.txt_groupno.value = "0";
document.all.form1.action = "person.jsp";
document.all.form1.submit();
</script>
<%
}//end WriteToDB
%>
<br><br>
<div align=left>
<font color="#CC00FF" size=2><b>个人群组信息列表<b></font>
</div>
<br>
<TABLE class="tab" cellSpacing=1 cellPadding=5 width="95%" align=center bgColor=#999999 style="word-break:break-all;">
<TBODY>
<TR bgColor="#2969b5" height=20>
<font color="#ffffff">
<TD width="170">
<CENTER><B><font color="#ffffff">群组名称</font></B></CENTER></TD>
<TD>
<CENTER><B><font color="#ffffff">群组内容</font></B></CENTER></TD>
<TD width="150">
<CENTER><B><font color="#ffffff">操作</font></B></CENTER></TD>
</font>
</TR>
<TR bgColor=#ffffff>
<TD colSpan=2 height=15 ></TD>
<TD align="center" >
<p align="center"><FONT color="#FF6600">
<A onclick="add('<%=strPersonNo%>');" style="cursor:hand;">新增个人群组</A> </FONT></p>
</TD>
</TR>
<%
Vector vect = (Vector)myBean.getData();
String bgcolor="";
for(int i=0;i<vect.size();i++)
{
if ((i%2)==0) {
bgcolor="#d0e7ff";
}else {
bgcolor="#ffffff";
}//end if else
Hashtable hash = (Hashtable)vect.get(i);
strBH = ds.toString((String)hash.get("QZBH"));
strMC = ds.toString((String)hash.get("QZMC"));
strLXRs = ds.toString((String)hash.get("LXRXHC"));
myBean.setGroupNO(strBH);
String strMember = ds.toString(myBean.getGroupMembers());
if (strMember.equals("")) strMember="无";
strMember=strMember;
%>
<TR bgColor="<%=bgcolor%>">
<%
//设置字符最长长度(strMC)
if (ds.byteLength(strMC)>25){
String str=ds.strByteCopy(strMC,25);
out.println("<TD width='170' align=center title=\""+strMC+"\">"+str+"...</TD>");
}else{
out.println("<TD width='170' align=center>"+strMC+"</TD>");
}//end if else
//设置字符最长长度(strMember)
if (ds.byteLength(strMember)>30){
String str=ds.strByteCopy(strMember,30);
%>
<TD align=left title=<%=strMember%>><%=str%><span style="cursor:hand;color:#0066CC;font-size:7pt;" onclick="openDetail('<%=strBH%>')">[...]</span></TD>
<%
}else{
out.println("<TD align=left >"+strMember+"</TD>");
}//end if else
%>
<TD align=center width="150">
<FONT color="#99cc00">
<A onclick="mod('<%=strPersonNo%>','<%=strBH%>','<%=strMC%>');" style="cursor:hand;">改名</A> |
<A onclick="del('<%=strPersonNo%>','<%=strBH%>');" style="cursor:hand;">删除</A> |
<A onclick="setGroup('<%=strPersonNo%>','<%=strBH%>','<%=strLXRs%>');"style="cursor:hand;">设置群组</A>
</FONT>
</TD>
</TR>
<%
}
%>
<TR bgColor="#d0e7ff" height=20>
<TD colSpan=3 height=30>
</TD>
</TR>
</TBODY>
</TABLE>
<script language="javascript">
function add(strPersonNO){
//产生新群组的名称
var strNewGroupName="";
strNewGroupName=window.prompt("请输入新群组名","");
if ((strNewGroupName!=null) && (strNewGroupName!="")){
document.all.txt_type.value = "4";
document.all.txt_edit.value = "1";
document.all.txt_personno.value = strPersonNO;
document.all.txt_groupno.value = "";
//alert(document.all.txt_type.value);
document.all.form1.action = "../../PerSvlt?newgroup_Name="+strNewGroupName;
document.all.form1.submit();
}else{
alert("您的输入为空或不合法,操作被取消!");
}
}
function mod(strPersonNO,strGroupNO,strGroupName){
//产生新群组的名称
var strNewGroupName="";
strNewGroupName=window.prompt("请输入新群组名",strGroupName);
if ((strNewGroupName!=null) && (strNewGroupName!=strGroupName)){
document.all.txt_type.value = "4";
document.all.txt_edit.value = "2";
document.all.txt_personno.value = strPersonNO;
document.all.txt_groupno.value = strGroupNO;
document.all.form1.action = "../../PerSvlt?newgroup_Name="+strNewGroupName;
document.all.form1.submit();
}
}
function del(strPersonNO,strGroupNO){
if(confirm("是否真的要删除?")){
document.all.txt_type.value = "4";
document.all.txt_edit.value = "3";
document.all.txt_personno.value = strPersonNO;
document.all.txt_groupno.value = strGroupNO;
document.all.form1.action = "../../PerSvlt";
document.all.form1.submit();
}
}
function setGroup(strPersonNO,strGroupNO,strLXRs){
document.all.txt_type.value = "4";
document.all.txt_edit.value = "0";
document.all.txt_groupno.value = strGroupNO;
var go="../organization/departBrower.jsp?ZGBHs="+strLXRs+"&target=1"
window.open(go,"设置群组","toolbar=0,location=0,status=no,menubar=0,scrollbars=yes,resizable=no,left=200,top=200,width=460,height=490");
}
function onButton_OK(oList){
Edit=1;
var strNames="";
var strValues="";
for(var i=0;i<oList.length;i++){
strNames+=oList.options[i].text;
strNames+=",";
strValues+=oList.options[i].value;
strValues+=";";
}
//document.all.txt_Members.value=strNames;
document.all.txt_Member_Value.value=strValues;
document.all.txt_type.value = "4";
document.all.txt_edit.value = "0";
document.all.form1.action = "person.jsp?txt_CMD=WriteToDB";
document.all.form1.submit();
}
function openDetail(groupid){
var go="personGroupDetail.jsp?txt_groupno="+groupid;
window.open(go,"群组人员","toolbar=0,location=0,status=no,menubar=0,scrollbars=no,resizable=no,width=300,height=200");
}
</script>
<%}finally{
if(myBean!=null)myBean.closeConn();
}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -