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

📄 spxsth.asp

📁 《网上商品交易系统》 开发及测试环境 操作系统:Windows 2000 Server 后台数据库:SQL Server 2000 Web服务器:IIS 5.0  《网上商品交易系统》
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/sell.asp" -->
<!--#include file="../Fun_JS.asp" -->
<%
set rsspname = Server.CreateObject("ADODB.Recordset")
sql_sp = "SELECT distinct spid, spname  FROM dbo.tab_sell"
rsspname.open sql_sp,conn,1,3
%>
<%
set rsautono = Server.CreateObject("ADODB.Recordset")
sql_max = "SELECT MAX(ID) AS MAXID FROM dbo.tab_sellth"
rsautono.open sql_max,conn,1,3
%>
<%
rsspname.movefirst
varname = rsspname("spid")
if (Request.Form("selectsp") <> "") then varname = Request.Form("selectsp")
set rs = Server.CreateObject("ADODB.Recordset")
sql_sell = "SELECT *  FROM dbo.tab_sell  WHERE spid ='"+Replace(varname,"'","''")+_
"'  ORDER BY id desc"
rs.open sql_sell,conn,1,3
%>
<script language="JavaScript">
function changesp(){
form1.submit();}
</script>
<html>
<head>
<title>明日企业网上销售管理系统——商品入库!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<% 
Dim no,cno,mymonth,cmonth,cday
no=trim(rsautono("MAXID"))
if (month(date())<10) then
	cmonth="0"+Cstr(month(date()))
else
	cmonth=Cstr(month(date()))
end if
if (day(date())<10) then
	cday="0"+Cstr(day(date()))
else
	cday=Cstr(day(date()))
end if
select case len(int(Right(no,5)+1))
	case 1
		cno="0000"+Cstr(int(Right(no,5)+1))
	case 2
		cno="000"+Cstr(int(Right(no,5)+1))
	case 3
		cno="00"+Cstr(int(Right(no,5)+1))
	case 4
		cno="0"+Cstr(int(Right(no,5)+1))
	case 5
		cno=Cstr(int(Right(no,5)+1))
	case Else
		cno="00001"
end select

intno="TH"+Cstr(year(date()))+cmonth+cday+cno
session("autonum")=intno
%>
<script language="JavaScript">
function check()
{
  if (form1.sl.value==0)
    { alert("请输入数量!");form1.sl.focus();return;}
     str=form1.sl.value;
     len=str.length;
     for(i=0;i<len;i++){
        x=str.substr(i,1);
        if(x!="0"&x!="1"&x!="2"&x!="3"&x!="4"&x!="5"&x!="6"&x!="7"&x!="8"&x!="9"&x!=".")
          {alert("您输入的不是有效值(请输入0-9之间的数)!");form1.sl.focus();return;}
      }
     str=form1.dj.value;
     len=str.length;
     for(i=0;i<len;i++){
        x=str.substr(i,1);
        if(x!="0"&x!="1"&x!="2"&x!="3"&x!="4"&x!="5"&x!="6"&x!="7"&x!="8"&x!="9"&x!=".")
          {alert("您输入的不是有效值(请输入0-9之间的数)!");form1.dj.focus();return;}
      }
     str=form1.sf.value;
     len=str.length;
     for(i=0;i<len;i++){
        x=str.substr(i,1);
        if(x!="0"&x!="1"&x!="2"&x!="3"&x!="4"&x!="5"&x!="6"&x!="7"&x!="8"&x!="9"&x!=".")
          {alert("您输入的不是有效值(请输入0-9之间的数)!");form1.sf.focus();return;}
      }
if (form1.czy.value=="")
	{alert("您的使用权限已过期,请重新登录!");window.parent.location.href='../login.asp';return;}
if (form1.jsr.value=="")
	{alert("请输入经手人姓名!");form1.jsr.focus();return;}
  if (CheckDate(form1.thdate.value))
    {alert("请输入标准日期(如:2002/09/27或2002-09-27)");form1.thdate.focus();return;}
	form1.je.value=form1.dj.value*form1.sl.value;
	form2.hthph.value=form1.thph.value;
	form2.hspname.value=form1.spname.value;
	form2.hjc.value=form1.jc.value;
	form2.hcd.value=form1.cd.value;
	form2.hkhname.value=form1.khname.value;
	form2.hgg.value=form1.gg.value;
	form2.hbz.value=form1.bz.value;
	form2.hsl.value=form1.sl.value;
	form2.hdw.value=form1.dw.value;
	form2.hdj.value=form1.dj.value;
	form2.hje.value=form1.je.value;
	form2.hyf.value=form1.yf.value;
	form2.hsf.value=form1.sf.value;
	form2.hwf.value=form1.wf.value;
	form2.hczy.value=form1.czy.value;
	form2.hjsr.value=form1.jsr.value;
	form2.hthdate.value=form1.thdate.value;
	form2.hjsfs.value=form1.jsfs.value;
	form2.hid.value=form1.id.value;
	form2.submit();
}
</script>
<Script language="Javascript">
function myreset(){
form1.reset();}
</script>
<Script language="Javascript">
function autoje(){
form1.je.value=form1.dj.value*form1.sl.value;
form1.yf.value=form1.je.value;
form1.wf.value=form1.yf.value-form1.sf.value;
if(form1.sf.value-form1.yf.value>0)
{alert("实付金额不应大于应付金额!");form1.sf.focus();return;}
}
</script>
<link href="../style.css" rel="stylesheet">
</head>
<body bgcolor="#FFFFFF" text="#000000" background="../../images/bg.gif">
<table width="590" border="0" cellspacing="-2" cellpadding="-2" height="27">
  <tr> 
    <td> 
      <h2 style="filter:glow(color=#ccccff,strength=5);height:1pt"align="center"><font size="2" color=#000099> 
        商品销售退货单</font></h2>
    </td>
  </tr>
</table>
<table width="590" border="0" cellspacing="-2" cellpadding="-2" height="211">
  <tr> 
    <td valign="top"> 
      <form name="form1" method="post" action="">
        <table width="470" align="center">
          <tr> 
            <td> 
              <select name="selectsp" onChange=changesp()>
                <option value="myempty" selected>请选择销售退货的商品名称:</option>
                <% While (NOT rsspname.EOF) %>
                <option value="<%=rsspname("spid")%>" ><%=rsspname("spname")%></option>
 				<% rsspname.MoveNext()
				Wend %>
              </select>
              <font color="#00CCFF"> </font></td>
          </tr>
        </table>
        <table align="center" width="470">
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">退货编号:</div>
            </td>
            <td colspan="3"><font color="#0099FF"><%=session("autonum")%> 
              <input type="hidden" name="thph" value="<%=session("autonum")%>">
              <input type="hidden" name="id" value="<%=rs("spid")%>">
              </font></td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">商品名称:</div>
            </td>
            <td width="161"> <font color="#0099FF"> 
              <input type="hidden" name="spname" value="<%=rs("spname")%>">
              <%=rs("spname")%> </font></td>
            <td width="67">简  称:</td>
            <td width="149"><font color="#0099ff"><%=rs("jc")%></font> 
              <input type="hidden" name="jc" value="<%=rs("jc")%>">
            </td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">产  地:</div>
            </td>
            <td width="161"><font color="#0099ff"><%=rs("cd")%></Font> 
              <input type="hidden" name="cd" value="<%=rs("cd")%>">
              <font color="#0099ff">&nbsp;</Font></td>
            <td width="67">规  格:</td>
            <td width="149"> 
              <input type="hidden" name="gg" value="<%=rs("gg")%>">
              <font color="#0099FF"><%=rs("gg")%></font></td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">客户全称:</div>
            </td>
            <td width="161"><font color="#0099FF"> 
              <input type="hidden" name="khname" value="<%=rs("khname")%>">
              <%=rs("khname")%></font> </td>
            <td width="67">包  装:</td>
            <td width="149"><font color="#0099ff"><%=rs("bz")%></font> 
              <input type="hidden" name="bz" value="<%=rs("bz")%>">
            </td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">单  价:</div>
            </td>
            <td width="161"> 
              <input type="text" name="dj" value="<%=rs("dj")%>" size="12" onchange=autoje()>
              <font color="#00CCFF">*</font> </td>
            <td>未  付:</td>
            <td> 
              <input type="text" name="wf" size="12" value="0" disabled=".t.">
            </td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">数  量:</div>
            </td>
            <td width="161"> 
              <input type="text" name="sl" value="0" size="12" onchange=autoje()>
              <font color="#00CCFF"></font><font color="#0099ff">( <%=rs("dw")%>)
			   </font><font color="#00CCFF"></font><font color="#00CCFF">*</font> 
              <input type="hidden" name="dw" value="<%=rs("dw")%>">
            </td>
            <td width="67">金  额: </td>
            <td width="149"> 
              <input type="text" name="je" value="0" size="12" disabled=".T.">
            </td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">应  付:</div>
            </td>
            <td width="161">
              <input type="text" name="yf" size="12" value="0" disabled=".t.">
            </td>
            <td width="67">实  付:</td>
            <td width="149">
              <input type="text" name="sf" size="12" value="0" onblur=autoje()>
              <font color="#00CCFF">*</font> </td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">操作员:</div>
            </td>
            <td width="161"> 
              <input type="text" name="czy" value="<%=session("UserID")%>" size="12" readonly="yes">
              <font color="#00CCFF">*</font> </td>
            <td width="67">经手人:</td>
            <td width="149"> 
              <input type="text" name="jsr" size="12">
              <font color="#00CCFF">*</font> </td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" width="73"> 
              <div align="left">退货日期:</div>
            </td>
            <td width="161"> 
              <input type="text" name="thdate" value="<%=date()%>" size="12">
              <font color="#00CCFF">*</font> </td>
            <td width="67">结算方式:</td>
            <td width="149"> 
              <select name="jsfs">
                <option value="现金" selected>现金 </option>
                <option value="支票">支票 </option>
                <option value="挂帐">挂帐 </option>
                <option value="预付">预付 </option>
              </select>
              <font color="#00CCFF">*</font> </td>
          </tr>
          <tr valign="baseline"> 
            <td nowrap align="right" colspan="4"> 
              <div align="left"><font color="#00CCFF">注:带*号项为必填项。</font></div>
            </td>
          </tr>
        </table>
      </form>
      <table width="590" border="0" cellspacing="-2" cellpadding="-2">
        <tr> 
          <td> 
            <form name="form2" method="post" action="./xsthaddok.asp">
              <div align="center"> 
                <input type="hidden" name="hthph">
                <input type="hidden" name="hspname">
                <input type="hidden" name="hjc">
                <input type="hidden" name="hcd">
                <input type="hidden" name="hkhname">
                <input type="hidden" name="hgg">
                <input type="hidden" name="hbz">
                <input type="hidden" name="hsl">
                <input type="hidden" name="hdw">
                <input type="hidden" name="hdj">
                <input type="hidden" name="hje">
                <input type="hidden" name="hczy">
                <input type="hidden" name="hjsr">
                <input type="hidden" name="hthdate">
                <input type="hidden" name="hjsfs">
                <input type="hidden" name="hwf">
                <input type="hidden" name="hyf">
                <input type="hidden" name="hsf">
                <input type="button" name="Button" value="保存" onclick=check()>
                <input type="button" name="Button" value="重填" onclick=myreset()>
                <input type="hidden" name="hid">
              </div>
            </form>
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
rsspname.Close()
%>
<%
rsautono.Close()
%>
<% rs.Close() %>

⌨️ 快捷键说明

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