<!–
———————————————————
– title : 天路办公系统
– desc : asp+com的标准办公系统
– ver : ver1.0
– author: zxn(comezxn@163.com)
– lastupdate: 2002-3-29
———————————————————
– apply in <贸促会办公系统>
– start at 未定
– contact with 天乐 (comezxn@163.com)
– this connection created at 1998-5-16 10:05:59
———————————————————-
–>
<html>
<head>
<meta http-equiv=content-type content=text/html; charset=gb2312>
<link rel=stylesheet type=text/css href=/css/css.css>
<title>贸促会办公系统</title>
</head>
<script language="javascript">
<!–
var onecount;
onecount=0;
subcat = new array();
subcat[0] = new array("李某","4","4");
subcat[1] = new array("系统管理员","3","2");
subcat[2] = new array("天乐","2","3");
subcat[3] = new array("测试员","1","1");
onecount=4;
//改变
function changesection(selectedvalue)
{
document.theform.list1.length = 0;
var selectid=selectedvalue;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][2] == selectid)
{
document.theform.list1.options[document.theform.list1.length] = new option(subcat[i][0], subcat[i][1]);
}
}
}
//初始化列出全部人员
function listsenction(){
for (i=0;i < onecount; i++)
{
document.theform.list1.options[document.theform.list1.length] = new option(subcat[i][0], subcat[i][1]);
}
}
//上下移动
//function singlemove(a,selectedvalue){
//document.theform.list2.selectedindex=document.theform.list2.selectedindex+a
//}
//移动
function move(fbox,tbox,order) {
var tempstr1;
var tempstr2;
for(var i=0; i<fbox.options.length; i++) {
if(fbox.options[i].selected && fbox.options[i].value != "") {
var no = new option();
if(order==2){
tempstr1=fbox.options[i].value
n=tempstr1.indexof(",");
tempstr1=tempstr1.substr(0,n);
no.value = tempstr1;
tempstr2=fbox.options[i].text
n=tempstr2.indexof("-");
tempstr2=tempstr2.substr(0,n);
no.text = tempstr2;
}
else
{
no.value = fbox.options[i].value+",1";
no.text = fbox.options[i].text+"-阅读";
}
tbox.options[tbox.options.length] = no;
fbox.options[i].value = "";
fbox.options[i].text = "";
}
}
bumpup(fbox);
//if (sortitems) sortd(tbox);
}
function bumpup(box) {
var tempstr;
for(var i=0; i<box.options.length; i++) {
if(box.options[i].value == "") {
for(var j=i; j<box.options.length-1; j++) {
box.options[j].value = box.options[j+1].value;
box.options[j].text = box.options[j+1].text;
}
var ln = i;
break;
}
}
if(ln < box.options.length) {
box.options.length -= 1;
bumpup(box);
}
}
//改变
function changepath(selecttext,selectvalue){
var tempstr;
for(i=0;i<theform.list2.length;i++){
if(theform.list2[i].selected==true){
//text
tempstr=theform.list2.options[i].text;
n=tempstr.indexof("-");
tempstr=tempstr.substr(0,n);
theform.list2.options[i].text=tempstr + "-" +selecttext;
//value
tempstr=theform.list2.options[i].value;
n=tempstr.indexof(",");
tempstr=tempstr.substr(0,n);
theform.list2.options[i].value=tempstr+ "," +selectvalue;
}
}
}
//提交,返回值
function button5_onclick()
{
var str1;
var str2;
str1="";
str2="";
var j;
j=1;
for(i=0;i<theform.list2.options.length;i++)
{
if(j=="1")
{
str1=theform.list2.item(i).text;
str2=theform.list2.item(i).value;
}
else
{
str1=str1+","+theform.list2.item(i).text;
str2=str2+"|"+theform.list2.item(i).value;
}
j=j+1;
}
top.returnvalue=str1+"+"+str2;
top.close();
}
function moveup(dbox) {
for(var i = 0; i < dbox.options.length; i++) {
if (dbox.options[i].selected && dbox.options[i] != "" && dbox.options[i] != dbox.options[0]) {
var tmpval = dbox.options[i].value;
var tmpval2 = dbox.options[i].text;
dbox.options[i].value = dbox.options[i – 1].value;
dbox.options[i].text = dbox.options[i – 1].text
dbox.options[i-1].value = tmpval;
dbox.options[i-1].text = tmpval2;
}
}
dbox.selectedindex=dbox.selectedindex-1;
}
function movedown(ebox) {
for(var i = 0; i < ebox.options.length; i++) {
if (ebox.options[i].selected && ebox.options[i] != "" && ebox.options[i+1] !=
ebox.options[ebox.options.length]) {
var tmpval = ebox.options[i].value;
var tmpval2 = ebox.options[i].text;
ebox.options[i].value = ebox.options[i+1].value;
ebox.options[i].text = ebox.options[i+1].text
ebox.options[i+1].value = tmpval;
ebox.options[i+1].text = tmpval2;
}
}
ebox.selectedindex=ebox.selectedindex+1;
}
/*直接提交
function submitme(){
// theform.userselect.value=theform.list1.value
for(i=0;i<theform.list2.length;i++)
{ theform.list2[i].selected=true; }
theform.submit();
}
*/
//–>
</script>
<body bgcolor="buttonface" onload="listsenction()">
<form name="theform" method="post">
<table border="0" cellpadding="0" cellspacing="0" width="80%" align=center>
<tr>
<td height="192" width="608" colspan="2">
<table border="0" cellpadding="0" cellspacing="0" align=center>
<tr>
<td>
<select name="section" onchange="changesection(this.options[this.selectedindex].value)">
<option value="0" selected>请选择部门列表</option>
<option value="4">办公室</option>
<option value="3">海外经贸事务处</option>
<option value="2">法律事务处</option>
<option value="1">会务处1</option>
</select>
</td>
<td></td>
<td>
<select name="path" onchange="changepath(this.options[this.selectedindex].text,this.options[this.selectedindex].value)">
<option value="0" selected>请选择执行权限</option>
<option value="1">阅读</option>
<option value="2">签字</option>
<option value="3">批复</option>
<option value="4">复函</option>
<option value="5">签发</option>
<option value="6">归档</option>
<option value="7">拟稿</option>
</select>
</td>
</tr>
<tr>
<td>
<select multiple name="list1" ondblclick="move(this.form.list1,this.form.list2,1)" size="12" style="width: 149; height:209">
</select>
</td>
<td nowrap valign="center">
<div align="center">
<br>
<input name="alluser" onclick="move(this.form.list1,this.form.list2,1)" type="button" value=" → ">
<br>
<br>
<input name="chooseuser" onclick="move(this.form.list2,this.form.list1,2)" type="button" value=" ← ">
<br>
<br>
<input name="up" onclick="moveup(this.form.list2)" type="button" value=" ↑ ">
<br>
<br>
<input name="down" onclick="movedown(this.form.list2)" type="button" value=" ↓ ">
<br>
</div>
</td>
<td>
<select multiple name="list2" ondblclick="move(this.form.list2,this.form.list1,2)" size="12" style="width: 149; height:209">
</select></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align=center>
<input name="submit" onclick="return button5_onclick()" type="button" value="保存">
<input name="cancel" onclick="window.close()" type="button" value="取消"></td>
</tr>
</table>
</form>
</body>
</html>
