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

📄 rkth.asp

📁 企业进销存管理系统
💻 ASP
字号:
<!--#include file="cart_rt.asp"-->
<%
ys=0
ws=0
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open application("dsn")
sql="select * from tab_kucun"
rs.open sql,conn,1,3
if rs.eof then 
response.write "<div align=center><font color=red>暂时没有库存!</font></div>"
response.End()
end if 
%>
<%'显示商品信息
set rs_sp=server.createobject("adodb.recordset")
sql="select spname from tab_kucun group by spname"
rs_sp.open sql,conn,1,3
defaultSP=trim(rs_sp("spname"))
rs_sp.movefirst
set rs_gg1=server.CreateObject("ADODB.RecordSet")
sql="select * from tab_kucun where spname='"&defaultSP&"'"
rs_gg1.open sql,conn,1,3
defaultGG=rs_gg1("gg")
defaultdj=rs_gg1("dj")
defaultdw=rs_gg1("dw")
%>
<% '得到供应商信息
set gysrs=server.CreateObject("adodb.recordset")
sql="select * from tab_gysinfo"
gysrs.open sql,conn,1,3
%>
<%
'保存到购物车
Q_spid=request.QueryString("SPID")
Q_DJ=request.QueryString("dj")
Q_SL=request.QueryString("SL")
if Q_spid<>"" and Q_DJ>=0 and Q_SL>=0 then 
	if isarray(session("arr_rt")) then
		arr=session("arr_rt")
		For I = 0 To ubound(arr,1)
			flag=false  '标记新添加的商品信息是否存在
			if Q_spid=arr(I,0) then  '当商品信息添加重复时
				arr(I,2)=cint(arr(I,2))+cint(Q_SL)  '累加商品数量
				session("arr_rt")=arr 
				flag=true
				exit for
			end if
		Next
		if not flag then
			call cart(Q_spid,Q_DJ,Q_SL) '将商品信息添加至购物车
		end if
	else
		call cart(Q_spid,Q_DJ,Q_SL) '将商品信息添加至购物车
	end if
end if
%>
<html>
<head>
<script language="javascript">
function changesp(value){
	url="rkth.asp?SPname="+value;
	window.location.href=url;
}
function changeGG(value){
	url="rkth.asp?GG="+value+"&SPname="+myform.spname.value;
	window.location.href=url;
}
function send(){
	if(myform.jsr.value==""){
	alert("请输入经手人!");myform.jsr.focus();return;
	}
	if(myform.ys.value==0){
	alert("请选择想要入库退货的商品!");return;
	}
	myform.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> 
<form action="rkth_deal.asp" method="post" name="myform"> 
  <table width="97%" border="0" align="center" class="tableBorder" cellpadding="0" cellspacing="0"> 
    <tr> 
      <td height="25" nowrap bgcolor="#FF9933" class="word_white">&nbsp;当前位置:商品入库退货> 商品入库退货> 入库退货登记单 &gt;&gt;&gt;</td> 
    </tr> 
    <tr> 
      <td height="10" nowrap bgcolor="#CCE3FF" class="word_white"></td> 
    </tr> 
    <tr align="center"> 
      <td height="44" valign="top" nowrap bgcolor="#CCE3FF"> <table width="99%" height="34"  border="0" cellpadding="-2" cellspacing="-2" bordercolor="#CCE3FF" bordercolorlight="#FFFFFF" bordercolordark="#CCE3FF" class="tableBorder"> 
          <tr> 
            <td width="14%" height="32" align="center" nowrap> 操 作 员:</td> 
            <td width="51%" bgcolor="#CCE3FF" >&nbsp; 
              <input type="text" name="czy" value="<%=session("name")%>" size="12" onKeyUp="k3()" readonly="yes"> 
              <input name="flag" type="hidden" id="flag" value=<%=sell%>></td> 
            <td width="10%" align="center">退货时间:</td> 
            <td width="25%" >&nbsp; 
              <input type="text" name="xsdate" readonly="yes"value="<%=now()%>" size="18"></td> 
          </tr> 
        </table></td> 
    </tr> 
    <tr align="center" valign="top"bgcolor="#CCE3FF"> 
      <td height="100" nowrap><table width="99%"  border="1" cellpadding="0" cellspacing="0"  bordercolor="#FFFFFF" bordercolorlight="#9CA6C6" bordercolordark="#CCE3FF"> 
          <tr align="center" bgcolor="#CCE3FF"> 
            <td width="42%" height="24">商品名称</td> 
            <td width="21%">规格</td> 
            <td width="14%">单价</td> 
            <td width="16%">数量</td> 
            <td width="7%">操作</td> 
          </tr> 
          <%if isarray(session("arr_rt")) then
arr=session("arr_rt")
For I = 0 To ubound(arr,1)
	arr_spid=arr(I, 0)
	arr_dj=arr(I,1)
	arr_sl=arr(I,2)	
	if arr_sl<=0 then
		arr_sl=1
	end if
	set arr_rs=Server.CreateObject("ADODB.RecordSet")
	sql="select * from tab_kucun where id='"&arr_spid&"'"
	arr_rs.open sql,conn,1,3
	if arr_rs.eof and arr_rs.bof then
		response.Write("<script>alert('您的操作有误!');window.location.href='rkth.asp';</script>")
		session("arr_rt")=""
		response.End()
	else
		arr_spname=arr_rs("spname")
		arr_gg=arr_rs("GG")
		ys=ys+arr_dj*arr_sl
		ws=ys
%> 
          <tr> 
            <td height="26" class="word_yellow"><%=arr_spname%></td> 
            <td class="word_yellow"><%=arr_GG%></td> 
            <td align="center" class="word_yellow"><%=arr_dj%></td> 
            <td align="center" class="word_yellow"><%=arr_sl%></td> 
            <td align="center"><img src="../images/move.gif" width="16" height="17" alt="删除入库退货记录" onClick="window.location.href='remove_rt.asp?spid=<%=arr_spid%>'"></td> 
          </tr> 
          <%	end if
Next
end if%> 
          <tr> 
            <%spname=request.QueryString("SPname")
		if spname="" then
			spname=defaultSP
		end if
		%> 
            <td><select name="spname" id="select4" onChange="changesp(this.value)" style="width:256px;"> 
                <%  while not rs_sp.eof  %> 
                <option value="<%=trim(rs_sp("spname"))%>" <%if trim(rs_sp("spname"))=spname then response.Write(" selected")%> ><%=rs_sp("spname")%></option> 
                <%
rs_sp.movenext
  wend%> 
              </select></td> 
            <td><select name="GG" id="select5" onChange="changeGG(this.value)"> 
                <%
			  GG_Q=request.QueryString("GG")
			  set rs_select=server.CreateObject("ADODB.RecordSet")
			  sql="select * from tab_kucun where spname='"&trim(spname)&"'"
			  rs_select.open sql,conn,1,3
			  while not rs_select.eof
			  gg=rs_select("gg")
			  if GG_Q="" then 
			  		GG_Q=gg
					dw=defaultdw
					dj=defaultdj
			  End if
			  %> 
                <option value="<%=gg%>" <%if GG_Q=gg then response.Write(" selected")%>><%=gg%></option> 
                <%
			 rs_select.movenext
			 wend%> 
              </select></td> 
            <%
			  set rs_GG=server.CreateObject("ADODB.RecordSet")
			  sql="select * from tab_kucun where spname='"&spname&"' and gg='"&GG_Q&"'"
			  rs_GG.open sql,conn,1,3
			  spID=trim(rs_GG("id"))
		  	  dj=rs_GG("dj")
			  dw=rs_GG("dw")
		  %> 
            <td align="center"><input name="dj" type="text" id="dj" value="<%=dj%>" size="12" ></td> 
            <td align="center"><input name="sl" type="text" id="sl" value="0" size="5" onKeyDown="if(event.keyCode==13) sell()"> 
              <font color="#0099ff">[ <%=dw%>]
              <input name="spid" type="hidden" id="spid" value="<%=spID%>"> 
              </font></td> 
            <script language="javascript">
			function sell(){
				if (myform.dj.value==0){
					alert("请输入单价!");myform.dj.focus();return;
				}
				if (myform.sl.value==0){
					alert("请输入入库退货数量!");myform.sl.focus();return;
				}	
				if (isNaN(myform.sl.value)){
					alert("您输入的入库退货数量有误,请重新输入!");
					myform.sl.focus();myform.sl.value="";return;
				}								
				FSPID=myform.spid.value;
				FDJ=myform.dj.value;
				FSL=myform.sl.value;
				url="rkth.asp?SPID="+FSPID+"&DJ="+FDJ+"&SL="+FSL;
				window.location.href=url;
			}
			</script> 
            <td align="center"><input name="Submit2" type="button" class="btn_grey" onClick="sell();" value="入库退货"></td> 
          </tr> 
        </table></td> 
    </tr> 
    <tr bgcolor="#CCE3FF"> 
      <td height="29" align="center" nowrap> <table width="99%" height="55"  border="0" cellpadding="-2" cellspacing="-2" class="tableBorder"> 
          <tr> 
            <td align="center" nowrap>供应商全称:</td> 
            <td><select name="gysname"> 
                <%while not gysrs.eof%> 
                <option value="<%=gysrs("name")%>"><%=gysrs("name")%></option> 
                <%
  gysrs.movenext
  wend%> 
              </select> </td> 
            <td align="center">结算方式:</td> 
            <td ><select name="jsfs"> 
                <option value="现金" selected>现金 </option> 
                <option value="支票">支票 </option> 
                <option value="挂账">挂账 </option> 
                <option value="预付">预付 </option> 
              </select></td> 
          </tr> 
          <tr> 
            <td width="14%" height="29" align="center" nowrap> 应  收:</td> 
            <td width="49%"><input name="ys" type="text" readonly="yes" id="ys" value="<%=ys%>" size="12"> 
              (元) </td> 
            <td width="14%" align="center">未  收:</td> 
            <td width="23%"><input type="text" name="ws" size="12" value="<%=ws%>" readonly="yes"> 
              (元)</td> 
          </tr> 
          <tr> 
            <td height="30" align="center" nowrap> 实  收:</td> 
            <script language="javascript">
			function calc_ws(){
			if(isNaN(myform.ss.value)){
				alert("您输入的实收金额有误!");
				myform.ss.focus();
				return;
			}
			myform.ws.value=myform.ys.value-myform.ss.value;
			}
			</script> 
            <td><input type="text" name="ss" size="12" value="0" onBlur="calc_ws()" onKeyUp="if(event.keyCode==13) myform.jsr.focus()"> 
              (元)<font color="#FF0000">*</font> </td> 
            <td align="center">经 手 人:</td> 
            <td> <input name="jsr" type="text" value="" size="12" onKeyUp="if(event.keyCode==13) myform.save.focus()"> 
              <font color="#FF0000">*</font> </td> 
          </tr> 
        </table></td> 
    </tr> 
    <tr bgcolor="#CCE3FF"> 
      <td nowrap align="center" height="37"><input name="save" type="button" class="btn_grey" id="save" onClick="send()" value="确定退货"> 
&nbsp; 
        <input name="cancel" type="reset" class="btn_grey" id="cancel" value="取消操作"> </td> 
    </tr> 
  </table> 
</form> 
<!--#include file="../Bottom.asp"--> 
</body>
</html>

⌨️ 快捷键说明

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