SelectDepartment.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:16k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="java.util.*,com.gforce.gfoa.*,com.gforce.currency.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  7. <title>部门选择页面——GForce OA 2.0</title>
  8. <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
  9. <script language="javascript" type="text/javascript">
  10. function showtree(jibie,shangjiID,bline)
  11. {
  12.     if(jibie<1)
  13.     {
  14.         document.write("<div id="t" + jibie + "_" + shangjiID +"" style="display:;line-height: 10px;">");
  15.     }
  16.     else
  17.     {
  18.         document.write("<div id="t" + jibie + "_" + shangjiID +"" style="display:none;line-height: 10px;">");
  19.     }
  20.     var i,notislast,j,haschild;
  21.     notislast=false;
  22.     haschild=false;
  23.     for(i=0;i<jsArray.length;i++)
  24.     {
  25.         if((jsArray[i][3]==jibie + 1)&&(jsArray[i][2]==shangjiID.toString()))
  26.         {
  27.             if(jsArray[i][12]=="true")
  28.             {
  29.                 var j,maxorder=0;
  30.                 haschild=false;
  31.                 for(j=0;j<jsArray.length;j++)
  32.                 {
  33.                     if((jsArray[j][3]==jibie + 1)&&(jsArray[j][2]==shangjiID.toString())&&parseInt(maxorder)<parseInt(jsArray[j][5]))
  34.                     {
  35.                         maxorder=jsArray[j][5];
  36.                     }
  37.                 }
  38.                 for(j=0;j<jsArray.length;j++)
  39.                 {
  40.                     if((jsArray[j][3]==jibie + 2)&&(jsArray[j][2]==jsArray[i][0]))
  41.                     {
  42.                         haschild=true;
  43.                         break;
  44.                     }
  45.                 }
  46.                 bline = bline.substr(0,jibie);
  47.                 for(j=0;j<bline.length;j++)
  48.                     if(bline.substr(j,1)=="1")
  49.                         document.write("<img align="absbottom" src="/images/tree/i.gif" border="0" width="19" height="19">");
  50.                     else
  51.                         document.write("<img align="absbottom" src="/images/tree/white.gif" border="0" width="19" height="19">");
  52.                 if(parseInt(maxorder)>parseInt(jsArray[i][5]))
  53.                 {
  54.                     if(haschild)
  55.                     {
  56.                         if(jsArray[i][10]=="true")
  57.                             if(jsArray[i][7]=="")
  58.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  59.                             else
  60.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  61.                         else
  62.                             if(jsArray[i][7]=="")
  63.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  64.                             else
  65.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/tplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  66.                     }
  67.                     else
  68.                     {
  69.                         if(jsArray[i][10]=="true")
  70.                             if(jsArray[i][7]=="")
  71.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  72.                             else
  73.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  74.                         else
  75.                             if(jsArray[i][7]=="")
  76.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  77.                             else
  78.                                 document.write("<img align="absbottom"  src="/images/tree/t.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  79.                     }
  80.                     bline += "1".toString();
  81.                     showtree(jibie + 1,jsArray[i][0],bline);
  82.                 }
  83.                 else
  84.                 {
  85.                     if(haschild)
  86.                     {
  87.                         if(jsArray[i][10]=="true")
  88.                             if(jsArray[i][7]=="")
  89.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  90.                             else
  91.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ");" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  92.                         else
  93.                             if(jsArray[i][7]=="")
  94.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src="/images/tree/folderclosed.gif" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  95.                             else
  96.                                 document.write("<a href="javascript:clicktree(" + (jibie + 1).toString() +"," + jsArray[i][0] + ")" target="_self" title=""+ jsArray[i][11] +""><img align="absbottom"  src="/images/tree/lplus.gif" border="0" width="19" height="19" name="n" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><img align="absbottom"  src=""+jsArray[i][7] +"" border="0" width="19" height="19" name="f" + (jibie + 1).toString() +"_" + jsArray[i][0] + ""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "</a><br>");
  97.                     }
  98.                     else
  99.                     {
  100.                         if(jsArray[i][10]=="true")
  101.                             if(jsArray[i][7]=="")
  102.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  103.                             else
  104.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  105.                         else
  106.                             if(jsArray[i][7]=="")
  107.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="/images/tree/book.gif" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  108.                             else
  109.                                 document.write("<img align="absbottom"  src="/images/tree/l.gif" border="0" width="19" height="19"><img align="absbottom"  src="" + jsArray[i][7] +"" border="0" width="19" height="19" title=""+ jsArray[i][11] +""><input type="radio" name="Department" onclick="checkdepart(this.value)" value="" + jsArray[i][0] + "">" + jsArray[i][1] + "<br>");
  110.                     }
  111.                     bline += "0".toString();
  112.                     showtree(jibie + 1,jsArray[i][0],bline);
  113.                 }
  114.             }
  115.         }
  116.     }
  117.     document.write("</div>");
  118. }
  119. function clicktree(jibie,shangjiID)
  120. {
  121.     if(shangjiID>0)
  122.     if(eval("t" + jibie + "_" + shangjiID).style.display=="none")
  123.     {
  124.         eval("t" + jibie + "_" + shangjiID).style.display="";
  125.         if(eval("document.n" + jibie + "_" + shangjiID).src.toLowerCase().indexOf("tplus.gif")>0)
  126.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/tminus.gif";
  127.         else
  128.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/lminus.gif";
  129.         folderOpenString = "";
  130.         for(j=0;j<jsArray.length;j++)
  131.         {
  132.             if((jsArray[j][0]==shangjiID))
  133.             {
  134.                 folderOpenString = jsArray[j][6];
  135.                 break;
  136.             }
  137.         }
  138.         if(folderOpenString=="")
  139.             eval("document.f" + jibie + "_" + shangjiID).src="/images/tree/folderopen.gif";
  140.         else
  141.             eval("document.f" + jibie + "_" + shangjiID).src=folderOpenString;
  142.     }
  143.     else
  144.     {
  145.         eval("t" + jibie + "_" + shangjiID).style.display="none";
  146.         if(eval("document.n" + jibie + "_" + shangjiID).src.toLowerCase().indexOf("tminus.gif")>0)
  147.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/tplus.gif";
  148.         else
  149.             eval("document.n" + jibie + "_" + shangjiID).src="/images/tree/lplus.gif";
  150.         folderClosedString = "";
  151.         for(j=0;j<jsArray.length;j++)
  152.         {
  153.             if((jsArray[j][0]==shangjiID))
  154.             {
  155.                 folderClosedString = jsArray[j][7];
  156.                 break;
  157.             }
  158.         }
  159.         if(folderClosedString=="")
  160.             eval("document.f" + jibie + "_" + shangjiID).src="/images/tree/folderclosed.gif";
  161.         else
  162.             eval("document.f" + jibie + "_" + shangjiID).src=folderClosedString;
  163.     }
  164. }
  165. function checkdepart(departmentid)
  166. {
  167.   window.parent.self.document.all.DepartmentID.value=departmentid;
  168. }
  169. </script>
  170. <style type="text/css">
  171. <!--
  172. a {
  173.     color: #0A0A0A;
  174. }
  175. body {
  176.     color: #0A0A0A;
  177. }
  178. -->
  179. </style>
  180. </head>
  181. <body leftmargin="5" topmargin="0" bgcolor="<%=m_session.GetString("BackColor")%>">
  182. <form name="SelectDepartment">
  183. <table width="98%" height="100%" border="0" align="center" cellspacing="0">
  184.     <tr>
  185.         <td align="left" valign="top">
  186. <img src="/images/tree/home.gif" align="absbottom" border="0" width="19" height="19"><input type="radio" name="Department" value="0" checked="true" onchange="checkdepart(this.value);"><a><%=SystemParament.GetCommpanyName()%></a><br>
  187. <script language="javascript">
  188. var jsArray = new Array();
  189. <%
  190. DepartmentManager departmanager = new DepartmentManager();
  191. Vector vc = departmanager.getDepartmentData();
  192. for(int row=0;row<vc.size();row++)
  193. {
  194.     String strTemp = "";
  195.     Vector hashtab = (Vector)vc.get(row);
  196.     for(int i=0;i<hashtab.size();i++)
  197.     {
  198.         if(i==2)
  199.         {
  200.             String strFarther = hashtab.get(i).toString();
  201.             strFarther = strFarther.substring(0,strFarther.length() - 1);
  202.             strFarther = strFarther.substring(strFarther.lastIndexOf("_") + 1);
  203.             strTemp += ","" + strFarther + """;
  204.         }
  205.         else
  206.             strTemp += ","" + hashtab.get(i).toString() + """;
  207.     }
  208.     out.println("jsArray[" + (row) + "]=new Array(" + strTemp.substring(1) + ","" + hashtab.get(2).toString() + "");");
  209. }
  210. %>
  211. showtree(0,0,"");
  212. if(window.parent.self.document.all.DepartmentID.value=="")
  213. {
  214.   checkdepart(0);
  215. }
  216. else
  217. {
  218.   checkdepart(window.parent.self.document.all.DepartmentID.value);
  219.   for(var i=0;i<document.SelectDepartment.elements.length;i++)
  220.   {
  221.     if(document.SelectDepartment.elements[i].name=="Department" && document.SelectDepartment.elements[i].value==window.parent.self.document.all.DepartmentID.value)
  222.       document.SelectDepartment.elements[i].checked=true;
  223.   }
  224. }
  225. </script>
  226.         </td>
  227.   </tr>
  228. </table>
  229. </form>
  230. </body>
  231. </html>