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

📄 salelist_right.asp

📁 一个比较完整的企业erp系统
💻 ASP
字号:
<%@language="vbscript" codepage="936"%>
<%response.buffer = true%>
<%Public HOME_PATH:HOME_PATH = "../"%>
<!--#include file="../db.asp"-->
<!--#include file="../inc/function.asp"-->
<%Public title:title = "管理员列表"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><%=title%></title><%
  if isLogin = false then
     Response.Write viewinfo("Logingo","","")
	 Response.end
  end if
%><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<link href="<%=HOME_PATH%>css/style01.css" rel="stylesheet" type="text/css">
<script type = 'text/javascript' src = '<%=HOME_PATH%>js/layer00.js'></script>
<style type = 'text/css'>
.tempA td {border-top:solid 0px #fff;border-left:solid 0px #fff;border-right:solid 1px #d6d3ce;border-bottom:solid 1px #d6d3ce;}
.clicked { background-color:#08246B;color:#ffffff;}

</style>

<script language="JavaScript">
<!--
function clicked_(s) {
 var td_len = td_.length;
 if (td_len == undefined) { 
    td_.className = 'clicked';
    form.box_.checked = true;

    }else{
		for(i_ = 0 ; i_<td_len;i_++) {
			if(s!=i_) {
			   td_[i_].className = '';
			   form.box_[i_].checked = false;
			}else{
			   td_[i_].className = 'clicked';
			   form.box_[i_].checked = true;
			}
		}
    }
}

function checked_(s) {
   var selLen = form.selAnnounce.length ;
   if (selLen==undefined) {
       if(form.selAnnounce.checked == true) {
	      selid_.className = 'clicked' ;
	   }else{
	      selid_.className = '' ;
	   }
   }else{
      if(form.selAnnounce[s].checked == true) {
         selid_[s].className = 'clicked';
      }else{
         selid_[s].className = '';
      }
   }
}
//-->
</script>

<!--onClick="this.value=check(this.form.del_producr)-->
</head>
<body style = 'background-color:#fff;margin:0px;'>
<div style = 'text-align:center;'>
<%
     Rmainid = GetText("maintypeid","G","number",1,10,0)
	 mtypeName = v1v2(Rmainid,0,"全部",SelectZD("select mtypeName from mtype where mtypeid = " & Rmainid & "","未知"))
     Rsubid = GetText("subtypeid","G","number",1,10,0)
     sel = trim(Request("sel"))
	 key_ = trim(Request("key"))
	 updateStock = trim(Request("updateStock"))
	 if updateStock = "YES" then upChecked = " checked = 'checked' " else upChecked = ""
	 selSQL = ""
	 C_Checked = ""
	 N_Checked = ""
	 P_Checked = ""
     BadStr = " ~`!@#$%^&*()-_+=|\{}[][]:;" & chr(34) & chr(39) & "<,>.?/"
     viewBadStr = ""
	 key__ = Check(BadStr,key_,viewBadStr,"0")
	 keyColor = v1v2(key_,"",""," style = 'color:red;' ")
	 select case sel
			case "C"
				 selSQL = " and Code like '%" & key__ & "%'"
				 C_Checked = " checked = 'checked' "
			case "N"
				 selSQL = " and cName like '%" & key__ & "%'"
				 N_Checked = " checked = 'checked' "
			case "P"
			     key__ = isNumber(key__,"dec",0)
				 selSQL = " and outPrice = " & key__ & ""
				 key_ = key__
				 P_Checked = " checked = 'checked' "
			case "J"
				 selSQL = " and supplierid in(select uid from supplier where FullName like '%" & key_ & "%')"
				 J_Checked = " checked = 'checked' "
	 end select
%>

     <table border = '1' cellspacing = '0' cellpadding = '1' borderColorLight='#000000' borderColorDark='#eeeeee' style = 'width:100%;background-color:buttonface;border-bottom:0px solid;border-right:0px solid;border-top:0px solid;border-left:0px solid;'/>
	   <form method='post' action="<%=SELVAR("FN","?")%>" name = 'formSearch'>
	   <input type = 'hidden' name = 'maintypeid' value = '<%=Rmainid%>'/>
	   <input type = 'hidden' name = 'subtypeid' value = '<%=Rsubid%>'/>
	   <input type = 'hidden' name = 'Searched' value = 'Y'/>
       <tr>
	   <td style = 'height:30px;'>
		 搜索:按代码<input type="radio" name="sel" style = 'border-style:none;' value = 'C' <%=C_Checked%> />
		 名称<input type="radio" name="sel" style = 'border-style:none;' value = 'N' <%=N_Checked%>/>
		 销价<input type="radio" name="sel" style = 'border-style:none;' value = 'P' <%=P_Checked%>/>
		 经销商名<input type="radio" name="sel" style = 'border-style:none;' value = 'J' <%=J_Checked%>/>
		 <%SQL = "select * from usertype where uTypeSelect = 0 Order by uTypeArray Desc"%>
		 关键字 <input <%=keyColor%> type="text" name="key" style = 'width:100px;' value = '<%=key_%>' style = 'border-left:1px solid #000;border-top:1px solid #000;border-bottom:1px solid #000;border-right:0px solid #000;line-height:17px;height:20px;'/><input type="button" value = '搜索' style = 'border:1px solid #000;line-height:17px;height:20px;' onclick="javascript:formSearch.submit();"/>   <input type = 'checkbox' value = 'YES' name = 'updateStock' style = 'border-style:none;' <%=upChecked %>/>选上同时更新当前页的商品库存
		 </td>
	   </tr>
	   </form>
	 </table>


     <table border = '1' cellspacing = '0' cellpadding = '1' borderColorLight='#000000' borderColorDark='#eeeeee' style = 'width:100%;background-color:buttonface;border-bottom:0px solid;border-right:0px solid;border-top:0px solid;border-left:0px solid;' class = 'LinkA'/>
	 <form method='post' action="<%=SELvar("FN","?")%>" name = 'form'>
	 <input type = 'hidden' name = 'Options'/>
	 <input type = 'hidden' name = 'Execute'/>
	 <input type = 'hidden' name = 'movetosupplierid'/>
	 <input type = 'hidden' name = 'movetomtypeid'/>
	        <tr>
			   <td style ='height:20px;width:45px;'>序号</td>
			   <td>代码</td>
			   <td>名称</td>
			   <td>性质</td>
			   <td>经销商</td>
			   <td>参考进价</td>
			   <td>参考销价</td>
			   <td>入库日期</td>
			   <td>进货数</td>
			   <td>已销售</td>
			   <td>现库存</td>
			   <td style = 'width:42px;text-align:center;'>可用性</td>
			   <td style = 'width:30px;text-align:center;'><input name = '' type = 'button' style = 'border-style:none;' onClick="this.value=sel(this.form.selAnnounce,'反选','全选',selid_,'clicked');" value = '全选' onfocus="this.blur();"/></td>
			</tr>
	        <tr>
			   <td style ='height:1px;line-height:1px;background-color:#adaaad;border-style:none;' colspan = '13'></td>
			</tr>
<%
  mainSQL = v1v2(Rmainid,0,"","  and mTypeid in(select mTypeid from mtype where mTypeSelect = " & Rmainid & ") ")
  subSQL = v1v2(Rsubid,0,""," and mTypeid=" & Rsubid & "")
  SQL = "select * from stock where 1 = 1 " & mainSQL & subSQL & selSQL & " Order By stockid desc"
  'Response.Write SQL
  Rs.Open(SQL),Conn,1,3
  LinkFile = SELVAR("FN","adminlist_right.asp")
  LUrl = "maintypeid=" & Rmainid & "&subtypeid=" & Rsubid & "&sel=" & sel & "&key=" & key_ & "&updateStock=" & updateStock
     dim uCount , KCJZinprice , KCJZoutprice , PCount
	 KCJZinprice = 0
	 KCJZoutprice = 0
	 thisPageSize = 20
	 PCount = 5 '当前页的前面和后面显示页数
  if not Rs.eof then
     PageWrite = PaginatinoGoogle(Rs,noteTotal,thisPageSize,LinkFile,LUrl,LArr)
	 for i_u = 1 to thisPageSize
	     if Rs.eof then exit for
		  sid = Rs("stockid")'
          supplierid = isNumber(Rs("supplierid"),"int",0)'相应供应商id
          mtypeid = Rs("mtypeid")'所属商品类别id
          Code = Rs("Code") & "a"'代码
          cName = Rs("cName")'中文名
          eName = Rs("eName")'英文名
          eRemark = Rs("eRemark")'英文备注
          cRemark = Rs("cRemark")'中文备注
          typeCode = Rs("typeCode")'型号条码
		  Quality = Rs("Quality") '性质
          inprice = Rs("inprice")'参考进货价
          outprice = Rs("outprice")'参考预出售价
          inhow = Rs("inhow")'数量
          unit = Rs("unit")'单位
          total = Rs("total")'总价格
          inpayment = Rs("inpayment")'已支付给供应商
          intotime = Rs("intotime")'进货时间
          updatetime = Rs("updatetime")'最后修改时间
          guarantyTime = Rs("guarantyTime")'保修期
          guarantyRemark = Rs("guarantyRemark")'保修期备注
          stockMax = Rs("stockMax")'库存上限
          stockMin = Rs("stockMin")'库存下限
          thisDate = Rs("thisDate")'
          aid = Rs("aid")'
          auid = Rs("auid")'
          disabled = isNumber(Rs("disabled"),"int",0)'
          inModel = Rs("inModel")'入库模式-是直接录入或销售时同步录入

          if updateStock = "YES" then 
		  Rs("outhowed") = SelectZD("select Sum(outHow) from salelist where stockid = " & sid & "",0)'同步更新商品库存
			 Rs.update
		  else
		     upChecked = ""
          end if

          outHow = Rs("outhowed") 'SelectZD("select Sum(outHow) from salelist where stockid = " & sid & "",0)
          nowKc = inhow-outHow
		  KCJZinprice = KCJZinprice+(nowKc*inprice)
		  KCJZoutprice = KCJZoutprice+(nowKC*outprice)
%>
            <tr ondblclick = "javascript:WindowOpen('mview.asp?stockid=<%=sid%>','mview',430,608,'');" style = 'background-color:#ffffff;' class = 'tempA' style='cursor: default;' onclick = "javascript:clicked_(<%=i_u-1%>);">
			   <input type = 'hidden' name ='input_<%=sid%>' id = 'input_'/>
			   <input type = 'hidden' name ='id_' id = 'id_' value = '<%=sid%>'/>
			   <td style = 'text-align:center;' id = 'td_'><%=sid%></td>
			   <td><%=Replace(Code,key_,"<span style = 'color:red;'><b>" & key_ & "</b></span>")%></td>
			   <td><%=Replace(cName,key_,"<span style = 'color:red;'><b>" & key_ & "</b></span>")%></td>
			   <td><%=Quality%></td>
			   <td><a href="javascript:SDD('<%=HOME_PATH%>supplier/supplierview.asp?uid=<%=supplierid%>','supplierview',778,480,'');"><%=Replace(SelectZD("select FullName from supplier where uid = " & supplierid & "","未知"),key_,"<span style = 'color:red;'><b>" & key_ & "</b></span>")%></a></td>
			   <td>¥<%=FormatNumber(inprice,2)%></td>
			   <%outPrice_ = v1v2(sel,"P", Replace(FormatNumber(outprice,2),FormatNumber(isNumber(key_,"dec",0),2),"<span style = 'color:red;'>" & FormatNumber(isNumber(key_,"dec",0),2) & "</span>"),FormatNumber(outPrice,2))%>
			   <td>¥<%=outPrice_%></td>
			   <td><%=thisDate%><input type = 'checkbox' name = 'box_' id = 'box_' value = '<%=sid%>' style = 'visibility:hidden;height:10px;'/></td>
			   <td style = 'text-align:center;'><%=inhow%></td>
			   <td style = 'text-align:center;'><%=outhow%></td>
			   <td style = 'text-align:center;'><%=nowKc%></td>
			   <td style = 'text-align:center;'><%=v1v2(disabled,1,"<span style = 'color:#000'>可用</span>","<span style = 'color:#808080;'>禁用</span>")%></td>
			   <td style = 'text-align:center;' id = 'selid_'><input type = 'checkbox' style = 'border-style:none;widht:15px;height:15px;' name = 'selAnnounce' onClick = "javascript:checked_(<%=i_u-1%>);" onfocus="this.blur();" value = '<%=sid%>'/></td>
			</tr>

<%
        Rs.movenext
     next
	 Response.Write"<tr><td style = 'text-align:center;' colspan = '13'>" & PageWrite & "</td></tr>"

	 Set kcCount = Server.CreateObject("Adodb.RecordSet")
	     SQL = "select Sum(inprice*inhow) , Sum(outprice*(inhow-outhowed)) from stock"
	     kcCount.Open(SQL),Conn,1,1
		 if not kcCount.eof then
		    KCJZinpriceCount = kcCount(0)
			KCJZoutpriceCount = KcCount(1)
		 else
		    KCJZinpriceCount = 0
			KCJZoutpriceCount = 0
         end if
		 kcCount.Close
	 Set kcCount = Nothing


	 'AAA = SelectZD("select Sum(inhow*inprice) from stock",0)
	 'BBB = SelectZD("select Sum(outhow*inprice) from salelist",0)
%>
     <tr>
	   <td style = 'text-align:left;padding:5px;line-height:18px;' colspan = '13'>
	   <div>·当页尚有价值:¥<%=formatNumber(isNumber(KCJZinprice,"dec",0),3)%> 的商品库存(参考进价)</div>
	   <div>·当页尚有价值:¥<%=formatNumber(isNumber(KCJZoutprice,"dec",0),3)%> 的商品库存(参考销价)</div>
<hr/>
	   <div>·一共还有价值:<span style = 'color:blue;'>¥<%=formatNumber(isNumber(KCJZinpriceCount,"dec",0),3)%> 的商品库存(参考进价)</span></div>
	   <div>·一共还有价值:<span style = 'color:blue;'>¥<%=formatNumber(isNumber(KCJZoutpriceCount,"dec",0),3)%> 的商品库存(参考销价)</span>      <input type = 'button' onclick = "javascript:var countData = <%=noteTotal%> ; if(countData>2000){var con = confirm('当前(<%=mtypeName%>)类别的记录总量为'+countData+'.更新需要较长时间.是否继续?');if(con){this.value='(<%=mtypeName%>)数据['+countData+']个记录更新中.请耐心等待…';form.buttonText.disabled = true;SDD('updateData.asp?mtypeid=<%=Rmainid%>&W=280&H=100','updateData',280,100,'');}else{return false;}}else{this.value='(<%=mtypeName%>)数据更新中.请稍候…';form.buttonText.disabled = true;SDD('updateData.asp?mtypeid=<%=Rmainid%>&W=280&H=100','updateData',280,100,'');}" value = '点击这里更新[<%=mtypeName%>]库存数据[数据总量:<%=noteTotal%>]' style = 'border-style:none;' name = 'buttonText'/></div>
<hr/>
	   <br/>

	   </td>
	 </tr>

<%
  else
%>
	        <tr style = 'background-color:#ffffff;' class = 'tempA'>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			   <td>&nbsp;</td>
			</tr>


<%
  end if
  Rs.Close
%>
  </table>
</form>
<%
  Options = trim(Request.Form("Options"))
  if Options = "delTrue" then 
     Set c01 = new CL01
     SQL = "delete from stock where stockid in(" & c01.splitList(trim(Request.Form("Execute")),",",0) & ")"
	 Set c01 = Nothing
	 'Response.Write SQL
     Conn.Execute(SQL)
     Response.Write viewinfo("divLoca","正在执行删除操作.请稍候…","")
     Response.Write viewinfo("LocaTimeself","",SELVAR("FN","mlist_right.asp"))

  end if

  if Options = "move" then 
     Set c01 = new CL01
	 dim mTypeid___ , supplierid___ , SQL___
	 ExecuteList = c01.splitList(trim(Request.Form("Execute")),",",0)
	 mTypeid___ = isNumber(trim(Request.Form("movetomtypeid")),"int",0)
	 supplierid___ = isNumber(trim(Request.form("movetosupplierid")),"int",0)
	 Set c01 = Nothing
Response.Write "mTypeid___ = " & mTypeid___
	 if not mTypeid___ = 0 then SQL___ = " mtypeid = " & mtypeid___ & ""
	 if not supplierid___ = 0 then SQL___ = " supplierid = " & supplierid___ & ""
	 if not mTypeid___ = 0 and not supplierid___ = 0 then SQL___ = " mtypeid = " & mtypeid___ & " , supplierid = " & supplierid___ & " "

     if not mTypeid___ = 0 or not supplierid___ = 0 then
        SQL = "update stock set " & SQL___ & " where stockid in(" & ExecuteList & ")"
	    'Response.Write SQL
        Conn.Execute(SQL)
        Response.Write viewinfo("divLoca","正在执行移动操作.请稍候…","")
        Response.Write viewinfo("LocaTimeself","",SELVAR("FN","mlist_right.asp"))
	 end if
  end if

  if trim(Request.Form("Searched")) = "Y" then Response.Redirect(LinkFile & "?" & LUrl)



ConnClose()
'Response.Write endtime*1000
%>
</div>
</body>
</html>

⌨️ 快捷键说明

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