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

📄 goods_update.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%
'#############################################################################################
'#
'#	文件名	 : goods_detail.inc
'#	
'#      创建人	 : yaoxiaohui
'#      日期	 : 2002-11-06
'#
'#	修改历史  : ****年**月**日 ****** 
'#      修改内容  : *********************************
'#
'#	功能描述	 : 库存物品和设备详细信息函数文件
'#      版   本	 : v1.0
'#
'#      Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'#############################################################################################
function TableFormGoods()
	'' 是否设备,0否,1是
	'' 进货方式分类,0全部,1为采购入库,2为移交入库,3为归还入库
	'' 库存状态分类,0全部,1在库中,2已借出,3已报废,4已退货,5已领用,6已移出
	'' 提醒状态分类,1正常中,2提醒中,3采购中

	dim sGoodsID, sGoodsName, sModel, sUnit, sQuantity, sGoodsDesp, sIsEquip
	dim sGoodsType, sMinQuantity, sUnitPrice, sBestBefore, sRemark, sRemindStatus
	dim sDepotID, sLocation, sKeeper, sInputMethod, sCurrentStatus
	dim sSQL
	
	sSQL = "select goods_id,goods_name,model,unit,quantity,goods_desp,is_equip" & _
	      " ,goods_type,min_quantity,unit_price,best_before,remark,remind_status" & _
		  " ,depot_id,location,keeper,input_method,current_status" & _
		  " from t_goods" & _
          " where goods_id =" & pGoodsID 
	
	'response.write sSQL
	'response.end
	
	dim rs	: set rs = Openrs(conn,sSQL)
	
	'' 若找不到相应的记录,则跳转到出错页面
	if rs.EOF then
			Response.Clear
			Server.Transfer("../common/error.asp")
			Response.end
	end if

	    sGoodsID			    = rs("goods_id")              ''物品ID
	    sGoodsName			    = rs("goods_name")            ''物品名称
	    sModel			        = rs("model")                 ''型号规格
		sUnit		        	= rs("unit")                  ''单位
		sQuantity			    = rs("quantity")              ''库存数
		sGoodsDesp              = rs("goods_desp")            ''描述
		sIsEquip                = rs("is_equip")              ''是否设备
		sGoodsType		    	= rs("goods_type")             ''物品类别
		sMinQuantity            = GetValue(rs,"min_quantity") ''最小库存数
		sUnitPrice              = rs("unit_price")            ''单价
		sBestBefore             = rs("best_before")           ''保质期
		sRemark                 = rs("remark")                ''备注
		sRemindStatus           = rs("remind_status")         ''提醒状态
		sLocation               = rs("location")              ''存货位置
		sKeeper                 = rs("keeper")                ''保管员
		sInputMethod	        = rs("input_method")		  ''入库方式
		sCurrentStatus			= rs("current_status")        ''当前状态
		sDepotID		    	= rs("depot_id")	          ''仓库名称

	rs.Close()
	set rs = nothing
	
	if sMinQuantity = "" then
		sMinQuantity = "未设置"
	end if

	TableFormGoods = _
		"<form name=""frmDetail"" method=post action=""" & sFileName & """>" & vbLF  & _
		"<input type=""hidden"" name=""FormAction"">" & vbLF & _
		"<input type=""hidden"" name=""id"" value=""" & sGoodsID &""">" & _
		"<table cellspacing=1 cellpadding=3 bgcolor=""silver"" width=""100%"" border=0 style=""table-layout:fixed"">" & vbLF & _
		"	<tr style=""display:none"">" & vbLF & _
		"		<td width=75>这一行仅用于控制每一栏的宽度</td><td width=75>这一行仅用于控制每一栏的宽度</td>" & vbLF & _
		"		<td width=75>这一行仅用于控制每一栏的宽度</td><td width=75>这一行仅用于控制每一栏的宽度</td>" & vbLF & _
		"		<td width=75>这一行仅用于控制每一栏的宽度</td><td width=75>这一行仅用于控制每一栏的宽度</td>" & vbLF & _
		"		<td width=75>这一行仅用于控制每一栏的宽度</td><td width=75>这一行仅用于控制每一栏的宽度</td>" & vbLF & _
		"	</tr>" & vbLF & _
		
		"	<tr bgcolor=""#0040a0"" style=""color:white;font-weight:600"">" & vbLF & _
		"		<td colspan=8 align=center>物品或设备详细情况一览</td>" & vbLF & _
		"	</tr>" & vbLF & _
		
		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td align=center>物品名称</td>" & vbLF & _
		"       <td colspan=3><input type=""text"" name=""goods_name"" value=""" & sGoodsName & """ size=20 maxlength=20></td>" & vbLF & _
		"		<td align=center>型号规格</td>" & vbLF & _
		"       <td><input type=""text"" name=""model"" value=""" & sModel & """ size=10 maxlength=20></td>" & vbLF & _
		"		<td align=center>单位</td>" & vbLF & _
		"       <td><input type=""text"" name=""unit"" value=""" & sUnit & """ size=10 maxlength=20></td>" & vbLF & _
		"	</tr>" & vbLF & _
		
		"	<tr bgcolor=white height=25>" & vbLF & _
		"       <td align=center>是否设备</td>" & vbLF & _
		"			<td><select name=""is_equip"" style=""width:70"">" & vbLF & _
		"                 <option value=""0"">否</option>" & _
		"                 <option value=""1"">是</option>" & _
		"			</select>" & _
		"		<script language=""javascript"">document.all.is_equip.selectedIndex=" & (sIsEquip) & "</script>" & _
		"</td>" & vbLF & _
		"       <td align=center>类别</td>" & vbLF & _
		"       <td>" & vbLF & _
		"			<select name=""goods_type"" style=""width:70"">" & vbLF & _
							SelectOptions(conn, "select *from t_goods_type", "type_id", "type_desc", sGoodsType) & vbLF & _
		"			</select></td>" & vbLF & _
		"       <td align=center>单价</td>" & vbLF & _
		"       <td><input type=""text"" name=""unit_price"" value=""" & sUnitPrice & """ size=10 maxlength=20></td>" & vbLF & _
		"       <td align=center>库存数</td>" & vbLF & _
		"       <td><input type=""text"" name=""quantity"" value=""" & sQuantity & """ size=10 maxlength=20></td>" & vbLF & _
		"	</tr>" & vbLF & _

		"	<tr bgcolor=white>" & vbLF & _
		"       <td align=center>描述</td>" & vbLF & _
		"       <td valign=top colspan=7 style=""word-wrap:break-word;""><textarea name=""goods_desp"" rows=3 cols=91>" & sGoodsDesp & "</textarea></td>" & vbLF & _
		"	</tr>" & vbLF & _

		"	<tr bgcolor=white height=25>" & vbLF & _
		"		<td align=center>保值期至</td>" & vbLF & _
		"       <td colspan = 3><input type=""text"" name=""best_before"" value=""" & sBestBefore & """ size=20 maxlength=20></td>" & vbLF & _
		"		<td align=center>当前状态</td>" & vbLF & _
		"       <td>" & vbLF & _
		"			<select name=""current_status"" style=""width:70"">" & 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=" & (sCurrentStatus-1) & "</script>" & _
		"</td>" & vbLF & _
		"		<td align=center>最小库存</td>" & vbLF & _
		"       <td><input type=""text"" name=""min_quantity"" value=""" & sMinQuantity & """ size=10 maxlength=20></td>" & vbLF & _
		"	</tr>" & vbLF & _
		
		"	<tr bgcolor=white height=25>" & vbLF & _
		"       <td align=center>存放仓库</td>" & vbLF & _
		"       <td>" & vbLF & _
		"			<select name=""depot_id"" style=""width:70"">" & vbLF & _
							SelectOptions(conn, "select *from t_depot", "depot_id", "depot_name", sDepotID) & vbLF & _
		"			</select></td>" & vbLF & _
		"       <td align=center>存货位置</td>" & vbLF & _
		"       <td><input type=""text"" name=""location"" value=""" & sLocation & """ size=10 maxlength=20></td>" & vbLF & _
		"       <td align=center>保管员</td>" & vbLF & _
		"       <td><input type=""text"" name=""keeper"" value=""" & sKeeper & """ size=10 maxlength=20></td>" & vbLF & _
		"       <td align=center>入库方式</td>" & vbLF & _
		"       <td>" & vbLF & _
		"			<select name=""input_method"" style=""width:70"">" & vbLF & _
		"                                       <option value=""1"">采购入库</option>" & _
		"                                       <option value=""2"">移交入库</option>" & _
		"                                       <option value=""3"">归还入库</option>" & _
		"			</select>" & _
		"		<script language=""javascript"">document.all.input_method.selectedIndex=" & (sInputMethod-1) & "</script>" & _
		"</td>" & vbLF & _
		"	</tr>" & vbLF & _
		
		"	<tr bgcolor=white>" & vbLF & _
		"		<td align=center>备注</td>" & vbLF & _
		"		<td valign=top colspan=7 style=""word-wrap:break-word;"">" & vbLF & _
		"       <textarea name=""remark"" rows=3 cols=91>" & sRemark & "</textarea></td>" & vbLF & _
		"</table>" & _
		"<tr height=30 bgcolor=white>" & vbLF & _
        "	 <td  colspan = 8 align=center>" & _
		"		<span title=""修改物品基本信息,然后点击按钮更新"" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnUpdate_OnClick();"">" & _
		"			<img border=0 src=""../images/modify.gif"" style=""vertical-align:middle"">确定更新</span>" & vbLF & _	
		"		<span>&nbsp;&nbsp;&nbsp;</span>" & _
		"		<span title=""关闭窗口"" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""JavaScript:closes.Click();"">" & _
		"			<img border=0 src=""../images/delete.gif"" style=""vertical-align:middle"">关闭窗口</span>" & _
		"    </td>" & vbLF & _	
		"</tr></form>" & vbLF
end function
'****************************************************************************************
function UpdateBasic()
	dim sGoodsID, sGoodsName, sModel, sUnit, sQuantity, sGoodsDesp, sIsEquip
	dim sGoodsType, sMinQuantity, sUnitPrice, sBestBefore, sRemark, sRemindStatus
	dim sDepotID, sLocation, sKeeper, sInputMethod, sCurrentStatus
	dim sSQL
	    
		sGoodsID			    = GetParam("id")				    ''物品ID
	    sGoodsName			    = GetParam("goods_name")            ''物品名称
	    sModel			        = GetParam("model")                 ''型号规格
		sUnit		        	= GetParam("unit")                  ''单位
		sQuantity			    = GetParam("quantity")              ''库存数
		sGoodsDesp              = GetParam("goods_desp")            ''描述
		sIsEquip                = GetParam("is_equip")              ''是否设备
		sGoodsType		    	= GetParam("goods_type")            ''物品类别
		sMinQuantity            = GetParam("min_quantity")          ''最小库存数
		sUnitPrice              = GetParam("unit_price")            ''单价
		sBestBefore             = GetParam("best_before")           ''保质期
		sRemark                 = GetParam("remark")                ''备注
		sLocation               = GetParam("location")              ''存货位置
		sKeeper                 = GetParam("keeper")                ''保管员
		sInputMethod	        = GetParam("input_method")		    ''入库方式
		sCurrentStatus			= GetParam("current_status")        ''当前状态
		sDepotID		    	= GetParam("depot_id")				''仓库名称

		if sMinQuantity = "未设置" then
			sMinQuantity = ""
		end if
	sSQL = "update t_goods set goods_name = " & ToSQL(sGoodsName, "Text") & _
		", model = " & ToSQL(sModel, "Text") & _
		", unit = " & ToSQL(sUnit, "Text") & _
		", quantity = " & ToSQL(sQuantity, "Number") & _
		", goods_desp = " & ToSQL(sGoodsDesp, "Text") & _
		", is_equip = " & ToSQL(sIsEquip, "Number") & _
		", goods_type = " & ToSQL(sGoodsType, "Number") & _
		", min_quantity = " & ToSQL(sMinQuantity, "Number") & _
		", unit_price = " & ToSQL(sUnitPrice, "Number") & _
		", best_before = " & ToSQL(sBestBefore, "Text") & _
		", remark = " & ToSQL(sRemark, "Text") & _
		", location = " & ToSQL(sLocation, "Text") & _
		", keeper = " & ToSQL(sKeeper, "Text") & _
		", input_method = " & ToSQL(sInputMethod, "Number") & _
		", current_status = " & ToSQL(sCurrentStatus, "Number") & _
		", depot_id = " & ToSQL(sDepotID, "Number") & _		
		" where goods_id = " & ToSQL(sGoodsID, "Number")

	'response.write sSQL & "<br>" : response.end
	call Openrs(conn, sSQL)
end function

'*********************************************************************************************
%>

⌨️ 快捷键说明

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