📄 purchase_input_detail.inc
字号:
<%
'###############################################################################
'#
'# 文件名 : goods_purchase_input.inc
'#
'# 创建人 : yaoxiaohui
'# 日期 : 2002-11-06
'#
'# 修改历史 : ****年**月**日 ******
'# 修改内容 : *********************************
'#
'# 功能描述 : 选择物品和设备入库函数文件
'# 版 本 : v1.0
'#
'# Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'###############################################################################
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=60>这一行仅用于控制表格的宽度</td>" & vbLF & _
" <td width=40></td>" & vbLF & _
" <td width=100></td>" & vbLF & _
" <td width=100></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=60></td>" & vbLF & _
" <td width=100></td></tr>" & vbLF & _
"<tr height=25>" & _
"<td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"">待选物品和设备一览</td></tr>" & _
"<tr height=25 bgcolor=white>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "cargo_id", "代码", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center>选择</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "cargo_name", "物品名称", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "sheet_id", "采购单编号", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "model", "型号规格", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "quantity", "申购数量", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "unit_price", "单价", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "unit", "单位", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & 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 iCounter : iCounter = 1
Dim iPrevPage, iNextPage
Dim rowCount : rowCount = 0
' response.write sSQL & "<br>"
' response.end
'------------------------------------
' 获取数据库连接
'------------------------------------
dim rs : set rs = Openrs(conn,sSQL)
dim sCargoID, sCargoName,sSheetID ,sModel, sUnit, sQuantity, 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
sCargoID = rs("cargo_id")
sCargoName = rs("cargo_name")
sSheetID = rs("sheet_id")
sModel = rs("model")
sQuantity = rs("quantity")
sUnitPrice = rs("unit_price")
sUnit = rs("unit")
sRemark = rs("remark")
sTemp = sTemp & "<tr bgcolor=white height=20>" & _
"<td align=center title=""" & sCargoID & """ nowrap> " & sCargoID & " </td>" & _
"<td align=center><input type=""checkbox"" id=choose1_" & rowCount & " name=""choose1"" value=""" & rowCount & """ style=""border-width:0""></td>" & vbLF & _
"<input type=""hidden"" name=""cargo_id1_" & rowCount & """ value=""" & sCargoID & """>" & vbLF & _
"<td align=center title=""" & sCargoName & """ nowrap> " & sCargoName & " </td>" & _
"<td align=center title=""" & sSheetID & """ nowrap> " & sSheetID & " </td>" & _
"<td align=center title=""" & sModel & """ nowrap> " & sModel & " </td>" & _
"<td align=center title=""" & sQuantity & """ nowrap> " & sQuantity & " </td>" & _
"<td align=center title=""" & sUnitPrice & """ nowrap> " & sUnitPrice & " </td>" & _
"<td align=center title=""" & sUnit & """ nowrap> " & sUnit & " </td>" & _
"<td align=center title=""" & sRemark & """ nowrap> " & sRemark & " </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 = _
"<form method=post name=""frmInput"" action=""" & sFileName & """>" & vbLF & _
"<input type=""hidden"" name=""FormAction"" value=""input"">" & vbLF & _
"<input type=""hidden"" name=""id"" value=""" & pSheetID & """>" & vbLF & _
sTemp & vbLF & _
ActionLink1 & vbLF
End Function
'*********************************************************************************************
Function TableRecords2(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
dim sTemp : sTemp = "" ' 临时字符串变量
dim j ' 临时循环变量
call PrepareListData(conn,sSQL, Join(arrayFields, sDelimiter), sDelimiter)
'------------------------------------
' 分页所需的变量定义
'------------------------------------
Dim iCounter : iCounter = 1
Dim iPrevPage, iNextPage
Dim rowCount : rowCount = 0
' response.write sSQL & "<br>"
' response.end
'------------------------------------
' 获取数据库连接
'------------------------------------
dim rs : set rs = Openrs(conn,sSQL)
dim sCargoID, sCargoName,sSheetID ,sModel, sUnit, sQuantity, sUnitPrice, sRemark
''response.write sSQL : response.end
if rs.EOF then
iCols = 9
iCounter = 4
sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)
end if
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.move (iCurrentPage - 1) * iRecordsPerPage
end if
while not rs.EOF and iCounter <= iRecordsPerPage
rowCount = rowCount + 1
sCargoID = rs("cargo_id")
sCargoName = rs("cargo_name")
sSheetID = rs("sheet_id")
sModel = rs("model")
sQuantity = rs("quantity")
sUnitPrice = rs("unit_price")
sUnit = rs("unit")
sRemark = rs("remark")
sTemp = sTemp & "<tr bgcolor=white height=20>" & _
"<td align=center title=""" & sCargoID & """ nowrap> " & sCargoID & " </td>" & _
"<td align=center><input type=""checkbox"" id=choose2_" & rowCount & " name=""choose2"" value=""" & rowCount & """ style=""border-width:0""></td>" & vbLF & _
"<input type=""hidden"" name=""cargo_id2_" & rowCount & """ value=""" & sCargoID & """>" & vbLF & _
"<td align=center title=""" & sCargoName & """ nowrap> " & sCargoName & " </td>" & _
"<td align=center title=""" & sSheetID & """ nowrap> " & sSheetID & " </td>" & _
"<td align=center title=""" & sModel & """ nowrap> " & sModel & " </td>" & _
"<td align=center title=""" & sQuantity & """ nowrap> " & sQuantity & " </td>" & _
"<td align=center title=""" & sUnitPrice & """ nowrap> " & sUnitPrice & " </td>" & _
"<td align=center title=""" & sUnit & """ nowrap> " & sUnit & " </td>" & _
"<td align=center title=""" & sRemark & """ nowrap> " & sRemark & " </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>"
TableRecords2 = _
"<table cellspacing=1 cellpadding=0 width=""100%"" align=center bgcolor=silver style=""table-layout:fixed"">" & vbLF & _
"<tr style=""display:none"">" & vbLF & _
" <td width=60>这一行仅用于控制表格的宽度</td>" & vbLF & _
" <td width=40></td>" & vbLF & _
" <td width=100></td>" & vbLF & _
" <td width=100></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=80></td>" & vbLF & _
" <td width=60></td>" & vbLF & _
" <td width=100></td></tr>" & vbLF & _
"<tr height=25>" & _
"<td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"">准备入库物品</td></tr>" & _
sTemp & vbLF & _
ActionLink2 & vbLF
End Function
'*********************************************************************************************
Function ActionLink1
ActionLink1 = _
"<img height=2>" & _
"<table cellspacing=0 cellpadding=1 width=""100%"" align=center bgcolor=""#0099cc"" style=""color:white"">" & vbLF & _
"<tr height=20>" & vbLF & _
" <td align=right" & _
" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""CheckAllRows1();"">全部选中</td>" & vbLF & _
" <td align=center" & _
" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnInput_OnClick();"">添加</td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
End Function
'*********************************************************************************************
Function ActionLink2
ActionLink2 = _
"<img height=2>" & _
"<table cellspacing=0 cellpadding=1 width=""100%"" align=center bgcolor=""#0099cc"" style=""color:white"">" & vbLF & _
"<tr height=20>" & vbLF & _
" <td align=right" & _
" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""CheckAllRows2();"">全部选中</td>" & vbLF & _
" <td align=center" & _
" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnOutput_OnClick();"">剔除</td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
End Function
function TableAction()
TableAction = _
"<table width=""100%"" cellspacing=0 cellpadding=5 height=30 align=center>" & vbLF & _
" <tr>" & vbLF & _
" <td align=center>" & _
" <a style=""color:blue"" href=""purchase_input_master.asp?id=" & pSheetID & """><img border=0 src=""../images/arrowr.gif""> 进入采购入库页面</a>" & vbLF & _
" " & vbLF & _
" <a style=""color:blue;cursor:hand;"" onclick=""btnCancel_OnClick();""><img border=0 src=""../images/delete.gif""> 返回选择入库方式页面</a>" & vbLF & _
" </td>" & vbLF & _
" </tr>" & vbLF & _
"</table>"
end function
'*********************************************************************************************
sub Input(choose1)
dim arrayInput, sCargoID, j
dim sSQL1
' response.write choose & "<br>"
' response.end
arrayInput = split(choose1, ",")
' response.Write arrayInput(0) & "<br>"
' response.end
for j = 0 to UBound(arrayInput) step 1
sCargoID = GetParam("cargo_id1_" & Trim(arrayInput(j)))
sSQL1 = "update t_purchase_detail set is_input = 1 where cargo_id = " & sCargoID
call Openrs(conn, sSQL1)
next
end sub
'*********************************************************************************************
sub Output(choose2)
dim arrayOutput, sCargoID, j
dim sSQL2
arrayOutput = split(choose2, ",")
for j = 0 to UBound(arrayOutput) step 1
sCargoID = GetParam("cargo_id2_" & Trim(arrayOutput(j)))
sSQL2 = "update t_purchase_detail set is_input = 0 where cargo_id = " & sCargoID
' response.Write sSQL2 & "<br>"
call Openrs(conn, sSQL2)
next
end sub
Sub Cancel()
dim sql
sql = "update t_purchase_detail set is_input = 0 where is_input = 1"
call Openrs(conn,sql)
response.redirect "goods_input.asp"
response.end
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -