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

📄 editworksheet.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%Function optionselect(i,iR)            	if CStr(i)=CStr(iR) then    	               	optionselect=" selected "    	else    	                	optionselect=""    	end if    end FunctionFunction EditWorksheetForm()	dim sTemp,sTemp1	dim iEquisysid,iObjecttype,iFormtype,iUrgency,sContent,iDepartment,sStarttime,sFailuretime	dim iRemindmethod,iPlanhours,iLimitdays,iPlanid,iFinished,sRecorder	dim sObjectname,sObjecttype,sFormtype,sUrgency,sFinished,sDepartment,sRemindmethod	 	dim sSQL	sSQL=" select * from t_worksheet where worksheet_id="&ToSQL(pWorksheetid,"number")		dim rs		set rs = OpenRS(conn, sSQL)		'' 若找不到相应的记录,则跳转到出错页面			if rs.EOF then			CloseRS(rs)			Response.Clear			response.redirect("../include/error.asp?error=没有找到该工作单记录")			Response.end	end if		iEquisysid		= GetValue(rs,"equi_sys_id")	iObjecttype		= GetValue(rs,"object_type")	iFormtype		= GetValue(rs,"form_type")			iUrgency		= GetValue(rs,"urgency")	sContent                =GetValue(rs,"content")		iDepartment		= GetValue(rs,"department")	sStarttime		= GetValue(rs,"starttime")	sFailuretime            = GetValue(rs,"failuretime")	sRecorder               = GetValue(rs,"recorder")	iRemindmethod                 = GetValue(rs,"remind_method")        iPlanhours                 = GetValue(rs,"plan_hours")            iLimitdays		= GetValue(rs,"limit_days")        iPlanid                 = GetValue(rs,"plan_id")        iFinished               =GetValue(rs,"finished")		CloseRs(rs)if iFinished=0 then		select case iFormtype		case 0			sFormtype="常规"			sTemp=	"		<td align=center>维保计划号</td>" & _				"               <td class=tdValue nowrap>"&iPlanid&"</td>"			        case 1	                sFormtype="临时"	                sTemp=	"		<td align=center>客户意见号</td>" & _				"               <td class=tdValue nowrap>"&DLookUp(conn,"select complaint_id from t_customer_complaints where worksheet_id="&pWorksheetid)&"</td>"						        case else	                sFormtype=""	                sTemp="<td colspan=2></td>"			end select              	EditWorksheetForm= _				"<form method=post name=""frmEditWorksheet"" action=""editworksheet.asp"" >" & vbLF & _									"<table width=600 cellspacing=1 cellpadding=3 bgcolor=""silver"" align=center background=""images/bgdots.gif"">" & vbLF & _		"	<tr >" & vbLF & _		"		<td width=90></td><td width=100></td>" & vbLF & _		"		<td width=90></td><td width=100></td>" & vbLF & _		"		<td width=90></td><td width=""*""></td>" & vbLF & _				"	</tr>" & vbLF & _		"	<tr bgcolor=""#0040a0"" style=""color:white;font-weight:600"">" & vbLF & _		"		<td colspan=6 align=center>修改工作单相关信息</td>" & vbLF & _		"	</tr>" & vbLF & _		"	<tr bgcolor=white height=25>" & vbLF & _		"		<td align=center>对象号</td>" & _		"               <td class=tdValue nowrap><input type=""text"" name=""equisysid"" value="&iEquisysid&" size=13 maxlength=12></td>" & vbLF & _		"		<td align=center>目标类型</td>"& _				"               <td class=tdValue nowrap><select name=""object_type""><option value=0 "& optionselect(iObjecttype,0)&">系统</option><option value=1 "& optionselect(iObjecttype,1)&">设备</option></select></td>" & vbLF & _				                sTemp&_		"	</tr>" & vbLF & _				"	<tr bgcolor=white height=25>" & vbLF & _		"		<td align=center>工作单类型</td>" & _		"		<td class=tdValue nowrap>"&sFormtype&"</td>"&_		"		<td align=center>紧急程度</td>" & _		"		<td class=tdValue nowrap><select name=""urgency"">" & vbLF & _				"					<option value=0 "& optionselect(iUrgency,0)&">普通</option>" & vbLF & _		"					<option value=1 "& optionselect(iUrgency,1)&">紧急</option>" & vbLF & _				"					<option value=2 "& optionselect(iUrgency,2)&">非常紧急</option>" & vbLF & _										"			</select></td>"&_		"		<td align=center>负责部门</td>" & _		"		<td align=center><select name=""department"" style=""width:80"">" & vbLF & _						selectOptions(conn, "select * from t_node where mark=0", "node_id", "node_desp", iDepartment) & vbLF & _						"</select></td>" & vbLF & _			"	</tr>" & vbLF & _		"	<tr bgcolor=white>" & vbLF & _		"		<td align=center>工作单内容</td>" & vbLF & _		"		<td valign=center colspan=5 style=""word-wrap:break-word;""><textarea name='content' cols=75 rows=6 onkeypress='this.style.color=red' onchange='this.style.color=red'>"&sContent&"</textarea></td>" & vbLF & _				"	</tr>" & vbLF & _		"	<tr bgcolor=white height=25>" & vbLF & _		"		<td align=center>开始时间<font color=red>*</font></td>" & _		"               <td class=tdValue nowrap><input type=""text"" name=""starttime"" value="""&sStarttime&""" size=19 maxlength=19></td>" & vbLF & _		"		<td align=center>故障时间<font color=red>*</font></td>" & _		"               <td class=tdValue nowrap><input type=""text"" name=""failuretime"" value="""&sFailuretime&""" size=19 maxlength=19></td>" & vbLF & _				"		<td align=center>记录人</td>" & _		"               <td class=tdValue nowrap><input type=""text"" name=""recorder"" value="&sRecorder&" size=9 maxlength=9></td>" & vbLF & _								"	</tr>" & vbLF & _		"	<tr bgcolor=white height=25>" & vbLF & _		"		<td align=center>提醒方式</td>" & _		"		<td class=tdValue nowrap><select name=""remindmethod"">" & vbLF & _				"					<option value=0 "& optionselect(iRemindmethod,0)&">不提醒</option>" & vbLF & _		"					<option value=1 "& optionselect(iRemindmethod,1)&">提前一天提醒</option>" & vbLF & _							"					<option value=2 "& optionselect(iRemindmethod,2)&">提前二天提醒</option>" & vbLF & _							"					<option value=3 "& optionselect(iRemindmethod,3)&">提前三天提醒</option>" & vbLF & _							"					<option value=4 "& optionselect(iRemindmethod,4)&">提前四天提醒</option>" & vbLF & _							"					<option value=5 "& optionselect(iRemindmethod,5)&">提前五天提醒</option>" & vbLF & _							"					<option value=6 "& optionselect(iRemindmethod,6)&">提前六天提醒</option>" & vbLF & _							"					<option value=7 "& optionselect(iRemindmethod,7)&">提前七天提醒</option>" & vbLF & _									"			</select></td>"&_		"		<td align=center>预设工时</td>" & _		"               <td class=tdValue nowrap><input type=""text"" name=""planhours"" value="&iPlanhours&" size=9 maxlength=9>小时</td>" & vbLF & _		"		<td align=center>完成期限</td>" & _		"               <td class=tdValue nowrap><input type=""text"" name=""limitdays"" value="&iLimitdays&" size=9 maxlength=9>天</td>" & vbLF & _				"	</tr>" & vbLF & _		"		<tr bgcolor=white align=center>" & vbLF & _		"				<td colspan=6>" & _		"                               <input type=hidden name=worksheetid value="""&pWorksheetid&""">" & _			"   <input type=hidden name=formaction>" & _						"		<img border=0 src=""../images/button/update.gif"" style=""cursor:hand"" onclick=""javascript:CheckInput()"">" & _					"		<img border=0 src=""../images/button/delete.gif"" style=""cursor:hand"" name=btnDelete>" & _					"		<img border=0 src=""../images/button/reset.gif"" style=""cursor:hand"" name=btnReset onclick=""frmEditWorksheet.reset();"">"&_					"		<img border=0 src=""../images/button/return.gif"" style=""cursor:hand"" name=btnReturn >"&_ 		"	</tr>" & vbLF & _ 		"	<tr bgcolor=white height=25>" & vbLF & _ 		"       <td colspan=6 ><font color=red>注:标*的输入框为日期时间类型,格式:2002-11-20 12:00:00或者2002-11-20</font></td>"&_		"	</tr>" & vbLF & _			"</table>" & vbLF & _		"</form>" & vbLFelse	EditWorksheetForm="本工作单状态为已办或不可知,不能修改或删除!"end if					End FunctionFunction TableLink()	'' 这是管理页面,因此每个链接都没有限制	TableLink = _		"<table width=600 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>&nbsp;" & vbLF & _		"		<img src=""../images/goto.gif"">&nbsp;<a href=""../worksheet/list_worksheet.asp"">工作单管理</a>" & vbLF & _		"		&nbsp;&nbsp;&nbsp;" & vbLF & _				"</tr>" & _		"</table>"End FunctionSub EditWorksheet()	dim sSQL,sError,sClientHost,iPass,sFormaction,iFormtype,iComplaintid        dim iEquisysid,iObjecttype,iUrgency,sContent,iDepartment,iRemindemethod,iPlanhours,iLimitdays,sStarttime,sFailuretime,sRecorder		iEquisysid=GetParam("equisysid")	iObjecttype=GetParam("object_type")			iUrgency=GetParam("urgency")	sContent=GetParam("content")		iDepartment=GetParam("department")	iRemindemethod=GetParam("remindmethod")	iPlanhours=GetParam("planhours")		iLimitdays=GetParam("limitdays")			  	sStarttime=GetParam("starttime")	sFailuretime=GetParam("failuretime")	sRecorder=Getparam("recorder")	sFormaction=Getparam("formaction")        select case sFormaction   case "update"		iRow=0	if IsEmpty(iObjecttype) then 	    	else        	if IsEmpty(iEquisysid) then        		        	else                 		if iObjecttype=0 then                 		        	     			iRow=DLookUp(conn,"select count(*) from t_sys where sys_id="&ToSQL(iEquisysid,"number"))	     		elseif iObjecttype=1 then	     		        	     		        iRow=DLookUp(conn,"select count(*) from t_equipment where equi_id="&ToSQL(iEquisysid,"number"))	     		else	        		iRow=0	     		end if		end if	end if	if iRow=0 then	      	     	response.write "<script language=javascript >alert('对不起,系统或设备不存在!')</script>"	     	response.write "<script language=javascript >history.back();</script>"	     	response.end	     			        end if				if iRemindemethod="" then iRemindemethod=0	if iLimitdays="" then iLimitdays=0				sSQL = "update t_worksheet set equi_sys_id= " &ToSQL(iEquisysid,"number")&",object_type="&_	                                         ToSQL(iObjecttype,"number")&",urgency="&_	                                        	                                         	                                         ToSQL(iUrgency,"number")&",content="&_	                                         ToSQL(sContent,"text")&",department="&_	                                         ToSQL(iDepartment,"number")&",recorder="&_	                                         ToSQL(sRecorder,"text")&",starttime="&_	                                         ToSQL(sStarttime,"text")&",failuretime="&_	                                         ToSQL(sFailuretime,"text")&",remind_method="&_	                                         ToSQL(iRemindemethod,"number")&",plan_hours="&_	                                         ToSQL(iPlanhours,"number")&",limit_days="&_	                                         	                                         ToSQL(iLimitdays,"number")&" where worksheet_id="&ToSQL(pWorksheetid,"number")	                                         	conn.Execute(sSQL)        sError=ProcessError(conn)                		                                       		if sError <> "" then		response.write "<script language=""javascript"">alert('对不起,修改工作单失败!错误为:"&sError&"')</script>"	else	        response.write "<script language=""javascript"">alert('对不起,成功修改工作单')</script>"		Response.Redirect("worksheet.asp?worksheetid="&pWorksheetid)                response.end							end if		   case "delete"      	iRow=0   	iRow=DLookUp(conn,"select count(*) from t_worksheet where worksheet_id="&ToSQL(pWorksheetid,"number"))   	if iRow>0 then   		iFormtype=DLookUp(conn,"select form_type from t_worksheet where worksheet_id="&ToSQL(pWorksheetid,"number"))                if iFormtype=1 then                	                	conn.Execute("update t_customer_complaints set worksheet_id=null where worksheet_id="&ToSQL(pWorksheetid,"number"))                	                end if                         else           	response.write "<script language=""javascript"">alert('对不起,不存在该工作单')</script>"		Response.Redirect("list_worksheet.asp")                response.end		   	end if                conn.Execute("delete from t_worksheet where worksheet_id="&ToSQL(pWorksheetid,"number"))        sError=ProcessError(conn)                		                                       		if sError <> "" then		response.write "<script language=""javascript"">alert('对不起,删除工作单失败!错误为:"&sError&"')</script>"	else	        response.write "<script language=""javascript"">alert('对不起,成功删除工作单')</script>"		Response.Redirect("list_worksheet.asp")                response.end							end if	   case elseend select			End Sub%>

⌨️ 快捷键说明

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