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

📄 sprk.asp

📁 企业进销存管理系统
💻 ASP
字号:
<!--#include file="cart_rk.asp"-->
<%
yf=0
wf=0
set conn=server.createobject("adodb.connection")
conn.open application("dsn")
%>
<%'显示商品信息
set rs_sp=server.createobject("adodb.recordset")
sql="select spname from tab_spinfo 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_spinfo where spname='"&defaultSP&"'"
rs_gg1.open sql,conn,1,3
defaultGG=rs_gg1("gg")
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_SL>=0 then 
	if isarray(session("arr_rk")) then
		arr=session("arr_rk")
		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_rk")=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="sprk.asp?SPname="+value;
	window.location.href=url;
}
function changeGG(value){
	url="sprk.asp?GG="+value+"&SPname="+myform.spname.value;
	window.location.href=url;
}
function send(){
	if(myform.jsr.value==""){
	alert("请输入经手人!");myform.jsr.focus();return;
	}
	if(myform.yf.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="sprk_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=<%=sprk%>></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_rk")) then
arr=session("arr_rk")
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_spinfo 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='sprk.asp';</script>")
		session("arr_rk")=""
		response.End()
	else
		arr_spname=arr_rs("spname")
		arr_gg=arr_rs("GG")
		yf=yf+arr_dj*arr_sl
		wf=yf
%>
          <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.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>
                <%
			  GG_Q=request.QueryString("GG")
			  set rs_select=server.CreateObject("ADODB.RecordSet")
			  sql="select * from tab_spinfo where spname='"&trim(spname)&"'"
			  rs_select.open sql,conn,1,3	%>		
			<select name="GG" id="select5" onChange="changeGG(this.value)">
			 <% while not rs_select.eof
			  gg=rs_select("gg")
			  if GG_Q="" then 
			  		GG_Q=gg
					dw=defaultdw
			  End if %>
                <option value="<%=gg%>"<%if GG_Q=gg then%> selected <%end if%>><%=gg%></option>
			 <%rs_select.movenext
			 wend%>
            </select></td>
            <%
			  set rs_GG=server.CreateObject("ADODB.RecordSet")
			  sql="select * from tab_spinfo where spname='"&spname&"' and gg='"&GG_Q&"'"
			  rs_GG.open sql,conn,1,3
			  spID=trim(rs_GG("id"))
			  dw=rs_GG("dw")
		  %>
            <td align="center"><input name="dj" type="text" id="dj" value="0" size="12" ></td>
            <td align="center"><input name="sl" type="text" id="sl" value="0" size="5" onKeyDown="if(event.keyCode==13) sprk()">              <font color="#0099ff">[ <%=dw%>]
                
              </font></td>
            <script language="javascript">
			function sprk(){
				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="sprk.asp?SPID="+FSPID+"&DJ="+FDJ+"&SL="+FSL;
				window.location.href=url;
			}
			</script>
            <td align="center"><input name="Submit2" type="button" class="btn_grey" onClick="sprk();" value="入库"></td>
          </tr>
      </table>
        <font color="#0099ff">
        <input name="spid" type="hidden" id="spid" value="<%=spID%>">
      </font></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="yf" type="text" readonly="yes" id="yf" value="<%=yf%>" size="12">            
            (元) </td>
            <td width="14%" align="center">未  付:</td>
            <td width="23%"><input name="wf" type="text" id="wf" value="<%=wf%>" size="12" readonly="yes">
            (元)</td>
          </tr>
          <tr>
            <td height="30" align="center" nowrap> 实  付:</td>
            <script language="javascript">
			function calc_wf(){
			if(isNaN(myform.wf.value)){
				alert("您输入的实收金额有误!");
				myform.sf.focus();
				return;
			}
			myform.wf.value=myform.yf.value-myform.sf.value;
			}
			</script>
            <td><input type="text" name="sf" size="12" value="0" onBlur="calc_wf()" 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 + -