- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
baosun.asp
资源名称:4s.rar [点击查看]
上传用户:apresys
上传日期:2021-03-30
资源大小:813k
文件大小:22k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
DOS
- <!--#include file="conn.asp"-->
- <!--#include file="checkuser.asp"-->
- <html>
- <head>
- <title>∷汽车4S店配件仓储管理系统:.</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>
- <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}
- -->
- </style>
- <SCRIPT LANGUAGE=javascript>
- <!--
- function Juge(powersearch)
- {
- if (powersearch.pinming.value == "")
- {
- alert("名称不能为空!");
- powersearch.pinming.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("classnumber")%>';
- po_ca_value[<%=i%>] = '<%=rs1("classnumber")%>';
- po_detail_show[<%=i%>] = new Array();
- po_detail_value[<%=i%>] = new Array();
- <%
- classnumber=rs1("classnumber")
- set rs2=server.createobject("adodb.recordset")
- rs2.open "select * from store where class='"&classnumber&"' 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("number")%> | <%=rs2("price")%> | <%=rs2("unit")%>';
- po_detail_value[<%=i%>][<%=j%>] = '<%=rs2("id")%>|<%=rs2("Material_id")%>';
- <%
- 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
- sub SaveAdd
- Loan_num=request.Form("Loan_num")
- pinming=trim(request.Form("pinming"))
- names=Split(pinming,"|")
- id=names(0)
- Material_id=names(1)
- Set rs99 = server.CreateObject("adodb.recordset")
- sql99 = "select * from material where Id=" & Material_id
- rs99.Open sql99, conn, 1, 1
- if not rs99.eof then
- pinming = rs99("pinming")
- guige=rs99("guige")
- unit=rs99("unit")
- end if
- rs99.Close
- Set rs99 = Nothing
- show=0
- set rs=server.createobject("adodb.recordset")
- sql="select * from storage where storage='"&request.Form("storage")&"'"
- rs.open sql,conn,1,3
- if not rs.eof then
- Material_ids=Split(rs("Material_id"),"|")
- nums=Split(rs("num"),"|")
- for i=0 to UBound(Material_ids)
- if Material_ids(i)<>"" then
- if clng(Material_ids(i))=clng(Material_id) then
- id0=id0&Material_ids(i)&"|"
- n=cdbl(nums(i))-cdbl(request.Form("Loan_num"))
- if n<0 then
- response.Write "<script language=javascript>alert('对不起该仓位存货不足!');</script>"
- response.write "<meta http-equiv=""refresh"" content=""0;url=baosun.asp"">"
- response.end
- end if
- num0=num0&n&"|"
- show=1
- else
- id0=id0&Material_ids(i)&"|"
- num0=num0&nums(i)&"|"
- end if
- end if
- next
- rs("Material_id") = id0
- rs("num") = num0
- rs.update
- end if
- rs.close
- set rs=nothing
- if show=0 then
- response.Write "<script language=javascript>alert('对不起该仓位没存放需报损配件!');</script>"
- response.write "<meta http-equiv=""refresh"" content=""0;url=baosun.asp"">"
- response.end
- end if
- set rs=server.createobject("adodb.recordset")
- sql="select * from store where id="&id&""
- rs.open sql,conn,1,3
- if not rs.eof then
- if rs("number")-Loan_num<0 then
- response.Write "<script language=javascript>alert('对不起,库存不足,请调整您的报损量!');</script>"
- response.write "<meta http-equiv=""refresh"" content=""0;url=baosun.asp"">"
- response.end
- else
- rs("number")=rs("number")-Loan_num
- rs.update
- end if
- end if
- rs.close
- set rs=nothing
- set rs=server.createobject("adodb.recordset")
- sql="select * from baosun"
- rs.open sql,conn,1,3
- rs.addnew
- rs("class") = trim(request.Form("d_position1"))
- rs("Material_id") = Material_id
- rs("guige") = guige
- rs("pinming") = pinming
- rs("uptime") = request.Form("uptime")
- rs("Unit") = unit
- rs("Loan_num") = Loan_num
- rs("content") = trim(request.Form("content"))
- rs("storage") = request.Form("storage")
- rs.update
- response.Write "<script language=javascript>alert('报损成功!');</script>"
- response.write "<meta http-equiv=""refresh"" content=""0;url=baosun.asp"">"
- response.end
- rs.close
- set rs=nothing
- end sub
- sub SaveModify
- old_num=request.Form("old_num")
- Loan_num=request.Form("Loan_num")
- num= old_num-Loan_num
- Material_id=request.Form("Material_id")
- set rs=server.createobject("adodb.recordset")
- sql="select * from store where Material_id="&Material_id&""
- rs.open sql,conn,1,3
- if not rs.eof then
- if rs("number")+num<0 then
- response.Write "<script language=javascript>alert('对不起,库存不足,请调整您的报损量!');</script>"
- response.write "<meta http-equiv=""refresh"" content=""0;url=baosun.asp"">"
- response.end
- else
- rs("number")=rs("number")+num
- rs.update
- end if
- end if
- rs.close
- set rs=nothing
- set rs=server.createobject("adodb.recordset")
- sql="select * from baosun where id="&request.Form("id")
- rs.open sql,conn,1,3
- rs("Loan_num") = Loan_num
- rs("content") = trim(request.Form("content"))
- rs.update
- response.Write "<script language=javascript>alert('修改成功!');</script>"
- response.write "<meta http-equiv=""refresh"" content=""0;url=baosun.asp"">"
- response.end
- rs.close
- set rs=nothing
- end sub
- sub delCate()
- conn.execute("delete from baosun where id in ("&Request.Form("selBigClass")&")")
- response.Write "<script language=javascript>alert('删除成功!');</script>"
- response.write "<meta http-equiv=""refresh"" content=""0;url=baosun.asp"">"
- response.end
- end sub
- %> <% sub myform(isEdit) %>
- <TABLE width=800 align=center border="1" cellspacing="0" bordercolor="#D6D3CE">
- <TBODY>
- <TR>
- <td align="center" valign="top"> <%if oskey="supper" or oskey="admin" then%>
- <fieldset style="width:98%"><legend>
- <%
- if isedit then
- set rs=server.createobject("adodb.recordset")
- rs.open "select * from baosun where id=" & request("id"),conn,1,1
- response.write "编辑报损信息"
- else
- response.write "添加报损信息"
- end if %></legend>
- <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
- <tr class="but">
- <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">报损日期</td>
- <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类 别</td>
- <td width="45%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">配件名称 | 车 型 | 剩余数量 | 采购单价 | 计量单位</td>
- <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">报损数量</td>
- <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">备 注</td>
- <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">报损仓位</td>
- </tr>
- <form name="powersearch" method="post" action="baosun.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")%>">
- <input type="Hidden" name="storage" value="<%=rs("storage")%>">
- <input type="Hidden" name="Material_id" value="<%=rs("Material_id")%>"><% End If %>
- <td height="18" align="center">
- <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>
- <select name='d_position1' onchange='Do_po_Change(this);' valign=top style='width:90'<% if isedit then%> disabled="disabled"<%end if%>>
- <% 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("classnumber")%>"><%=rs1("classnumber")%></option>
- <%
- rs1.movenext
- loop
- end if
- rs1.close
- set rs1=nothing
- %></select></td>
- <td align="center">
- <select name='pinming' size=1 style='width:300'<% if isedit then%> disabled="disabled"<%end if%>>
- <% if isedit then%>
- <option selected="selected" value="0|<%=rs("pinming")%>|<%=rs("guige")%>|<%=rs("Loan_num")%>|<%=rs("unit")%>"><%=rs("pinming")%></option>
- <input type="hidden" value="<%=rs("Loan_num")%>" name="old_num">
- <%else%>
- <option>--请选择--</option>
- <%end if%>
- </select>
- </td>
- <td><input name="Loan_num" type="text" size="10" value='<% if isedit then
- response.write rs("Loan_num")
- end if %>'></td>
- <td align="center"><input name="content" type="text" size="20" value='<% if isedit then
- response.write rs("content")
- end if %>'></td>
- <td>
- <select name='storage' style='width:70'<% if isedit then%> disabled="disabled"<%end if%>>
- <% if isedit then%>
- <option selected="selected"><%=rs("storage")%></option>
- <%end if%>
- <%
- set rs1=server.createobject("adodb.recordset")
- rs1.open "select * from storage order by storage",conn,1,1
- if not rs1.eof then
- do while not rs1.eof
- %>
- <option value="<%=rs1("storage")%>"><%=rs1("storage")%></option>
- <%
- rs1.movenext
- loop
- end if
- rs1.close
- set rs1=nothing
- %></select></td></tr>
- <tr>
- <td colspan="8" align="center"><input type="submit" value="<% if isedit then
- response.write "编辑"
- else
- response.write "添加"
- end if %>"> </td>
- </tr></form>
- </table>
- </fieldset><%end if%>
- <TABLE cellSpacing=1 cellPadding=0 width="100%" border=0 >
- <TR>
- <TD height="25" align="center">报 损 配 件 列 表</TD>
- </TR>
- </TABLE>
- <form action="baosun.asp" method="post" name="selform" >
- <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8" align="center">
- <tr>
- <td width="100%" align="center" valign="top">
- <fieldset style="width:100%">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
- <tr class="but">
- <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">报损日期</td>
- <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类 别</td>
- <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">配件名称</td>
- <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">车 型</td>
- <td width="6%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">单 位</td>
- <td width="8%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">报损数量</td>
- <td width="8%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">仓 位</td>
- </tr>
- <%
- PageShowSize = 10 '每页显示多少个页
- MyPageSize = 20 '每页显示多少条
- If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
- MyPage=1
- Else
- MyPage=Int(Abs(Request("page")))
- End if
- set rs=server.CreateObject("ADODB.RecordSet")
- search=request("search")
- if search<>"" then
- class1=request("class")
- keyword=request("keyword")
- rs.Source="select * from baosun where class like '%"&class1&"%' and pinming like '%"&keyword&"%' order by -id"
- else
- rs.Source="select * from baosun order by -id"
- end if
- rs.Open rs.Source,conn,1,1
- if not rs.EOF then
- rs.PageSize = MyPageSize
- MaxPages = rs.PageCount
- rs.absolutepage = MyPage
- total = rs.RecordCount
- for i=1 to rs.PageSize
- if not rs.EOF then
- %>
- <tr><td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="selBigClass" type="checkbox" id="selBigClass" value="<%=rs("ID")%>"><a href="baosun.Asp?id=<%=rs("ID")%>&action=edit"><%=rs("uptime")%></a></td>
- <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("class")%><%if rs("class")="" then%> <%end if%></td>
- <td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> <a href="baosun.Asp?id=<%=rs("ID")%>&action=edit"><%=rs("pinming")%></a></td>
- <td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> <%=rs("guige")%></td>
- <td height="18" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"> <%=rs("unit")%></td>
- <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("Loan_num")%><%if rs("Loan_num")="" then%> <%end if%></td>
- <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("storage")%></td>
- </tr>
- <%
- rs.MoveNext
- end if
- next
- end if
- %>
- <tr><td align="right" colspan="10" height="22">
- 共 <%=total%> 条,当前第 <%=Mypage%>/<%=Maxpages%>
- 页,每页 <%=MyPageSize%> 条
- <%
- if search<>"" then
- url="baosun.asp?class="&class1&"&keyword="&keyword&"&search=search&"
- else
- url="baosun.asp?"
- end if
- PageNextSize=int((MyPage-1)/PageShowSize)+1
- Pagetpage=int((total-1)/rs.PageSize)+1
- if PageNextSize >1 then
- PagePrev=PageShowSize*(PageNextSize-1)
- Response.write "<a class=black href='" & Url & "page=" & PagePrev & "' title='上" & PageShowSize & "页'>上一翻页</a> "
- Response.write "<a class=black href='" & Url & "page=1' title='第1页'>页首</a> "
- end if
- if MyPage-1 > 0 then
- Prev_Page = MyPage - 1
- Response.write "<a class=black href='" & Url & "page=" & Prev_Page & "' title='第" & Prev_Page & "页'>上一页</a> "
- end if
- if Maxpages>=PageNextSize*PageShowSize then
- PageSizeShow = PageShowSize
- Else
- PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
- End if
- If PageSizeShow < 1 Then PageSizeShow = 1
- for PageCounterSize=1 to PageSizeShow
- PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
- if PageLink <> MyPage Then
- Response.write "<a class=black href='" & Url & "page=" & PageLink & "'>[" & PageLink & "]</a> "
- else
- Response.Write "<B>["& PageLink &"]</B> "
- end if
- If PageLink = MaxPages Then Exit for
- Next
- if Mypage+1 <=Pagetpage then
- Next_Page = MyPage + 1
- Response.write "<a class=black href='" & Url & "page=" & Next_Page & "' title='第" & Next_Page & "页'>下一页</A>"
- end if
- if MaxPages > PageShowSize*PageNextSize then
- PageNext = PageShowSize * PageNextSize + 1
- Response.write " <A class=black href='" & Url & "page=" & Pagetpage & "' title='第"& Pagetpage &"页'>页尾</A>"
- Response.write " <a class=black href='" & Url & "page=" & PageNext & "' title='下" & PageShowSize & "页'>下一翻页</a>"
- End if
- rs.Close
- set rs=nothing
- %> <%if oskey="supper" or oskey="admin" then%>
- <input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()"> 选择/反选
- <input onClick="{if(confirm('此操作将删除该信息!nn为了数据的一致,请先把报损数量修改为0再删除nn确定要执行此项操作吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=删除 name=action2>
- <input type="Hidden" name="action" value='del'><%end if%></td></tr>
- </table>
- </fieldset>
- </td>
- </tr>
- <tr>
- <td height="50" colspan="3" align="center">
- </td>
- </tr>
- </table>
- </form><br>
- <fieldset style="width:80%"><legend>报损搜索</legend>
- <table width="90%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
- <form name="search" method="post" action="baosun.asp">
- <tr><input name="search" type="hidden" value="search">
- <td height="18" align="center" width="20%">
- <select name="class" size="1">
- <option value="">所有分类</option>
- <%
- set rs2=server.createobject("adodb.recordset")
- rs2.open "select * from class",conn,1,1
- if not rs2.eof then
- do while not rs2.eof
- classnumber=rs2("classnumber")
- %>
- <option value="<%=rs2("classnumber")%>"><%=rs2("classnumber")%></option>
- <%
- rs2.movenext
- loop
- end if
- rs2.close
- set rs2=nothing
- %></select></td>
- <td align="center" width="65%">配件名称关键字: <input name="keyword" type="text" size="25"> 关键字为空则搜索所有</td>
- <td align="center" width="15%" ><input type="submit" value="查 找"> </td>
- </tr></form>
- </TD>
- </TR>
- </table>
- </fieldset>
- <table width="100%" border="0" cellspacing="0" cellpadding="4">
- </table>
- </TBODY>
- </TABLE>
- <%end sub%>
- <P>
- <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
- <TBODY>
- <TR vAlign=center>
- <TD align=middle width="100%"><!--#include file="footer.htm"--></TD>
- </TR></TBODY></TABLE></P></BODY></HTML>