📄 salelistbycust.asp
字号:
<!--#include file="../Conndb.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>销售订单管理</title>
<link href="../style.css" rel="stylesheet">
<script language="javascript">
function newView(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=620,height=500";
var newView=window.open(url,"newView",oth);
newView.focus();
return false;
}
function newView1(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=200,height=100";
var newView1=window.open(url,"newView1",oth);
newView1.focus();
return false;
}
function see(opt1,opt){
var c=document.getElementById(opt).style.display;
if(c=="" || c=="none"){
document.getElementById(opt).style.display="block";
opt1.src = "pic/Down.gif";
}
else{
document.getElementById(opt).style.display="none";
opt1.src = "pic/Right.gif";
}
}
</script>
</head>
<body link="#000080" vlink="#080080">
<form id="form1" name="form1" method="POST">
<p align="center"><font color="#000080"><b><font style="font-size: 12pt">销 售 订 单 管 理</font></b></font></p>
<table align=center border="1" cellspacing="0" width="100%" bordercolorlight="#000080" bordercolordark="#FFFFFF">
<tr>
<td align="center" bgcolor="#C1E0FF"><strong>订单编号</strong></td>
<td align="center" bgcolor="#C1E0FF"><strong>客户联系人</strong></td>
<td align="center" bgcolor="#C1E0FF"><strong>销售人员</strong></td>
<td align="center" bgcolor="#C1E0FF"><strong>商品总金额</strong></td>
<td align="center" bgcolor="#C1E0FF"><strong>其他费用</strong></td>
<td align="center" bgcolor="#C1E0FF"><strong>订单总金额</strong></td>
<td align="center" bgcolor="#C1E0FF"><strong>操作</strong></td>
</tr>
<%
Dim rs,rsCust,Ssum,strFlag,n
strFlag = Request.QueryString("Flag")
n = 0
Set rsCust = Server.CreateObject("ADODB.RecordSet")
'读取所有订单的客户信息
If strFlag="0" Then
sql = "Select o.CustId,c.CustName From SaleOrder o,Customer c " _
+ " Where o.CustId=c.CustId And o.Status='创建' Group By o.CustId,c.CustName"
Else
sql = "Select o.CustId,c.CustName From SaleOrder o,Customer c " _
+ " Where o.CustId=c.CustId And o.Status='审核'Group By o.CustId,c.CustName"
End If
rsCust.Open sql,conn,1,1
If rsCust.EOF Then
Response.Write "<tr><td colspan=7 align=center>目前还没有客户。</td></tr></table>"
Else
Do While Not rsCust.EOF
Set rs = Server.CreateObject("ADODB.RecordSet")
n = n + 1
DivTitle = "title" & CStr(n)
DivId = "answer" & CStr(n)
%>
<tr>
<td colspan="7"><div style="cursor:hand" onclick=see(<%=DivTitle%>,"<%=DivId%>")>
<img src="pic/Right.gif" id=<%=DivTitle%> width="12" height="12" border="0"><%=rsCust("CustName")%></div>
<div id=<%=DivId%> style="display:none">
<% '读取此客户的订单数据到记录集rs中
If strFlag="0" Then
sql = "SELECT o.*, e.EmpName,c.CustName " _
+ " FROM SaleOrder o Inner Join Customer c On o.CustId = c.CustId" _
+ " Left Join Employees e On o.EmpId = e.EmpId " _
+ " Where o.CustId=" & rsCust("CustId") &" And o.Status='创建' ORDER BY o.SaleId"
Else
sql = "SELECT o.*, e.EmpName,c.CustName " _
+ " FROM SaleOrder o Inner Join Customer c On o.CustId = c.CustId" _
+ " Left Join Employees e On o.EmpId = e.EmpId " _
+ " Where o.CustId="& rsCust("CustId") & " And o.Status='审核' ORDER BY o.SaleId"
End If
rs.Open sql,conn,1,1
'在表格中显示订单信息
If rs.Eof Then
Response.Write "目前还没有记录。</div></td></tr>"
Else
Do While Not rs.EOF
Ssum = CDbl(rs("ProSum")) + CDbl(rs("OtherCost"))
%>
<table border="1" cellspacing="0" width="100%" bordercolorlight="#C1E0FF" bordercolordark="#FFFFFF">
<tr>
<td align="center"><a href="SaleView.asp?sid=<%=rs("SaleId")%>" onClick="return newView(this.href)"><%=rs("SaleId")%></a> </div></td>
<td align="center"><%=rs("Contact")%> </td>
<td align="center"><%=rs("EmpName")%> </td>
<td align="right"><%=rs("ProSum")%> </td>
<td align="right"><%=rs("OtherCost")%> </td>
<td align="right"><%=Ssum%> </td>
<td align="center">
<%If strFlag="0" Then%>
<a href="SaleEdit.asp?action=edit&sid=<%=rs("SaleId")%>" onClick="return newView(this.href)">修改</a>
<a href="SaleDelt.asp?sid=<%=rs("SaleId")%>" onClick="if(confirm('确定要删除记录吗?')){return newView1(this.href);}return false;">删除</a>
<a href="SaleAudit.asp?sid=<%=rs("SaleId")%>" onClick="if(confirm('确定要审核记录吗?')){return newView1(this.href);}return false;">审核</a>
<%End If%>
</td>
</tr>
</table>
<% rs.MoveNext()
Loop%></div></td></tr><%
End If
rs.Close()
rsCust.MoveNext()
Loop
%>
</table>
<%End If
rsCust.Close()
%>
<%If strFlag="0" Then%>
<p align="center">
<input type="button" value="新建销售订单" onclick="newView('SaleEdit.asp?action=add')" name=add>
</p>
<%End If%>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -