📄 purchase_mgr.inc
字号:
<%
'*******************************************************************************
Function SheetSearch()
'' 进货方式分类,0全部,1为采购入库,2为移交入库,3为归还入库
'' 库存状态分类,0全部,1在库中,2已借出,3已报废,4已退货,5已领用,6已移出, 7待选择
'' 提醒状态分类,0不需提醒,1正常,2已提醒,3采购中
'' 出库方式分类,1入库,2移入,3归还,4领用,5退货,6报废,7移出,8借出
select case pPayMode
case "现金"
pPayMode = 1
case "支票"
pPayMode = 2
case "转账"
pPayMode = 3
end select
select case pSheetStatus
case "新建"
pSheetStatus = "1"
case "完成"
pSheetStatus = "2"
case "入库"
pSheetStatus = "3"
end select
SheetSearch = _
"<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=""" & sFileName & """>" & 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>" & vbLF & _
" <select name=""supplier"" style=""width:80"">" & vbLF & _
" <option value=-1>全部</option>" & vbLF & _
SelectOptions(conn, "select *from t_firm", "id", "name", pSupplier) & vbLF & _
" </select></td>" & vbLF & _
" <td align=right>采 购 人:</td>" & vbLF & _
" <td><input type=""text"" name=""buyer"" value=""" & pBuyer & """ size=12 maxlength=20>" & vbLF & _
" <td align=right colspan=1>申购部门:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""department"" style=""width:80"">" & vbLF & _
" <option value=-1>全部</option>" & vbLF & _
SelectOptions(conn, "select *from t_node", "node_id", "node_desp", pDepartID) & vbLF & _
" </select></td>" & vbLF & _
" <td align=right>申 购 人:</td>" & vbLF & _
" <td><input type=""text"" name=""proposer"" value=""" & pProposer & """ size=12 maxlength=20>" & vbLF & _
" </tr>" & vbLF & _
" <tr height=30 bgcolor=white>" & vbLF & _
" <td align=right>批准日期:</td>" & vbLF & _
" <td>" & DrawCal("", pDay, "purchase_time", "dateimg") & "</td>" & _
" <td align=right>申请金额:</td>" & vbLF & _
" <td><input type=""text"" name=""request_price"" value=""" & pReqPrice & """ size=12 maxlength=20>" & vbLF & _
" <td align=right colspan=1>支付方式:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""pay_mode"" style=""width:80"">" & vbLF & _
" <option value=0>全部</option>" & vbLF & _
" <option value=1>现金</option>" & _
" <option value=2>支票</option>" & _
" <option value=3>转账</option>" & _
" </select>" & _
" <script language=""javascript"">document.all.pay_mode.selectedIndex=" & (pPayMode) & "</script>" & _
"</td>" & vbLF & _
" <td align=right>支票抬头:</td>" & vbLF & _
" <td><input type=""text"" name=""cheque"" value=""" & pCheque & """ size=12 maxlength=20>" & vbLF & _
" </tr>" & vbLF & _
" <tr height=30 bgcolor=white>" & vbLF & _
" <td align=right>物品类别:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""goods_type"" style=""width:80"">" & 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=""is_temporary"" style=""width:80"">" & vbLF & _
" <option value=""-1"">全部</option>" & vbLF & _
" <option value=""0"">常规</option>" & _
" <option value=""1"">临时</option>" & _
" </select>" & _
" <script language=""javascript"">document.all.is_temporary.selectedIndex=" & (pIsTemp+1) & "</script>" & _
"</td>" & vbLF & _
" <td align=right>采购单状态:</td>" & vbLF & _
" <td>" & vbLF & _
" <select name=""sheet_status"" style=""width:80"">" & vbLF & _
" <option value=0>全部</option>" & vbLF & _
" <option value=1>新建</option>" & _
" <option value=2>完成</option>" & _
" <option value=3>入库</option>" & _
" </select>" & _
" <script language=""javascript"">document.all.sheet_status.selectedIndex=" & (pSheetStatus) & "</script>" & _
"</td>" & vbLF & _
" <td align=center colspan=2><span style=""cursor:hand"" title=""设置查询条件,然后点击查询按钮进行查询"" onclick=""btnSearch_OnClick();""><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=""13%"">这一行仅用于控制表格的宽度</td>" & vbLF & _
" <td width=""10%""></td>" & vbLF & _
" <td width=""12%""></td>" & vbLF & _
" <td width=""10%""></td>" & vbLF & _
" <td width=""10%""></td>" & vbLF & _
" <td width=""10%""></td>" & vbLF & _
" <td width=""10%""></td>" & vbLF & _
" <td width=""12%""></td>" & vbLF & _
" <td width=""13%""></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, "sheet_id", "采购单编号", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "goods_type", "类别", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "is_temporary", "采购单类型", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "supplier", "供货商", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "buyer", "采购人", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "department", "申购部门", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "proposer", "申购人", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "sheet_status", "采购单状态", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "purchase_time", "批准日期", 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 rs : set rs = Openrs(conn,sSQL)
dim sSheetID,sDepart,sProposer,sBuyer,sSupplier,sIsTemp,sSheetStatus,sGoodsType,sDay
''response.write sSQL : response.end
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.move (iCurrentPage - 1) * iRecordsPerPage
end if
while not rs.EOF and iCounter <= iRecordsPerPage
sSheetID = rs("sheet_id")
sDepart = rs("department")
sProposer = rs("proposer")
sBuyer = rs("buyer")
sSupplier = rs("supplier")
sIsTemp = rs("is_temporary")
sSheetStatus = rs("sheet_status")
sGoodsType = rs("goods_type")
sDay = GetValue(rs,"purchase_time")
select case sIsTemp
case "0"
sIsTemp = "常规"
case "1"
sIsTemp = "临时"
end select
sql = "select node_desp from t_node where node_id =" & sDepart
sDepart = DLookUp(conn,sql)
sql = "select name from t_firm where id =" & sSupplier
sSupplier = DLookUp(conn,sql)
sql = "select type_desc from t_goods_type where type_id =" & sGoodsType
sGoodsType = DLookUp(conn,sql)
sTemp = sTemp & "<tr bgcolor=white height=20>" & _
"<td title=""点击可以察看采购单" & sSheetID & "的信息"" style=""cursor:hand;color:blue;"" onclick=""javascript:location.href='purchase_goto.asp?sheet_id=" & sSheetID & "';"" nowrap> <img src=""../images/bg/ar-g.gif"" width=8 height=8> " & sSheetID & " </td>" & _
"<td align=center title=""" & sGoodsType & """ nowrap> " & sGoodsType & " </td>" & _
"<td align=center title=""" & sIsTemp & """ nowrap> " & sIsTemp & " </td>" & _
"<td align=center title=""" & sSupplier & """ nowrap> " & sSupplier & " </td>" & _
"<td align=center title=""" & sBuyer & """ nowrap> " & sBuyer & " </td>" & _
"<td align=center title=""" & sDepart & """ nowrap> " & sDepart & " </td>" & _
"<td align=center title=""" & sProposer & """ nowrap> " & sProposer & " </td>" & _
"<td align=center title=""" & sSheetStatus & """ nowrap> " & sSheetStatus & " </td>" & _
"<td align=center title=""" & sDay & """ nowrap> " & sDay & " </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()
TableLink = _
"<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=""purchase_remind.asp"">采购提醒处理</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/goods_query.asp"">库存查询</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../stock/purchase_input.asp"">采购入库</a>" & vbLF & _
" " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""purchase_new.asp"">新建采购</a></td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -