📄 inlist.asp
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
'进货管理:InList.asp
'用户限权检查
Dim Pro_ID
dim Action
Action = Trim(request("Action"))
Pro_ID = Trim(Request("Pro_ID"))
%>
<html>
<head>
<title>进货管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/mobile_sale.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function CheckAdd()
{
if(document.form1.Pro_Pprice.value=="")
{
alert("请填写单价");
document.form1.Pro_Pprice.focus();
return false;
}
}
</script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong>进 货 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="InList.asp">进货清单</a> | <a href="sInList.asp">进货搜索</a> | <a href="InList.asp?Action=Add">进货添加</a></td>
</tr>
</table>
<%
if Action="Add" then '添加
If GetUserGPower=9999 then
call AddAdmin()
Else
Call Msg("您没有权限",1,"")
end if
elseif Action="SaveAdd" then '保存添加
If GetUserGPower=9999 then
call SaveAdd()
Else
Call Msg("您没有权限",1,"")
end if
elseif Action="Modify" then '修改
If GetUserGPower=9999 then
call Modify()
Else
Call Msg("您没有权限",1,"")
end if
elseif Action="SaveModify" then '保存修改
If GetUserGPower=9999 then
call SaveModify()
Else
Call Msg("您没有权限",1,"")
end if
'elseif Action="CheckList" then '审核
' If GetUserGPower=9999 and (GetUserPower="A" or GetUserPower="B") then
' call CheckList()
'Else
' Call Msg("您没有权限",1,"")
' end if
''elseif Action="RefuseList" then '拒绝
' If GetUserGPower=9999 and (GetUserPower="A" or GetUserPower="B") then
' call RefuseList()
' Else
' Call Msg("您没有权限",1,"")
' end if
elseif Action="Del" then '删除
If GetUserGPower=9999 then
call DelAdmin()
Else
Call Msg("您没有权限",1,"")
end if
else
call main()
end if
Call CONN_End(Conn)
sub main()
if Pro_ID="" then
Sql = "select T_InList.*,T_Product.* from T_InList Inner join T_Product on T_InList.Pro_ID=T_Product.Pro_ID order by T_InList.InListID desc;"
else
Sql = "select T_InList.*,T_Product.* from T_InList Inner join T_Product on T_InList.Pro_ID=T_Product.Pro_ID where T_InList.Pro_ID="&cstr(Pro_ID)&" order by T_InList.InListID desc;"
end if
Call sql_open(Rs,Sql,Conn,1,1)
' iCount=Rs.recordcount
Call page_code(Rs,20)
If Not Rs.Eof Then
IsFor=True
Else
IsFor=False
Response.write "<center><b><font color=red>暂无内容!</font></b></center>"
End IF
%>
<br>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr align="center" class="title">
<td>产品名</td>
<td>单价(元)</td>
<td>数量(部)</td>
<td>填写人姓名</td>
<td>进货日期</td>
<td width="150" height="22"><strong> 操 作</strong></td>
</tr>
<%
For i= 1 to Rs.PageSize
If Rs.Eof Then Exit For
%>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td><%=rs("Pro_MC")%></td>
<td align="center"><%=rs("Pro_Pprice")%></td>
<td align="center"><%=rs("Pro_Num")%></td>
<td width="150" align="center"><%=Rs("inUserName")%></td>
<td width="150" align="center"><%=Rs("Pro_InTime")%></td>
<td width="150" align="center">
<%
Response.write "<a href='InList.asp?Action=Modify&ID=" & rs("InListID") & "'>修改</a>"
if GetUserPower<>"C" then
Response.write " | <a href='InList.asp?Action=Del&ID=" & rs("InListID") & "' onClick=""return confirm('确定要删除此进货单吗?');"">删除</a>"
end if
%> </td>
</tr>
<%
Rs.MoveNext
Next
%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" height="30"> </td>
<td> </td>
<td width="300"><%If IsFor Then Call page_code_down(Rs,"&Pro_ID="&Pro_ID&"","条记录") %></td>
</tr>
</table>
</td>
</tr></table>
<%
Call Rs_End(Rs)
end sub
sub AddAdmin()
'添加:省级用户(9999,A,C)
%>
<form method="post" action="InList.asp" name="form1" onsubmit="javascript:return CheckAdd();">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
<tr class="title">
<td height="22" colspan="2"> <div align="center">新增进货</div></td>
</tr>
<!--
<tr class="tdbg">
<td class="tdbg">主题</td>
<td class="tdbg"><input name="InListTitle" type="text" id="InListTitle" size="40" maxlength="30"></td>
</tr>
-->
<tr class="tdbg">
<td width="35%" class="tdbg">产品名</td>
<td width="65%" class="tdbg">
<select name="Pro_ID" id="Pro_ID">
<%Call Opt_N("T_Product","Pro_ID","Pro_MC","")%>
</select>
</td>
</tr>
<tr class="tdbg">
<td class="tdbg">单价</td>
<td class="tdbg"><input name="Pro_Pprice" type="text" id="Pro_Pprice"> </td>
</tr>
<tr class="tdbg">
<td class="tdbg">数量</td>
<td class="tdbg"><input name="Pro_Num" type="text" id="Pro_Num" onkeyup='this.value=this.value.replace(/\D/gi,"")'></td>
</tr>
<!--
<tr class="tdbg">
<td class="tdbg">总金额</td>
<td class="tdbg"><input name="Pro_Tprice" type="text" id="Pro_Tprice"></td>
</tr>
-->
<tr class="tdbg">
<td class="tdbg">说明</td>
<td class="tdbg"><textarea name="InListInfo" cols="60" rows="6" id="InListInfo"></textarea></td>
</tr>
<tr class="tdbg">
<td class="tdbg">填写人</td>
<td class="tdbg"><input name="inUserName" type="text" value="<%=GetUserName%>"></td>
</tr>
<tr>
<td height="40" colspan="2" align="center" class="tdbg"><input name="UserID" type="hidden" id="UserID" value="<%=GetUserID%>">
<input name="Action" type="hidden" id="Action" value="SaveAdd">
<input type="submit" name="Submit" value=" 添 加 " style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='InList.asp'" style="cursor:hand;"></td>
</tr>
</table>
</form>
<%
end sub
sub Modify()
Dim InListID
InListID=trim(Request("ID"))
if InListID="" then
Call Msg("请指定要修改的内容", 1,"")
exit sub
else
InListID=Clng(InListID)
end if
Sql="Select * from T_InList where InListID=" & InListID
Call sql_open(Rs,Sql,Conn,1,3)
If Rs.Bof And Rs.EOF Then
Call Msg("不存在此内容", 1,"")
Else
' If Rs("IsCheck")=1 then
' Call Msg("管理已经审核过,不允许修改",1,"")
' Else
%>
<form method="post" action="InList.asp" name="form1" onsubmit="javascript:return CheckModify();">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
<tr class="title">
<td height="22" colspan="2"> <div align="center">修改进货</div></td>
</tr>
<!--
<tr>
<td class="tdbg">流水号</td>
<td class="tdbg"><font color="#0000FF"><%=Rs("JHNo")%></font></td>
</tr>
<tr>
<td class="tdbg">主题</td>
<td class="tdbg"><input name="InListTitle" type="text" id="InListTitle" value="<%=Rs("InListTitle")%>" size="40" maxlength="30"></td>
</tr>
-->
<tr class="tdbg">
<td width="35%" class="tdbg">产品名</td>
<td width="65%" class="tdbg">
<select name="Pro_ID" id="Pro_ID">
<%Call Opt_N("T_Product","Pro_ID","Pro_MC",Rs("Pro_ID"))%>
</select>
</td>
</tr>
<tr class="tdbg">
<td class="tdbg">单价</td>
<td class="tdbg"><input name="Pro_Pprice" type="text" id="Pro_Pprice" value="<%=Rs("Pro_Pprice")%>"> </td>
</tr>
<tr class="tdbg">
<td class="tdbg">数量</td>
<td class="tdbg"><input name="Pro_Num" type="text" id="Pro_Num" value="<%=Rs("Pro_Num")%>"></td>
</tr>
<!--
<tr class="tdbg">
<td class="tdbg">总金额</td>
<td class="tdbg"><input name="Pro_Tprice" type="text" id="Pro_Tprice" value="<%=Rs("Pro_Tprice")%>"></td>
</tr>
-->
<tr class="tdbg">
<td class="tdbg">说明</td>
<td class="tdbg"><textarea name="InListInfo" cols="60" rows="6" id="InListInfo"><%=Rs("InListInfo")%></textarea></td>
</tr>
<tr class="tdbg">
<td class="tdbg">填写人</td>
<td class="tdbg"><input name="inUserName" type="text" value="<%=GetUserName%>"></td>
</tr>
<tr>
<td colspan="2" align="center" class="tdbg"><input name="UserID" type="hidden" id="UserID" value="<%=Rs("UserID")%>">
<input name="InListID" type="hidden" id="InListID" value="<%=Rs("InListID")%>"> <input name="Action" type="hidden" id="Action" value="SaveModify">
<input type="submit" name="Submit" value="保存修改结果" style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='InList.asp'" style="cursor:hand;"></td>
</tr>
</table>
</form>
<%'if Rs("isCheck")=2 then %>
<!--
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
<tr class="topbg">
<td><div align="center">拒绝原因</div></td>
</tr>
<tr class="tdbg">
<td>
<%
if Rs("Refuse")="" then
Response.write "<font color=#0000FF>管理员没有填写原因</font>"
Else
Response.write "<font color=#FF0000>"&Rs("Refuse")&"</font>"
End if
%>
</td>
</tr>
</table>
-->
<%
'end if
' End If
End If
Call Rs_End(Rs)
End Sub
%>
</body>
</html>
<%
'增加新组
Sub SaveAdd()
dim JHNo,Pro_ID,UserID,inUserName,InListTitle,Pro_Pprice,Pro_Num,Pro_Tprice,InListInfo
JHNo = trim("JH"&Format_Time(Now(),7)&RndNum(4))
Pro_ID=trim(Request("Pro_ID"))
UserID=trim(Request("UserID"))
inUserName = trim(Request("inUserName"))
' InListTitle=trim(Request("InListTitle"))
Pro_Pprice=trim(Request("Pro_Pprice"))
Pro_Num=trim(Request("Pro_Num"))
InListInfo=trim(Request("InListInfo"))
Call Isnum(Pro_Pprice,Pro_Pprice,1)
Call Isnum(Pro_Num,Pro_Num,1)
Pro_Tprice=cint(Pro_Pprice)*cint(Pro_Num)
' Response.write Pro_Tprice
' Response.end
' Call Isnum(Pro_Tprice,Pro_Tprice,1)
' if InListTitle="" then
' Call Msg("主题不能为空", 1,"")
' end if
Sql="Select * from T_InList"
Call sql_open(Rs,Sql,Conn,1,3)
rs.addnew
rs("Pro_ID")=Pro_ID
rs("JHNo")=JHNo '流水号:JH+年月日时分秒+4位随机数
' rs("UserID")=UserID
rs("UserID")=5
Rs("inUserName")=inUserName
' rs("InListTitle")=InListTitle
rs("Pro_Pprice")=Pro_Pprice
rs("Pro_Num")=Pro_Num
rs("Pro_Tprice")=Pro_Tprice
rs("InListInfo")=InListInfo
rs.update
Call Rs_End(Rs)
Call Msg("添加成功",5,"InList.asp")
Call main()
end sub
'修改
sub SaveModify()
dim InListID,Pro_ID,UserID,inUserName,InListTitle,Pro_Pprice,Pro_Num,Pro_Tprice,InListInfo
InListID=trim(Request("InListID"))
Pro_ID=trim(Request("Pro_ID"))
UserID=trim(Request("UserID"))
inUserName = trim(Request("inUserName"))
' InListTitle=trim(Request("InListTitle"))
Pro_Pprice=trim(Request("Pro_Pprice"))
Pro_Num=trim(Request("Pro_Num"))
Call Isnum(Pro_Pprice,Pro_Pprice,1)
Call Isnum(Pro_Num,Pro_Num,1)
Pro_Tprice=cint(Pro_Pprice)*cint(Pro_Num)
InListInfo=trim(Request("InListInfo"))
if InListID="" then
Call Msg("请指定要修改的内容", 1,"")
else
InListID=Clng(InListID)
end if
Sql="Select * from T_InList where InListID=" & InListID
Call sql_open(Rs,Sql,Conn,1,3)
if Rs.Bof and Rs.EOF then
Call Msg("不存在此内容", 1,"")
Call Rs_End(Rs)
exit sub
end if
Rs("Pro_ID")=Pro_ID
Rs("UserID")=UserID
Rs("inUserName")=inUserName
' Rs("InListTitle")=InListTitle
Rs("Pro_Pprice")=Pro_Pprice
Rs("Pro_Num")=Pro_Num
Rs("Pro_Tprice")=Pro_Tprice
Rs("InListInfo")=InListInfo
if Rs("isCheck")=2 then
Rs("isCheck")=0
end if
Rs("ModifyTime")=Now()
Rs.update
Call Rs_End(Rs)
Call Msg("保存成功",5,"InList.asp")
end sub
'审核
'Sub CheckList()
' Dim InListID
' InListID=trim(Request("ID"))
' if InListID="" then
' Call Msg("请指定要审核的内容", 1,"")
' exit sub
' end if
' if instr(InListID,",")>0 then
' InListID=replace(InListID," ","")
' Sql="Select * from T_InList where InListID in (" & InListID & ")"
' else
' InListID=clng(InListID)
' sql="select * from T_InList where InListID=" & InListID
' end if
' Call sql_open(Rs,Sql,Conn,1,3)
' do while not rs.eof
' Rs("IsCheck")=1 '通过审核
' Rs("CheckTime")=Now() '审核时间
' rs.update
' rs.movenext
' loop
' Call Rs_End(Rs)
' call main()
'End Sub
'拒绝
'Sub RefuseList()
' Dim InListID
' InListID=trim(Request("ID"))
' if InListID="" then
' Call Msg("请指定要拒绝的内容", 1,"")
' exit sub
' end if
' InListID=clng(InListID)
' sql="select * from T_InList where InListID=" & InListID
' Call sql_open(Rs,Sql,Conn,1,3)
' if Rs.eof and Rs.bof then
' Call Msg("没有找到符合条件的内容",1,"")
' else
' Rs("IsCheck")=2 '拒绝
' Rs.update
' end if
''弹出窗口填写拒绝理由
' Response.write "<SCRIPT LANGUAGE=""JavaScript"">"
' Response.write "window.open (""InListRefuse.asp?InListID="&InListID&""", ""newwindow"", ""height=260, width=400, top=20, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"")"
' Response.write "<//SCRIPT>"
' Call Rs_End(Rs)
' call main()
'End Sub
'删除
sub DelAdmin()
dim InListID
InListID=trim(Request("ID"))
if InListID="" then
Call Msg("请指定删除的内容", 1,"")
exit sub
end if
if instr(InListID,",")>0 then
InListID=replace(InListID," ","")
Sql="Select * from T_InList where InListID in (" & InListID & ")"
else
InListID=clng(InListID)
sql="select * from T_InList where InListID=" & InListID
end if
Call sql_open(Rs,Sql,Conn,1,3)
do while not rs.eof
rs.delete
rs.update
rs.movenext
loop
Call Rs_End(Rs)
call main()
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -