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

📄 intoflow.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:开始公文流转
%>

<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/Conn.asp"-->
<!--#include file="../inc/Const.asp"-->

<%
'------------------------------------------------设置参数
sRecordID=Request("RecordID")
'------------------------------------------------
if sRecordID="" then
	call MsgOut("没有指定公文号","javascript:history.back()",1)
	oConn.close
	set oConn=nothing
	Response.End
end if

'------------------------------------------------取工作点记录(tbioaOffice_FlowPoint)
set rs=server.CreateObject("adodb.recordset")
oConn.begintrans

'取得首流程点序号
'取得入度为0的工作点(只可能有一个)
sql = "select a.*,b.blgzmc from tbioaOffice_FlowPoint a,tbioaOffice_Flow_Bldy b " _
		& "where a.RecordID='" & sRecordID & "' " _
		& "and a.gzdxh not in(" _
		& "select zgzdxh as gzdxh from tbioaOffice_Flow " _
		& "where RecordID='" & sRecordID & "') " _
		& "and a.blgzbh=b.blgzbh "
rs.Open sql,oConn,1,1

if rs.EOF then
	rs.Close
	oConn.rollbacktrans
	set rs=nothing
	call MsgOut("该公文尚未定义工作流程","javascript:history.back()",1)
	oConn.close
	set oConn=nothing
	Response.End
end if

sxgbz="1"
sblbz="N"
szcbz="0"
sgzdbh=rs("blgzbh")'办理工作编号
sgzdxh=rs("gzdxh") '工作点序号
sblrlbr=GetTableValue("tbioaOffice_Flow_Bldy","xyblr","blgzbh",rs("blgzbh"))
if sblrlbr=0 then
  sblrlb=rs("blrylb")	'办理人列表
else
  sblrlb=GetTableValue("tbioaOffice_Document","Author","RecordID",sRecordID)	'办理人列表
end if
stjlzbj=rs("lzbz") '流转标志(1全部完成继续/0一人完成继续)
sclsx=formatdatetime(dateadd("d",rs("gzsx") ,now),2) '处理时限(这里转换成日期)
rs.Close
'------------------------------------------------

'------------------------------------------------处理公文记录(tbioaOffice_Document)
	rs.Open "select Step,RecordID,Status from tbioaOffice_Document where RecordID='" & sRecordID & "'",oConn,3,2
	if rs.EOF then
		rs.Close
		oConn.rollbacktrans
		set rs=nothing
		oConn.close
		set oConn=nothing
		call MsgOut("该公文不存在可能已被删除","javascript:history.back()",1)
	end if
	if cstr(rs("Step") & "")<>"FW" and cstr(rs("Step") & "")<>"SW" then
		oConn.rollbacktrans
		call MsgOut("该公文已进入流转","javascript:history.back()",1)
		rs.Close
		set rs=nothing
		oConn.close
		set oConn=nothing
		Response.End
	end if
	'if cstr(rs("Status") & "")="EDIT" and cstr(rs("zwsdr") & "")<>cstr(session("uYGBH")) then
	'	showerrmsg_1 "该公文已由" & rs("zwsdr") & "在" & rs("zwsdsj") & "锁定,不能恢复版本","提示", "gwlz_gwnz_edit_fb_list.asp?gwxh=" & sgwxh
	'	rs.Close
	'	set rs=nothing
	'	oConn.close
	'	set oConn=nothing
	'	Response.End
	'end if
	'rs("zwsdr")=null
	'rs("zwsdsj")=""
	rs("Status")="NONE" '设置公文状态
	rs("Step")=sgzdbh   '设置办理工作编号
	rs.Update
	rs.Close
'------------------------------------------------

'------------------------------------------------保存办理记录
ary=Split(sblrlb,",")'办理人列表(数组)
for ii=0 to ubound(ary)
	if trim(ary(ii))<>"" then
		'取办理序号
		sblxh=1
		rs.Open "select max(blxh) from tbioaOffice_Flow_Blqk where RecordID='" & sRecordID & "'",oConn,1,1
		if not rs.EOF then
			if rs(0)&""<>"" then
				sblxh=clng(rs(0))+1
			end if
		end if
		rs.Close

		'增加办理记录
		rs.Open "select * from tbioaOffice_Flow_Blqk where RecordID='" & sRecordID & "' and blxh='" & sblxh & "'",oConn,3,2
		if rs.EOF then
			rs.AddNew
		end if
		rs("RecordID")=sRecordID	'公文编号
		rs("blxh")=sblxh		'办理序号
		rs("gzdbh")=sgzdbh		'办理工作编号(工作定义编号)
		rs("gzdxh")=sgzdxh		'工作点序号
		rs("blr")=ary(ii)		'办理人ID
		rs("xgbz")=sxgbz		'1 修改标志(1可修改)
		rs("blbz")=sblbz                '办理标志(N)
		rs("zcbz")=szcbz                '0
		rs("tjlzbj")=stjlzbj            '流转标志(1全部完成继续/0一人完成继续)
		rs("clsj")=date()               '处理开始时间
		rs("clsx")=sclsx                '处理结束时间
		rs.update
		rs.Close
	end if
next

set rs=nothing
oConn.committrans
oConn.close
set oConn=nothing
%>
<script language="javascript">opener.location.reload();window.close();</script> 

⌨️ 快捷键说明

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