AddDepartment.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="java.util.*,com.gforce.gfoa.*,com.gforce.currency.*" %>
- var jsArray = new Array();
- <%
- DepartmentManager departmanager = new DepartmentManager();
- Vector vc = departmanager.getDepartmentData();
- for(int row=0;row<vc.size();row++)
- {
- String strTemp = "";
- Vector hashtab = (Vector)vc.get(row);
- for(int i=0;i<hashtab.size();i++)
- {
- if(i==2)
- {
- String strFarther = hashtab.get(i).toString();
- strFarther = strFarther.substring(0,strFarther.length() - 1);
- strFarther = strFarther.substring(strFarther.lastIndexOf("_") + 1);
- strTemp += ",t"" + strFarther + """;
- }
- else
- strTemp += ",t"" + hashtab.get(i).toString() + """;
- }
- out.println("jsArray[" + (row) + "]=new Array(" + strTemp.substring(1) + ",t"" + hashtab.get(2).toString() + "");");
- }
- %>
- function addsubdepartment(shangjiID)
- {
- var returnvalue=""
- for(var i=0;i<jsArray.length;i++)
- {
- if((jsArray[i][2]==shangjiID.toString()))
- {
- var haschild=false;
- for(j=0;j<jsArray.length;j++)
- {
- if(jsArray[j][2]==jsArray[i][0])
- {
- haschild=true;
- break;
- }
- }
- returnvalue+="<option value='"+jsArray[i][0]+"'>";
- for(j=0;j<parseInt(jsArray[i][3],10);j++)
- {
- returnvalue+=(" ");
- }
- returnvalue+=(""+jsArray[i][1]+"</option>");
- if(haschild)
- {
- returnvalue+=addsubdepartment(jsArray[i][0]);
- }
- }
- }
- return returnvalue;
- }
- function adddepartment()
- {
- document.write("<option value='0'><%=SystemParament.GetCommpanyName()%></option>");
- document.write(addsubdepartment(0));
- }
- adddepartment();