📄 goods_query.inc
字号:
<%
'###############################################################################
'#
'# 文件名 : goods_query.inc
'#
'# 创建人 : yaoxiaohui
'# 日期 : 2002-11-06
'#
'# 修改历史 : ****年**月**日 ******
'# 修改内容 : *********************************
'#
'# 功能描述 : 查询库存物品和设备函数文件
'# 版 本 : v1.0
'#
'# Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'###############################################################################
'*******************************************************************************
Function TableSearch()
'' 进货方式分类,0全部,1为采购入库,2为移交入库,3为归还入库
'' 库存状态分类,0全部,1在库中,2已借出,3已报废,4已退货,5已领用,6已移出, 7待选择
'' 提醒状态分类,0不需提醒,1正常,2已提醒,3采购中,4选中的
'' 出库方式分类,1入库,2移入,3归还,4领用,5退货,6报废,7移出,8借出
TableSearch = _
"<table cellspacing=0 cellpadding=3 width=""100%"" align=center border=0>" & vbLF & _
"<tr height=20>" & _
"<td colspan=8 bgcolor=""black"" align=center style=""color:white;font-weight:600"">设置物品和设备查询条件</td></tr>" & _
"<form name=""frmSearch"" method=post action=""goods_query.asp"">" & vbLF & _
" <tr height=10 bgcolor=white><td colspan=8></td></tr>" & vbLF & _
" <tr height=30 bgcolor=white>" & vbLF & _
" <td align=right colspan=1>物品名称:</td>" & vbLF & _
" <td colspan=3><input type=""text"" name=""goods_name"" value=""" & pGoodsName & """ size=20 maxlength=20>" & vbLF & _
" <td align=right colspan=1>型号规格:</td>" & vbLF & _
" <td colspan=3><input type=""text"" name=""model"" value=""" & pModel & """ size=20 maxlength=20>" & vbLF & _
" </tr>" & vbLF & _
" <tr height=30 bgcolor=white>" & vbLF & _
" <td align=right colspan=1>单 位:</td>" & vbLF & _
" <td colspan=3><input type=""text"" name=""unit"" value=""" & pUnit & """ size=20 maxlength=20>" & vbLF & _
" <td align=right colspan=1>库 存 数:</td>" & vbLF & _
" <td colspan=3><input type=""text"" name=""quantity"" value=""" & pQuantity & """ size=20 maxlength=20>" & vbLF & _
" </tr>" & vbLF & _
" <tr height=30 bgcolor=white>" & vbLF & _
" <td align=right>物品类别:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""goods_type"" style=""width:70"">" & vbLF & _
" <option value=-1>全部</option>" & vbLF & _
SelectOptions(conn, "select *from t_goods_type", "type_id", "type_desc", pGoodsType) & vbLF & _
" </select></td>" & vbLF & _
" <td align=right>入库方式:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""input_method"" style=""width:70"">" & vbLF & _
" <option value=0>全部</option>" & vbLF & _
" <option value=""1"">采购入库</option>" & _
" <option value=""2"">移交入库</option>" & _
" <option value=""3"">归还入库</option>" & _
" </select>" & _
" <script language=""javascript"">document.all.input_method.selectedIndex=" & (pInputMethod) & "</script>" & _
"</td>" & vbLF & _
" <td align=right>当前状态:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""current_status"" style=""width:70"">" & vbLF & _
" <option value=0>全部</option>" & vbLF & _
" <option value=""1"">在库中</option>" & _
" <option value=""2"">已借出</option>" & _
" <option value=""3"">已报废</option>" & _
" <option value=""4"">已退货</option>" & _
" <option value=""5"">已领用</option>" & _
" <option value=""6"">已移出</option>" & _
" </select>" & _
" <script language=""javascript"">document.all.current_status.selectedIndex=" & (pCurrentStatus) & "</script>" & _
"</td>" & vbLF & _
" <td align=right>存货仓库:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""depot_id"" style=""width:70"">" & vbLF & _
" <option value=-1>全部</option>" & vbLF & _
SelectOptions(conn, "select *from t_depot", "depot_id", "depot_name", pDepotID) & vbLF & _
" </select></td>" & vbLF & _
" </tr>" & vbLF & _
" <tr height=30 bgcolor=white>" & vbLF & _
" <td align=right colspan=7><span id=btnSearch style=""cursor:hand"" title=""设置查询条件,然后点击查询按钮进行查询""><img border=0 src=""../images/search.gif"" style=""vertical-align:middle"">查询</span></td></tr>" & vbLF & _
" <tr height=10 bgcolor=white><td colspan=8></td></tr>" & vbLF & _
"</form>" & 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=90>这一行仅用于控制表格的宽度</td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=60></td>" & vbLF & _
" <td width=60></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=70></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> <img src=""../images/bg/ar-y.gif"" width=8 height=8> " & TableHeaderField(sFileName, "goods_name", "物品名称", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "model", "型号规格", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "unit", "单位", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "quantity", "库存数", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "type_desc", "物品类别", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "input_method", "入库方式", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "current_status", "当前状态", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "depot_name", "存货仓库", sFormParams, sSorting, sSorted) & "</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 rs : set rs = Openrs(conn,sSQL)
dim GoodsID, sGoodsName, sModel, sUnit, sQuantity, sGoodsType, sInputMethod, sCurrentStatus, sDepotID
''response.write sSQL : response.end
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.move (iCurrentPage - 1) * iRecordsPerPage
end if
while not rs.EOF and iCounter <= iRecordsPerPage
GoodsID = rs("id")
sGoodsName = rs("goods_name")
sModel = rs("model")
sUnit = rs("unit")
sQuantity = rs("quantity")
sGoodsType = rs("type_desc")
sInputMethod = rs("input_method")
sCurrentStatus = rs("current_status")
sDepotID = rs("depot_name")
select case sInputMethod
case "1"
sInputMethod = "采购入库"
case "2"
sInputMethod = "移交入库"
case "3"
sInputMethod = "归还入库"
end select
select case sCurrentStatus
case "1"
sCurrentStatus = "在库中"
case "2"
sCurrentStatus = "已借出"
case "3"
sCurrentStatus = "已报废"
case "4"
sCurrentStatus = "已退货"
case "5"
sCurrentStatus = "已领用"
case "6"
sCurrentStatus = "已移出"
end select
sTemp = sTemp & "<tr bgcolor=white height=20>" & _
"<td title=""点击可以察看“" & sGoodsName & "”的信息"" style=""cursor:hand;color:blue;"" onclick=""javascript:location.href='goods_detail.asp?id=" & GoodsID & "';"" nowrap> <img src=""../images/bg/ar-g.gif"" width=8 height=8> " & sGoodsName & " </td>" & _
"<td align=center title=""" & sModel & """ nowrap> " & sModel & " </td>" & _
"<td align=center title=""" & sUnit & """ nowrap> " & sUnit & " </td>" & _
"<td align=center title=""" & sQuantity & """ nowrap> " & sQuantity & " </td>" & _
"<td align=center title=""" & sGoodsType & """ nowrap> " & sGoodsType & " </td>" & _
"<td align=center title=""" & sInputMethod & """ nowrap> " & sInputMethod & " </td>" & _
"<td align=center title=""" & sCurrentStatus & """ nowrap> " & sCurrentStatus & " </td>" & _
"<td align=center title=""" & sDepotID & """ nowrap> " & sDepotID & " </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) & _
" </td></tr>"
TableRecords = sTemp
End Function
'*******************************************************************************
Function TableLink()
dim sTemp : sTemp = ""
if hasright(ID_STOCK) < RIGHT_WRITE then
sTemp = _
"<table width=""100%"" cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
"<tr height=10>" & vbLF & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
"</tr>" & vbLF & _
"<tr>" & vbLF & _
" <td width=600> " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/depot_list.asp"">仓库管理</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/sheet_mgr.asp"">出入库单管理</a></td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
else
sTemp = _
"<table width=""100%"" cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
"<tr height=10>" & vbLF & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
"</tr>" & vbLF & _
"<tr>" & vbLF & _
" <td width=600> " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/goods_input.asp"">物品入库</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/output.asp"">物品出库</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/goods_move.asp"">物品移动</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/depot_list.asp"">仓库管理</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/type_mgr.asp"">物品类别管理</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/sheet_mgr.asp"">出入库单管理</a></td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
end if
TableLink = sTemp
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -