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

📄 output.asp

📁 物业管理和办公自动化系统
💻 ASP
字号:
<%
'##############################################################################
'#
'#		文 件 名	 : output.asp
'#
'#
'#		创 建 人	 : yaoxiaohui
'#  	日   期	 : 2002-11-4
'#
'#		修改历史  : ****年**月**日 ******
'#      修改内容  : **************************************************
'#
'#		功能描述	 : 出库物品和方式选择
'#  	版   本	 : v1.0
'#	
'#	    Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'##############################################################################
'------------------------------------------------------------------------------
'----   服务器端设置
'------------------------------------------------------------------------------
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- include files begin -->

<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/commonpage.inc" -->

<!-- #include file="output.inc" -->

<!-- include files end -->
<%
call CheckSecurity()
'##############################################################################
'----   服务器端代码
'##############################################################################
'------------------------------------------------------------------------------
'----   用户权限检查
'------------------------------------------------------------------------------
if hasright(ID_STOCK) < RIGHT_READ  then
	Response.Clear
	Response.Redirect "../include/error.asp?error=只有仓库管理员才能进行出库操作!"
	Response.end
end if
'******************************************************************************
'----   建立数据库连接
'------------------------------------------------------------------------------
dim conn
set conn = DBConnection
'******************************************************************************
'----   分页相关的变量定义
'------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby,sWhere2
Dim sFileName			: sFileName			= "output.asp"
Dim iTotalRecords		: iTotalRecords		= 0			                ' 分页
Dim iRecordsPerPage		: iRecordsPerPage	= 8                        ' 一页10行
Dim iTotalPages			: iTotalPages		= 0
Dim iCols				: iCols				= 9                         ' 8列
Dim iCurrentPage		: iCurrentPage		= GetParam("Page")
Dim sSorting			: sSorting			= GetParam("Sorting")
Dim sSorted				: sSorted			= GetParam("Sorted")
Dim sSortParams			: sSortParams		= ""
Dim sFormParams			: sFormParams		= ""
Dim sDirection			: sDirection		= ""

'******************************************************************************
'----   查询参数
'------------------------------------------------------------------------------
'' 物品或设备名称
dim pGoodsName		: pGoodsName = GetParam("goods_name")

'' 型号规格
dim pModel	    	: pModel = GetParam("model")

'' 单位
dim pUnit	    	: pUnit = GetParam("unit")

'' 库存数
dim pQuantity		: pQuantity = GetParam("quantity")

'' 物品类别
dim pGoodsType		: pGoodsType = GetParam("goods_type")
if IsEmpty(pGoodsType)     then pGoodsType = -1

'' 进货方式
dim pInputMethod	: pInputMethod = GetParam("input_method")
if IsEmpty(pInputMethod)   then pInputMethod = -1

'' 当前状态
dim pCurrentStatus	: pCurrentStatus = GetParam("current_status")
if IsEmpty(pCurrentStatus) then pCurrentStatus = -1

'' 存货仓库
dim pDepotID    	: pDepotID = GetParam("depot_id")
if IsEmpty(pDepotID)       then pDepotID = -1

sFormParams = "goods_name=" & pGoodsName & "&model=" & pModel & "&unit=" & pUnit & "&quantity=" & pQuantity & "&goods_type=" & pGoodsType & "&input_method=" & pInputMethod & "&current_status=" & pCurrentStatus & "&depot_id=" & pDepotID & "&"

'******************************************************************************
'----    选择物品
'------------------------------------------------------------------------------
if UCase(Request.ServerVariables("REQUEST_METHOD") = "POST") then
	dim choose1, choose2, sFormAction
	choose1 = GetParam("choose1")
	choose2 = GetParam("choose2")
	sFormAction = GetParam("FormAction")
	select case sFormAction
	case "input"
		call Input(choose1)
	case "output"
		call Output(choose2)
    case "next":
		call NextStep()
    case "cancel":
		call Cancel()
	end select
end if

'******************************************************************************
'----   构造分页的SQL语句
'------------------------------------------------------------------------------
sSQL = " select t1.goods_id as id,t1.goods_name,t1.model,t1.unit,t1.quantity,t2.type_desc ,t3.depot_name,t1.input_method,t1.current_status" & _
       " from t_goods t1" & _
	   " left join t_goods_type  t2 on t1.goods_type=t2.type_id" & _
	   " left join t_depot  t3 on t1.depot_id=t3.depot_id"
sWhere = " where  t1.current_status = 1 and t1.input_method = 1"
sOrderby = " order by t1.goods_name"
sWhere2 = " where t1.current_status = 7 and t1.input_method = 1"
'******************************************************************************
'----   查询条件限制
'------------------------------------------------------------------------------
'' 物品或设备名称
if pGoodsName <> "" then sWhere = sWhere & " and t1.goods_name like " & ToSQL("%" & pGoodsName & "%","Text")
'' 型号规格
if pModel <> "" then sWhere = sWhere & " and t1.model like " & ToSQL("%" & pModel & "%","Text")
'' 单位
if pUnit <> "" then sWhere = sWhere & " and t1.unit like " & ToSQL("%" & pUnit & "%","Text")
'' 库存数
if pQuantity <> "" then sWhere = sWhere & " and t1.quantity like " & ToSQL("%" & pQuantity & "%","Text")
'------------------------------------------------------------------------------
'' 物品类别
if pGoodsType > 0 then sWhere = sWhere & " and t2.type_id=" & pGoodsType
'' 存货仓库
if pDepotID > 0 then sWhere = sWhere & " and t3.depot_id = " & pDepotID

'******************************************************************************
'----   分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'------------------------------------------------------------------------------
dim arrayFields(7), sDelimiter
sDelimiter = "*"
arrayFields(0)	=	"goods_name"
arrayFields(1)	=	"model"
arrayFields(2)	=	"unit"
arrayFields(3)	=	"quantity"
arrayFields(4)	=	"type_desc"
arrayFields(5)	=	"input_method"
arrayFields(6)	=	"current_status"
arrayFields(7)	=	"depot_name"

call PrepareListData(conn,sSQL & sWhere & sOrderby, Join(arrayFields, sDelimiter), sDelimiter)
'******************************************************************************
%>

<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../include/common.css" type="text/css">

<style type="text/css">
.tdlist		{border-width:0px}
.tdHead	    {border-width:0px}
</style>

<script language="VBScript">
Sub btnSearch_OnClick()
	document.all.frmSearch.submit()
End Sub
</script>
<script language="javascript">
function btnNext_OnClick()
{	
	if( frmInput.output_method.value != "7")
	{
	if( frmInput.row.value == 0 )
	{
		alert("必须先确定出库物品!");
		return;
	}
	}
	frmInput.FormAction.value = "next";
	frmInput.submit();
}
function btnCancel_OnClick()
{
	frmInput.FormAction.value = "cancel";
	frmInput.submit();
}
</script>
<script language="javascript" src="purchase_input_detail.js"></script>

</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg/bg0.jpg">
<br>

<%
'response.write sSQL & sWhere & sOrderby & "<br>" : response.end
Response.Write OuterTableHeader
Response.Write HeaderWithMenu
Response.Write InnerTableHeader
'******************************************************************************
'----   主体从这里开始
'------------------------------------------------------------------------------
Response.Write TableSearch
Response.Write TableHeader
Response.Write TableRecords(sSQL & sWhere & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.Write TableRecords2(sSQL & sWhere2 & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.Write TableAction
'Response.Write TableLink
'------------------------------------------------------------------------------
'----   主体到这里结束
'******************************************************************************
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
Disconnect(conn)
%>

</body>
</html> 

⌨️ 快捷键说明

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