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

📄 deliveryprintselect.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "po","read"
set objcheck=nothing

dim conn
dim rspo 
set conn=server.CreateObject("adodb.connection")
set rspo=server.CreateObject("adodb.recordset")
conn.Open connstring

%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>采购收货单</title>
</head>
<script language="JavaScript">
function window_onload(){
	window.moveTo(-2,-2);
	window.resizeTo(screen.availWidth, screen.availHeight);
}
function doprint(){
	if(form1.linecount.value<=0){
		alert('请选择出货产品')
		return;	
	}
	else{
		form1.print.value='yes';
	}
	var actualqty;
	var doprint;
	doprint=false;
	
	for(i=1;i<=form1.linecount.value;i++){
		actualqty='actualqty'+i;
		//alert(parseInt(form1.item(actualqty).value));
		//alert(actualqty);
		if(parseInt(form1.item(actualqty).value)>0){
			doprint=true;
		}
	}
	
	if(doprint==false){
		alert("请输入出货数量")
		return;
	}
form1.submit();
}
</script>
<body leftmargin="2" rightmargin="0" topmargin="2"onload="window_onload()">
<%if Request.Form("print")="" then%>

  <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      
    <td height="25"><strong><font class=title>新建采购收货单</font></strong> </td>
    </tr>
    <tr > 
      <td height="16" colspan="3" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr>
      <td height=4></td>
    </tr>
  </table>
<form name="form1" method="post" action="">
<%
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
rs.Open "select * from podeliverytemp where userid='"&session("loginid")&"'",conn,1,1

if not rs.EOF then
	set rsa=conn.execute("select accountid from po where poid="&rs("poid"))
	provider=rsa("accountid")
end if
%>

<input type=hidden name=processtype value="po">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor=efefef>
<%
i=1
do while not rs.EOF%>
	<tr >
		<td align=center nowrap>采购单号</td><td bgcolor=white nowrap><%=rs("pono")%><input type=hidden name=pono<%=i%> value="<%=rs("pono")%>"> <input type=hidden name=poid<%=i%> value="<%=rs("poid")%>"><input type=hidden name=polineid<%=i%> value="<%=rs("lineid")%>">&nbsp;</td>
		<td align=center nowrap>SLIP编号</td><td bgcolor=white nowrap><%=rs("slipno")%><input type=hidden name=slipno<%=i%> value="<%=rs("slipno")%>">&nbsp;</td>
		<td align=center nowrap>特价编号</td><td bgcolor=white nowrap><%=rs("specialpriceno")%><input type=hidden name=specialpriceno<%=i%> value="<%=rs("specialpriceno")%>"><input type=hidden name=productid<%=i%> value="<%=rs("productid")%>">&nbsp;</td>
		<td align=center height=20 nowrap>货号</td><td bgcolor=white nowrap><%=rs("productcode")%><input type=hidden name=productcode<%=i%> value="<%=rs("productcode")%>">&nbsp;</td>
		<td align=center nowrap>型号</td><td bgcolor=white nowrap><%=rs("model")%><input type=hidden name=model<%=i%> value="<%=rs("model")%>"><input type=hidden name=amount<%=i%> value="<%=rs("amount")%>">&nbsp;</td>
		<td align=center nowrap>数量</td><td bgcolor=white nowrap><%=rs("qty")%><input type=hidden name=qty<%=i%> value=<%=rs("qty")%>><input type=hidden name=price<%=i%> value=<%=rs("price")%>>&nbsp;</td>
		<td align=center nowrap>已收数量</td><td bgcolor=white nowrap><%=rs("issuedqty")%><input type=hidden name=issuedqty<%=i%> value=<%=rs("issuedqty")%>></td>
		<td align=center nowrap>收货数量</td><td bgcolor=white nowrap><input type=text size=8 name=actualqty<%=i%> value=<%=csng(rs("qty"))-csng(rs("issuedqty"))%>>&nbsp;</td>
		<td><a href="javascript:opensubwin3('../delete.asp?poprintlineid=<%=rs("lineid")%>','','resizable=yes, scrollbars=yes, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=300, height=200');"> 删除</a></td>
		</tr>
<%
rs.MoveNext
i=i+1
loop
%>
</table>
  <table width=100%>
    <tr>
      <td height=20 align=center><div align="left">开票: 
          <select name="invoice">
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
        </div></td>
    </tr>
    <tr>
      <td height=50 align=center> <input type=hidden name=linecount value=<%=rs.recordcount%>> 
        <input type=hidden name=print id=print>
        <input type=button value="添加" onclick="opensubwin3('selectpolinetoprint.asp?accountid=<%=provider%>','','toolbar=no,scrollbars=yes,location=no,resize=yes,status=no,menubar=no,width=650,height=400,top=100,left=160');"> 
        <input type=button value="保存" onclick="doprint()" id=button1 name=button1></td>
    </tr>
  </table>
</form>
<%else

	dim c:c=0
	for i=1 to request.Form("linecount")
		if Request.Form("actualqty"&i)<>0 and Request.Form("actualqty"&i)<>"" then
			c=c+1
		end if
	next
	
	if c=0 then
		Response.Write "没有收货细目"
		response.end
	else
		'取参数
		set rspara=conn.Execute("select * from parameter where type='poreceive'")
		set rsd=conn.Execute("select * from poreceive order by poreceiveid desc")
		x=1
		for l=1 to rspara("len")
			x=x*10
		next
		if not rsd.EOF then
			x=x+rsd("poreceiveid")+1
		else
			x=x+1
		end if
		receiveNo=rspara("prefix")&right(x,len(x)-1)
		sysid=getsysaccount("sysaccountid")
		sql="insert into poreceive(sysaccountid,poreceiveNo,invoice,poId,Status,Owner,Creator,CreateDate,LastModUser,LastModDate,TotalAmount)values("&sysid&",'"&receiveNo&"',"&request("invoice")&","&request.form("poid1")&",'初始','"&session("loginid")&"','"&session("loginid")&"','"&date()&"','"&session("loginid")&"','"&date()&"',0)"
		response.write sql
		set rsd=conn.execute(sql)
		sql="select * from poreceive order by poreceiveid desc"
		set rsd=conn.execute(sql)
		receiveid=rsd("poreceiveid")
	end if
	
	set rsd=conn.Execute("delete from podeliverytemp where userid='"&session("loginid")&"'")

	dim totalamount
	totalamount=0
	for i=1 to request.Form("linecount")
		if Request.Form("actualqty"&i)<>0 and Request.Form("actualqty"&i)<>"" then
			sql="insert into poreceiveline(poreceiveid,poLineid,Productid,model,productcode,Qty,Price,Amount,slipno,specialpriceno,Creator,CreateDate,LastModUser,LastModDate,description) values("&receiveid&","&request("polineid"&i)&","&request("productid"&i)&",'"&request("model"&i)&"','"&request("productcode"&i)&"',"&request("actualqty"&i)&","&request("price"&i)&","&csng(request("actualqty"&i))*csng(request("price"&i))&",'"&request("slipno"&i)&"','"&request("specialpriceno"&i)&"','"&session("loginid")&"','"&date()&"','"&session("loginid")&"','"&date()&"','"&request("description"&i)&"')"
			response.write sql
			set rsc=conn.Execute(sql)
			c=c+1
		end if
		totalamount=totalamount+csng(request("actualqty"&i))*csng(request("price"&i))
	next
	sql="update poreceive set totalamount="&totalamount&" where poreceiveid="&receiveid
	set rsd=conn.execute(sql)
	%>
	<script language=javascript>
		window.opener.location.reload();window.close()
	</script>
	<%
end if
%>
</body>
</html>

⌨️ 快捷键说明

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