📄 borrow_input_master.inc.bak
字号:
<%
'###############################################################################
'#
'# 文件名 : handover_output_detail.inc
'#
'# 创建人 : yaoxiaohui
'# 日期 : 2002-11-06
'#
'# 修改历史 : ****年**月**日 ******
'# 修改内容 : *********************************
'#
'# 功能描述 : 移交出库函数文件
'# 版 本 : v1.0
'#
'# Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'###############################################################################
'*******************************************************************************
Function TableHeader()
TableHeader = _
"<form name=""frmSheetDetail"" method=post action=""" & sFileName & """>" & vbLF & _
"<input type=""hidden"" name=""FormAction"">" & vbLF & _
"<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=70></td>" & vbLF & _
" <td width=70></td>" & vbLF & _
" <td width=70></td>" & vbLF & _
" <td width=40></td>" & vbLF & _
" <td width=40></td>" & vbLF & _
" <td width=90></td>" & vbLF & _
" <td width=90></td>" & vbLF & _
" <td width=90></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> 序号</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "goods_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, "unit", "单位", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "quantity", "数量", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> " & TableHeaderField(sFileName, "due_return_date", "预计归还日期", sFormParams, sSorting, sSorted) & "</td>" & _
"<td class=tdHead align=center> 实际归还日期</td>" & _
"<td class=tdHead align=center> 备注</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 sGoodsID, sGoodsName ,sModel, sUnit, sQuantity, sSheetID, sDueDate
''response.write sSQL : response.end
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.move (iCurrentPage - 1) * iRecordsPerPage
end if
pOpDate = date
while not rs.EOF and iCounter <= iRecordsPerPage
rowCount = rowCount + 1
sGoodsID = GetValue(rs,"goods_id")
sGoodsName = GetValue(rs,"goods_name")
sSheetID = GetValue(rs,"sheet_id")
sModel = GetValue(rs,"model")
sQuantity = GetValue(rs,"quantity")
sUnit = GetValue(rs,"unit")
sDueDate = GetValue(rs,"due_return_date")
sTemp = sTemp & "<tr bgcolor=white height=20>" & _
"<td align=center nowrap> " & rowCount & " </td>" & _
"<input type=""hidden"" name=""goods_id_" & rowCount & """ value=""" & sGoodsID &""">" & _
"<input type=""hidden"" name=""sheet_id_" & rowCount & """ value=""" & sSheetID &""">" & _
"<td align=center title=""" & sGoodsName & """ nowrap> " & sGoodsName & " </td>" & _
"<td align=center title=""" & sSheetID & """ nowrap> " & sSheetID & " </td>" & _
"<td align=center title=""" & sModel & """ nowrap> " & sModel & " </td>" & _
"<td align=center title=""" & sUnit & """ nowrap> " & sUnit & " </td>" & _
"<td align=center title=""" & sQuantity & """ nowrap> " & sQuantity & " " & _
"<input type=""hidden"" name=""quantity_" & rowCount & """ value=""" & sQuantity & """></td>" & _
"<td align=center title=""" & sDueDate & """ nowrap> " & sDueDate & " </td>" & _
"<td align=center nowrap><input type=""text"" name=""real_" & rowCount & """ value=""" & pOpdate & """ size=32 maxlength=50></td>" & _
"<td align=center nowrap><input type=""text"" name=""remark_" & rowCount & """ value=""" & pRemark & """ size=32 maxlength=50></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 = _
"<input type=""hidden"" name=""sheet_id"" value=""" & pSheetID & """>" & vbLF & _
"<input type=""hidden"" name=""row_count"" value=""" & rowCount &""">" & _
sTemp & vbLF
End Function
'*********************************************************************************************
function TableAction()
TableAction = _
"<table width=""100%"" cellspacing=0 cellpadding=5 height=30 align=center>" & vbLF & _
" <tr height=10 bgcolor=white><td colspan=8></td></tr>" & vbLF & _
" <tr height=30 bgcolor=white>" & vbLF & _
" <td colspan = 4 align=center>验 收 人:" & vbLF & _
" <input type=""text"" name=""checker"" value=""" & pChecker & """ size=12 maxlength=20>" & _
" </td>" & vbLF & _
" <td colspan = 4 align=center>" & _
" <span title=""填写归还物品的各项细节,然后点击按钮归还"" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnBorrowInput_OnClick();"">" & _
" <img border=0 src=""../images/arrowr.gif"" style=""vertical-align:middle"">确定归还</span>" & _
" " & _
" <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>" & _
"</table></form>"
end function
'*********************************************************************************************
Function BorrowInput()
dim sGoodsName, sModel, sUnit, sQuantity, sGoodsType, sDepotID, sLocation,sSID,sMinQ
dim sGoodsID, sSheetID
dim rowCount : rowCount = GetParam("row_count") ''记录数
dim iCount : iCount = 1
dim sql, sql2, sql3, rs
sql = "insert into t_stock_master(optype,checker,sheet_status)" & _
" values(3," & ToSQL(pChecker,"text") & ",1)"
'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)
sGoodsID = GetParam("goods_id_" & iCount)
pOpdate = GetParam("real_" & iCount)
pRemark = GetParam("remark_" & iCount)
sSID = GetParam("sheet_id_" & iCount)
sQuantity = GetParam("quantity_" & iCount)
sql = "select goods_name,model,quantity,unit,goods_type,depot_id,min_quantity from t_goods" & _
" where goods_id = " & ToSQL(sGoodsID,"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")
sGoodsType = rs("goods_type")
sDepotID = rs("depot_id")
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,goods_type,depot,opdate,remark)" & _
" values(" & ToSQL(sGoodsID,"text") & "," & ToSQL(sSheetID,"number") & _
"," & ToSQL(sGoodsName,"text") & "," & ToSQL(sModel,"text") & _
"," & ToSQL(sUnit,"text") & "," & ToSQL(sQuantity,"number") & _
"," & ToSQL(sGoodsType,"number") & "," & ToSQL(sDepotID,"number") & _
"," & ToSQL(pOpdate,"text") & "," & ToSQL(pRemark,"text") & ")"
call Openrs(conn,sql2)
'response.write sql2 : response.end
sql2 = "update t_stock_detail set real_returned_date =" & ToSQL(pOpdate,"text") & _
",remark =" & ToSQL(pRemark,"text") & _
" where sheet_id =" & ToSQL(sSID,"number") & _
" and goods_id =" & ToSQL(sGoodsID,"text")
'response.write sql2 : response.end
call Openrs(conn,sql2)
Dim sStatus,sGQuantity
sql = "select current_status from t_goods where goods_id =" & ToSQL(sGoodsID,"number")
'response.write sql : response.end
sStatus = DLookUp(conn,sql)
if sStatus = 2 then
sql3 = "update t_goods set current_status = 1" & _
" where goods_id =" & ToSQL(sGoodsID,"number")
call Openrs(conn,sql3)
end if
sql = "select quantity from t_goods where goods_id =" & ToSQL(sGoodsID,"number")
'response.write sql : response.end
sGQuantity = DLookUp(conn,sql)
sQuantity = sQuantity + sGQuantity
sql3 = "update t_goods set quantity = " & ToSQL(sQuantity,"number") & _
" where goods_id =" & ToSQL(sGoodsID,"number")
'response.write sql3 : response.end
call Openrs(conn,sql3)
if sMinQ <> "" then
if (sQuantity + sGQuantity) >= sMinQ then
'response.write sql : response.end
sql = "update t_goods set remind_status = 1 where goods_id =" & ToSQL(sGoodsID,"number")
'response.write sql : response.end
call Openrs(conn,sql)
end if
end if
iCount = iCount + 1
wend
dim pSID, arrayID, j
arrayID = split(pSheetID,",")
for j = 0 to UBound(arrayID) step 1
pSID = arrayID(j)
sql = "select * from t_stock_detail where real_returned_date = Null and sheet_id =" & ToSQL(pSID,"number")
response.write sql : response.end
set rs = Openrs(conn,sql)
'' 出入库单状态分类,0新建,1完成
if rs.EOF then
sql = "update t_stock_master set sheet_status = 1 where sheet_id =" & ToSQL(pSID,"number")
call Openrs(conn,sql)
end if
next
session.contents.remove "goods_id_for_input"
response.redirect "goods_input.asp"
End Function
'*******************************************************************************
sub Cancel()
session.contents.remove "goods_id_for_input"
response.redirect "goods_input.asp"
end sub
'*******************************************************************************
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=""../stock/goods_query.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></td>" & vbLF &_
"</tr>" & vbLF & _
"</table>" & vbLF
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -