⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dept_info.jsp

📁 oa办公系统
💻 JSP
字号:
<%@ page language="java" import="java.util.*,cn.jx.ecjtu.oa.servlets.dept.*,java.util.*,cn.jx.ecjtu.oa.services.*,cn.jx.ecjtu.oa.ps.pojo.Dept" pageEncoding="gbk"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>部门信息</title>
<link href="../../common/defaultFa/css/all.css" rel="stylesheet" type="text/css" />
<link href="../../common/defaultFa/css/css.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="../../common/js/checkform.js"></script>
<script type="text/javascript">
	function removedept(){
		var temp=confirm("是否删除该部门?");
		if(temp==1)
		{
			document.f1.action="../modify/removeDeptServlet";
			document.f1.submit();
		}
	}
	var readonly=${requestScope.forbidden};
	function printll(temp){
		if(temp==0){
		alert("部门信息没有修改");
		}
		if(temp==2){
			alert("上级部门设置错误,本部门不能为自身的上级部门!");
		}
		if(temp==3){
			alert("上级部门设置错误,本部门上级部门不能为该部门的子部门!");
		}
		if(readonly) setReadOnly();
	}
	
	
	function setReadOnly(){
		var inputs=document.getElementsByTagName("input");
		for(var i=0;i<inputs.length;i++){
			inputs[i].disabled=true;
		}
		var textAreas=document.getElementsByTagName("textarea");
		for(var i=0;i<textAreas.length;i++){
			textAreas[i].disabled=true;
		}
		var select=document.getElementsByTagName("select");
		for(var i=0;i<select.length;i++){
			select[i].disabled=true;
		}
	}
</script>
</head>

<%!
  private String getChildrenTree(List<Node> children,int level){
    StringBuffer str=new StringBuffer();
  	for(Node node:children){
  		str.append("<option value='");
  		str.append(node.getId());
  		str.append("'>");
  		for(int i=0;i<level;i++){
  			str.append("|");
  			str.append("  ");
  		}
  		str.append("|─");
  		str.append(node.getName());
  		str.append("</option>\n");
  		if(node.getChildren() != null && node.getChildren().size()>0){
  			str.append(getChildrenTree(node.getChildren(),level+1));
  		}
  	}
  	return str.toString();  	
  }
%>

<body style="overflow-y:auto" onload="printll(${requestScope.boolvalue });">
<table border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th align="left" valign="middle">部门信息</th>
    <td>&nbsp;</td>
  </tr>
</table>
<p></p>
<p></p>
<p></p>
<p></p>
<form name="f1" action="../modify/modifyDeptServlet" method="post" onSubmit="return CheckForm.Check(this,2)" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tb_form">
    <tr>
      <td width="321" height="25"><div align="right" class="style2">部门排序号:</div></td>
      <td width="436">        
        <div align="left" class="style1">
          <input name="sort_number" type="text" size="10" 
         dataType="Number" msg="部门排序号格式不正确,不能为空或不超过10位数!" value="${requestScope.DeptInfo.sort_number}">      
      </div></td>
    </tr>
    <tr>
      <td width="321" height="29"><div align="right" class="style2">部门名称:</div></td>
      <td>
        <div align="left" class="style1">
        <input name="name" type="text" size="20" 
        dataType="Limit" min="1" max="30" 
               msg="部门名称字符必须在(1-30)之间!"  
                value="${requestScope.DeptInfo.name}">
        </div>
      </td>
    </tr>
    <tr>
      <td width="321" height="29"><div align="right" class="style2">部门经理:</div></td>
      <td>
        <div align="left" class="style1">
        <input name="name" value="${requestScope.managerName}" type="text" size="25" disabled >
        </div>
      </td>
    </tr>
	 <tr>
      <td width="321" height="22"><div align="right" class="style2">电话:</div></td>
      <td width="436">        
        <div align="left" class="style1">
            <input name="phone" type="text" size="30" dataType="Phone" msg="电话号码格式不正确!必须是7、8位或类似0791-7120472格式"
             value="${requestScope.DeptInfo.phone}"> 
       </div></td>
    </tr>
	 <tr>
      <td width="321" height="22"><div align="right" class="style2">传真:</div></td>
      <td width="436">        
        <div align="left" class="style1">
          <input name="fax" type="text" size="30" 
           dataType="Phone" msg="传真号码格式不正确!必须是7、8位或类似0791-7120472格式" value="${requestScope.DeptInfo.fax}">      
       </div></td>
    </tr>
	 <tr>
      <td width="321" height="20"><div align="right" class="style2">地址:</div></td>
      <td width="436">        
        <div align="left" class="style1">
          <input name="address" type="text" size="30" 
          dataType="Limit" max="80" 
               msg="部门地址字符必须在(1-80)之间!"
                value="${requestScope.DeptInfo.address}">     
       </div></td>
    </tr>
	 <tr>
      <td width="146" height="20"><div align="right" class="style2">上级部门:</div></td>
      <td width="640">        
        <div align="left" class="style1">
         <select name="predept_id" lang="25">
           <option value='0'>无</option>
           <%
	          RootNode root=(RootNode)request.getAttribute("depts");
	          String str= getChildrenTree(root.getChildren(),0);
	          out.println(str);
	       %>
       </div></td>
    </tr>
	 <tr>
      <td width="146" height="20"><div align="right" class="style2">职能:</div></td>
      <td width="640">        
        <div align="left" class="style1">
          <textarea name="duty" cols="29" dataType="Limit"  require="false"
				  max="100"  
				  msg="部门职能内容在100个字以内!">${requestScope.DeptInfo.duty}</textarea>     
       </div></td>
    </tr>
     
</table>
<script type="text/javascript">
	var parentId=${requestScope.DeptInfo.predept_id};
	var options=document.f1.predept_id.options;
	for(i=0;i<options.length;i++){
		if(options[i].value==parentId) options[i].selected=true;
	}
</script>
<p></p>
<p></p>
<p></p>
<div style="display:${requestScope.forbidden?"none":"block" }">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="tb_foot">
  <tr>
    <td align="center"><input name="Input2" type="submit" value="修改部门">      &nbsp;&nbsp;
  <input name="Input3" type="button" value="删除部门" onclick="removedept()" >  </tr>
</table>
</div>
	<input type="hidden" name="dept_id" value="${requestScope.DeptInfo.dept_id}">
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -