📄 quotedetaillist.asp
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
sysid=1
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "quote","read"
dim conn
dim rs
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
if Request("strfield")<>"" then
if Request("strfield")<>"signeddate" then
strwhere=" and "&request("strfield")&" like '%"&request("strvalue")&"%'"
else
strwhere=" and "&request("strfield")&"='"&request("strvalue")&"'"
end if
end if
if Request.Form("strfield")<>"" then
if Request("strfield")<>"signeddate" then
strwhere=" and "&request("strfield")&" like '%"&request.form("strvalue")&"%'"
else
strwhere=" and "&request("strfield")&"='"&request.form("strvalue")&"'"
end if
end if
'按发货情况显示
if request("quotestatus")<>"" then
session("quotestatus")=request("quotestatus")
end if
if session("quotestatus")="" then
session("quotestatus")="待发货明细"
end if
if session("quotestatus")="待发货明细" then
'strwhere=strwhere & "and (qty >issuedqty)"
elseif session("quotestatus")="发货完成明细" then
'strwhere=strwhere & "and (qty=issuedqty)"
elseif session("quotestatus")="所有明细" then
'strwhere=strwhere
end if
'response.write strwhere&"<br>"
'response.write request("quotestatus")&"<br>"
if Request.QueryString("quotebyfield")<>"" then
'排序字段改变返回第一页
if session("quotebyfield")<>Request.QueryString("quotebyfield") then
tofirstpage=true
else
tofirstpage=false
end if
'翻页时保持排序方式,不翻页循环改变升序/降序
if request("turnpage")="" then
if request("quoteby")="" or request("quoteby")="desc" then
session("quoteby")="asc"
else
session("quoteby")="desc"
end if
strwhere=strwhere & " order by "&Request.QueryString("quotebyfield")&" "&session("quoteby")
else
if request("quotebyfield")<>"" then
strwhere=strwhere & " order by "&Request.QueryString("quotebyfield")&" "&session("quoteby")
end if
end if
'保存当然排序字段
session("quotebyfield")=Request.QueryString("quotebyfield")
else
strwhere=strwhere '& " order by createdate desc"
end if
if objcheck.CheckUserFunction2("payment","edit") or objcheck.CheckUserFunction2("po","edit") or objcheck.CheckUserFunction2("delivery","edit") then
sql="select * from v_quoteline where 1=1 "&strwhere
'response.Write(sql)
'response.End()
rs.Open sql,conn,1,1
'搜索时用
selecttablename="v_quote where sysaccountid="&sysid
else
rs.Open "select top 100 * from v_quoteline where (Ownerid='"&session("loginid")&"' or Ownerid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) "&strwhere,conn,1,1
'搜索时用
selecttablename="v_quote where (userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid
end if
if Request.QueryString("CurPage") = "" or Request("CurPage") = 0 then
CurPage = 1
else
CurPage = cint(Request.QueryString("CurPage"))
end If
if not Rs.eof then
Rs.PageSize=session("PageSize")
Rs.AbsolutePage=CurPage
else
CurPage=0
end if
%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>报价明细</title>
</head>
<SCRIPT language=JavaScript>
function relativeinput_onchange()
{
if (form1.strfield.value!="Owner"){
strvalue1.style.display='block';
strvalue2.style.display='none';
form1.strvalue2.value="";
}
if (form1.strfield.value=="Owner"){
strvalue1.style.display='none';
strvalue2.style.display='block';
form1.strvalue1.value="";
}
}
function GetStrValue()
{
if (form1.strfield.value!="Owner"){
form1.strvalue.value=form1.strvalue1.value;
}
if (form1.strfield.value=="Owner"){
form1.strvalue.value=form1.strvalue2.value;
}
form1.submit();
}
</SCRIPT>
<body leftmargin="10" rightmargin="0" topmargin="10">
<form name="form1" method="post" action="quotedetaillist.asp" onsubmit="return GetStrValue();">
<table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%"> <select name="strfield" onchange="relativeinput_onchange();">
<option value=siccode <%if request("strfield")="siccode" then Response.Write "selected"%>>客户代码</option>
<option value=account <%if request("strfield")="account" then Response.Write "selected"%>>客户</option>
<option value=quoteno <%if request("strfield")="quoteno" then Response.Write "selected"%>>报价单号</option>
<option value=quotedate <%if request("strfield")="quotedate" then Response.Write "selected"%>>报价日期</option>
<option value=Model <%if request("strfield")="Model" then Response.Write "selected"%>>型号</option>
<option value=ProductCode <%if request("strfield")="ProductCode" then Response.Write "selected"%>>货号</option>
<option value=Owner <%if request("strfield")="Owner" then Response.Write "selected"%>>销售员</option>
<option value=term <%if request("strfield")="term" then Response.Write "selected"%>>付款方式</option>
<option value=shipvia <%if request("strfield")="shipvia " then Response.Write "selected"%>>运货方式</option>
</select></td>
<td width="18%">
<div id=strvalue1 <%if request("strfield")<>"Owner" or request("strfield")="" then response.write "style=display:block" else response.write "style=display:none" end if%>>
<input type="text" name="strvalue1" value="<%=request("strvalue")%>">
</div>
<div id=strvalue2 <%if request("strfield")="Owner" then response.write "style=display:block" else response.write "style=display:none" end if%>>
<select name="strvalue2" class="stedit">
<option value="">--请选择销售员--</option>
<%getgrouptype selecttablename,"Owner",request("strvalue2")%>
</select></div>
</td>
<td>
<input type=hidden name="strvalue" value="<%=request("strvalue")%>" >
<input type=image src="../images/button_submit.gif" style="cursor:hand" border=0>
<%
if CurPage<=1 then
Response.Write "<a href='quotedetaillist.asp?turnpage=yes"eby="&session("quoteby")&""ebyfield="&request("quotebyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage=1'><img src='../images/button_start.gif' border=0></a> "
else
Response.Write "<a href='quotedetaillist.asp?turnpage=yes"eby="&session("quoteby")&""ebyfield="&request("quotebyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage=1'><img src='../images/button_start.gif' border=0></a> "
Response.Write "<a href='quotedetaillist.asp?turnpage=yes"eby="&session("quoteby")&""ebyfield="&request("quotebyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&CurPage-1&"'><img src='../images/button_backward.gif' border=0></a> "
end if
if CurPage>=RS.PageCount then
Response.Write "<a href='quotedetaillist.asp?turnpage=yes"eby="&session("quoteby")&""ebyfield="&request("quotebyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&RS.PageCount&"'><img src='../images/button_end.gif' border=0></a>"
else
Response.Write "<a href='quotedetaillist.asp?turnpage=yes"eby="&session("quoteby")&""ebyfield="&request("quotebyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&CurPage+1&"'><img src='../images/button_forward.gif' border=0></a> "
Response.Write "<a href='quotedetaillist.asp?turnpage=yes"eby="&session("quoteby")&""ebyfield="&request("quotebyfield")&"&strvalue="&request("strvalue")&"&strfield="&request("strfield")&"&CurPage="&RS.PageCount&"'><img src='../images/button_end.gif' border=0></a>"
end if
%>
</td>
<td width=30% valign="middle"> </td>
</tr>
<tr>
<td height="25" colspan="3"><strong><font class=title><b>报价明细</b></font></strong></td>
<td height="25" align="right" class="title"><a href="quote.asp"><img src="../images/arrow_right.gif" border="0">报价列表</a></td>
</tr>
<tr >
<td height="16" colspan="4" background="../images/title.gif"> </td>
</tr>
<tr>
<td height=4 colspan=4></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DECFAD">
<tr bgcolor="efefef">
<td width="8%" align=center height="22"><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=quoteno"eby=<%=session("quoteby")%>">报价单号</a></td>
<td align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=account"eby=<%=session("quoteby")%>">客户</a></td>
<td width="9%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=productcode"eby=<%=session("quoteby")%>">货号</a></td>
<td width="18%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=Model"eby=<%=session("quoteby")%>">型号</a></td>
<td width="4%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=qty"eby=<%=session("quoteby")%>">数量</a></td>
<td width="6%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=discount"eby=<%=session("quoteby")%>">折扣</a></td>
<td width="8%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=discountprice"eby=<%=session("quoteby")%>">折扣价</a></td>
<td width="7%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=amount"eby=<%=session("quoteby")%>">金额</a></td>
<td width="8%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=quotedate"eby=<%=session("quoteby")%>">报价日期</a></td>
<td width="5%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=status"eby=<%=session("quoteby")%>">状态</a></td>
<td width="6%" align=center><a href="quotedetaillist.asp?CurPage=<%=CurPage%>&strfield=<%=request("strfield")%>&strvalue=<%=request("strvalue")%>"ebyfield=owner"eby=<%=session("quoteby")%>">销售员</a></td>
</tr>
<%
set quoteid=rs("quoteid")
set quotenum=rs("quoteno")
set productid=rs("productid")
set productcode=rs("productcode")
set model=rs("model")
set qty=rs("qty")
set discount=rs("discount")
set discountprice=rs("discountprice")
set amount=rs("amount")
set strstatus=rs("status")
set shipdate=rs("shipdate")
set owner=rs("owner")
set quotedate=rs("quotedate")
set account=rs("account")
set accountid=rs("accountid")
i=1:do while not rs.EOF and i<=session("pagesize")%>
<tr bgcolor="#FFFFFF">
<td align=center height="22"><a href="javascript:opensubwin('resizable=yes, scrollbars=yes, left= 40, top=40, menubar=no, location=no, toolbar=no ,width=750, height=500','quotedetail.asp?quoteid=<%=quoteid%>');"><%=quoteNum%></a></td>
<td align=center nowrap><a href="javascript:opensubwin('resizable=no, scrollbars=no, left= 200, top=100, menubar=no, location=no, toolbar=no ,width=580, height=250','../account/accountdetail.asp?accountid=<%=accountid%>');"><%=account%></a></td>
<td align=center><a href="javascript:opensubwin('resizable=no, scrollbars=no, left= 200, top=100, menubar=no, location=no, toolbar=no ,width=580, height=250','../product/productdetail.asp?productid=<%=productid%>');"><%=productcode%></a></td>
<td align=center><%=model%></td>
<td align=center><%=qty%></td>
<td align=center><%=discount%>%</td>
<td align=center><%=formatnumber(discountprice,2)%></td>
<td align=center><%=formatnumber(amount,2)%></td>
<td align=center><%=quotedate%></td>
<td align=center><%=strstatus%></td>
<td align=center><%=owner%></td>
</tr>
<%
i=i+1
rs.MoveNext
loop
%>
</table>
<%
dim totalissuedqty
dim totalissuedamount
dim totalreturnqty
dim totalreturnamount
dim availabledqty
dim availabledamount
dim quoteqty
dim quoteamount
totalissuedqty=0
totalissuedamount=0
totalreturnqty=0
totalreturnamount=0
availabledqty=0
availabledamount=0
quoteqty=0
quoteamount=0
%>
<BR>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="50"><td><!--第<%=CurPage%>页 / 共<%=RS.PageCount%>页 / 记录数:<%=Rs.RecordCount%>条-->
</td></tr></table>
<%
rs.Close
set rs=nothing
conn.Close
set conn=nothing
set objcheck=nothing
%>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -