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

📄 baosun.asp

📁 汽车4s店库存管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -