📄 sysdept_edit.jsp
字号:
<!--function:添加&修改部门页面
author:bao
-->
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ page import="com.stframe.form.DataForm"%>
<%@ taglib uri="/WEB-INF/tlds/frametag.tld" prefix="by"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>deptmanage.jsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<STYLE>
body,td{
font-size: 12px;
font-family: Tahoma, Arial;
margin: 0px;
padding: 0px;
margin-bottom: 10px;
color:#000000;
}
</STYLE>
<link rel="stylesheet" href="<%=path %>/CSS/table.css" type="text/css" />
<script type="text/javascript">
//去左空格;
function ltrim(s){
return s.replace( /^\s*/, "");
}
//去右空格;
function rtrim(s){
return s.replace( /\s*$/, "");
}
//除去左右空格
function trim(s){
return rtrim(ltrim(s));
}
//获取指定字符串的长度
function getLength(strTemp)
{
var i,sum;
sum=0;
for(i=0;i<strTemp.length;i++)
{
if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
sum=sum+1;
else
sum=sum+2;
}
return sum;
}
function checkdata()
{
//部门名是否为空
var deptname = trim(document.deptform.NAME.value);
if( deptname == "")
{
alert("部门名不能为空");
return false;
}
var deptcode = trim(document.deptform.CODE.value);
if( deptcode == "")
{
alert("部门编码不能为空");
return false;
}
//部门名是否在指定长度范围内
var ulength = getLength(deptname);
if (ulength < 3 || ulength > 20)
{
alert("部门名长度只能在 3-20 个字符内");
return false;
}
//是否选择多个经理
var direct = document.getElementById("show_j").value;
var dirarray = direct.split(",");
if(dirarray.length>2)
{
alert("一个部门只能有一个经理,请重新选择!");
return false;
}
//部门描述是否超过最大字符
var deptmemo = document.deptform.DESCRIPTION.childNodes[0];
if(deptmemo != null)
{
var dlength = getLength(deptmemo.data);
if(dlength > 50)
{
alert("部门描述超过所允许的最大字符数!");
return false;
}
}
}
var child; // 用来获得子窗口返回的值
function selectTree1(hid) {
var win = window;
var url = "${pageContext.request.contextPath}/Selevet.do?action=TREEACTION&task=dept&flag=j";
if(hid!=null&&hid!='') {
url += "&hid="+hid;
}
var style = "dialogWidth=430px;dialogHeight=400px;scroll=no";
child = showModalDialog(url,win,style);
}
function selectTree_jl(id) {
var hid = document.getElementById("hid_"+id);
selectTree1(hid.value);
}
var child2;
function selectTree2(hid) {
var win = window;
var url = "${pageContext.request.contextPath}/Selevet.do?action=TREEACTION&task=dept&flag=h";
if(hid!=null&&hid!='') {
url += "&hid="+hid;
}
var style = "dialogWidth=430px;dialogHeight=400px;scroll=no";
child2 = showModalDialog(url,win,style);
}
function selectTree_yg(id) {
var hid = document.getElementById("hid_"+id);
selectTree2(hid.value);
}
</script>
</head>
<body topmargin="0" leftmargin="0">
<table width="100%" height="26" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="center" bgcolor="#66CCFF">
<by:out name="deptinfo">
${deptinfo_ID==null?"添加":"修改"}部门
</by:out>
</td>
</tr>
</table>
<p><br></p>
<form name="deptform" method="post" action="<%=path%>/Selevet.do?action=BASE_SYSDEPT_SAVE">
<by:out name="deptinfo">
<table width="100%" align="center" class="MyTABLE">
<input type="hidden" name="ID" value="${deptinfo_ID}"/>
<input type="hidden" name="PARENT_ID" value="${deptinfo_PARENT_ID}"\>
<input type="hidden" name="CMD" value="${deptinfo_ID==null?"A":"U"}"/>
<tr>
<td width="35%" align="right" valign="middle">部门名称</td>
<td width="34%">
<input type="text" name="NAME" value="${deptinfo_NAME}">
<font color="red">*</font> </td>
<td width="31%" colspan="2" align="right" valign="middle"> </td>
</tr>
<tr>
<td width="35%" align="right" valign="middle">部门编码</td>
<td width="34%">
<input type="text" name="CODE" value="${deptinfo_CODE}">
<font color="red">*</font> </td>
<td width="31%" colspan="2" align="right" valign="middle"> </td>
</tr>
<tr>
<td width="35%" align="right" valign="middle">部门经理</td>
<td width="34%">
<input type="text" name="DIRECTOR" value="${deptinfo_DIRECTOR}">
<font color="red">*</font> </td>
<td width="31%" colspan="2" align="right" valign="middle"> </td>
</tr>
<tr>
<td align="right" valign="middle">拥有员工</td>
<td colspan="3">
<input type="hidden" id="hid_h" name="hid_h" value="${uhid}"/>
<textarea name="show_h" id="show_h" cols="30" rows="3" readonly="readonly" type="_moz">${ushow}</textarea>
<a href="javascript:{selectTree_yg('h');}">添加员工</a>
</td>
</tr>
<tr>
<td align="right" valign="middle">部门描述</td>
<td colspan="3">
<textarea name="REMARKS" cols="40" rows="3" id="REMARKS" type="_moz">${deptinfo_REMARKS}</textarea>
</td>
</tr>
<tr>
<td colspan="4" align="center" valign="middle"><input type="submit" name="Submit" value="保 存" onClick="return checkdata();">
<input type="button" name="btngoback" value="返 回" onClick="javascript:{history.back();}"> </td>
</tr>
</table>
</by:out>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -