⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sell.asp

📁 Activity——活动管理模块 Analyse——分析模块 Client——客户管理系统模块 Email——E-mail管理模块 Fee——费用管理模块 Report——报表模块 Sel
💻 ASP
字号:
<!--#include file="../conn.asp"-->
<!--#include file="../IsUser.asp"-->
<!--#include file="../Pub_Fun.asp"-->
<!--#include file="../scripts/openwindow.js"-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>销售信息添加</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=Pragma content=no-cache>
<META content="MSHTML 6.00.2715.400" name=GENERATOR>
<style type="text/css">
<!--
.style1 {color: #FF6600}
-->
</style>
</HEAD>
<LINK href="../css.css" rel=stylesheet>
<script language="VBScript">
sub checkinfo()  
  if trim(sellmain.selltopic.value) = "" then
		msgbox "请填写销售主题!!"
		sellmain.selltopic.focus
		exit sub
  end if
  if trim(sellmain.sellordernum.value) = "" then
		msgbox "请填写订单/合同号!!"
		sellmain.sellordernum.focus
		exit sub
  end if  
  if trim(sellmain.sellclientID.value) = "0" then
		msgbox "请选择相关客户!!"
		sellmain.sellclientID.focus
		exit sub
  end if
  if trim(sellmain.selltouchmanID.value) = "0" then
		msgbox "请选择相关联系人!!"
		sellmain.selltouchmanID.focus
		exit sub
  end if
  if trim(sellmain.selldate.value) = "" then
		msgbox "请选择销售日期!!"
		sellmain.selldate.focus
		exit sub
  end if
  if trim(sellmain.Selldetail.value) <> "" then
		if len(trim(sellmain.Selldetail.value))>760 then
		msgbox "输入的库存说明内容太多,请重新编辑!!"		
		sellmain.Selldetail.focus
		exit sub
		end if
   else
		msgbox "请输入销售说明!!"
		sellmain.Selldetail.focus
		exit sub
  end if
  sellmain.act.value="add"
  sellmain.action="sell.asp"
  sellmain.submit
End sub

sub del_onclick(id)
    sellmain.id.value=id
    sellmain.act.value="del"
    sellmain.action="sell.asp"
    sellmain.submit
end sub

sub clientchang()
    sellmain.act.value="choose"
    sellmain.action="sell.asp"
    sellmain.submit
end sub
</script>

<BODY><BR>
<%
StockCreatorID=session("Session_User")
 if request("act")="del" and request("id")<>""  then
    sql="delete from stock_temp where CreatorID = " & session("Session_User") & " and CreateDate = convert(char(10),getdate(),120) and type='sell' and ProductID=" &trim(request("id"))
	conn.execute sql 
 end if

 if request("act")="add" then
''获取传递过来的销售信息参数
    selltopic=htmlencode2(trim(request("selltopic")))
	sellordernum=trim(request("sellordernum"))
	sellclientID=trim(request("sellclientID"))
	sellmoneysort=trim(request("sellmoneysort"))
	selltouchmanID=trim(request("selltouchmanID"))
	selldate=trim(request("selldate"))
	Selldetail=htmlencode2(request("Selldetail"))
	if request("Sellopenflag")<>"" then
		Sellopenflag=trim(request("Sellopenflag"))
	else
		Sellopenflag=0
	end if
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql="Insert into sell(SellTopic,SellClientID,SellTouchmanID,SellOrderNum,SellProduct,SellMoneySort,SellProductPrice,SellProductNum,Selldetail,SellDate,SellCreatorID,SellCreateDate,SellOpenFlag) "
    sql=sql&"  ( select '"& SellTopic&"',"&SellClientID&","&SellTouchmanID&",'"&SellOrderNum&"',ProductName,'"&SellMoneySort&"',ProductPrice,ProductNum,'"& Selldetail&"','"&selldate&"',creatorID,createdate,"&Sellopenflag
    sql=sql&" from stock_temp where CreatorID = " & session("Session_User") & " and CreateDate = convert(char(10),getdate(),120) and type='sell')" 
''执行数据写入
	conn.execute sql
	sql="delete  from stock_temp where CreatorID = " & session("Session_User") & " and CreateDate = convert(char(10),getdate(),120) and type='sell' " 
''删除临时表中使用过的数据
	conn.execute sql
%>
<script language="VBScript">
			msgbox "销售添加成功!!"	  
			window.location="sell.asp"
</script>  
<%
end if
%>  
<TABLE  width="751" border=0 align=center cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR> 
      <TD  height="24" valign="top"   bgcolor="#566CDB"  ><img src="../images/DispStation_H.gif" width="11" height="24">销售信息——添加</TD>
      <TD align="right" valign="middle" bgcolor="#DDDDDD" >
        &nbsp;&nbsp; <input name="SaveButton" type="button" class="button_all" value="保存" onClick="checkinfo()"> 
		&nbsp;&nbsp; <input  onclick="javascript:location.href='selllist.asp';"  name="ListButton" type="button" class="button_with" width="80" value="销售列表"> 
        &nbsp;&nbsp; <input  onclick="javascript:location.href='../menu.asp';" name="BackButton" type="button" class="button_all"  value="返回"> 
	   </TD>
    </TR>
  <TR> 
    <TD height="16" colspan="2" valign="top" width="100%">&nbsp;</TD>
  </TR>
  </Tbody>
 </table>
 <form name="sellmain" method="post">
 <input type="hidden" name="act">
 <input type="hidden" name="id">
 <TABLE  width="751" border=0 align=center cellPadding=3 cellSpacing=1  bgcolor="#33CCFF">
  <TBODY>
 <!-- 显示添加物品链接 -->
     <TR  bgcolor="#FFFFFF">
	<td colspan="6"><input name="SaveButton" type="button" class="button_with"  width="100"value="添加销售物品" onClick="javascript:windowOpener('sell_Product_choose.asp','choose');"></td>
	</TR> 
 <!-- 显示物品信息标题 -->
    <TR  bgcolor="#FFFFFF" >
	<td><span class="style1">物品编号</span></td>
	<td><span class="style1">物品名称</span></td>
	<td><span class="style1">物品单价</span></td>
	<td><span class="style1">物品数量</span></td>
	<td><span class="style1">总金额</span></td>
	<td><div align="center"><span class="style1">操作</span></div></td>
	</TR>
<%
''利用For循环显示添加的物品
	set rs=server.createobject("adodb.recordset")
	''读取数据的条件是CreatorID是本操作者,type 是 sell , CreateDate是当天
	str="select * from Stock_temp where CreatorID = '" & session("Session_User") & "' and type='sell' and CreateDate = convert(char(10),getdate(),120) order by ProductID" 
	rs.open str,conn,3
	if not rs.eof then 
     for i=1 to rs.recordcount
         if rs.eof then exit for
	%>
    <TR  bgcolor="#FFFFFF">
	<td><%=rs("ProductID")%></td>
	<td><%=rs("ProductName")%></td>
	<td><%=rs("ProductPrice")%></td>
	<td><%=rs("ProductNum")%></td>
<!-- 显示计算出来的价格 -->
	<td><%=(cdbl(rs("ProductPrice"))*cint(rs("ProductNum")))%></td>
	<td><div align="center"><a href="javascript:windowopensmall1('sell_product_numchange.asp?ID=<%=rs("ProductID")%>&num=<%=rs("Productnum")%>','numchange')"><font color="#0000FF">更改</font></a>&nbsp;<u><a style='cursor:hand'  onclick='del_onclick("<%=rs("ProductID")%>")'><font color="#0000FF">删除</font></a></u></div></td>
	</TR>
	<%rs.movenext%>
	<%if rs.eof then exit for%>
<%next
  else
 %>
    <TR  bgcolor="#FFFFFF">
	    <td colspan="6">没有选择销售物品</td>
	</TR> 
 <%
   end if
%>
  </TBody>
</table>
<TABLE  width="751" border=0 align=center cellPadding=3 cellSpacing=1  bgcolor="#33CCFF">
<TBODY>
	<TR> 	
		<TD   align="left" valign="middle"  bgcolor="#FFFFFF" width="12%"> <FONT face=Wingdings  color=#99ccff >v</FONT><span class="style1">销售主题: </span> </TD>
		<TD width="40%"   bgcolor="#FFFFFF"> 
          <input name="selltopic" type="text"  size="35" maxlength="50" value="<%=request("selltopic")%>" >
       </TD>
        <TD align="left" valign="middle"   bgcolor="#FFFFFF"   width="12%"> <FONT face=Wingdings  color=#99ccff >v</FONT></FONT><span class="style1">订单/合同号:</span>         </TD>
		<TD   bgcolor="#FFFFFF">
		<input name="sellordernum" type="text"  size="25" maxlength="50" value="<%=request("sellordernum")%>" >
		</TD>
	</TR>
    <TR> 	
		<TD   align="left" valign="middle"  bgcolor="#FFFFFF" width="12%"> <FONT face=Wingdings  color=#99ccff >v</FONT><span class="style1">相关客户:  </span> </TD>
		<TD width="40%"   bgcolor="#FFFFFF"> 
<!--  显示销售相关客户 -->
			<select name="sellclientID" onChange="clientchang()">
                  <option value="0" >未选择销售客户</option>
<%
	set rs_s = server.createobject("adodb.recordset")
	sql_s= "select distinct clientid,clientname from client order by clientid "
	rs_s.open sql_s,conn,3
	if not rs_s.eof then
	    for i=1 to rs_s.recordcount
		
%>
                  <option value="<%=trim(rs_s("clientid"))%>" <% if request("sellclientID")=trim(rs_s("clientid")) then response.Write("selected") %>> <%=rs_s("clientname")%></option>
<%
            rs_s.movenext
	    next
	 end if
	 set rs_s=nothing
%>  
           </select>
		</TD>
        <TD align="left" valign="middle"   bgcolor="#FFFFFF"   width="12%"> <FONT face=Wingdings  color=#99ccff >v</FONT></FONT><span class="style1">货币类型:</span> 
        </TD>
		<TD   bgcolor="#FFFFFF">
			<select name="sellmoneysort">
                 <option value="人民币" selected>人民币</option>
             </select>
		  </TD>
	</TR>
    <TR> 	
		<TD   align="left" valign="middle"  bgcolor="#FFFFFF" width="12%"> <FONT face=Wingdings  color=#99ccff >v</FONT><span class="style1">相关联系人: </span> </TD>
<!--  显示销售相关客户的相关联系人 -->	
		<TD width="40%"   bgcolor="#FFFFFF"> 
		  <select name="selltouchmanID">
             <option value="0" >未选择联系人所属的客户</option>
<%
if request("sellclientID")<> "" then
	set rs_s = server.createobject("adodb.recordset")
	sql_s= "select distinct touchmanID,touchmanname from touchman where touchmanID="& request("sellclientID")&" order by touchmanid "
	rs_s.open sql_s,conn,3
	if not rs_s.eof then
	    for i=1 to rs_s.recordcount
		
%>
           <option value="<%=trim(rs_s("touchmanID"))%>" <% if request("touchmanID")=trim(rs_s("touchmanID")) then response.Write("selected") %>> <%=rs_s("touchmanname")%></option>
<%
          rs_s.movenext
	    next
	 end if
	 set rs_s=nothing
end if
%>  
        </select>
       </TD>
        <TD align="left" valign="middle"   bgcolor="#FFFFFF"   width="12%"> <FONT face=Wingdings  color=#99ccff >v</FONT></FONT><span class="style1">销售日期:</span> 
        </TD>
		<TD   bgcolor="#FFFFFF">
          <input name="selldate" type="text"  size="20" maxlength="50" readonly="true" value="<%=request("selldate")%>">
		  <input name="Button2" type="button" class="button_dic" id="Button2" onClick="show_calendar('sellmain.selldate')" value="…">
		  </TD>
    </TR>
   <TR bgcolor="#FFFFFF">       
        <TD  colspan="4" align="left" valign="middle" ><FONT style="LINE-HEIGHT: 150%"><FONT face=Wingdings 
      color=#99ccff >v</FONT></FONT><span class="style1">销售说明: </span></TD>
    </TR>
    <TR bgcolor="#FFFFFF"> 
      <TD  colspan="4" >
	  <textarea name="Selldetail" cols="90%" rows="6"><%=keepformat(request("Selldetail"))%></textarea>
	  </TD>
    </TR>	
    <TR  bgcolor="#FFFFFF"> 
      <TD colspan="4" ><hr   color="#566CDB" align="center" size="1"></TD>
    </TR>
    <TR  bgcolor="#FFFFFF"> 
		<TD width="100%" align="left" valign="middle" colspan="4" ><FONT style="LINE-HEIGHT: 150%"><FONT face=Wingdings  color=#99ccff >v</FONT></FONT><FONT color=#ff6600>创建者: </FONT> 
          <input readonly="true" name="StockCreator" type="text"  size="15" maxlength="30" value="<%=showoperatorname(StockCreatorID)%>">
		  <input name="StockCreatorID" type="hidden" value ="<%=StockCreatorID%>">
          <FONT style="LINE-HEIGHT: 150%"><FONT face=Wingdings color=#99ccff > v</FONT></FONT><FONT color=#ff6600>创建日期: </FONT> 
          <input readonly="true" name="sellCreateDate" type="text" size="15" maxlength="30" value="<%=date()%>">
		  <FONT face=Wingdings color=#99ccff >v</FONT></FONT><FONT color=#ff6600>是否公开记录: </font>
           <input name="sellopenflag" type="checkbox" id="Check_Open" value="1"  <%if request("sellopenflag") = "1"then%>checked<%end if%>>
		 </TD>
    </TR>   
	 <TR align=middle bgColor=#99ccff> 
		<TD height="24" colSpan=4 vAlign=middle></TD>
	</TR>
</TBODY>
</TABLE>
</form>
<form name="childfm"></form>
</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -