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

📄 goods_move_master.inc

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

'*******************************************************************************
Function SheetDetail()
    pOpDate = date
	SheetDetail = _
		"<form name=""frmSheetDetail"" method=post action=""" & sFileName & """>" & vbLF  & _
		"<input type=""hidden"" name=""FormAction"">" & vbLF & _
		"<table cellspacing=0 cellpadding=3 width=""100%"" align=center border=0>" & vbLF & _
		"  <tr height=10 bgcolor=white><td colspan=8></td></tr>" & vbLF & _
		"<tr height=20>" & _
		"<td colspan=6 bgcolor=""black"" align=center style=""color:white;font-weight:600"">物品移动细节</td></tr>" & _
		"  <tr height=30 bgcolor=white>" & vbLF & _
		"	<td align=right colspan=1>目标仓库:</td>" & vbLF & _
		"       <td>" & vbLF & _
		"			<select name=""goal_depot"" style=""width:100"">" & vbLF & _
		"					<option value=-1>未指定</option>" & vbLF & _
							SelectOptions(conn, "select *from t_depot", "depot_id", "depot_name", pDepotID) & vbLF & _
		"			</select></td>" & vbLF & _
		"	<td align=right>移动日期:</td>" & vbLF & _
		"       <td>"& DrawCal("", pOpDate, "opdate", "dateimg") &"</td>" & vbLF & _
		"  </tr>" & vbLF & _

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

'*******************************************************************************
Function TableHeader()
	TableHeader = _
		"<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=80></td>" & vbLF & _
		"	<td width=80></td>" & vbLF & _
		"	<td width=80></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;" & TableHeaderField(sFileName, "goods_name", "物品名称", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "model", "型号规格", sFormParams, sSorting, sSorted) & 	"</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "unit", "单位", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "quantity", "库存数", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "depot_id", "存货仓库", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "unit_price", "单价", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "remark", "备注", sFormParams, sSorting, sSorted) & "</td>" & _
		"</tr>"
End Function

'*******************************************************************************
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp	: sTemp = ""	' 临时字符串变量
	dim j					' 临时循环变量
	dim sql
	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	Dim rowCount        : rowCount = 0
	
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
	dim rs	: set rs = Openrs(conn,sSQL)

	dim GoodsID, sGoodsName, sModel, sUnit, sQuantity, sGoodsType, sDepotID, sUnitPrice,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
		GoodsID			        = rs("id")
		sGoodsName		    	= rs("goods_name")
		sModel			        = rs("model")
		sUnit		        	= rs("unit")
		sQuantity	    		= rs("quantity")
		sGoodsType		    	= rs("type_desc")
		sDepotID		        = rs("depot_id")		
		sUnitPrice	    		= rs("unit_price")
		sRemark					= rs("remark")
		sql = "select depot_name from t_depot where depot_id =" & ToSQL(sDepotID,"number")
		sDepotID = DLookUp(conn,sql)

		sTemp = sTemp & "<tr bgcolor=white height=20>" & _
		        "<td align=center nowrap>&nbsp;" & rowCount & "&nbsp;</td>" & _
				"<input type=""hidden"" name=""goods_id_" & rowCount & """ value=""" & GoodsID &""">" & _
				"<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=""" & sDepotID & """ nowrap>&nbsp;" & sDepotID & "&nbsp;</td>" & _
				"<td align=center title=""" & sUnitPrice & """ nowrap>&nbsp;" & sUnitPrice & "&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 &""">" & _
				"  <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=""btnCancel_OnClick();"">" & _
				"    <img border=0 src=""../images/delete.gif"" style=""vertical-align:middle"">放弃移动</span>" & _
				"    </td>" & vbLF & _	
				"    </tr>" & _
				"</form>"

End Function

'*******************************************************************************
Function Move()
	dim sGoodsName, sModel, sUnit, sQuantity, sUnitPrices, sGoodsType, sDepotID, sLocation, sMinQ
	dim pGoodsID
	dim sSheetID
	dim rowCount  :  rowCount = GetParam("row_count")                   ''记录数
	dim iCount    :  iCount = 1
	pOpdate = GetParam("opdate")
	pDepotID = GetParam("goal_depot")
	dim sql, sql2, sql3, rs
	
	'' 移动出库
	sql = "insert into t_stock_master(optype,sheet_status) values(10,0)"
	'response.write sql  & "<br>"
	'response.end
	call Openrs(conn,sql)

	sql = "select Max(sheet_id) from t_stock_master"  
	sSheetID = DLookUp(conn,sql)
	'response.write Cint(rowCount)  & "<br>"
	'response.end
   
	while  iCount <= Cint(rowCount)
		pGoodsID  = GetParam("goods_id_" & iCount)	
		sql = "select goods_name,model,quantity,unit,unit_price,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")
			sUnitPrices		= rs("unit_price")
			sGoodsType		= rs("goods_type")
			sDepotID		= rs("depot_id")
			sLocation		= GetValue(rs, "location")
			sMinQ			= GetValue(rs, "min_quantity")
		end if
		rs.Close()
		set rs = nothing

		sql2 = "insert into t_stock_detail(goods_id,sheet_id,goods_name,model,unit,quantity,unit_price,goods_type,depot,location,opdate)" & _
			" values(" & ToSQL(pGoodsID,"number") & "," & ToSQL(sSheetID,"number") & _
			"," & ToSQL(sGoodsName,"text") & "," & ToSQL(sModel,"text") & _
			"," & ToSQL(sUnit,"text") & "," & ToSQL(sQuantity,"number") & _
			"," & ToSQL(sUnitPrices,"number") & "," & ToSQL(sGoodsType,"number") & _
			"," & ToSQL(sDepotID,"number") & "," & ToSQL(sLocation,"text") & _
			"," & ToSQL(pOpdate,"text") & ")"
	'	response.write sql2 : response.end
		call Openrs(conn,sql2)	
		iCount = iCount + 1
	wend 
	
	'' 移动入库
	sql = "insert into t_stock_master(optype,sheet_status) values(9,0)"
	'response.write sql  & "<br>"
	'response.end
	call Openrs(conn,sql)

	sql = "select Max(sheet_id) from t_stock_master"  
	sSheetID = DLookUp(conn,sql)
	'response.write Cint(rowCount)  & "<br>"
	'response.end
	iCount = 1
	while  iCount <= Cint(rowCount)
		pGoodsID  = GetParam("goods_id_" & iCount)	
		sql = "select goods_name,model,quantity,unit,unit_price,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")
			sUnitPrices		= rs("unit_price")
			sGoodsType		= rs("goods_type")
			sDepotID		= rs("depot_id")
			sLocation		= GetValue(rs, "location")
		end if
		rs.Close()
		set rs = nothing

		sql2 = "insert into t_stock_detail(goods_id,sheet_id,goods_name,model,unit,quantity,unit_price,goods_type,depot,location,opdate)" & _
			" values(" & ToSQL(pGoodsID,"text") & "," & ToSQL(sSheetID,"number") & _
			"," & ToSQL(sGoodsName,"text") & "," & ToSQL(sModel,"text") & _
			"," & ToSQL(sUnit,"text") & "," & ToSQL(sQuantity,"number") & _
			"," & ToSQL(sUnitPrices,"number") & "," & ToSQL(sGoodsType,"number") & _
			"," & ToSQL(pDepotID,"number") & "," & ToSQL(sLocation,"text") & _
			"," & ToSQL(pOpdate,"text") & ")"
		call Openrs(conn,sql2)

		sql3 = "update t_goods set depot_id ="& ToSQL(pDepotID,"number") & _
				" where goods_id =" & ToSQL(pGoodsID,"number") 
		call Openrs(conn,sql3)
		
		iCount = iCount + 1
	wend 
	sql = "update t_goods set current_status = 1 where current_status = 7"
	call Openrs(conn,sql)
	'response.write pRemindID : response.end
	response.redirect "goods_move.asp"
	response.end
End Function
'*******************************************************************************
sub Cancel()
	dim sql
	sql = "update t_goods set current_status = 1 where current_status = 7"
	call Openrs(conn,sql)
	response.redirect "goods_move.asp"
	response.end
end sub
'*******************************************************************************
%>

⌨️ 快捷键说明

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