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

📄 xsth.asp

📁 企业进销存管理系统
💻 ASP
字号:
<%
set conn=server.createobject("adodb.connection")
conn.open application("dsn")
%>
<%'显示商品的信息'
set rs=server.createobject("adodb.recordset")
sql="select distinct spid,spname from tab_sell"
rs.open sql,conn,1,3
if rs.eof then 
response.write "<div align=center><font color=red>没有销售任何商品</font></div>"
response.end
end if 
rs.movefirst
spid=rs("spid")
if (request("sel")<>"") then spid=request("sel")
%>
<%
set myrs=server.createobject("adodb.recordset")
sql="select * from tab_sell where spid='"&spid&"'"
myrs.open sql,conn,1,3
%>
<%'取得退货票号'
set rec=server.createobject("adodb.recordset")
sql="select id from tab_sellth"
rec.open sql,conn,1,3
  if not rec.eof then 
set rec=conn.execute("select max(id) as id from tab_sellth")
str=rec("id")
thid=cint(mid(str,7,5))+1
thid="th2003"&cstr(thid)
else
thid="th200310001"
end if 
session("auto")=thid
set kc=server.CreateObject("adodb.recordset")
sql="select kcsl from tab_kucun where id='"&spid&"'"
kc.open sql,conn,1,3
%>
<html>
<head>
<script language="JavaScript">
function changesp()
{myform.submit()}
function k()
{myform.sl.focus()
myform.sl.select()}
function k1()
{
if (myform.sl.value=="0" )
{alert("请输入数量")
myform.sl.focus()
myform.sl.select()
return false}
if (event.keyCode==13)
{myform.je.value=myform.dj.value*myform.sl.value
myform.yf.value=myform.je.value
if (myform.kcsl.value-myform.sl.value<0)
{alert("库存数量不足!")
myform.yf.value=""
myform.je.value=""
myform.sl.focus()
myform.sl.select()
return false}
myform.kcsl.value=myform.kcsl.value-myform.sl.value
myform.sf.focus()
myform.sf.select()}
str=myform.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之间的数)!");myform.sl.focus();myform.sl.select();return false}
}}

function k2()
{
if (event.keyCode==13)
{
myform.wf.value=myform.yf.value-myform.sf.value
if (myform.wf.value<0)
{alert("实收金额整的不对!不能大于应收金额")
myform.sf.focus()
myform.sf.select()
myform.wf.value=""
return false
}
myform.czy.focus()
myform.czy.select()
}
if (myform.sf.value=="0" )
{alert("请输入实付金额")
myform.sf.focus()
myform.sf.select()
return false}
str=myform.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之间的数)!");myform.sf.focus();myform.sf.select();return;}
}}
function k3()
{
if (myform.czy.value=="")
{alert("请输入操作员名称")
myform.czy.focus()
return false
}
if (event.keyCode==13)
{myform.jsr.focus()
myform.jsr.select()
}
}
function ti()
{if (event.keyCode==13)
{send()}}
function send()
{
    form2.hthph.value=myform.thph.value;
	form2.hspname.value=myform.spname.value;
	form2.hkhname.value=myform.khname.value;
	form2.hjc.value=myform.jc.value;
	form2.hcd.value=myform.cd.value;
	form2.hgg.value=myform.gg.value;
	form2.hbz.value=myform.bz.value;
	form2.hsl.value=myform.sl.value;
	form2.hdw.value=myform.dw.value;
	form2.hdj.value=myform.dj.value;
	form2.hje.value=myform.je.value;
	form2.hyf.value=myform.yf.value;
	form2.hsf.value=myform.sf.value;
	form2.hwf.value=myform.wf.value;
	form2.hczy.value=myform.czy.value;
	form2.hjsr.value=myform.jsr.value;
	form2.hthdate.value=myform.thdate.value;
	form2.hjsfs.value=myform.jsfs.value;
	form2.hid.value=myform.id.value;
    form2.hkcsl.value=myform.kcsl.value
form2.submit()
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品销售退货</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body onload="k()">
<form action="xsth.asp" method="post" name="myform">
  <input type="hidden" name="kcsl"  value="<%=kc("kcsl")%>">
  <table width="525" border="1" align="center" bordercolor="#CCCCFF">
    <tr valign="baseline" bgcolor="#CCCCFF"> 
      <td colspan="4" align="right" nowrap bgcolor="#CCFF99"> <div align="center"><strong><font color="#8080c0">商品销售退货单</font></strong></div></td>
    </tr>
    <tr valign="baseline" bgcolor="#CCCCFF"> 
      <td colspan="4" align="right" nowrap><div align="justify"> 商品名称: 
          <input name="textfield" type="text" value="<%=myrs("spname")%>" size="12">
          <font color="#0099FF"> 
          <input type="hidden" name="spname" value="<%=myrs("spname")%>">
          </font> 
          <select name="sel" onChange="changesp()">
            <option value="myempty" selected>请选择销售退货的商品名称:</option>
            <%while not rs.eof%>
            <option value="<%=rs("spid")%>"><%=rs("spname")%></option>
            <%rs.movenext
			   wend%>
          </select>
          <font color="#3300FF">注:带<font color="#FF0000">*</font>号项为必填项。</font></div></td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">退货编号:</div></td>
      <td width="241"> <font color="#0099FF"><%=session("auto")%> 
        <input type="hidden" name="thph" value="<%=session("auto")%>">
        <input type="hidden" name="id" value="<%=myrs("spid")%>">
        </font></td>
      <td width="68">简  称:</td>
      <td width="122"><font color="#0099ff"><%=myrs("jc")%></font> <input type="hidden" name="jc" value="<%=myrs("jc")%>"> 
      </td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">产  地:</div></td>
      <td width="241"><font color="#0099ff"><%=myrs("cd")%></Font> <input type="hidden" name="cd" value="<%=myrs("cd")%>"> 
        <font color="#0099ff">&nbsp;</Font></td>
      <td width="68">规  格:</td>
      <td width="122"> <input type="hidden" name="gg" value="<%=myrs("gg")%>"> 
        <font color="#0099FF"><%=myrs("gg")%></font></td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">客户全称:</div></td>
      <td width="241"><font color="#0099FF"> 
        <input type="hidden" name="khname" value="<%=myrs("khname")%>">
        <%=myrs("khname")%></font> </td>
      <td width="68">包  装:</td>
      <td width="122"><font color="#0099ff"><%=myrs("bz")%></font> <input type="hidden" name="bz" value="<%=myrs("bz")%>"> 
      </td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">单  价:</div></td>
      <td width="241"> <input type="text" name="dj" value="<%=myrs("dj")%>" size="12" > 
        <font color="#FF0000">*</font> </td>
      <td>未  付:</td>
      <td> <input type="text" name="wf" size="12" value="0" disabled=".t."> </td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">数  量:</div></td>
      <td width="241"> <input type="text" name="sl" value="0" size="12" onkeyup="k1()"> 
        <font color="#3300FF">&nbsp;( </font><font color="#0099ff"><%=myrs("dw")%><font color="#3300FF">)</font> </font><font color="#FF0000">&nbsp;*</font> 
        <input type="hidden" name="dw" value="<%=myrs("dw")%>"> 
      </td>
      <td width="68">金  额: </td>
      <td width="122"> <input type="text" name="je" value="0" size="12" disabled=".T."> 
      </td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">应  付:</div></td>
      <td width="241"> <input type="text" name="yf" size="12" value="0" disabled=".t."> 
      </td>
      <td width="68">实  付:</td>
      <td width="122"> <input type="text" name="sf" size="12" value="0" onkeyup="k2()"> 
        <font color="#FF0000">*</font> </td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">操作员:</div></td>
      <td width="241"> <input type="text" name="czy" value="<%=session("name")%>" size="12" onKeyUp="k3()"> 
        <font color="#FF0000">*</font> </td>
      <td width="68">经手人:</td>
      <td width="122"> <input name="jsr" type="text" value="<%=session("name")%>" size="12" onkeyup="ti()"> 
        <font color="#FF0000">*</font> </td>
    </tr>
    <tr valign="baseline"bgcolor="#CCCCFF"> 
      <td nowrap align="right" width="66"> <div align="left">退货日期:</div></td>
      <td width="241"> <input type="text" name="thdate" value="<%=date()%>" size="12"> 
        <font color="#FF0033">*</font> </td>
      <td width="68">结算方式:</td>
      <td width="122"> <select name="jsfs">
          <option value="现金" selected>现金 </option>
          <option value="支票">支票 </option>
          <option value="挂帐">挂帐 </option>
          <option value="预付">预付 </option>
        </select> <font color="#FF0000">*</font> </td>
    </tr>
    <tr valign="baseline"> 
      <td colspan="4" align="right" nowrap bgcolor="#CCCCFF"> <div align="center"> 
          <input name="subb" type="button" id="subb" value="保存" onClick="send()">
          <input name="but" type="reset" id="but" value="重填">
        </div></td>
    </tr>
  </table>
</form>
<form action="checkxsth.asp" method="post" name="form2">
  <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="hidden" name="hkcsl">
    <input type="hidden" name="hid">
  </div>
</form>
</body>
</html>

⌨️ 快捷键说明

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