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

📄 document_file_gd.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:待归档公文
%>

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

<%
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
mRecordID=Request("RecordID")	'取得编号
'------------------------------------------------
'------------------------------------------------读入文档内容
  mSql="Select * From tbioaOffice_Document Where RecordID='"& mRecordID & "'"
  Set TbMainRs=Server.CreateObject("ADODB.RecordSet")
  TbMainRs.Open mSql,oConn,1,3

  If TbMainRs.Eof then '如果无文档记录则退出
  	response.write "该公文不存在!"
  	response.end
  else  '如果有记录则取记录参数
	'------------------------------------------------
	mRecordID = TbMainRs("RecordID")  '公文编号
	mStep	  = TbMainRs("Step")	  '流程号
	'---------------------------------
	mAuthor		   = TbMainRs("Author")	  	  '作者ID
	mFileDate	   = TbMainRs("FileDate")	  '建立日期
	mDocFileNo	   = TbMainRs("DocFileNo")	  '公文文号
	mDocType 	   = TbMainRs("DocType")	  '内外部公文
	mDocMod		   = TbMainRs("DocMod")           '收发文
	mDC_Doc_Sort	   = TbMainRs("DC_Doc_Sort")	  '公文种类
	mDC_Doc_Security   = TbMainRs("DC_Doc_Security")  '公文密级
	mDC_Doc_Exigence   = TbMainRs("DC_Doc_Exigence")  '公文紧急程度
	mSubject	   = TbMainRs("Subject")	  '公文标题
	mDepartmentID	   = GetTableValue("tbioaUser","Department","ID",mAuthor) '作者部门ID
	mDepartment_Name   = GetTableValue("tbioaDepartment","Name","ID",mDepartmentID) '作者部门名
	'------------------------------------------------
    end if
	TbMainRs.Close
	Set TbMainRs=Nothing

'------------------------------------------------读入办理部门
   sql="SELECT tbioaDepartment.ID, tbioaDepartment.Name FROM tbioaUser INNER JOIN tbioaOffice_Flow_Blqk ON tbioaUser.ID = tbioaOffice_Flow_Blqk.BLR INNER JOIN tbioaDepartment ON tbioaUser.Department = tbioaDepartment.ID GROUP BY tbioaDepartment.ID, tbioaDepartment.Name, tbioaOffice_Flow_Blqk.RecordID HAVING tbioaOffice_Flow_Blqk.RecordID = '"& mRecordID &"'"
   'response.write sql
   set rs=oConn.execute(sql)
   while not rs.eof
      viewer=viewer & rs("Name")
      viewerid=viewerid & rs("ID")
   rs.movenext
      if not rs.eof then
        viewer=viewer & vbcrlf
        viewerid=viewerid & ","
      end if
   wend
   rs.close
   Set rs=Nothing
   if instr(","&viewerid&"," , ","&mDepartmentID&",")<1 then '加入拟制人的部门
     viewerid=mDepartmentID & "," & viewerid
     viewer=mDepartment_Name & vbcrlf & viewer
   end if
%>

<html>
<head>
<title>公文办理</title>
<link rel='stylesheet' type='text/css' href='../css/main.css'>
<script src="../js/iweboffice_func.js" type="text/javascript"></script>
<script src="../js/front_chec.js"></script>
<script language="javascript">
//检查是否必填
function require(form){
	return  checnull(form.FLH,"请填选择档案目录!")&&
		checnull(form.viewer,"请设置档案查询权限!") &&
		checnull(form.File_Save,"请填写档案保存期限!")&&
		checnumber(form.File_Save,"档案保存期限必须为数字!")&&
		confirm('确定要归档该条公文吗?');
}

function doSel_Cx(sCxqx,sCxqxsz){
	url = "../inc/SelectQx.asp?cxqx="+sCxqx+"&cxqxsz="+sCxqxsz
	k=showModalDialog(url,"","dialogWidth:510px;status:no;dialogHeight:60px")
	if (k!="") {
		k=k.split("_")
		if (k[0]!="0"){
			webform.viewer.value=k[2].replace(/ /g,"\n")
			webform.input_CXQX.value=k[1]
			webform.input_CXQXBZ.value=k[0]
		}else{
			webform.viewer.value='全部人员'
			webform.input_CXQX.value=k[1]
			webform.input_CXQXBZ.value=k[0]
		}
	}
}
</script>
</head>

<body topmargin="10" leftmargin="10">
<table width=98% class=tabletoolbar border=0 align=center>
	<tr valign=center><td align=left nowrap><img src="../images/icon_title.gif" align="absmiddle"> 公文归档</td>
	<td align=right valign=bottom nowrap>
	</td></tr>
</table>
<hr width="100%" size=1 color="#000000">
<br>
<form name="webform" method="post" action="Document_File_Save.asp" OnSubmit="return require(this)">
<input type=hidden name=RecordID value="<%=mRecordID%>">
<table border=0 cellspacing='1' cellpadding='2' width=700 align=center class="tab">
  <!--tr>
    <td align="right" class="tdBottom">公文种类:</td>
    <td class="tdBottom">
      <input type=text name='DC_Doc_Sort' size='8' value="<%=htmlout(GetTableValue("tbioaOffice_Document_Sort","doc_sort","id",mDC_Doc_Sort))%>" class="inputreadonly" readonly>
      公文类型:<input type=text name='DocType' value="<%=mDocType%>" size=8 class="inputreadonly" readonly>
      <input  type="text" name='DocMod' size='8' value="<%=mDocMod%>" class="inputreadonly" readonly>
      公文紧急程度:
      <input type=text name='DC_Doc_Exigence' size='8' value="<%=mDC_Doc_Exigence%>" class="inputreadonly" readonly>
      公文密级:
      <input type=text name='DC_Doc_Security' size='8' value="<%=mDC_Doc_Security%>" class="inputreadonly" readonly>
    </td>
  </tr>
  <tr>
    <td align="right" class="tdBottom">公文文号:</td>
    <td class="tdBottom"><input type="text" name="DocFileNo" size="25" maxlength="15" value="<%=mDocFileNo%>" class="inputreadonly" readonly></td>
  </tr-->
  <tr>
    <td  align="right" class="tdBottom">公文标题:</td>
    <td  class="tdBottom"><input type="text" name="Subject" size="80" maxlength="150" value="<%=mSubject%>" class="inputreadonly" readonly></td>
  </tr>
  <tr>
    <td align=right class="tdBottom">类别目录:</td>
    <td class="tdBottom">
	<select id=FLH name=FLH>
		<%=pOptions2("tbioaDocument_Sort","LMMC",0,0,"","SJFLH")%>
	</select>
    </td>
  </tr>
  <tr>
    <td width="100" class="td1" align="right" valign="_top">查询权限:
      <img src="../images/selectman.gif" border="0" onclick="doSel_Cx(webform.input_CXQX.value,webform.input_CXQXBZ.value)" style="cursor:hand">
    </td>
    <td class="td1"><textarea rows="7" name="viewer" cols="80" class="textarea" readonly><%=viewer%></textarea>
      <input type=hidden name="input_CXQXBZ" value="1">
      <input type=hidden name="input_CXQX" value="<%=viewerid%>">
      (默认查询权限为公文涉及办理人所在的部门,如有变动请自行修改!)
    </td>
  </tr>
  <tr>
    <td align=right class="tdBottom">拟制人:</td>
    <td class="tdBottom">
    	<input type=text name="Author" value="<%=GetUserName(mAuthor)%>" class="inputreadonly" readonly>&nbsp;
    	拟制部门:<input type=text name="Author_Department" value="<%=mDepartment_Name%>" class="inputreadonly" readonly>
    	拟制时间:<input type=text name="FileDate" value="<%=mFileDate%>" class="inputreadonly" readonly size="18" >
    </td>
  </tr>
  <tr>
    <td align=right class="tdBottom">归档人:</td>
    <td class="tdBottom">
    	<input type=text name="File_Man_Name" value="<%=session("realname")%>" class="inputreadonly" readonly>
    	<input type=hidden name="File_Man" value="<%=LoginID%>" class="inputreadonly" readonly>
    	归档时间:<input type=text name="File_Date" value="<%=now()%>" class="inputreadonly" readonly size="20" >
    	保存期限:<input type=text name="File_Save" value="365" class="input" size="5">天
    </td>
  </tr>
  <tr>
    <td  class="tdBottom" colspan=2 align=center>
	<input type="submit" value="归档" class="button0" onmouseout=className="button0" onmouseover=className="button1">
	<input type="button" value="返回" class="button0" onmouseout=className="button0" onmouseover=className="button1" onclick="history.back()">
    </td>
  </tr>
</table>
</form>

</body>
</html>

<%'释放对象变量
<!--#include file="../inc/conn_close.asp"-->
%>

<%
Function pOptions2(TableName,Field,ParentID,Selected,Heads,ParentField)
'递归下拉菜单(表名,字段名,选中字段ID,起始字段ID,分割头,存放上级栏目ID的字段名)-----
	set rs_sort=Server.CreateObject("ADODB.RecordSet")
	sql="select * from "& TableName &" where "&ParentField&" = '"& ParentID &"' order by FLH"
	rs_sort.open sql,oConn,1,1
	while not rs_sort.EOF '循环
		if Selected="" then Selected="0"
		if Return_Sort_Manage(rs_sort("GDQXBZ"),rs_sort("FLH"),"GDQX",TableName) then
			if rs_sort("FLH")= Selected then
				response.write "<option value='"&rs_sort("FLH")&"' selected>"& Heads & rs_sort(Field)&"</option>" & vbcrlf
			else
				response.write "<option value='"&rs_sort("FLH")&"'>"& Heads & rs_sort(Field)&"</option>" & vbcrlf
			end if
		end if

		Call pOptions2(TableName,Field,rs_sort("FLH"),Selected,Heads&rs_sort(Field)&"/",ParentField)
	rs_sort.MoveNext: wend
	rs_sort.close
End Function

''''''''''''''''''''''返回当前用户是否有操作权限'''''''''''''''''''''
Function Return_Sort_Manage(managemod,ArchivesID,SField,STable)
''''''''''''''''''''''列表类型,id号,查找字段,查找表名
'返回用户是否有管理/查看权限
dim i
if ArchivesID<>"" and IsNumeric(ArchivesID) then
	select case managemod		'管理/查看列表类型  0:所有用户 1:部门2:职务
		case "0"
			Return_Sort_Manage=true
		case "1"
			TmpSQL="select "&SField&" from " & STable & " where FLH='"&ArchivesID&"'"	'取得管理/查看权限
			set TmpRS=Server.CreateObject("ADODB.RecordSet")
			TmpRS.open TmpSQL,oconn,1,1
			if TmpRS.eof then
				TmpRS=close
				set TmpRS=nothing
				Return_Sort_Manage=false
			else
				ManageStr=TmpRS(SField)
				TmpRS.close
				set TmpRS = nothing
				if len(ManageStr)>0 then
					if Instr(1,","&ManageStr&",",","&session("DepID")&",", 1)>0 then '判断管理/查看权限中是否包含有当前用户部门ID
						Return_Sort_Manage=true
					else
						Return_Sort_Manage=false
					end if
				else
					Return_Sort_Manage=false
				end if
			end if
		case "2"
			TmpSQL="select "&SField&" from " & STable & " where FLH='"&ArchivesID&"'"	'取得管理/查看权限
			set TmpRS=Server.CreateObject("ADODB.RecordSet")
			TmpRS.open TmpSQL,oconn,1,1
			if TmpRS.eof then
				Return_Sort_Manage=false
			else
				ManageStr=TmpRS(SField)
				TmpRS=close
				TmpSQL="select roleID from tbioaUser where id="&session("LoginID")	'取得当前用户职务
				set TmpRS=Server.CreateObject("ADODB.RecordSet")
				TmpRS.open TmpSQL,oconn,1,1
				if TmpRS.eof then
					TmpRS.close
					set TmpRS=nothing
					Return_Sort_Manage=false
				else
					RoleArr=split(TmpRS("RoleID"),",")
					TmpRS.close
					set TmpRS=nothing
					Return_Sort_ManageR=false
					for i=0 to UBound(RoleArr)
						if instr(1,","&ManageStr&",",","&RoleArr(i)&",")>0 then	'判断管理/查看权限中是否包含有当前用户职务
							Return_Sort_ManageR=true
						end if
					next
					Return_Sort_Manage=Return_Sort_ManageR
				end if
			end if
		case else
			Return_Sort_Manage=false
	end select
else
	Return_Sort_Manage=false
end if
end Function
'-----------------------------------------------------------
%> 

⌨️ 快捷键说明

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