📄 spcg.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/sell.asp" -->
<!--#include file="../Fun_JS.asp" -->
<%
'创建最大编号的记录集
set rsautono = Server.CreateObject("ADODB.Recordset")
sql_max= "SELECT MAX(ID) AS MAXID FROM dbo.tab_procure"
rsautono.open sql_max,conn,1,3
%>
<%
if request.Form("spname") <>"" then
ID=session("autonum")
spname=request.Form("spname")
cs=request.Form("cs")
gg=request.Form("gg")
bz=request.Form("bz")
dw=request.Form("dw")
dj=request.Form("dj")
sl=request.Form("sl")
je=request.Form("je")
cgdate=request.Form("cgdate")
memo=request.Form("memo")
sql_Ins="Insert into dbo.tab_procure values('"&ID&"','"&spname&"','"&cs&"','"&gg&"','"&_
bz&"','"&dw&"',"&dj&","&sl&","&je&",'"&cgdate&"','"&memo&"')"
conn.execute(sql_Ins)
response.Write("<script language='javascript'>")
response.Write("alert("""&"数据保存成功!"&""");")
response.Write("</script>")
end if
%>
<html>
<head>
<title>明日企业网上销售管理系统——商品采购!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
Dim no,valno,mymonth,cmonth,cday
no=trim(rsautono("MAXID"))
'将日期转换为YYYYMMDD格式的字符串
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="CG"+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.cs.value=="")
{alert("请输入厂商!");form1.cs.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;}
if(isNaN(form1.sl.value))
{alert("您输入的不是有效值(请输入0-9之间的数)!");form1.sl.focus();return;}
if (form1.je.value==0)
{ alert("请输入金额!");form1.je.focus();return;}
if(isNaN(form1.je.value))
{alert("您输入的不是有效值(请输入0-9之间的数)!");form1.je.focus();return;}
if (form1.dj.value==0)
{ alert("请输入单价!");form1.dj.focus();return;}
if(isNaN(form1.dj.value))
{alert("您输入的不是有效值(请输入0-9之间的数)!");form1.dj.focus();return;}
if (CheckDate(form1.cgdate.value))
{alert("您输入的日期不对!请输入标准日期(如:2002/09/27或2002-09-27)");
form1.cgdate.focus();return;}
form1.je.value=form1.dj.value*form1.sl.value;
form1.submit();
}
</script>
<Script language="Javascript">
function autoje(){
form1.je.value=form1.dj.value*form1.sl.value;}
</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="311">
<tr>
<td valign="top">
<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="265">
<tr>
<td valign="top">
<form method="POST" action="spcg.asp" name="form1">
<table align="center" width="439">
<tr valign="baseline">
<td nowrap align="right">采购单号:</td>
<td> <font color="#0099FF"><%=session("autonum") %></font>
<input type="hidden" name="ID" value="<% =session("autonum") %>" >
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">商品名称:</td>
<td>
<input type="text" name="spname" value="" size="46">
<font color="#00CCFF"> * </font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">厂 商:</td>
<td>
<input type="text" name="cs" value="" size="46">
<font color="#00CCFF"> *</font> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">规 格:</td>
<td>
<input type="text" name="gg" value="" size="46">
<font color="#00CCFF"> *</font> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">包 装:</td>
<td>
<input type="text" name="bz" value="" size="46">
<font color="#00CCFF"> *</font> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">单 位:</td>
<td>
<input type="text" name="dw" value="" size="46">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">单 价:</td>
<td> <font color="#00CCFF">
<input type="text" name="dj" value="0" onChange="autoje()" size="46">
*</font> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">数 量:</td>
<td> <font color="#00CCFF">
<input type="text" name="sl" value="0" onchange="autoje()" size="46">
*</font> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">金 额:</td>
<td>
<input type="text" name="je" value="0" size="46">
<font color="#00CCFF">*</font> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">采购日期:</td>
<td>
<input type="text" name="cgdate" value="<% =date()%>" size="13">
<font color="#00CCFF">*日期格式为:yyyy-mm-dd (2003-07-17)。 </font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">备 注:</td>
<td>
<input type="text" name="memo" value="" size="46">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" colspan="2">
<div align="center">
<input type="button" value="提交" onclick="check()">
<input type="reset" name="Submit" value="重填">
</div>
</td>
</tr>
</table>
</form>
<p> </p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -