`
microsystems
  • 浏览: 7200 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

SelectReaderBody.jsp

阅读更多
<%@ page language="java" contentType="text/html;CHARSET=utf8"
import="org.apache.commons.beanutils.BasicDynaBean,
        cn.com.detech.struts.action.DEMessages,
cn.com.detech.deinfo.util.Constants"
%>
<%@ 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" %>

<head>
<title>选择传阅对象</title>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">  -->
<LINK href="../skin/skin<bean:write name="user" property="systemskin"/>/style.css" rel="stylesheet">
<script language="JavaScript" src="../script/oa_Popup.js"></SCRIPT>
<script language="JavaScript">
<!--
function lTrim(str){
    var rtnStr;
    rtnStr="";
    for (var i=0;i<str.length;i++){
if (str.charAt(i)!=" "){
rtnStr=str.substr(i);
break;
}
}
    return rtnStr;
}

function rTrim(str){
    var rtnStr;
rtnStr="";
for (var i=str.length-1;i>=0;i--){
if (str.charAt(i)!=" "){
rtnStr=str.substring(0,i+1);
break;
}
}
return rtnStr;
}

//去除左边和右边的空格
function lrtrim(str){
    return(lTrim(rTrim(str)));
}

function setReaderNameStr(){
    myform = document.SelectReaderForm;
var NameStr = "";
myform.readerNameStr.value = "";

for(i=0; i < myform.selectedIDStr.options.length; i++){
        NameStr = myform.selectedIDStr.item(i).text;

if(NameStr != ""){
if (i < myform.selectedIDStr.options.length - 1) {
myform.readerNameStr.value += NameStr+"#";
}
else {
myform.readerNameStr.value += NameStr;
}
}
}
}

function setReturnValue(){
    myform = document.SelectReaderForm;
    var NameStr ="";
myform.returnName.value = "";
    //var EMailStr = "";
    //var IDStr = "";
    for(i=0; i < myform.selectedIDStr.options.length; i++){
//NameStr = lrtrim(myform.selectedIDStr.item(i).text.substring(0, 6));
var index = myform.selectedIDStr.item(i).text.indexOf(" ");
if (index > 0)
NameStr = myform.selectedIDStr.item(i).text.substring(0, index);

        //IDStr = myform.selectedIDStr.item(i).value;
        //EMailStr = NameStr.substring(NameStr.indexOf(" <")+2,NameStr.indexOf(">"));
        //NameStr = NameStr.substring(0,NameStr.indexOf(" <"));

        if(NameStr != ""){
if (i < myform.selectedIDStr.options.length - 1) {
            myform.returnName.value += NameStr+", ";
}
else {
                myform.returnName.value += NameStr;
}
}
        //myform.returnEMail.value += EMailStr+",";
        //myform.returnID.value += IDStr+",";
    }
}

function setback(){
    myform = document.SelectReaderForm;
    setReturnValue();

window.opener.document.CirculationEditForm.reader.value = myform.returnName.value;
//    if(myform.returnObjName.value == "assignEmpName"){//分配他人
//        window.opener.document.todoDetailForm.assignEmpName.value = myform.returnName.value;
//        window.opener.document.todoDetailForm.assignEmpID.value = myform.returnID.value;
//    }else
//    if(myform.returnObjName.value == "engageEmpName"){//预约他人
//        window.opener.document.schDetailForm.engageEmpName.value = myform.returnName.value;
//        window.opener.document.schDetailForm.engageEmpID.value = myform.returnID.value;
//    }else
//    if(myform.returnObjName.value == "messageEmpName"){//留言他人
//        window.opener.document.schDetailForm.messageEmpName.value = myform.returnName.value;
//        window.opener.document.schDetailForm.messageEmpID.value = myform.returnID.value;
//    }else
//    if(myform.returnObjName.value == "mailto"){//邮件给他人
//        window.opener.document.schDetailForm.mailto.value = myform.returnEMail.value;
//    }else
//    if(myform.returnObjName.value == "mail_cc"){//邮件抄送他人
//        window.opener.document.schDetailForm.mail_cc.value = myform.returnEMail.value;
//    }else
//    if(myform.returnObjName.value == "mail_bcc"){//密件抄送他人
//        window.opener.document.schDetailForm.mail_bcc.value = myform.returnEMail.value;
//    }
//    window.close();
}

function checkDept() {
var temp = document.SelectReaderForm.selDeptID.value;
if (temp == null || temp == "9998" || temp == "")
return false;
return true;
}

function checkGroup() {
var temp = document.SelectReaderForm.selGroupID.value;
if (temp == null || temp == "9998" || temp == "")
return false;
return true;
}

function selectAll() {
myform = document.SelectReaderForm;
for(i = myform.selectableIDStr.options.length - 1; i >= 0; i --) {
        document.SelectReaderForm.selectableIDStr.options(i).selected = true;
}
}

function addReceiver() {
    myform = document.SelectReaderForm;
    for(i=0; i < myform.selectableIDStr.options.length; i++) {
        if (myform.selectableIDStr.options(i).selected == true) {
    j = myform.selectedIDStr.options.length - 1;
    for (; j >= 0; j--) {
if (myform.selectableIDStr.item(i).value == myform.selectedIDStr.item(j).value) {
    break;
}
    }
    if (j < 0) {
        newOpt = new Option(myform.selectableIDStr.item(i).text, myform.selectableIDStr.item(i).value);
                myform.selectedIDStr.add(newOpt);
    }
}
    }
}

function removeReceiver() {
    myform = document.SelectReaderForm;
    for (i = myform.selectedIDStr.options.length - 1; i >= 0; i--) {
        if (myform.selectedIDStr.options(i).selected == true) {
            myform.selectedIDStr.remove(i);
}
    }
}

function moveUpDn(direction) {
    myform = document.SelectReaderForm;
    index = myform.selectedIDStr.options.length;
    count = 0;
    for (i = myform.selectedIDStr.options.length - 1; i >= 0; i--) {
        if (myform.selectedIDStr.options(i).selected == true) {
        count++;
        index = i;
    }
    }
    if (count == 1) { // Select One only
        if (direction < 0 && index > 0) { // Up
        newOpt = new Option(myform.selectedIDStr.item(index).text, myform.selectedIDStr.item(index).value);
        newOpt.selected = true;
            myform.selectedIDStr.remove(index);
            myform.selectedIDStr.add(newOpt, index + direction);
        }
        if (direction > 0 && index < myform.selectedIDStr.options.length - 1) { // Down
        newOpt = new Option(myform.selectedIDStr.item(index).text, myform.selectedIDStr.item(index).value);
        newOpt.selected = true;
            myform.selectedIDStr.remove(index);
            myform.selectedIDStr.add(newOpt, index + direction);
        }
    }
}

function moveUp() {
myform = document.SelectReaderForm;
var j = 0;
    for (i = myform.selectedIDStr.options.length - 1; i >= 0; i--) {
        if (myform.selectedIDStr.options(i).selected == true) {
            myform.selectedIDStr.options(i).selected = false;
            j = i;
}
}
if ( myform.selectedIDStr.options.length > 0 ) {
if (j == 0)
myform.selectedIDStr.options(j).selected = true;
else
myform.selectedIDStr.options(j - 1).selected = true;
}
}

function moveDown() {
myform = document.SelectReaderForm;
var j = 0;
    for (i = 0; i < myform.selectedIDStr.options.length; i++) {
        if (myform.selectedIDStr.options(i).selected == true) {
            myform.selectedIDStr.options(i).selected = false;
            j = i;
}
}
if ( myform.selectedIDStr.options.length > 0 ) {
if (j == (myform.selectedIDStr.options.length - 1))
myform.selectedIDStr.options(j).selected = true;
else
myform.selectedIDStr.options(j + 1).selected = true;
}
}

function submitForm(act){
myform = document.SelectReaderForm;

    //if(act == "Save"){
        for (i = document.SelectReaderForm.selectedIDStr.options.length - 1; i >= 0; i--) {
            document.SelectReaderForm.selectedIDStr.options(i).selected = true;
    }
        for (i = document.SelectReaderForm.selectableIDStr.options.length - 1; i >= 0; i--) {
            document.SelectReaderForm.selectableIDStr.options(i).selected = false;
    }
    //}

myform.action.value = act;
myform.submit();
}
//-->
</script>
</head>

<html:form action="/SelectReader" name="SelectReaderForm" method="POST" type="cn.com.detech.deinfo.communion.web.SelectFormForm">
<html:hidden property="action"/>
<html:hidden property="returnName"/>
<html:hidden property="readerNameStr"/>

<body class="popbg" topmargin="0" leftmargin="0">
<% DEMessages DEMSG = (DEMessages)request.getAttribute(Constants.ERROR_BEAN);
if (DEMSG!=null) {
String[] strMsg = DEMSG.getStrErrMSG();
if (strMsg!=null && strMsg.length>=1) { %>
        <%-- <jsp:include page="../../../platform/jsp/DEMessages.jsp" flush="true" /> --%>
        <script language="javascript">
window.close();
</script>
<%
}
}
%>
<div align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="popbt">
  <tr>
    <td>&&<B>请从列表中选择姓名</B></td>
   
  </tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>

      <td>
        
      <div align="center">
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
            <tr>
              <td width="100%" >

  <TABLE width="100%" border="0" cellspacing="1">
            <TR>
              <TD width="100%"  colspan="4">
              <b>
              &部门科室:</b>
<html:select property="selDeptID" size="1" onchange="setReaderNameStr();submitForm('ChangeDept');" style="width:150">
        <logic:iterate id="did" name="SelectReaderForm" property="deptList">
                      <html:option value="<%=Integer.toString(((cn.com.detech.deinfo.users.BeanDepartment)did).getDeptID())%>"><%=((cn.com.detech.deinfo.users.BeanDepartment)did).getDepartmentName()
  %>
  </html:option>
                 </logic:iterate>
</html:select><b>
自定义群组:</b>
<html:select property="selGroupID" size="1" onchange="setReaderNameStr();submitForm('ChangeGroup');" style="width:150">
    <logic:iterate id="gid" name="SelectReaderForm" property="groupList">
                      <html:option value="<%=Integer.toString(((cn.com.detech.deinfo.users.BeanGroup)gid).getGroupID())%>"><%=((cn.com.detech.deinfo.users.BeanGroup)gid).getGroupName()
  %>
  </html:option>
                 </logic:iterate>
</html:select>(信息送给指定的传阅对象)
              </TD>
            </TR>
            <TR>
             
      <TD width="44%">
        <p align="center"><strong>人员一览</strong></TD>
              <TD width="8%" rowspan="3" >
                <p align="center">
                  <input type="button" value="→ 添加" name="B3" onClick="addReceiver();"><br>
                  <br>
                  <input type="button" value="← 删除" name="B3" onClick="removeReceiver(); return false;"><br>
                  <br>
                  <input type="button" value="○ 全选" name="B3" onClick="selectAll(); return false;"></p></TD>
             
      <TD width="50%"  colspan="2">
        <p align="center"><strong>传阅对象一览</strong></TD>
            </TR>
            <TR>
              <TD width="45%" valign="middle" >
                <table border="0" width="99%" cellspacing="0" cellpadding="0">
                  <tr >
                    <td width="30%"  align="left"  height="11">姓名</td>
                    <td width="40%"  align="left"  height="11">部门科室</td>
                    <td width="29%"  align="left"  height="11">职务</td>
                  </tr>
                </table></TD>
              <TD width="45%" > <table border="0" width="99%" cellspacing="0"  cellpadding="0">
                  <tr >
                    <td width="30%"  align="left"  height="11">姓名</td>
                    <td width="40%"  align="left"  height="11">部门科室</td>
                    <td width="29%"  align="left"  height="11">职务</td>
                  </tr>
                </table></TD>
              <TD width="2%"  rowspan="2">
                <p align="center"><input type="button" value="↑" name="B3" onclick="moveUpDn(-1);"><br>
                <br>
                <input type="button" value="↓" name="B3" onclick="moveUpDn(1);"><br>
                <br>
              </TD>
            </TR>
            <tr>
              <TD width="45%" >
  <html:select property="selectableIDStr" multiple="true" size="15" style="width:100%; font-family:Courier New; font-size:9pt" ondblclick="addReceiver(); return false;">
    <logic:iterate id="eid" name="SelectReaderForm" property="empList">
<%
     String userStr = "";
     String userName = ((cn.com.detech.deinfo.communion.model.ReaderBean)eid).getUserName();
String deptName = ((cn.com.detech.deinfo.communion.model.ReaderBean)eid).getDeptName();
String positionName = ((cn.com.detech.deinfo.communion.model.ReaderBean)eid).getPositionName();

int ulength = 0;
ulength = 6 - userName.length();
if (ulength > 0) {
for(int i = 0; i < ulength; i ++) {
userName += " ";
}
}
else {
userName += " ";
}

ulength = 9 - deptName.length();
if (ulength > 0) {
for(int i = 0; i < ulength; i ++) {
deptName += " ";
}
}
else {
deptName += " ";
}

userStr = userName + deptName + positionName;
%>
      <html:option value='<%=Integer.toString(((cn.com.detech.deinfo.communion.model.ReaderBean)eid).getUserID()) + "#" + Integer.toString(((cn.com.detech.deinfo.communion.model.ReaderBean)eid).getDeptID()) + "#" + Integer.toString(((cn.com.detech.deinfo.communion.model.ReaderBean)eid).getPositionID())%>'><%=userStr%>
  </html:option>
                 </logic:iterate>
              </html:select>
  </TD>
              <TD width="45%" >
  <html:select property="selectedIDStr" multiple="true" size="15" style="width:100%; font-family:Courier New; font-size:9pt" ondblclick="removeReceiver(); return false;">
     <logic:iterate id="rid" name="SelectReaderForm" property="readerList">
<%
     String readerStr = "";
     String readerName = ((cn.com.detech.deinfo.communion.model.ReaderBean)rid).getUserName();
String deptName = ((cn.com.detech.deinfo.communion.model.ReaderBean)rid).getDeptName();
String positionName = ((cn.com.detech.deinfo.communion.model.ReaderBean)rid).getPositionName();

int ulength = 0;
ulength = 6 - readerName.length();
if (ulength > 0) {
for(int i = 0; i < ulength; i ++) {
readerName += " ";
}
}
else {
readerName += " ";
}

ulength = 9 - deptName.length();
if (ulength > 0) {
for(int i = 0; i < ulength; i ++) {
deptName += " ";
}
}
else {
deptName += " ";
}

readerStr = readerName + deptName + positionName;
%>
                      <html:option value='<%=Integer.toString(((cn.com.detech.deinfo.communion.model.ReaderBean)rid).getUserID()) + "#" + Integer.toString(((cn.com.detech.deinfo.communion.model.ReaderBean)rid).getDeptID()) + "#" + Integer.toString(((cn.com.detech.deinfo.communion.model.ReaderBean)rid).getPositionID())%>'><%=readerStr%>
  </html:option>
                 </logic:iterate>
  </html:select>
  </TD>
            </tr>
          </TABLE>

</td>
        </tr>
      </table>
         </div>
      </TD>
      </TR>
      </TABLE>
  <HR>
<table width="90%" border="0" cellpadding="2" cellspacing="2">
  <tr>
    <td align="right"><input  type="button" value="&&确定&&" name="B39"  onClick="setReaderNameStr();setback();submitForm('Save');" class="button" onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"> <input  type="button" value="&&取消&&" name="B40" onClick="window.close();" class="button" onMouseOver="this.className='button_over';" onMouseOut="this.className='button';">&</td>
  </tr>
</table>

</div>
</body>
</html:form>
分享到:
评论

相关推荐

    jakarta.servlet.jsp.jstl-api-2.0.0.jar

    标题中的"jakarta.servlet.jsp.jstl-api-2.0.0.jar"是一个重要的Java Web开发组件,它属于JavaServer Pages(JSP)标准标签库(JSTL)的一部分,用于提供一套标准的标签来简化HTML或XML文档的生成。JSTL的主要目标是...

    javax.servlet.jsp.tagext源码

    在Java服务器页面(JSP)技术中,`javax.servlet.jsp.tagext`包是核心组件之一,它提供了用于创建自定义标签库(Tag Libraries)的接口和类。自定义标签是JSP的一种强大特性,允许开发者将复杂的逻辑封装到可重用的...

    javax.servlet.jsp-api-2.3.1.jar

    javax.servlet.jsp-api-2.3.1.jar

    javax.servlet.jsp.jar

    javax.servlet.jsp_2.0.0.v201101211617.jar,javax.,servlet,jsp

    javax.servlet.jsp.jstl-api-1.2.1.jar

    javax.servlet.jsp.jstl-api-1.2.1.jar

    login.jsp用户登录界面

    login.jsp用户登录界面login.jsp用户登录界面login.jsp用户登录界面login.jsp用户登录界面

    proxy.jsp、proxy.ashx、proxy.php、proxy.config

    **proxy.jsp** 是一个用Java编写的代理页面,适用于Java服务器环境,如Tomcat。它通过设置`esri.config.defaults.io.proxyUrl`来指定代理服务的URL,当ArcGIS JavaScript API请求需要跨域访问的资源时,会自动通过这...

    JSP——登录页面login.jsp

    Javaweb账号登陆 实现登录页面login.jsp,在其中输入用户名,密码,发送到登录验证页面loginCL.jsp,验证登录成功.

    one.jsp

    one.jsp

    javax.servlet.jsp.jar.zip(72 k).zip

    【标题】"javax.servlet.jsp.jar.zip(72 k).zip" 涉及的是Java服务器页面(JSP)的核心库,这是一个压缩文件,大小为72千字节。该库包含用于开发动态Web应用程序的API,是Java Servlet和JavaServer Pages(JSP)技术...

    javax.servlet.jsp.jstl-1.2.1.jar.zip

    JSTL(Java server pages standarded tag library,即JSP标准标签库)是由JCP(Java community Proces)所制定的标准规范,它主要提供给Java Web开发人员一个标准通用的标签库,并由Apache的Jakarta小组来维护。...

    大三下学期JSP作业实验三SWQ 里面没有学号.pdf

    大三下学期JSP作业实验三SWQ 里面没有学号。 文件夹 PATH 列表 卷序列号为 4E8D-6931 C:. │ .txt │ 实验三 JSP应用开发进阶.doc │ 报告三学号姓名.doc │ ├─代码 │ 1.html │ 1.jsp │ 2.jsp │ 3.jsp │ 4....

    javax.servlet.jar与javax.servlet.jsp.jar

    在Java Web开发中,`javax.servlet.jar`和`javax.servlet.jsp.jar`是两个非常重要的库文件,它们分别提供了Servlet和JSP(JavaServer Pages)的核心API。这两个库是开发基于Java的Web应用程序不可或缺的部分,特别是...

    vcode.jsp 验证码

    vcode.jsp,验证码使用 vcode.jsp,验证码使用

    tomcat-memshell-scanner.jsp

    Java内存马查杀 ...java-memshell-scanner:通过jsp脚本扫描并查杀各类中间件内存马。 只需要将tomcat-memshell-scanner.jsp放在可能被注入内存马的web录下,然后使用浏览器访问即可直接获得扫描结果。

    经营DateTree.jsp

    经营DateTree.jsp经营DateTree.jsp经营DateTree.jsp

    javax.servlet.jsp-api-2.3.3.jar

    web项目里面开发jsp页面的时候,使用action调用servlet里面get和post方法的时候需要这个jar包,来获取 请求路径的

    javax.servlet.jsp jar包

    解决jsp中out对象和pageContext不能调用方法的问题,将这一jar包下载并导入项目就可以成功解决这一问题。

Global site tag (gtag.js) - Google Analytics