![]() |
#2
yeyuge2012-04-11 10:07
sub SaveAdd class1=request.Form("d_position1") pinming=request.Form("pinming") names=Split(pinming,"|") pinming=names(0) guige=names(1) unit=names(2) set rs1=server.createobject("adodb.recordset") if guige="" then sql1="select * from yuanliao_store where pinming='"&pinming&"'" else sql1="select * from yuanliao_store where pinming='"&pinming&"' and guige='"&guige&"'" end if rs1.open sql1,conn,1,3 if not rs1.eof and not rs1.bof then rs1("number")=rs1("number")+request.Form("use_num") else rs1.addnew rs1("class") = trim(request.Form("d_position1")) rs1("Unit") = unit rs1("guige") = guige rs1("pinming") = pinming rs1("number")=request.Form("use_num") end if rs1.update rs1.close set rs1=nothing set rs=server.createobject("adodb.recordset") sql="select * from yuanliao_in_store" rs.open sql,conn,1,3 rs.addnew rs("class") = trim(request.Form("d_position1")) rs("guige") = guige rs("pinming") = pinming rs("uptime") = request.Form("uptime") rs("Unit") = unit rs("Supplier") = trim(request.Form("Supplier")) rs("use_num") = request.Form("use_num") rs("ghfph") = request.Form("ghfph") rs("caigou") = request.Form("caigou") rs("cgjcsqdh") = request.Form("cgjcsqdh") rs("cgddh") = request.Form("cgddh") rs("sltzdh") = request.Form("sltzdh") rs("jincbh") = request.Form("jincbh") rs("shencs") = request.Form("shencs") rs("wuliaobm") = request.Form("wuliaobm") rs("pihao") = request.Form("pihao") rs("beizhu") = trim(request.Form("beizhu")) rs("content") = trim(request.Form("content")) rs.update response.Write "<script language=javascript>alert('入库成功!');</script>" response.write "<meta http-equiv=""refresh"" content=""0;url=yuanliao_in_store.asp"">" response.end rs.close set rs=nothing end sub sub SaveModify class1=request.Form("d_position1") pinming=request.Form("pinming") names=Split(pinming,"|") pinming=names(0) guige=names(1) unit=names(2) num=names(3) num0=request.Form("use_num") num1=num-num0 set rs1=server.createobject("adodb.recordset") if guige="" then sql1="select * from yuanliao_store where pinming='"&pinming&"'" else sql1="select * from yuanliao_store where pinming='"&pinming&"' and guige='"&guige&"'" end if rs1.open sql1,conn,1,3 if not rs1.eof and not rs1.bof then rs1("number")=rs1("number")-num1 end if rs1.update rs1.close set rs1=nothing set rs=server.createobject("adodb.recordset") sql="select * from yuanliao_in_store where id="&request.Form("id") rs.open sql,conn,1,3 rs("class") = trim(request.Form("d_position1")) rs("guige") = guige rs("pinming") = pinming rs("Unit") = unit rs("uptime") = request.Form("uptime") rs("Supplier") = trim(request.Form("Supplier")) rs("use_num") = request.Form("use_num") rs("ghfph") = request.Form("ghfph") rs("caigou") = request.Form("caigou") rs("cgjcsqdh") = request.Form("cgjcsqdh") rs("cgddh") = request.Form("cgddh") rs("sltzdh") = request.Form("sltzdh") rs("jincbh") = request.Form("jincbh") rs("shencs") = request.Form("shencs") rs("wuliaobm") = request.Form("wuliaobm") rs("pihao") = request.Form("pihao") rs("beizhu") = trim(request.Form("beizhu")) rs("content") = trim(request.Form("content")) rs.update response.Write "<script language=javascript>alert('修改成功!');</script>" response.write "<meta http-equiv=""refresh"" content=""0;url=yuanliao_in_store.asp"">" response.end rs.close set rs=nothing end sub sub delCate() conn.execute("delete from yuanliao_in_store where id in ("&Request.Form("selBigClass")&")") response.Write "<script language=javascript>alert('删除成功!');</script>" response.write "<meta http-equiv=""refresh"" content=""0;url=yuanliao_in_store.asp"">" response.end end sub %> <% sub myform(isEdit) %> <TABLE width=800 align=center border="1" cellspacing="0" cellpadding="0" bordercolor="#0055E6"> <TBODY> <TR> <td align="center" valign="top"> <%if oskey="supper" or oskey="yuanliao" then%> <% if isedit then set rs=server.createobject("adodb.recordset") rs.open "select * from yuanliao_in_store where id=" & request("id"),conn,1,1 %> <table width="800" border="0" cellpadding="0" cellspacing="0" > <tr > <td height=26 background="images/background.gif"> <b><font color="#ffffff">编 辑 原 料 入 库</font></b></td> </tr> </table> <% else %> <table width="800" border="0" cellpadding="0" cellspacing="0" > <tr > <td height=26 background="images/background.gif"> <b><font color="#ffffff">添 加 原 料 入 库</font></b> </td> </tr> </table> <%end if %> <table width="800" border="0" cellpadding="0" cellspacing="0" bordercolor="#0055E6"> <tr class="but"> <td width="12%" height="29" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">入库日期</td> <td width="10%" height="29" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类 别</td> <td width="28%" height="29" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">品 名 | 规 格 | 计量单位</td> <td width="25%" height="29" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">供货单位</td> <td width="25%" height="29" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">入库数量</td> </tr> <form name="powersearch" method="post" action="yuanliao_in_store.asp" onSubmit="return Juge(this)" > <tr> <input type="Hidden" name="action" value='<% If isedit then%>modify<% Else %>add<% End If %>'> <% If isedit then%><input type="Hidden" name="id" value="<%=rs("id")%>"> <% End If %> <td height="33" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"> <input name="uptime" onFocus="show_cele_date(uptime,'','',uptime)" type="text" size="10" value='<% if isedit then response.write rs("uptime") else response.write date() end if %>'></td> <td height="33" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"> <select name='d_position1' onchange='Do_po_Change(this);' valign=top style='width:90'> <% if isedit then%> <option selected="selected"><%=rs("class")%></option> <%else%> <option selected value='0000'>请选择类别</option> <%end if%> <% set rs1=server.createobject("adodb.recordset") rs1.open "select * from class",conn,1,1 if not rs1.eof then do while not rs1.eof %> <option value="<%=rs1("classname")%>"><%=rs1("classname")%></option> <% rs1.movenext loop end if rs1.close set rs1=nothing %></select></td> <td height="33" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"> <select name='pinming' size=1 style='width:200'> <% if isedit then%> <option selected="selected" value="<%=rs("pinming")%>|<%=rs("guige")%>|<%=rs("unit")%>|<%=rs("use_num")%>"><%=rs("pinming")%> | <%=rs("guige")%> | <%=rs("unit")%></option> <%else%> <option>--请选择--</option> <%end if%> </select> </td> <td height="33" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><select name="Supplier" size="1" style='width:200'> <% if isedit then%><option ><%=rs("Supplier")%></option><%end if%> <% set rs3=server.createobject("adodb.recordset") rs3.open "select * from Supplier",conn,1,1 if not rs3.eof then do while not rs3.eof %> <option <% if isedit then if trim(rs3("Supplier_name"))=trim(rs("Supplier")) then %> selected="selected"<%end if%><%end if%>><%=rs3("Supplier_name")%></option> <% rs3.movenext loop end if rs3.close set rs3=nothing %> </select> </td> <td height="33" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><input name="use_num" type="text" size="10" value='<% if isedit then response.write rs("use_num") end if %>'></td> </tr> <tr class="but"> <td height="16" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> </td> <td height="16" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> </td> <td height="16" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> </td> <td height="16" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> </td> <td height="16" colspan="2" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> </td> </tr> <tr class="but"> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">购货发票号</td> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">采购方式</td> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">采购检测申请单号</td> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">采购订单号</td> <td height="36" colspan="2" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">收料通知单号</td> </tr> <tr class="but"> <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="ghfph" type="text" size="10" value='<% if isedit then response.write rs("ghfph") end if %>'></td> <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="caigou" type="text" id="caigou" size="10" value='<% if isedit then response.Write rs("caigou") end if %>'></td> <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="cgjcsqdh" type="text" id="cgjcsqdh" size="10" value='<% if isedit then response.Write rs("cgjcsqdh") end if %>'></td> <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="cgddh" type="text" id="cgddh" size="10" value='<% if isedit then response.Write rs("cgddh") end if %>'></td> <td height="18" colspan="2" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="sltzdh" type="text" id="sltzdh" size="10" value='<% if isedit then response.Write rs("sltzddh") end if %>'></td> </tr> <tr class="but"> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">进厂编号</td> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">生产商</td> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">物料编码</td> <td height="36" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">批号</td> <td height="36" colspan="2" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">保质期</td> </tr> <tr class="but"> <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="jincbh" type="text" id="jincbh" size="10" value='<% if isedit then response.write rs("jincbh") end if %>'></td> <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="shencs" type="text" id="shencs" size="10" value='<% if isedit then response.Write rs("shencs") end if %>'></td> <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="wuliaobm" type="text" id="wuliaobm" size="20" value='<% if isedit then response.Write rs("wuliaobm") end if %>'></td> |
Microsoft VBScript 编译器错误 '800a03f8'
缺少 'Sub'
\yuanliao_in_store.asp, line 507
end if
-----~
---------------------------------以上为调试错误---------------------------------------
代码如下:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim conn
Dim conn_numRows
Set conn = Server.CreateObject("ADODB.Recordset")
conn.ActiveConnection = MM_conn_STRING
conn.Source = "SELECT * FROM yuanliao_In_Store ORDER BY ID DESC"
conn.CursorType = 0
conn.CursorLocation = 2
conn.LockType = 1
conn.Open()
conn_numRows = 0
%>
<!--#include file="conn.asp"-->
<!--#include file="checkuser.asp"-->
<html>
<head>
<title>∷企业生产管理信息系统∷</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/main.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript src="css/User_Info_Modify.js"></SCRIPT>
<SCRIPT language=javascript src="js/selectcity.js"></script>
<script language="JavaScript" src="js/validate.js" type="text/JavaScript"></script>
<SCRIPT language=javascript src="css/init.js"></SCRIPT>
<style type="text/css">
<!--
td { font-family: "宋体"; font-size: 9pt}
body { font-family: "宋体"; font-size: 9pt}
select { font-family: "宋体"; font-size: 9pt}
A {text-decoration: none; color: #336699; font-family: "宋体"; font-size: 9pt}
A:hover {text-decoration: underline; color: #FF0000; font-family: "宋体"; font-size: 9pt}
.STYLE1 {color: #FFFFFF}
-->
</style>
<SCRIPT LANGUAGE=javascript>
<!--
function Juge(powersearch)
{
if (powersearch.use_num.value == "")
{
alert("数量不能为空!");
powersearch.use_num.focus();
return (false);
}
}
function SelectAll() {
for (var i=0;i<document.selform.selBigClass.length;i++) {
var e=document.selform.selBigClass[i];
e.checked=!e.checked;
}
}
//-->
</script>
<script>
var po_ca_show = new Array();
var po_ca_value = new Array();
var po_detail_show = new Array();
var po_detail_value = new Array();
var funtype1;
//Modified by Ryan Gao 2006-03-30 16:01:09
<%
i=0
set rs1=server.createobject("adodb.recordset")
rs1.open "select * from class",conn,1,1
if not rs1.eof then
do while not rs1.eof
j=0
%>
po_ca_show[<%=i%>] = '<%=rs1("classname")%>';
po_ca_value[<%=i%>] = '<%=rs1("classname")%>';
po_detail_show[<%=i%>] = new Array();
po_detail_value[<%=i%>] = new Array();
<%
classname=rs1("classname")
set rs2=server.createobject("adodb.recordset")
rs2.open "select * from Material where class='"&classname&"' order by pinming",conn,1,1
if not rs2.eof then
do while not rs2.eof
%>
po_detail_show[<%=i%>][<%=j%>] = '<%=rs2("pinming")%> | <%=rs2("guige")%> | <%=rs2("unit")%>';
po_detail_value[<%=i%>][<%=j%>] = '<%=rs2("pinming")%>|<%=rs2("guige")%>|<%=rs2("unit")%>';
<%
rs2.movenext
j=j+1
loop
else
%>
po_detail_show[<%=i%>][<%=j%>] = '此类暂无材料';
po_detail_value[<%=i%>][<%=j%>] = '';
<%
end if
rs2.close
set rs2=nothing
%>
<%
rs1.movenext
i=i+1
loop
end if
rs1.close
set rs1=nothing
%>
</script>
<script Language="JavaScript">
var psid="";
function DoLoad(form,funtypev){
var n;
var i,j,k;
var num;
num= GetObjID('funtype[]');
num1= GetObjID('pinming');
if (!funtypev)
return;
k=0;
for (i=0;i<po_ca_show.length;i++) {
for(j = 0; j < po_detail_value[i].length; j++){
if(funtypev.indexOf(po_detail_value[i][j])!=-1) {
NewOptionName = new Option(po_detail_show[i][j], po_detail_value[i][j]);
form.elements[num].options[k] = NewOptionName;
k++;
}
}
}
}
function Do_po_Change(form){
var num,n, i, m;
num= GetObjID('d_position1');
m = document.powersearch.elements[num].selectedIndex-1;
n = document.powersearch.elements[num + 1].length;
for(i = n - 1; i >= 0; i--)
document.powersearch.elements[num + 1].options[i] = null;
if (m>=0) {
for(i = 0; i < po_detail_show[m].length; i++){
NewOptionName = new Option(po_detail_show[m][i], po_detail_value[m][i]);
document.powersearch.elements[num + 1].options[i] = NewOptionName;
}
document.powersearch.elements[num + 1].options[0].selected = true;
}
}
function InsertItem(ObjID, Location)
{
len=document.powersearch.elements[ObjID].length;
for (counter=len; counter>Location; counter--)
{
Value = document.powersearch.elements[ObjID].options[counter-1].value;
Text2Insert = document.powersearch.elements[ObjID].options[counter-1].text;
document.powersearch.elements[ObjID].options[counter] = new Option(trimPrefixIndent(Text2Insert), Value);
}
}
function GetLocation(ObjID, Value)
{
total=document.powersearch.elements[ObjID].length;
for (pp=0; pp<total; pp++)
if (document.powersearch.elements[ObjID].options[pp].text == "---"+Value+"---")
{ return (pp);
break;
}
return (-1);
}
function GetObjID(ObjName)
{
for (var ObjID=0; ObjID < window.powersearch.elements.length; ObjID++)
if ( window.powersearch.elements[ObjID].name == ObjName )
{ return(ObjID);
break;
}
return(-1);
}
</script>
</HEAD>
<BODY topMargin=0 rightMargin=0 leftMargin=0>
<!--#include file="top.asp"-->
<%
select case request("action")
case "add"
call SaveAdd()
case "modify"
call SaveModify()
case "del"
call delCate()
case "edit"
isEdit=True
call myform(isEdit)
case else
isEdit=False
call myform(isEdit)
end select
由于帖子限制发帖字数,所以后面的代码接下楼!