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

📄 borrow_output_over.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%
'###############################################################################
'#
'#	文件名	 : borrow_output_over.inc
'#	
'#      创建人	 : yaoxiaohui
'#      日期	 : 2002-11-06
'#
'#	修改历史  : ****年**月**日 ****** 
'#      修改内容  : *********************************
'#
'#	功能描述	 : 领用函数文件
'#      版   本	 : v1.0
'#
'#      Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'###############################################################################

'*******************************************************************************
Function SheetDetail()
	dim sql, rs
	sql = "select *from t_stock_master where sheet_id =" & pSheetID
	set rs = Openrs(conn,sql)
	if rs.EOF then
	else
	pNodeID			= GetValue(rs,"node_id")
	pHandover		= GetValue(rs,"handover")
	pReceiver		= GetValue(rs,"receiver")
	end if
	rs.Close()
	set rs = nothing

	sql = "select opdate from t_stock_detail where sheet_id =" & pSheetID
	pOpdate = DLookUp(conn,sql)

    SheetDetail = _
		TableTitle("借用登记表_"&pSheetID&"细节", 700, "", "") & vbLF & _
		"<table cellspacing=0 cellpadding=3 width=""100%"" align=center bgcolor=silver style=""table-layout:fixed;border-style:solid;border-top-width:0px;border-bottom-width:1px;border-left-width:1px;border-right-width:1px;"">" & vbLF & _
		"  <tr height=10 bgcolor=white><td colspan=8></td></tr>" & vbLF & _	
		
		"  <tr height=30 bgcolor=white>" & vbLF & _
		"	<td align=right colspan=2>部  门:</td>" & vbLF & _
		"       <td colspan=2>" & vbLF & _
		"			<select name=""node_id"" style=""width:120"">" & vbLF & _
		"					<option value=-1>全部</option>" & vbLF & _
							SelectOptions(conn, "select *from t_node", "node_id", "node_desp", pNodeID) & vbLF & _
		"			</select></td>" & vbLF & _
		"	<td align=right colspan=1>日  期:</td>" & vbLF & _
		"	<td colspan=3>"& DrawCal("", pOpDate, "opdate", "dateimg") &"</td>" & _
		"  </tr>" & vbLF & _


		"  <tr height=30 bgcolor=white>" & vbLF & _
		"	<td align=right colspan=2>借用人:</td>" & vbLF & _
		"       <td colspan=2><input type=""text"" name=""receiver"" value=""" & pReceiver & """ size=18 maxlength=20>" & vbLF & _
		"	<td align=right colspan=1>发料人:</td>" & vbLF & _
		"       <td colspan=3><input type=""text"" name=""handover"" value=""" & pHandover & """ size=18 maxlength=20>" & vbLF & _
		"  </tr>" & vbLF & _

		"  <tr height=10 bgcolor=white><td colspan=8></td></tr>" & vbLF & _
		
		"</table>" & vbLF
End Function

'*******************************************************************************
Function TableHeader()
	TableHeader = _
		"<form name=""frmSheetDetail"" method=post action=""" & sFileName & """>" & vbLF  & _
		"<input type=""hidden"" name=""FormAction"">" & vbLF & _
		"<table cellspacing=1 cellpadding=0 width=""100%"" align=center bgcolor=silver style=""table-layout:fixed"">" & vbLF & _
		"<tr style=""display:none"">" & vbLF & _
		"	<td width=40>这一行仅用于控制表格的宽度</td>" & vbLF & _
		"	<td width=100></td>" & vbLF & _
		"	<td width=90></td>" & vbLF & _
		"	<td width=60></td>" & vbLF & _
		"	<td width=70></td>" & vbLF & _
		"	<td width=70></td>" & vbLF & _
		"	<td width=70></td>" & vbLF & _
		"	<td width=""*""></td></tr>" & vbLF & _
		"<tr height=20>" & _
		"<td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"">被领用物品和设备一览</td></tr>" & _
		"<tr bgcolor=white>" & _
        "<td class=tdHead align=center>&nbsp;序号</td>" & _
		"<td class=tdHead align=center>&nbsp;<img src=""../images/bg/ar-y.gif"" width=8 height=8>&nbsp;物品名称</td>" & _
		"<td class=tdHead align=center>&nbsp;型号规格</td>" & _
		"<td class=tdHead align=center>&nbsp;单位</td>" & _
		"<td class=tdHead align=center>&nbsp;数量</td>" & _
		"<td class=tdHead align=center>&nbsp;存货仓库</td>" & _
		"<td class=tdHead align=center>&nbsp;存货位置</td>" & _
		"<td class=tdHead align=center>&nbsp;备注</td>" & _
		"</tr>"
End Function

'*******************************************************************************
'*******************************************************************************
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp	: sTemp = ""	' 临时字符串变量
	dim j					' 临时循环变量

	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	Dim rowCount        : rowCount = 0
	
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
	dim rs	: set rs = Openrs(conn,sSQL)

	dim sGoodsID, sGoodsName, sModel, sUnit, sQuantity, sGoodsType, sDepotName, sUnitPrice, sLocation, sRemark
	
	''response.write sSQL : response.end
	
	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
	if Not rs.EOF then		
		rs.move (iCurrentPage - 1) * iRecordsPerPage
	end if

	
	while not rs.EOF and iCounter <= iRecordsPerPage
	    rowCount = rowCount + 1
		sGoodsID			    = rs("goods_id")
		sGoodsName		    	= rs("goods_name")
		sModel			        = rs("model")
		sUnit		        	= rs("unit")
		sQuantity	    		= rs("quantity")
		sGoodsType		    	= rs("type_desc")
		sDepotName				= rs("depot_name")		
		sLocation				= rs("location")
		sRemark					= rs("remark")

		sTemp = sTemp & "<tr bgcolor=white height=20>" & _
		        "<td align=center nowrap>&nbsp;" & rowCount & "&nbsp;</td>" & _
				"<input type=""hidden"" name=""goods_id_" & rowCount & """ value=""" & sGoodsID &""">" & _
				"<td align=center title=""" & sGoodsName & """ nowrap>&nbsp;" & sGoodsName & "&nbsp;</td>" & _
				"<td align=center title=""" & sModel & """ nowrap>&nbsp;" & sModel & "&nbsp;</td>" & _
				"<td align=center title=""" & sUnit & """ nowrap>&nbsp;" & sUnit & "&nbsp;</td>" & _
				"<td align=center title=""" & sQuantity & """ nowrap>&nbsp;" & sQuantity & "&nbsp;</td>" & _
				"<td align=center title=""" & sDepotName & """ nowrap>&nbsp;" & sDepotName & "&nbsp;</td>" & _
				"<td align=center title=""" & sLocation & """ nowrap>&nbsp;" & sLocation & "&nbsp;</td>" & _
				"<td align=center title=""" & sRemark & """ nowrap>&nbsp;" & sRemark & "&nbsp;</td>" & _
				"</tr>"
		iCounter = iCounter + 1
		rs.movenext
	wend
	rs.Close()
	set rs = nothing

	' 填补空白行
	sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)

	' 首页、前页、后页、尾页等分页信息
	sTemp = sTemp & "<tr bgcolor=white height=20><td colspan=" & iCols & " align=right>" & _
				Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
				"&nbsp;</td></tr>"
	TableRecords = _ 
				sTemp & _
				"<input type=""hidden"" name=""row_count"" value=""" & rowCount &""">" & _
				"<input type=""hidden"" name=""sheet_id"" value=""" & pSheetID &""">"
End Function

Function ActionLink()
	ActionLink = _
				"<table>" & _
				"  <tr height=30 bgcolor=white>" & vbLF & _
		        "	 <td  colspan = 8 align=center>" & _
				"    <span title=""完成借用单"" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnItemadd_OnClick();"">" & _
				"    <img border=0 src=""../images/arrowr.gif"" style=""vertical-align:middle"">完成借用单</span>" & _
				"		&nbsp;&nbsp;&nbsp;" & vbLF & _	
				"    <span title=""取消借用单"" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnDelete_OnClick();"">" & _
				"    <img border=0 src=""../images/trash.gif"" style=""vertical-align:middle"">取消借用单</span>" & _
				"		&nbsp;&nbsp;&nbsp;" & vbLF & _	
				"    <span title=""返回出入库单管理界面!"" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnCancel_OnClick();"">" & _
				"    <img border=0 src=""../images/delete.gif"" style=""vertical-align:middle"">返回</span>" & _
				"    </td>" & vbLF & _	
				"    </tr>" & _
				"</table></form>"
End Function
'*******************************************************************************

'*******************************************************************************
Function ItemOutput()
   dim sGoodsName, sModel, sUnit, sQuantity, sGoodsType, sDepotID, sLocation, sMinQ
   dim pQuantity
   dim pRemindID : pRemindID = ""
   dim rowCount  :  rowCount = GetParam("row_count")                   ''记录数
   dim iCount    :  iCount = 1
   pOpdate = GetParam("opdate")
   dim sql, sql2, sql3, rs
 
   
   while  iCount <= Cint(rowCount)
         pGoodsID  = GetParam("goods_id_" & iCount)
		 sql = "select quantity from t_stock_detail" & _
			" where goods_id = " & ToSQL(pGoodsID,"number") & _
			" and sheet_id =" & ToSQL(pSheetID,"number")
		'response.write sql  & "<br>" : response.end
		 pQuantity	= DLookUp(conn,sql)
	 	 sql = "select goods_name,model,quantity,unit,goods_type,depot_id,location,min_quantity from t_goods" & _
		 " where goods_id = " & ToSQL(pGoodsID,"number")
		 'response.write sql  & "<br>"
         'response.end
		 set rs = Openrs(conn,sql)
		 if Not rs.EOF then
		      sGoodsName     = rs("goods_name")
			  sModel         = rs("model")
			  sUnit          = rs("unit")
			  sQuantity      = GetValue(rs, "quantity")
			  sGoodsType     = rs("goods_type")
			  sDepotID       = rs("depot_id")
			  sLocation      = GetValue(rs, "location")
			  sMinQ			 = GetValue(rs, "min_quantity")
		 end if
		 rs.Close()
		 set rs = nothing

		 if (sQuantity - pQuantity) > 0 then
			sql3 = "update t_goods set quantity ="& ToSQL(sQuantity - pQuantity,"number") & _
				" where goods_id =" & ToSQL(pGoodsID,"number") 
			call Openrs(conn,sql3)
		 else
		    sql3 = "update t_goods set current_status = 2,quantity ="& ToSQL(sQuantity - pQuantity,"number") & _
				" where goods_id =" & ToSQL(pGoodsID,"number") 
			call Openrs(conn,sql3)
		 end if
		if sMinQ <> "" then
			if (sQuantity - pQuantity) < sMinQ then
				sql = "update t_goods set remind_status = 2 where goods_id =" & ToSQL(pGoodsID,"number")
				call Openrs(conn,sql)
				pRemindID = pGoodsID & "," & pRemindID
			end if
		end if
		 iCount = iCount + 1
   wend 

	sql = "update t_stock_master set sheet_status = 2" & _
		",node_id=" & ToSQL(pNodeID,"Text") & _
		",handover=" & ToSQL(pHandover,"text") & _
		",receiver=" & ToSQL(pReceiver,"text") & _
		" where sheet_id =" & ToSQL(pSheetID,"number") 
	call Openrs(conn,sql)

   sql = "update t_goods set current_status = 1 where current_status = 7"
   call Openrs(conn,sql)

   dim Num        :  Num = Len(pRemindID)
	'response.write pRemindID : response.end
	
	if Num > 0 then
	pRemindID = left(pRemindID,Num - 1)
	end if
	'response.write pRemindID : response.end
	response.redirect "remind.asp?goods_id=" & pRemindID & "&" & "sheet_id=" & pSheetID
End Function
'*******************************************************************************
sub Cancel()
	dim sql
	sql = "update t_goods set current_status = 1 where current_status = 7"
	call Openrs(conn,sql)
	response.redirect "../stock/sheet_mgr.asp"
	response.end
end sub
'*******************************************************************************
sub Delete()
	dim sql
	sql = "delete from t_stock_detail where sheet_id =" & pSheetID
	call Openrs(conn,sql)
	sql = "delete from t_stock_master where sheet_id =" & pSheetID
	call Openrs(conn,sql)
	response.redirect "../stock/sheet_mgr.asp"
	response.end
end sub
%>

⌨️ 快捷键说明

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