📄 newprice.asp
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "price","add"
set objcheck=nothing
dim conn
set conn=server.CreateObject("adodb.connection")
conn.Open connstring
if Request("id")<>"" then
sql="select * from price where priceid="&Request("id")
set rs=conn.Execute(sql)
if rs.eof then
Response.Write "找不到记录"
Response.End
end if
productid=rs("productid")
productcode=getfieldvalue("product","productid",rs("productid"),"productcode")
model=getfieldvalue("product","productid",rs("productid"),"model")
retail_price=rs("retail_price")
discount1=rs("discount")
productprice1=rs("price")
description=rs("description")
disable=rs("disable")
account=rs("accountid")
accountname=getfieldvalue("account","accountid",rs("accountid"),"account")
qty11=rs("qty1")
qty12=rs("qty2")
qty13=rs("qty3")
discount11=rs("discount1")
discount12=rs("discount2")
discount13=rs("discount3")
price11=rs("price1")
price12=rs("price2")
price13=rs("price3")
producttype=rs("producttype")
else
discount1=100
discount11=100
discount12=100
discount13=100
account=-1
disable=false
end if
if Request.Form ("discount1")<>"" then
if Request.Form("disable")=1 then
disable=1
else
disable=0
end if
if Request.Form("discount1")<>"" and Request.Querystring("type")="productprice" or Request.Querystring("type")="" then
sql="select productid from price where productid="&Request.Form("product1")&" and SalesPriceType='productprice'"
set rs=conn.Execute(sql)
if Request("id")<>"" then
sql="update price set productid="&Request.Form("product1")&", discount="&Request.Form("discount1")&", retail_price="&Request.Form("price1")&",price="&Request.Form("productprice1")&", lastmoduser='"&session("loginid")&"', lastmoddate='"&now()&"', disable="&disable&",description='"&Request.Form("description")&"' where priceid="&Request("id")
set rs=conn.Execute(sql)
elseif rs.eof then
sql="insert into price(productid,discount,retail_price,price,creator,createdate,SalesPriceType,disable,description)values("&Request.Form("product1")&","&Request.Form("discount1")&","&Request.Form("price1")&","&Request.Form("productprice1")&",'"&session("loginid")&"','"&now()&"','productprice',"&disable&",'"&Request.Form("description")&"')"
set rs=conn.Execute(sql)
else
%>
<script language=javascript>
alert('记录已经存在');
</script>
<%
end if
elseif Request.Form("discount1")<>"" and Request.Querystring("type")="productaccount" then
sql="select productid from price where productid="&Request.Form("product1")&" and SalesPriceType='productaccount'"
set rs=conn.Execute(sql)
if request("id")<>"" then
sql="update price set productid="&Request.Form("product1")&", accountid="&Request.Form("account")&", discount="&Request.Form("discount1")&", retail_price="&Request.Form("price1")&",price="&Request.Form("productprice1")&", lastmoduser='"&session("loginid")&"', lastmoddate='"&now()&"', disable="&disable&",description='"&Request.Form("description")&"' where priceid="&Request("id")
set rs=conn.Execute(sql)
elseif rs.eof then
sql="insert into price(productid,accountid,discount,retail_price,price,creator,createdate,SalesPriceType,disable,description)values("&Request.Form("product1")&","&Request.Form("account")&","&Request.Form("discount1")&","&Request.Form("price1")&","&Request.Form("productprice1")&",'"&session("loginid")&"','"&now()&"','productaccount',"&disable&",'"&Request.Form("description")&"')"
set rs=conn.Execute(sql)
else
%>
<script language=javascript>
alert('记录已经存在');
</script>
<%
end if
elseif Request.Form("discount1")<>"" and Request.Querystring("type")="producttype" then
sql="select productid from price where producttype="&Request.Form("producttype")&" and SalesPriceType='producttype'"
set rs=conn.Execute(sql)
if request("id")<>"" then
sql="update price set producttype="&Request.Form("producttype")&", discount="&Request.Form("discount1")&", lastmoduser='"&session("loginid")&"', lastmoddate='"&now()&"', disable="&disable&",description='"&Request.Form("description")&"' where priceid="&Request("id")
set rs=conn.Execute(sql)
elseif rs.eof then
sql="insert into price(producttype,discount,creator,createdate,SalesPriceType,disable,description)values("&Request.Form("producttype")&","&Request.Form("discount1")&",'"&session("loginid")&"','"&now()&"','producttype',"&disable&",'"&Request.Form("description")&"')"
set rs=conn.Execute(sql)
else
%>
<script language=javascript>
alert('记录已经存在');
</script>
<%
end if
elseif Request.Form("discount1")<>"" and Request.Querystring("type")="productqty" then
if Request.Form("qty2")="" then
qty2=0
discount2=0
productprice2=0
end if
if Request.Form("qty3")="" then
qty3=0
discount3=0
productprice3=0
end if
sql="select productid from price where productid="&Request.Form("product1")&" and SalesPriceType='productqty'"
set rs=conn.Execute(sql)
if Request("id")<>"" then
sql="update price set productid="&Request.Form("product1")&", retail_price="&Request.Form("price1")&", qty1="&Request.Form("qty1")&", discount1="&Request.Form("discount1")&", price1="&Request.Form("productprice1")&", qty2="&Request.Form("qty2")&", discount2="&Request.Form("discount2")&", price2="&Request.Form("productprice2")&", qty3="&Request.Form("qty3")&", discount3="&Request.Form("discount3")&", price3="&Request.Form("productprice3")&", lastmoduser='"&session("loginid")&"', lastmoddate='"&now()&"', disable="&disable&",description='"&Request.Form("description")&"' where priceid="&Request("id")
set rs=conn.Execute(sql)
elseif rs.eof then
sql="insert into price(productid,retail_price,qty1,discount1,price1,qty2,discount2,price2,qty3,discount3,price3,creator,createdate,SalesPriceType,disable,description)values("&Request.Form("product1")&","&Request.Form("price1")&","&Request.Form("qty1")&","&Request.Form("discount1")&","&Request.Form("productprice1")&","&Request.Form("qty2")&","&Request.Form("discount2")&","&Request.Form("productprice2")&","&Request.Form("qty3")&","&Request.Form("discount3")&","&Request.Form("productprice3")&",'"&session("loginid")&"','"&now()&"','productqty',"&disable&",'"&Request.Form("description")&"')"
set rs=conn.Execute(sql)
else
%>
<script language=javascript>
alert('记录已经存在');
</script>
<%
end if
end if
%>
<script language=javascript>
window.opener.location.reload();
window.close();
</script>
<%
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>
window.top.frames (1).document.location='../left.asp?type=product';
</script>
<body leftmargin="10" rightmargin="10" topmargin="10">
<%'产品-价格#############################################################################################################
if Request("type")="productprice" or Request("type")="" then%>
<form name="form1" id="form1" method="post" action="">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF" align="center">
<tr>
<td height="25" colspan=3><div align="left"><strong><font size="2" class=title>按产品制定销售价格</font></strong></div></td>
<td height="25" align="right">
<select name="strfield" onchange="chgselect();">
<option value=productprice <%if request.querystring("type")="productprice" or request.querystring("type")="" then Response.Write "selected"%>>按产品</option>
<option value=productaccount <%if request.querystring("type")="productaccount" then Response.Write "selected"%>>按产品与客户</option>
<option value=productqty <%if request.querystring("type")="productqty" then Response.Write "selected"%>>按产品与数量</option>
<option value=producttype <%if request.querystring("type")="producttype" then Response.Write "selected"%>>按产品类型</option>
</select>
</td>
</tr>
<tr>
<td height="16" colspan="4" background="../images/title.gif"> </td>
</tr>
<tr>
<td colspan="4" height=4></td>
</tr>
<tr valign="middle">
<td height="25" colspan="4" align=center><div align=center>
<input type=hidden name=account value=<%=account%>>
<img src="../images/button_history.gif" style="cursor:hand" border=0 onClick="JavaScript:if(form1.product1.value==''){alert('请选择产品')}else {opensubwin6('form1','quoteandorder',form1.product1.value,form1.account.value)}">
<img src="../images/button_save.gif" style="cursor:hand" border=0 onclick="save();">
<img src="../images/button_cancel.gif" style="cursor:hand" border=0 onclick="window.close();">
</div></td>
</tr>
<tr valign="middle">
<td width="15%" height="25" align=center bgcolor="DEDFDE">型号</td>
<td height="25" colspan="3" bgcolor="efefef"><div align="left">
<font color=red>
<div name="product1name" id="product1name"><%=model%></div>
</font> </div></td>
</tr>
<tr valign="middle">
<td width="15%" height="25" align=center bgcolor="DEDFDE">货号</td>
<td width="35%" height="25" align=left bgcolor="efefef"> <input type=hidden name=product1 value=<%=productid%>>
<input type=text name=code1 size=14 readonly value="<%=productcode%>"> <input type=button name=bproduct1 onClick="JavaScript:opensubwin4('form1','product1','code1','price1')" value="..." class=black>
</td>
<td width="15%" height="25" align=center bgcolor="DEDFDE">单价</td>
<td width="35%" height="25" align=center bgcolor="efefef"> <div align="left">
<input type=text name="price1" size=12 readonly value=<%=retail_price%>>
</div></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF" align="center">
<tr align="left" valign="bottom" bgcolor="FFFFFF">
<td height="25" colspan="6"> 价格明细</td>
</tr>
<tr valign="middle">
<td width="15%" height="25" align=center bgcolor="DEDFDE">折扣</td>
<td width="18%" height="25" bgcolor="efefef"><input type=text name=discount1 size=4 onChange="calculateamount(1);" value=<%=discount1%>>
%</td>
<td width="15%" bgcolor="DEDFDE"><div align="center">折扣价</div></td>
<td width="18%" bgcolor="efefef"> <div align="left">
<input type=text name=productprice1 size=12 onChange="recalculateamount(1);" value=<%=productprice1%> >
</div></td>
<td width="15%" height="25" align=center bgcolor="DEDFDE">失效</td>
<td height="25" align=center bgcolor="efefef"> <div align="left">
<input type="checkbox" name="disable" value=1 <%if disable=true then Response.Write "checked"%>>
</div></td>
</tr>
<tr valign="middle">
<td height="25" align=center bgcolor="DEDFDE">描述</td>
<td height="25" colspan="5" bgcolor="efefef"><textarea name="description" cols="50" rows="5" id="description" ><%=description%></textarea>
<div align="left"> </div></td>
</tr>
</table>
</form>
<%'产品-客户-价格#############################################################################################################
elseif Request("type")="productaccount" then%>
<form name="form1" id="form1" method="post" action="">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF" align="center">
<tr>
<td height="25" colspan=3><div align="left"><strong><font size="2" class=title>按产品与客户制定销售价格</font></strong></div></td>
<td height="25" align="right">
<select name="strfield" onchange="chgselect();">
<option value=productprice <%if request.querystring("type")="productprice" or request.querystring("type")="" then Response.Write "selected"%>>按产品</option>
<option value=productaccount <%if request.querystring("type")="productaccount" then Response.Write "selected"%>>按产品与客户</option>
<option value=productqty <%if request.querystring("type")="productqty" then Response.Write "selected"%>>按产品与数量</option>
<option value=producttype <%if request.querystring("type")="producttype" then Response.Write "selected"%>>按产品类型</option>
</select>
</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -