?? sysdept_edit.jsp
字號(hào):
<!--function:添加&修改部門頁(yè)面
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));
}
//獲取指定字符串的長(zhǎng)度
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;
}
//部門名是否在指定長(zhǎng)度范圍內(nèi)
var ulength = getLength(deptname);
if (ulength < 3 || ulength > 20)
{
alert("部門名長(zhǎng)度只能在 3-20 個(gè)字符內(nèi)");
return false;
}
//是否選擇多個(gè)經(jīng)理
var direct = document.getElementById("show_j").value;
var dirarray = direct.split(",");
if(dirarray.length>2)
{
alert("一個(gè)部門只能有一個(gè)經(jīng)理,請(qǐng)重新選擇!");
return false;
}
//部門描述是否超過(guò)最大字符
var deptmemo = document.deptform.DESCRIPTION.childNodes[0];
if(deptmemo != null)
{
var dlength = getLength(deptmemo.data);
if(dlength > 50)
{
alert("部門描述超過(guò)所允許的最大字符數(shù)!");
return false;
}
}
}
var child; // 用來(lái)獲得子窗口返回的值
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">部門經(jīng)理</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>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -