📄 sprk.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/sell.asp" -->
<!--#include file="../Fun_JS.asp" -->
<%'查询商品信息
set rsspname = Server.CreateObject("ADODB.Recordset")
sql_sp= "SELECT * FROM dbo.tab_brand"
set rsspname=conn.execute(sql_sp)
%>
<%'查询最大的入库票号
set rsautono = Server.CreateObject("ADODB.Recordset")
sql_max = "SELECT MAX(ID) AS MAXID FROM dbo.tab_ruku"
rsautono.open sql_max,conn,1,3
%>
<%
rsspname.movefirst
varspname = rsspname("ID")
if (Request.Form("selectsp") <> "") then varspname = Request.Form("selectsp")
%>
<%
set rs = Server.CreateObject("ADODB.Recordset")
sql_rs= "SELECT * FROM dbo.tab_brand WHERE ID='"&varspname&"'"
rs.open sql_rs,conn,1,3
%>
<html>
<head>
<title>网上商品交易系统——商品入库!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<% '自动生成入库票号
Dim no,valno,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="RK"+Cstr(year(date()))+cmonth+cday+cno
session("autonum")=intno
%>
<script language="JavaScript">
function check()
{if (form1.spname.value=="")
{alert("请选择入库商品的名称!");form1.spname.focus();return;}
if (form1.jc.value=="")
{alert("请输入简称!");form1.jc.focus();return;}
if (form1.cd.value=="")
{alert("请输入产地!");form1.cd.focus();return;}
if (form1.gg.value=="")
{alert("请输入商品的规格!");form1.gg.focus();return;}
if (form1.bz.value=="")
{alert("请输入商品的包装!");form1.bz.focus();return;}
if (form1.sl.value==0)
{ alert("请输入数量!");form1.sl.focus();return;}
str=form1.sl.value;
if(isNaN(str))
{alert("您输入的不是有效值(请输入0-9之间的数)!");form1.sl.focus();return;}
if (form1.dj.value==0)
{ alert("请输入单价!");form1.dj.focus();return;}
str=form1.dj.value;
if(isNaN(str))
{alert("您输入的不是有效值(请输入0-9之间的数)!");form1.dj.focus();return;}
if (form1.dw.value=="")
{alert("请输入单位!");form1.dw.focus();return;}
str=form1.sf.value;
if(isNaN(str))
{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.rkdate.value))
{alert("请输入标准日期(如:2004/07/27或2004-07-27)");form1.rkdate.focus();return;}
form1.je.value=form1.dj.value*form1.sl.value;
form2.hspid.value=form1.spid.value;
form2.hspname.value=form1.spname.value;
form2.hjc.value=form1.jc.value;
form2.hcd.value=form1.cd.value;
form2.hgysname.value=form1.gysname.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.hwf.value=form1.wf.value;
form2.hsf.value=form1.sf.value;
form2.hczy.value=form1.czy.value;
form2.hjsr.value=form1.jsr.value;
form2.hrkdate.value=form1.rkdate.value;
form2.hjsfs.value=form1.jsfs.value;
form2.hid.value=form1.id.value;
form2.submit();
}
</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 (eval(form1.sf.value)>eval(form1.yf.value)){
alert("实付金额不应大于应付金额!");form1.sf.focus();return;}}
</script>
<link href="../style.css" rel="stylesheet">
<style type="text/css">
<!--
.style1 {color: #0099ff}
-->
</style>
</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="sprk.asp">
<table width="446" align="center">
<tr>
<td>
<select name="selectsp" onchange="JScript:form1.submit();">
<option value="myempty" selected>请选择入库商品的商品名称:</option>
<%While NOT rsspname.EOF %>
<option value="<%=rsspname("ID")%>" ><%=rsspname("spname")%></option>
<% rsspname.MoveNext()
Wend%>
</select>
<font color="#00CCFF">注:带*号项为必填项。</font>
</td>
</tr>
</table>
<table align="center" width="446">
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">入库编号:</div>
</td>
<td colspan="3"><font color="#0099FF"><%=session("autonum")%>
<input type="hidden" name="spid" value="<%=session("autonum")%>">
<input type="hidden" name="id" value="<%=rs("ID")%>">
</font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">商品名称:</div>
</td>
<td width="164"> <font color="#0099FF"> <%=rs("spname")%>
<input type="hidden" name="spname" value="<%=rs("spname")%>">
</font></td>
<td width="64">简 称:</td>
<td width="126"><font color="#0099ff"><%=rs("jc")%></font>
<input type="hidden" name="jc" value="<%=rs("jc")%>">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">规 格:</div>
</td>
<td width="164"><font color="#0099ff">
<input type="hidden" name="gg" value="<%=rs("gg")%>">
<font color="#0099FF"><%=rs("gg")%></font> </Font></td>
<td width="64">包 装:</td>
<td width="126"><font color="#0099ff"><%=rs("bz")%></font>
<input type="hidden" name="bz" value="<%=rs("bz")%>">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">供应商全称:</div>
</td>
<td width="164"><font color="#0099ff"><%=rs("gysname")%></font>
<input type="hidden" name="gysname" value="<%=rs("gysname")%>">
</td>
<td width="64">产 地:</td>
<td width="126"><font color="#0099ff"><%=rs("cd")%></font>
<input type="hidden" name="cd" value="<%=rs("cd")%>">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">数 量:</div>
</td>
<td width="164">
<input type="text" name="sl" value="0" size="12" onChange="autoje()">
<font color="#0099ff">(<%=trim(rs("dw"))%>)</font><font color="#00CCFF"> *</font>
<input type="hidden" name="dw" value="<%=rs("dw")%>">
</td>
<td width="64">金 额:</td>
<td width="126">
<input type="text" name="je" value="0" size="12" disabled=".f.">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">单 价:</div>
</td>
<td width="164">
<input type="text" name="dj" value="0" size="12" onChange="autoje()">
<span class="style1">(元)</span><font color="#00CCFF">*</font> </td>
<td width="64">应 付:</td>
<td width="126">
<input type="text" name="yf" size="12" value="0" disabled=".f.">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">实 付:</div>
</td>
<td width="164">
<input type="text" name="sf" size="12" value="0" onblur="autoje()">
<font color="#00CCFF">*</font> </td>
<td width="64">未 付:</td>
<td width="126">
<input type="text" name="wf" size="12" value="0" disabled=".f.">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">操作员:</div>
</td>
<td width="164">
<input type="text" name="czy" value="<%=session("UserID")%>" size="12" readonly="yes">
<font color="#00CCFF">*</font> </td>
<td width="64">经手人:</td>
<td width="126">
<input type="text" name="jsr" size="12">
<font color="#00CCFF">*</font> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" width="72">
<div align="left">入库日期:</div>
</td>
<td width="164">
<input type="text" name="rkdate" value="<%=date()%>" size="12">
<font color="#00CCFF">*</font> </td>
<td width="64">结算方式:</td>
<td width="126">
<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="center"></div>
</td>
</tr>
</table>
</form>
<table width="590" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td>
<form name="form2" method="post" action="./rkaddok.asp">
<div align="center">
<input type="hidden" name="hspid">
<input type="hidden" name="hspname">
<input type="hidden" name="hjc">
<input type="hidden" name="hcd">
<input type="hidden" name="hgysname">
<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="hrkdate">
<input type="hidden" name="hjsfs">
<input type="hidden" name="hyf">
<input type="hidden" name="hwf">
<input type="hidden" name="hsf">
<input type="button" name="Button" value="保存" onclick="check()">
<input type="reset" name="Reset" value="重填" onclick= "JScript:form1.reset();">
<input type="hidden" name="hid">
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -