📄 cc_suboutorder.asp
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
'订单管理:SubOrder.asp
'用户限权检查
Dim Action,crs,csql,Pro_Name
Dim Rst,Sqlt,k,j
Dim t,t1,t2
Dim rsm,sqlm
Dim CityID,CityName
Dim Total
Dim syear,smonth,sday,Stime
if GetUserGPower <> 9999 then
Call Msg("您无权管理")
end if
Action = Trim(Request("Action"))
if Action="Se" then
Stime=Request("syear")&"-"&Request("smonth")&"-"&Request("sday")
else
Stime=Format_Time(now(),2)
end if
Stime = RequestTime(Stime)
CityID = Trim(Request("CityID"))
if CityID = "" then
CityID = 1
end if
Sqlt="Select CityID,CityName from City where CityID="&Cstr(CityID)&""
Call sql_open(Rst,Sqlt,Conn,1,1)
if Rst.eof and Rst.bof then
Response.Write("没有相应地区")
Response.end()
else
CityName = Rst("CityName")
end if
Call rs_end(Rst)
%>
<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 ShowSubOrder(uid,pid,stime) {
var url = "ShowSubOrder.asp?UID=" + uid +"&PID=" + pid + "&stime=" + stime;
window.open(url,"","scrollbars=yes,resizable=auto, width=800,height=500");
}
//-->
</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">
<%
Sqlt="Select CityID,CityName from City order by CityID asc;"
Call sql_open(Rst,Sqlt,Conn,1,1)
for k=0 to Rst.recordcount
Response.write "<a href=CC_SubOutOrder.asp?CityID="&Rst("CityID")&"&CityName="&Rst("CityName")&">"&Rst("CityName")&"</a> "
Rst.movenext
If Rst.eof then Exit for
Next
Call Rs_End(Rst)
%>
</td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="65%" valign="bottom"> <%Response.Write "<font color='#FF0000'>"&Stime&"</font> 向<font color='#0000FF'>"&CityName&"</font>地区发货单"%></td>
<td width="35%"><table width="300" border="0" cellspacing="2" cellpadding="0">
<form name="sfrm" method="post" action="CC_SubOutOrder.asp?Action=Se&CityID=<%=CityID%>">
<tr>
<td valign="bottom">历史订单</td>
<td>
<select name="syear" id="select">
<%call tTime(2005,year(Now()),year(Now()))%>
</select>
年
<select name="smonth" id="select2">
<%call tTime(1,12,month(Now()))%>
</select>
月
<select name="sday" id="select3">
<%call tTime(1,31,day(Now()))%>
</select>
日</td>
<td><input type="submit" name="Submit" value="查询"></td>
</tr>
</form>
</table></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr align="center" class="topbg">
<td height="22">型号</td>
<td width="50">发货数量</td>
<td>收货单位</td>
<td width="150"> 操 作</td>
<td width="45">进货数</td>
<td width="45">发货数</td>
<td width="45">回款数</td>
<td width="45">库存数</td>
<td width="45">回款率</td>
</tr>
<%
csql = "Select * from T_Product order by Pro_ID desc;"
Call sql_open(crs,csql,Conn,1,1)
if crs.eof and crs.bof then
Response.Write "没有任何产品"
else
k = 1
Do while not crs.eof
sql = "Select * from T_User where CityID="&cstr(CityID)&" and (UserGID=6 or UserGID=7) order by UserGID,UserID desc;"
Call sql_open(rs,sql,conn,1,1)
for j=0 to rs.recordcount
'/////////////////////////////////////////
'''计算申购数量(今日)表名:T_SubOrder
sqlm = "Select SUM(Pro_Num) as Total from T_SubOutOrder where Pro_ID="&cstr(crs("Pro_ID"))&" and InChk_UserID="&Cstr(rs("UserID"))&" and convert(varchar(10),Intime,120)='"&Stime&"'"
Call sql_open(rsm,sqlm,conn,1,1)
'Response.Write sqlm&"<br>"
Total = rsm("Total")
if Total="" or isnull(Total) then
Total=0
end if
if Total=0 and rs("UserGID")=7 then
response.write ""
else
%>
<tr <%if k mod 2 =1 then
Response.write "class='tdbg' onmouseout=""this.style.backgroundColor=''"" onmouseover=""this.style.backgroundColor='#B3B3B3'"""
else
Response.write "class='Lborder' onmouseout=""this.style.backgroundColor=''"" onmouseover=""this.style.backgroundColor='#CCCCCC'"""
end if
%>>
<td align="center"><%=crs("Pro_MC")%></td>
<td align="center"><%
if clng(Total)<0 then
Response.write "<font color=""#0000FF""><b>"&Total&"</b></font>"
else
Response.write "<font color=""#0000FF""><b>"&Total&"</b></font>"
end if
%></td>
<td><%
if rs("UserGID")=6 then
Response.write "<b>"&rs("UserUnit")&"</b>"
else
Response.write rs("UserUnit")
end if
%></td>
<td align="center"><%
if Total=0 then
Response.Write "<font color=""#666666"">查看</font>"
else
'Response.write "<a href=""javascript:ShowSubOrder('"&Rs("UserID")&"','"&crs("Pro_ID")&"','"&Stime&"')"" title=""查看订单详情"">查看</a>"
Response.write "<a href=""CC_SubOutOrder_List.asp?UID="&Rs("UserID")&"&PID="&crs("Pro_ID")&"&stime="&Stime&""" title=""查看发货详单"">查看</a>"
end if
%></td>
<td align="center"><%=S_InSubOrder(1,rs("UserID"),crs("Pro_ID"))%></td>
<td align="center"><%=S_OutSubOrder(1,rs("UserID"),crs("Pro_ID"))%></td>
<td align="center"><%
if rs("UserGID")=6 then '市的回款数
Response.Write S_FundSubOrder(1,999,rs("CityID"),"","",crs("Pro_ID"))
elseif rs("UserGID")=7 then '县的回款
Response.Write S_FundSubOrder(1,99,"",rs("CountyID"),"",crs("Pro_ID"))
end if
%></td>
<td align="center">
<%
t=0
t1=0
t2=0
t1 = S_InSubOrder(1,rs("UserID"),crs("Pro_ID"))
t2 = S_OutSubOrder(1,rs("UserID"),crs("Pro_ID"))
t = clng(t1)-clng(t2)
if clng(t)<50 then
Response.write "<font color=""#0000FF"">"&t&"</font>"
else
Response.write "<font color=""#FF0000""><b>"&t&"</b></font>"
end if
%>
</td>
<td align="center"><%
t=0
t1=0
t2=0
if rs("UserGID")=6 then '市的回款数
t1= S_FundSubOrder(1,999,rs("CityID"),"","",crs("Pro_ID"))
elseif rs("UserGID")=7 then '县的回款
t1= S_FundSubOrder(1,99,"",rs("CountyID"),"",crs("Pro_ID"))
end if
t2 = S_InSubOrder(1,rs("UserID"),crs("Pro_ID"))
if t1=0 or t2=0 then
t=0
else
t = 100*(round((t1/t2),2))
end if
Response.write t&"%"
%></td>
</tr>
<%
end if
rs.movenext
If rs.eof then Exit for
Next
crs.movenext
k = k + 1
loop
end if
%>
</table>
<br>
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -