📄 newworksheet.inc
字号:
<%Function optionselect(i,iR) if CStr(i)=CStr(iR) then optionselect=" selected " else optionselect="" end if end FunctionFunction AddWorksheetForm() dim sTemp,sTemp1 AddWorksheetForm= _ "<form method=post name=""frmAddWorksheet"" action=""newworksheet.asp"" >" & vbLF & _ "<table width=600 cellspacing=1 cellpadding=3 align=center bgcolor=""silver"" background=""images/bgdots.gif"">" & vbLF & _ " <tr >" & vbLF & _ " <td width=100></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="""&pEquisysid&""" size=13 maxlength=12></td>" & vbLF & _ " <td align=center>目标类型</td>"& _ " <td class=tdValue nowrap><select name=""object_type""><option value=0"& optionselect(pObjecttype,0)&">系统</option><option value=1 "& optionselect(pObjecttype,1)&">设备</option></select></td>" & vbLF & _ " <td align=center>客户意见号</td>" & _ " <td class=tdValue nowrap><input type=""text"" name=""complaintid"" value="""&pComplaintid&""" size=10 maxlength=10></td>" & vbLF & _ " </tr>" & vbLF & _ " <tr bgcolor=white height=25>" & vbLF & _ " <td align=center>工作单类型</td>" & _ " <td class=tdValue nowrap><select name=""formtype"">" & vbLF & _ " <option value=1 selected>临时</option>" & vbLF & _ " </select></td>"&_ " <td align=center>紧急程度</td>" & _ " <td class=tdValue nowrap><select name=""urgency"">" & vbLF & _ " <option value=0 selected>普通</option>" & vbLF & _ " <option value=1>紧急</option>" & vbLF & _ " <option value=2>非常紧急</option>" & vbLF & _ " </select></td>"&_ " <td align=center>负责部门</td>" & _ " <td align=center><select name=""node"" style=""width:80"">" & vbLF & _ selectOptions(conn, "select * from t_node where mark=0", "node_id", "node_desp", "") & 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'></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="""&date&""" size=19 maxlength=19></td>" & vbLF & _ " <td align=center>故障时间<font color=red>*</font></td>" & _ " <td class=tdValue nowrap><input type=""text"" name=""failuretime"" value="""&date&""" size=19 maxlength=19></td>" & vbLF & _ " <td align=center>记录人</td>" & _ " <td class=tdValue nowrap><input type=""text"" name=""recorder"" value="&GetUserName&" 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 selected>不提醒</option>" & vbLF & _ " <option value=1>提前一天提醒</option>" & vbLF & _ " <option value=2>提前二天提醒</option>" & vbLF & _ " <option value=3>提前三天提醒</option>" & vbLF & _ " <option value=4>提前四天提醒</option>" & vbLF & _ " <option value=5>提前五天提醒</option>" & vbLF & _ " <option value=6>提前六天提醒</option>" & vbLF & _ " <option value=7>提前七天提醒</option>" & vbLF & _ " </select></td>"&_ " <td align=center>预设工时</td>" & _ " <td class=tdValue nowrap><input type=""text"" name=""planhours"" size=9 maxlength=9>小时</td>" & vbLF & _ " <td align=center>完成期限</td>" & _ " <td class=tdValue nowrap><input type=""text"" name=""limitdays"" size=9 maxlength=9>天</td>" & vbLF & _ " </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 & _ " <tr bgcolor=white align=center>" & vbLF & _ " <td colspan=6>" & _ " <img border=0 src=""../images/button/submit.gif"" style=""cursor:hand"" onclick=""CheckInput()"">" & _ " <img border=0 src=""../images/button/reset.gif"" style=""cursor:hand"" name=btnReset onclick=""frmAddWorksheet.reset();"">"&_ "</table>" & vbLF & _ "</form>" & vbLFEnd 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> " & vbLF & _ " <img src=""../images/goto.gif""> <a href=""../worksheet/list_worksheet.asp"">工作单管理</a>" & vbLF & _ " " & vbLF & _ "</tr>" & _ "</table>"End FunctionSub AddWorksheet() dim sSQL,sError,sClientHost,iPass dim sEquisysid,sObjecttype,sComplaintid,sFormtype,sUrgency,sContent,sDepartment,sRemindemethod,sPlanhours,limitdays dim sStarttime,sFailuretime,sRecorder,wid sEquisysid=GetParam("equisysid") sObjecttype=GetParam("object_type") sComplaintid=GetParam("complaintid") sFormtype=GetParam("formtype") sUrgency=GetParam("urgency") sContent=GetParam("content") sDepartment=GetParam("node") sRemindemethod=GetParam("remindmethod") sPlanhours=GetParam("planhours") limitdays=GetParam("limitdays") sStarttime=GetParam("starttime") sFailuretime=GetParam("failuretime") sRecorder=GetParam("recorder") if not IsEmpty(sComplaintid) then iRow=0 iRow=DLookUp(conn,"select count(*) from t_customer_complaints where complaint_id="&ToSQL(sComplaintid,"number")) if iRow=0 then Response.Write "<script language=""javascript"">alert('对不起,没有找到客户意见记录!')</script>" response.write "<script language=vbscript>window.navigate(""../complaint/list_complaint.asp"")</script>" response.end else wid=DLookUp(conn,"select worksheet_id from t_customer_complaints where complaint_id="&ToSQL(sComplaintid,"number")) if wid<>"" then Response.Write "<script language=""javascript"">alert('对不起,该客户意见记录已建立工作单,因此不能再建立!')</script>" response.write "<script language=vbscript>window.navigate(""../worksheet/newworksheet.asp"")</script>" response.end end if end if end if iRow=0 if IsEmpty(sObjecttype) then else if IsEmpty(sEquisysid) then else if sObjecttype=0 then iRow=DLookUp(conn,"select count(*) from t_sys where sys_id="&ToSQL(sEquisysid,"number")) elseif sObjecttype=1 then iRow=DLookUp(conn,"select count(*) from t_equipment where equi_id="&ToSQL(sEquisysid,"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 sRemindemethod="" then sRemindemethod=0 end if if Limitdays="" then Limitdays=0 end if sClientHost = Request.ServerVariables("REMOTE_HOST") sSQL = "proc_AddTWorksheet " &ToSQL(sEquisysid,"number")&","&_ ToSQL(sObjecttype,"number")&","&_ ToSQL(sComplaintid,"number")&","&_ ToSQL(sFormtype,"number")&","&_ ToSQL(sUrgency,"number")&","&_ ToSQL(sContent,"text")&","&_ ToSQL(sDepartment,"number")&","&_ ToSQL(sStarttime,"text")&","&_ ToSQL(sFailuretime,"text")&","&_ ToSQL(sRecorder,"text")&","&_ ToSQL(sRemindemethod,"number")&","&_ ToSQL(sPlanhours,"number")&","&_ ToSQL(limitdays,"number") iPass = ExecuteSP(conn,sSQL) if iPass < 0 then if iPass=-1 then sError = "对不起,插入工作单记录失败!" else sError = "对不起,插入工作单成功,但更新客户意见时失败!" end if end if if sError <> "" then response.write "<script language=""javascript"">alert('"&sError&"')</script>" else Response.Redirect("list_worksheet.asp?worksheetid="&iPass) response.end end if End Sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -