📄 s_chk_suborder.asp
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
'省公司审核订单
Dim Action,crs,csql,Pro_Name
Dim Rst,Sqlt,k,j
Dim t,t1,t2,t3
Dim rsm,sqlm
Dim CityID,CityName
Dim Total
Dim syear,smonth,sday,Stime
'if GetUserGPower <> 9999 then
' Call Msg("您无权管理",1,"")
'end if
Action = Trim(Request("Action"))
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 ShowPro(id) {
var url = "../product/ShowProInfo.asp?ID=" + id ;
window.open(url,"","scrollbars=yes,resizable=no, width=800,height=500");
}
function ShowUser(id) {
var url = "../User/ShowUserInfo.asp?ID=" + id ;
window.open(url,"","scrollbars=yes,resizable=no, 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
sqlm = "Select SUM(SubOrderTotal) as Total from T_SubOrder where CityID="&cstr(rst("CityID"))&" and (IsChk=0 or IsChk=3) and SupChk_UserGPower=9999"
'Response.Write sqlm
Call sql_open(rsm,sqlm,conn,1,1)
'Response.Write sqlm&"<br>"
Total = rsm("Total")
if Total="" or isnull(Total) then
Total=0
else
Total=Rsm("Total")
end if
call rs_end(rsm)
if Total=0 then
Response.write "<a href=P_Chk_SubOrder.asp?CityID="&Rst("CityID")&"&CityName="&Rst("CityName")&">"&Rst("CityName")&"</a> "
else
Response.write "<a href=P_Chk_SubOrder.asp?CityID="&Rst("CityID")&"&CityName="&Rst("CityName")&"><font color='#FF0000'>"&Rst("CityName")&"</font></a> "
end if
Rst.movenext
If Rst.eof then Exit for
Next
Call Rs_End(Rst)
%>
</td>
</tr>
</table>
<br>
<%
if Action="ChkSubOrder" then
Call ChkSubOrder()
elseif Action="ReChkSubOrder" then
Call ReChkSubOrder()
else
Call Main()
end if
Sub Main()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="65%" valign="bottom"> <%Response.Write "<font color=""#0000FF"">"&CityName&"</font>未审核订单"%></td>
<td width="35%"> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr align="center" class="topbg">
<td>主题</td>
<td height="22">产品型号</td>
<td>申购时间</td>
<td>申购数</td>
<td>收货人</td>
<td>审批数</td>
<td>操作</td>
<td>进货数</td>
<td>发货数</td>
<td>回款数</td>
<td>库存数</td>
<td>回款率</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 * from T_SubOrder where Pro_ID="&cstr(crs("Pro_ID"))&" and UserID="&Cstr(rs("UserID"))&" and (IsChk=0 or IsChk=3) and SupChk_UserGPower=9999"
Call sql_open(rsm,sqlm,conn,1,1)
Do while not rsm.eof
'Response.Write sqlm&"<br>"
Total = rsm("SubOrderTotal")
if Total="" or isnull(Total) then
Total=0
end if
if Total=0 and rs("UserGID")=7 then
response.write "fff"
else
%>
<form name="myform" method="Post" action="P_Chk_SubOrder.asp?Action=ChkSubOrder&ID=<%=rsm("SubOrderID")%>" onsubmit="return confirm('确认审批此订单?');">
<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">
<%
Response.Write "<a href=""javascript:ShowUser('"&rsm("UserID")&"')"" title=""查看用户信息"">"
if rs("UserGID")=6 then
Response.write "<b>"&rsm("SubOrderTitle")&"</b>"
else
Response.write rsm("SubOrderTitle")
end if
Response.write "</a>"
%>
</td>
<td align="center">
<%
sqlt= "Select * from T_Product where Pro_ID="&cstr(rsm("Pro_ID"))&""
Call sql_open(rst,sqlt,conn,1,1)
if rst.eof and rst.bof then
Response.Write("<font color='#FF0000'>无此产品</font>")
else
response.Write "<a href=""javascript:ShowPro('"&rsm("Pro_ID")&"')"" title=""查看产品信息"">"&rst("Pro_MC")&"<font color='#0000FF'>("&rsm("Pro_col")&")</font></a>"
end if
call rs_end(rst)
%></td>
<td align="center"><%=Format_Time(rsm("InTime"), 9)%></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 align="center"><%=rsm("RecName")%></td>
<td align="center">
<%
if rsm("Chk_SubOrderTotal")=0 or isnull(rsm("Chk_SubOrderTotal")) then
Response.Write "<input name=""Chk_SubOrderTotal"" type=""text"" value="&Total&" size=""3"" maxlength=""5"" onKeyUp='this.value=this.value.replace(/\D/gi,"""")'>"
else
Response.Write "<b>"&rsm("Chk_SubOrderTotal")&"+</b><input name=""Chk_SubOrderTotal"" type=""text"" value="&clng(rsm("Chk_SubOrderTotal"))-clng(Total)&" size=""3"" maxlength=""5"" onKeyUp='this.value=this.value.replace(/\D/gi,"""")'>"
end if
%>
</td>
<td align="center"><input type="submit" name="Submit" value="审批"></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
t3=0
t1 = S_InSubOrder(1,rs("UserID"),crs("Pro_ID"))
t2 = S_OutSubOrder(1,rs("UserID"),crs("Pro_ID"))
' Response.Write t1&"<br>"
' Response.Write t2&"<br>"
if rs("UserGID")=6 then '市的回款数
t3 = S_FundSubOrder(1,999,rs("CityID"),"","",crs("Pro_ID"))
elseif rs("UserGID")=7 then '县的回款
t3 = S_FundSubOrder(1,99,"",rs("CountyID"),"",crs("Pro_ID"))
end if
t = clng(t1)-clng(t2)-clng(t3)
if clng(t)<clng(rs("UserProSave")) 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></form>
<%
end if
rsm.movenext
loop
rs.movenext
If rs.eof then Exit for
Next
crs.movenext
k = k + 1
loop
end if
%>
</table><br>
<%
End Sub
Sub ChkSubOrder()
Dim ID,Chk_SubOrderTotal
ID = Request("ID")
Chk_SubOrderTotal = Request("Chk_SubOrderTotal")
if ID="" or isnull(ID) then
Call Msg("非法参数",1,"")
end if
sqlt = "Select * from T_SubOrder where SupChk_UserGPower="&GetUserGPower&" and SubOrderID="&Cstr(ID)&";"
Call sql_open(rst,sqlt,conn,1,3)
if rst.eof and rst.bof then
Response.write "订单不存在"
else
rst("SupChk_UserID")=GetUserID
rst("SupChk_UserName")=GetUserName
rst("Chk_SubOrderTotal")=Chk_SubOrderTotal
rst("IsChk")=3 '尚未审批结束
rst("ChkInfo")="省公司已审核"
rst("ChkTime")=Now()
rst.addnew
%>
<table width="40%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" align="center"><strong>订单审核</strong></td>
</tr>
<tr class="tdbg">
<td height="30"> </td>
</tr>
<tr class="tdbg">
<td height="30" align="center">
<input type="button" name="S2" value="没有完全审批,保留订单" onClick="window.location.href='P_Chk_SubOrder.asp?Action=ReChkSubOrder&keep=3&ID=<%=ID%>'" style="cursor:hand;">
<input type="button" name="S3" value="不保留" onClick="window.location.href='P_Chk_SubOrder.asp?Action=ReChkSubOrder&keep=1&ID=<%=ID%>'" style="cursor:hand;"></td>
</tr>
</table>
<%
end if
'call rs_end(rst)
End Sub
Sub ReChkSubOrder()
Dim ID,keep
Dim rsc,sqlc
ID = trim(Request("ID"))
keep = trim(Request("keep"))
if ID="" or isnull(ID) then
Call Msg("非法参数",1,"")
end if
if keep="" or isnull(keep) then
Call Msg("非法参数",1,"")
end if
sqlc = "Select * from T_SubOrder where SupChk_UserGPower="&GetUserGPower&" and SubOrderID="&Cstr(ID)&";"
Call sql_open(rsc,sqlc,conn,1,3)
if rsc.eof and rsc.bof then
Response.write "订单不存在"
else
if keep=1 then '不保留
rsc("IsChk")=1
elseif keep=3 then
rsc("IsChk")=3
end if
rsc.update
end if
call rs_end(rsc)
Response.Redirect("P_Chk_SubOrder.asp")
End Sub
%>
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -