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

📄 oldexecute.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<%option explicit%>
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"
%>
<%
'----------------------------------------------------------------------
'---------------文件包含部分说明---------------------------------------
'----------------------------------------------------------------------
'---------------	使用数据库连接包含	DataEnvi.asp	---------------
'---------------	使用字符串包含	String.asp	-----------------------
'---------------	使用分页操作包含	Page.asp	-------------------
'----------------------------------------------------------------------
%>

<!--#include virtual ="/Include/DataEnvi.asp"-->
<!--#include virtual = "/Include/String.asp"-->
<!--#include virtual = "/Include/Page.asp"-->

<%
	Dim objRS,objDB,strSQL
	Dim	MsgType,RecordID,ComMsgID,IsEnd,FlowID,LocationID,Writer
	Dim	IsPass,Advice
	Dim ExecuteID,PassType,IsNeed,CurrentID
	Dim AccountID,SendTime,Title
	Dim IsShowSelect,strShow
	
	Set	objDB	=	server.CreateObject("Adodb.Connection")
	OpenDB	objDB
	Set	objRS	=	server.CreateObject("ADODB.Recordset")
	
	MsgType			=	Request.Form("MsgType")
	RecordID		=	Request.Form("RecordID")
	ComMsgID		=	Request.Form("ComMsgID")
	IsEnd			=	Request.Form("IsEnd")
	FlowID			=	Request.Form("FlowID")
	LocationID		=	Request.Form("LocationID")
	Writer			=	Request.Form("Writer")
	
	IsPass			=	Request.Form("IsPass")
	Advice			=	FixSql(Request.Form("Advice"))
	
	IsShowSelect	=	False
		
	strSQL	=	"select IsPass,Advice,ExecuteTime,State from t_OA_Work_ComMessage_Record Where ID	= " & RecordID
	objRS.Open strSQL,objDB,1,3
	objRS.Fields("Advice")	=	Advice
	objRS.Fields("IsPass")	=	IsPass
	objRS.Fields("ExecuteTime")	=	Now()
	objRS.Fields("State")		=	2
	objRS.Update()
	objRS.Close()
	
	If	   MsgType = 1 Then
	'	strSQL	=	"select * from t_OA_Work_ComMessage where ID = " & ComMsgID
	'	objRS.Open strSQL,objDB,1,3
	'	objRS.Fields("State")	=	2
	'	objRS.Update()
	'	objRS.Close()
	ElseIf MsgType = 2 Or MsgType=3 Then
		If IsPass=1 Then	'如果同意通过则做以下操作	则继续往下发送
				strSQL = "Select Top 1 ID,IsSend From t_OA_Work_ComMessage_Record Where ComMsgID = " & ComMsgID &	" And ParentID<>0 And IsSend=0"
				objRS.Open strSQL,objDB,1,3
				objRS.Fields("IsSend")	=	1
				CurrentID	=	objRS.Fields("ID")	+	1
				objRS.Update()
				objRS.Close()
				
				strSQL	=	"Select LocationID From t_OA_Work_ComMessage Where ID = " & ComMsgID'更新LocationID
				objRS.Open strSQL,objDB,1,3
				objRS.Fields("LocationID")	=	CurrentID	
				objRS.Update()
				objRS.Close()
		ElseIf IsPass=0 Then	'如果不同意通过则强制中断
			strSQL	=	"select IsEnd from t_OA_Work_ComMessage_Record Where ID	= " & RecordID
			objRS.Open strSQL,objDB,1,3
			objRS.Fields("IsEnd")	=	1	'强制中断
			objRS.Update()
			objRS.Close()
		End If
	ElseIf MsgType = 4 Then
			If IsPass=1 Then
				If Not IsEnd Then	'如果不是工作流的最后节点则让用户选择是否继续往下发送
					IsShowSelect	=	true
				Else	'如果是工作流的最后节点则把公文状态置为 2(已经处理完毕)
					strSQL	=	"select * from t_OA_Work_ComMessage where ID = " & ComMsgID
					objRS.Open strSQL,objDB,1,3
					objRS.Fields("State")	=	2
					objRS.Update()
					objRS.Close()
				End If
			ElseIf IsPass=0 Then
				strSQL	=	"select IsEnd from t_OA_Work_ComMessage_Record Where ID	= " & RecordID
				objRS.Open strSQL,objDB,1,3
				objRS.Fields("IsEnd")	=	1	'强制中断
				objRS.Update()
				objRS.Close()
			End If
	End IF
	
	If	IsShowSelect Then
		
		strSQL	=	"select MsgType,FlowID,LocationID,AccountID,SendTime,Title From t_OA_Work_ComMessage Where ID = " & ComMsgID
		objRS.Open strSQL,objDB,1,3
		AccountID	=	objRS.Fields("AccountID")
		SendTime	=	objRS.Fields("SendTime")
		Title		=	objRS.Fields("Title")
		objRS.Close()
		
		strSQL	=	"select * from t_OA_Work_ComMessage_Record Where ComMsgID = " & ComMsgID & "  And isSend=1"
		objRS.Open strSQL,objDB,1,3
		Do While Not objRS.EOF
			If  (objRS.Fields("IsEnd") = True) And Not ( IsNull(objRS.Fields("ExecuteTime")) )Then
				isShowEnd	=	True
			End If
			strShow	=	strShow	& "<tr><td colspan=8><Hr></td></tr>"
			strShow	=	strShow	&	"<tr><td>处理人:"	& "</td>"
			strShow	=	strShow	&	"<td>"	&	objRS.Fields("ExecuteID")	&	"</td>"
			strShow	=	strShow	&	"<tr><td>状态:"	& "</td>"
			If IsNull(objRS.Fields("ExecuteTime")) Then
				strShow	=	strShow	&	"<td>尚未处理</td>"
				strShow	=	strShow	&	"<td>是否通过</td>"
				strShow	=	strShow	&	"<td>----</td>"
				strShow	=	strShow	&	"<td>处理意见</td>"
				strShow	=	strShow	&	"<td>----</td>"
				strShow	=	strShow	&	"<td>处理时间</td>"
				strShow	=	strShow	&	"<td>----</td>"
			Else
				strShow	=	strShow	&	"<td>已处理</td>"
				strShow	=	strShow	&	"<td>是否通过</td>"
				strShow	=	strShow	&	"<td>"  &	objRS.Fields("IsPass")	&"</td>"
				strShow	=	strShow	&	"<td>处理意见</td>"
				strShow	=	strShow	&	"<td>"  &	objRS.Fields("Advice")	&"</td>"
				strShow	=	strShow	&	"<td>处理时间</td>"
				strShow	=	strShow	&	"<td>"  &	objRS.Fields("ExecuteTime")	&"</td>"
			End If
			objRS.MoveNext()
		Loop
		objRS.Close()
%>
	<table width=90% border=0>
		<tr>
			<td>公文发起人:</td>
			<td><%=AccountID%></td>
			<td>发起时间:</td>
			<td><%=SendTime%></td>
			<td>公文标题:</td>
			<td><%=FixStrLen(Title,15)%></td>
			<td></td>
			<td>&nbsp</td>
		</tr>
		<%=strShow%>
		<tr><td colspan=8><hr></td></tr>
		
		<Form action="Type4.asp" Method="Post" id=form1 name=form1>
		<tr><td colspan=8 align=center>
		<B>这是一个随机工作流,您希望继续下去吗?</B>
			<input type=radio name=IsContinue id=Continue value=1 Checked>继续
			<input type=radio name=IsContinue id=Stop value=0>结束
		</td></tr>
		<tr>
			<td colspan=8>
				<Hr>
			</td>
		</tr>
		
		<tr>
			<td colspan=8>
				<B>请在这里指定下一节点信息</B>
			</td>
		</tr>
		<tr>
			<td colspan=8>
				处理人:<input name=ExecuteID>
			</td>
		</tr>
		<tr>
			<td colspan=8>
				审核类型:<select name=PassType><option value=1 selected>审核</option><option value=0>阅读</option></select>
			</td>
		</tr>
		<tr>
			<td colspan=8>
				是否为结束点<input type=radio name=IsEnd value=0 checked>否<input type=radio name=IsEnd value=1>是
			</td>
		</tr>
		<tr>
			<td colspan=8>
				<input type=submit value="确    定" id=submit1 name=submit1>
			</td>
		</tr>
		<input type=hidden name="RecordID" value="<%=RecordID%>">
		<input type=hidden name="ComMsgID" value="<%=ComMsgID%>">
		</Form>
		
	</table>
<%				
	Else
		Response.Redirect "List1.asp"
	End If
%>

⌨️ 快捷键说明

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