📄 unitconfig.aspx
字号:
<%@ page language="C#" autoeventwireup="true" inherits="BaseInfo_UnitConfig, App_Web_eihb9n8s" %>
<html>
<head id="Head1" runat="server">
<title>单位设置</title>
<link rel="stylesheet" href="../css/master.css" type="text/css" />
</head>
<body topmargin="0" leftmargin="0" bgcolor="#ffffff">
<form id="form1" runat="server">
<!--快捷菜单-->
<div style="overflow-x:auto;width:830; overflow-y:auto;height:32;background-color:#f6f6f6;border-top:#000000 1px solid;border-left:#000000 1px solid;border-bottom:#000000 1px solid;border-right:#000000 1px solid;">
<table cellpadding="0" cellspacing="0" style="cursor:default" border=0 style="padding:1px 1px 1px 1px">
<tr height=30>
<td align="center">
<span onmouseover="vbs:changeBorder_In me" onmouseout="vbs:changeBorder_Out me" class="MainMenu" onclick="vbs:newRecord document.all('popDiv')"><img src="../images/add.gif"> 新增单位</span>
<span onmouseover="vbs:changeBorder_In me" onmouseout="vbs:changeBorder_Out me" class="MainMenu" onclick="vbs:modifyRecord "><img src="../images/modify.gif" > 修改单位</span>
<span onmouseover="vbs:changeBorder_In me" onmouseout="vbs:changeBorder_Out me" class="MainMenu" onclick="vbs:delRecord"><img src="../images/delete.gif"> 删除单位</span>
</td>
</tr>
</table>
</div>
<br />
<!--=================================================================================-->
<span id=span3 style="z-index:4;position:absolute;left:0;top:0;border-top:0px inset;border-left:1px inset;border-bottom:none;border-right:1px inset;overflow-y:hidden;overflow-x:hidden;padding-right:0"></span>
<!--=================================================================================-->
<div id="span1" style="overflow-x:auto;width:830; overflow-y:auto;height:400;background-color:f6f6f6;border-top:#000000 1px solid;border-left:#000000 1px solid;border-bottom:#000000 1px solid;border-right:#000000 1px solid;border-color:#a6a6a6; border-style:solid; scrollbar-base-color:#f6f6f6; scrollbar-face-color:none; scrollbar-arrow-color:none; scrollbar-track-color:#f6f6f6; scrollbar-3dlight-color:#ffffff; scrollbar-darkshadow-color:#ffffff; scrollbar-highlight-color:#a6a6a6; scrollbar-shadow-color:#a6a6a6;"onscroll="vbs:HScroll">
<table border=0 cellspacing=0 cellpadding=0 id=tb1 STYLE="table-layout: fixed; background-Color:#ffffff;border-left:buttonface 1px solid;">
<tr style="background-image:url('../images/tr.gif');height:22px">
<td class="td1" style="width:0">
<table border=0 width=100% height=100% cellpadding=0 cellspacing=0 STYLE="table-layout: fixed">
<tr>
<td noWrap class=td2>编号</td>
<td noWrap class=td2 style="height:22;width:3" onmouseover="vbs:me.style.cursor='E-resize'" onmousedown="vbs:tz me"><img style="LEFT: 1px; POSITION: relative" height=100% src="a/.gif" width=3 title="调整表格宽度" ></td>
</tr>
</table>
</td>
<td class="td1" style="width:150">
<table border=0 width=100% height=100% cellpadding=0 cellspacing=0 STYLE="table-layout: fixed">
<tr>
<td noWrap class=td2>单位名称</td>
<td noWrap class=td2 style="height:22;width:3" onmouseover="vbs:me.style.cursor='E-resize'" onmousedown="vbs:tz me"><img style="LEFT: 1px; POSITION: relative" height=100% src="a/.gif" width=3 title="调整表格宽度" ></td>
</tr>
</table>
</td>
<td class="td1" style="width:300">
<table border=0 width=100% height=100% cellpadding=0 cellspacing=0 STYLE="table-layout: fixed">
<tr>
<td noWrap class=td2>备注</td>
<td noWrap class=td2 style="height:22;width:3" onmouseover="vbs:me.style.cursor='E-resize'" onmousedown="vbs:tz me"><img style="LEFT: 1px; POSITION: relative" height=100% src="a/.gif" width=3 title="调整表格宽度" ></td>
</tr>
</table>
</td>
</tr>
<asp:Repeater ID="rptUnit" runat="server">
<ItemTemplate>
<tr style="height:20; white-space:nowrap;background-Color:#ffffff" onmouseover="vbs:RowMouseOver me" onmouseout="vbs:RowMouseOut me" onclick="vbs:chooseTr me">
<td class="td1"> <%#DataBinder.Eval(Container.DataItem, "PKID") %> </td>
<td class="td1"><%#DataBinder.Eval(Container.DataItem, "Unit")%> </td>
<td class="td1"><%#DataBinder.Eval(Container.DataItem,"Note") %> </td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr style="height:20; white-space:nowrap;background-Color:#ffffff" onmouseover="vbs:RowMouseOver me" onmouseout="vbs:RowMouseOut me" onclick="vbs:chooseTr me">
<td class="td1"><%#DataBinder.Eval(Container.DataItem, "PKID") %> </td>
<td class="td1"><%#DataBinder.Eval(Container.DataItem, "Unit")%> </td>
<td class="td1"><%#DataBinder.Eval(Container.DataItem, "Note")%> </td>
</tr>
</AlternatingItemTemplate>
</asp:Repeater>
</table>
</div>
<!--=================================================================================-->
<span id=span2 style="border-right:#229900 1px solid;border-left:#cc0000 1px solid;display:none;z-index:10;left:0px;width:0px;position:absolute;top:0px;height:0" onmousemove="vbs:M_Move" onmouseup="vbs:m_up"></span>
<!--==============================弹出层===============================-->
<div id="popDiv" onmousedown="vbs:Login_Win_Down me" onmousemove="vbs:Login_Win_Move me" onmouseup="vbs:Login_Win_Up me" style="display:none;left:0;top:0;position:absolute;width:300;height:250;border-top:solid 1px #000000;border-left:solid 1px #000000;border-bottom:solid 1px #000000;border-right:solid 1px #000000;">
<table cellpadding="0" cellspacing="0" border="0" width="300" height="250" bgcolor="#f6f6f6" >
<tr id="trfirst" height="22" style="background-image:url('../images/tr.gif')">
<td>单位</td>
<td align=right><img src="../images/close.gif" onmousedown="vbs:window.event.cancelBubble=true" onclick="vbs:document.all('popDiv').style.display='none'"/></td>
</tr>
<tr onmousedown="vbs:window.event.cancelBubble=true">
<td valign="middle" align="center">
<div style="width:250;border-top:solid 1px #999999;border-left:solid 1px #999999;border-right:solid 1px #ffffff;border-bottom:solid 1px #ffffff;" align="center">
<table height="140" border=0 style="width:250;border-top:solid 1px #ffffff;border-left:solid 1px #ffffff;border-right:solid 1px #999999;border-bottom:solid 1px #999999;">
<tr>
<td>
单位
</td>
<td>
<input class="textBox" id="txtUnit"/><input type=hidden id="txtId" />
</td>
</tr><tr>
<td>
备注
</td>
<td>
<textarea style="width:180;height:50;" id="txtNote" class="textBox"></textarea>
</td>
</tr>
</table>
</div><br />
<input type=button value="保 存" style="border:none;width:100;height:25;background-image:url('../images/button.gif');font-size:12px;" onclick="javascript:save();"/>
<input type=button value="取 消" style="border:none;width:100;height:25;background-image:url('../images/button.gif');font-size:12px;" onclick="vbs:hideDiv document.all('popDiv')"/>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<script language=vbscript src="../script/vbscript.vbs"></script>
<script language=vbscript>
titleResize
sub modifyRecord()
if not IsObject(currentTR) then
msgbox "请先选择要修改的单位"
exit sub
end if
if document.all("tb1").rows.length=1 then
exit sub
end if
document.all("txtId").value=trim(currentTR.cells(0).outerText)
document.all("txtUnit").value=trim(currentTR.cells(1).outerText)
document.all("txtNote").value=trim(currentTR.cells(2).outertext)
showDiv document.all("popDiv")
end sub
sub newRecord(div)
document.all("txtId").value=""
document.all("txtUnit").value=""
document.all("txtNote").value=""
showDiv div
end sub
sub delRecord()
if not IsObject(currentTR) then
msgbox "请先选择要修改的单位"
exit sub
end if
if document.all("tb1").rows.length=1 then
exit sub
end if
if msgbox("记录删除后将不能恢复,确定删除记录吗?",vbYesNo,"尚洋生产管理系统")=vbYes then
document.all("txtId").value=trim(currentTR.cells(0).outerText)
save "del"
end if
end sub
'
sub validate(byval retValue,byref isAvailable,byref msg)
tmp=split(retValue,"|")
isAvailable=tmp(0)
msg=tmp(1)
end sub
function vbTrim(str)
vbTrim=trim(str)
end function
</script>
<script language="javascript">
//添加事件处理
function addMoveEvent(obj)
{
obj.attachEvent("onmouseover",function(){RowMouseOver(obj);});
}
function addOutEvent(obj)
{
obj.attachEvent("onmouseout",function(){RowMouseOut(obj);});
}
function addClickEvent(obj)
{
obj.attachEvent("onclick",function(){chooseTr(obj);});
}
function save(op)
{
var param="";
var IsAvailable,msg;
var xmlHttp=new ActiveXObject("microsoft.XMLHTTP");
if(op!="del")
{
if(vbTrim(document.all("txtUnit").value).length==0)
{
alert("单位名称不能为空!");
return;
}
if(document.all("txtId").value=="")
{
param="op=add&unit="+document.all("txtUnit").value+"¬e="+document.all("txtNote").value;
}
else
{
param="op=modify&unit="+document.all("txtUnit").value+"¬e="+document.all("txtNote").value+"&id="+document.all("txtId").value.toString();
}
}
else
{
param="op=del&id="+document.all("txtId").value;
}
xmlHttp.open("POST","UnitHandle.aspx",false);
xmlHttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded;");
xmlHttp.send(param);
var responseValue=xmlHttp.responsetext;
if(getState(responseValue)=="0")
{
alert(getMsg(responseValue));
return;
}
if(op!="del")
{
if(document.all("txtId").value=="")
{
var row=tb1.insertRow(tb1.rows.length);
row.style.height="22";
row.style.whiteSpace="nowrap";
row.style.backgroundColor="#ffffff";
addMoveEvent(row);
addOutEvent(row);
addClickEvent(row);
var cell=row.insertCell();
cell.className="td1";
cell.innerText=getMsg(responseValue);
cell=row.insertCell();
cell.className="td1";
cell.innerText=document.all("txtUnit").value;
cell=row.insertCell();
cell.className="td1";
cell.innerText=document.all("txtNote").value+" ";
alert("添加成功!");
document.all("popDiv").style.display="none";
}
else
{
currentTR.cells[1].innerText=document.all("txtUnit").value;
currentTR.cells[2].innerText=document.all("txtNote").value+" ";
alert("修改成功!");
document.all("popDiv").style.display="none";
}
}
else
{
var obj;
var obj2=currentTR;
if((obj=currentTR.nextSibling)!=null)
{
currentTR=obj;
}
else
{
if((obj=currentTR.previousSibling)!=null)
{
currentTR=obj;
}
else
{
currentTR=null;
}
}
tb1.deleteRow(obj2.rowIndex);
if(currentTR!=null)
{
chooseTr(currentTR);
}
alert("删除成功!");
}
}
function getState(s)
{
var ary=s.split("|");
return ary[0];
}
function getMsg(s)
{
var ary=s.split("|");
return ary[1];
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -