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

📄 poapply.asp

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

'设置本页尺寸
session("localpagesize")=40

'取小计值
function getsubtotal(poapplyno)
dim connsub
dim rssub 
set connsub=server.CreateObject("adodb.connection")
set rssub=server.CreateObject("adodb.recordset")
connsub.Open connstring
	rssub.open "select sum(poprice*poqty) as subtotalpo,sum(discountprice*orderqty) as subtotalorder from v_poapply where poapplyno='"&poapplyno&"' group by poapplyno",connsub,1,1
	if rssub("subtotalpo")<>"" then subtotalpo=rssub("subtotalpo") else subtotalpo=0
	if rssub("subtotalorder")<>"" then subtotalorder=rssub("subtotalorder") else subtotalorder=0

	subtotalpo=formatnumber(subtotalpo,2)
	subtotalorder=formatnumber(subtotalorder,2)
	getsubtotal="订货金额:"&subtotalpo&"  合同金额:"&subtotalorder
	
  rssub.Close
  set rssub=nothing
  connsub.Close 
  set connsub=nothing
end function

if request("mod")="deliverysave" then
	dim connq
	dim rsq
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
		rsq.Open "select * from poapply where poapplyid="&cint(request("id")),connq,2,3,1
	if request("result")="update" then
			if request("deliverydate"&request("id"))<>"" then rsq("deliverydate")=request("deliverydate"&request("id"))			
	else
			rsq("deliverydate")=null			
	end if
			rsq.Update
			rsq.Close
	set rsq=nothing
	connq.Close 
	set connq=nothing 
response.Redirect("poapply.asp?strapplystatus="&request("strapplystatus")&"&strfield="&request("strfield")&"&strvalue="&request("strvalue"))
end if

objcheck.CheckUserFunction "order","read"

dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
strwhere=" where 1=1 "
if Request("strfield")<>"" then
	strwhere=strwhere & " and "&request("strfield")&" like '%"&request("strvalue")&"%'"
end if
if Request.Form("strfield")<>"" then
	strwhere=strwhere & " and "&request("strfield")&" like '%"&request.form("strvalue")&"%'"
end if
'按申请日期显示

if request("strapplystatus")<>"" then
	session("strapplystatus")=request("strapplystatus")
else
	if session("strapplystatus")="" then session("strapplystatus")="2"
end if

	if session("strapplystatus")="2" then 
		strwhere=strwhere & " and poapplyno<>''"
	elseif session("strapplystatus")="1" then
		strwhere=strwhere & " and poqty<>'' and poapplyno is null"
	elseif session("strapplystatus")="-1" then
		strwhere=strwhere&"and poqty is null"
	end if
if Request.QueryString("orderbyfield")<>"" then
	'排序字段改变返回第一页
	if session("orderbyfield")<>Request.QueryString("orderbyfield") then
		tofirstpage=true
	else
		tofirstpage=false
	end if
	
	if session("strapplystatus")="2" then
		'翻页时保持排序方式,不翻页循环改变升序/降序
		if request("turnpage")="" then
			if request("orderby")="" or request("orderby")="desc" then
				session("orderby")="asc"
			else
				session("orderby")="desc"
			end if
			strwhere=strwhere & " order by poapplyno asc,"&Request.QueryString("orderbyfield")&" "&session("orderby")
		else
			if request("orderbyfield")<>"" then
				strwhere=strwhere & " order by poapplyno asc,ordernum asc,"&Request.QueryString("orderbyfield")&" "&session("orderby")
			end if
		end if	
	else
		'翻页时保持排序方式,不翻页循环改变升序/降序
		if request("turnpage")="" then
			if request("orderby")="" or request("orderby")="desc" then
				session("orderby")="asc"
			else
				session("orderby")="desc"
			end if
			strwhere=strwhere & " order by "&Request.QueryString("orderbyfield")&" "&session("orderby")
		else
			if request("orderbyfield")<>"" then
				strwhere=strwhere & " order by "&Request.QueryString("orderbyfield")&" "&session("orderby")
			end if
		end if
	end if
	
	'保存当前排序字段
	session("orderbyfield")=Request.QueryString("orderbyfield")
else
	if session("strapplystatus")="2" then
		strwhere=strwhere&" order by poapplyno desc"
	else
		strwhere=strwhere&" order by poapplyid desc"
	end if
end if
'response.write "select top 100 * from v_poapply"&strwhere
rs.Open "select top 100 * from v_poapply"&strwhere,conn,1,1

'搜索时用
selecttablename="v_poapply"
if Request.QueryString("CurPage") = "" or Request("CurPage") = 0 then
	CurPage = 1 
else
	CurPage = cint(Request.QueryString("CurPage"))
end If

if not Rs.eof then
	Rs.PageSize=session("localpagesize")
	Rs.AbsolutePage=CurPage
else
	CurPage=0
end if
%>
<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 showTr(tag1){
	tag_plus = document.getElementById(tag1+"_plus")
	tag_minus = document.getElementById(tag1+"_minus")
	arrHid = document.form1.hid
	if(tag_plus!=null)
	{ 
		if(tag_plus.style.display == "none")
		{
			for(tempI=0;tempI<arrHid.length;tempI++)
			{
				if(arrHid[tempI].ATCUSF == tag1)
				{
					eval("tr_"+arrHid[tempI].trid+".style.display='none'")
					eval("trr_"+arrHid[tempI].trid+".style.display='none'")
				}
			}

			tag_plus.style.display=""
			tag_minus.style.display="none"
		}
		else
		{
			for(tempI=0;tempI<arrHid.length;tempI++)
			{
				if(arrHid[tempI].ATCUSF == tag1)
				{
					eval("tr_"+arrHid[tempI].trid+".style.display=''")
					eval("trr_"+arrHid[tempI].trid+".style.display=''")
				}
			}
			tag_plus.style.display="none"
			tag_minus.style.display=""
		}
	}
}
function printit()
{
	ATCUSF = self.form1.poapplyno.value
	if(ATCUSF == "")
		alert("请选择预定申请单")
	else
	{
	  window.open('poapplyprint.asp?poapplyno='+ATCUSF,'打印预定申请单','resizable=yes, scrollbars=yes, left= 160, top=10, menubar=no, location=no, toolbar=no');
	}
}

function convert(poapplyno){
	  window.open('poconvert.asp?poapplyno='+poapplyno,'转换采购单','resizable=yes, scrollbars=yes, left= 160, top=10, menubar=no, location=no, toolbar=no');
}

function printit2()
{
	strpoapplyno = self.form1.printcheck.value
	if(strpoapplyno == "")
		alert("无待订产品记录!")
	else
	{
	  window.open('poapplyprint.asp','打印预定申请单','resizable=yes, scrollbars=yes, left= 160, top=10, menubar=no, location=no, toolbar=no');
	}
}
</SCRIPT>
<SCRIPT language=JavaScript>
function relativeinput_onchange()
{
if (form1.strfield.value=="ownername"){
	strvalue1.style.display='none';
	strvalue2.style.display='block';
	form1.strvalue1.value="";
	}
if (form1.strfield.value!="ownername"){
	strvalue1.style.display='block';
	strvalue2.style.display='none';
	form1.strvalue2.value="";
	}
}
function GetStrValue()
{
if (form1.strfield.value!="ownername"){
	form1.strvalue.value=form1.strvalue1.value;
	}
if (form1.strfield.value=="ownername"){
	form1.strvalue.value=form1.strvalue2.value;
	}
form1.submit();
}
function selectproduct(){
	var theWindow;
	theWindow = window.open("selectstockproduct.asp","选择备货产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=680,height=500,top=150,left=160");
	theWindow.opener = this;
}
function clrdate(x){
   form1.mod.value="deliverysave";
   form1.result.value="clear";
   form1.id.value=x;
   form1.submit();
}
</SCRIPT>
<SCRIPT language=JavaScript>
function closewin(){
	//window.opener.location.reload();
	window.close();
}
</SCRIPT>
<body leftmargin="10" rightmargin="10" topmargin="10">
<form name="form1" method="post" action="poapply.asp"  onsubmit="return GetStrValue();">
  <input type=hidden name=mod>
  <input type=hidden name=result>
  <input type=hidden name="id">
  <input type="hidden" name="hid" trid="" ATCUSF="">
  <input type="hidden" name="poapplyno" value="">
  <table align=center width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="8%"><select name="strfield" onchange="relativeinput_onchange();">
          <option value=model <%if request("strfield")="product" then Response.Write "selected"%>>型号</option>
          <option value=productcode <%if request("strfield")="productcode" then Response.Write "selected"%>>货号</option>
          <option value=accountname <%if request("strfield")="accountname" then Response.Write "selected"%>>客户</option>
		  <option value=ordernum <%if request("strfield")="ordernum" then Response.Write "selected"%>>合同号</option>
		  <option value=ownername <%if request("strfield")="ownername" then Response.Write "selected"%>>销售员</option>
  		  <option value=poapplyno <%if request("strfield")="poapplyno" then Response.Write "selected"%>>编号</option>
        </select></td>
	  <td width="10%">
	  <div id=strvalue1 <%if request("strfield")<>"ownername" or request("strfield")=""  then response.write "style=display:block" else response.write "style=display:none" end if%>>
          <input type="text" name="strvalue1" value="<%=request("strvalue1")%>" size=10>
        </div>
	  <div id=strvalue2 <%if request("strfield")="ownername" then response.write "style=display:block" else response.write "style=display:none" end if%>>
	  	<select name="strvalue2" class="stedit">
               <option value="">--请选择销售员--</option>
                <%getgrouptype selecttablename,"ownername",request("strvalue2")%>
         </select></div></td>
	 <td>
		<input type=hidden name="strvalue" value="<%=request("strvalue")%>" > 
	  <input type=image src="../images/button_submit.gif" style="cursor:hand" border=0>
	      <%
		if CurPage<=1 then

⌨️ 快捷键说明

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