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

📄 documentedit.asp

📁 OFFICE办公自动化
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'功能:公文编辑
'作者:展亮
'日期:2003-12-27 16:28
%>

<!--#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
mBLXH  =Request("BLXH")   '办理序号
mGZDBH =Request("GZDBH") '当前工作定义号

  Response.buffer=true
  mScriptName="DocumentEdit.asp"
  mServerName="../inc/OfficeServer.asp"
  mClientName="iWebOffice2003.ocx#version=6,4,0,4"
  mHttpUrl="http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
  mHttpUrl=Left(mHttpUrl,Len(mHttpUrl)-Len(mScriptName))
  mServerUrl=mHttpUrl & mServerName
  mClientUrl=mHttpUrl & mClientName

  mRecordID=Request("RecordID")	'取得编号
  mTemplate=Request("Template")	: if ( mTemplate="") then mTemplate="" '取得模板编号' 默认没有模板
  mFileType=Request("FileType")	: if ( mFileType="") then mFileType=".doc" '取得类型,默认为.doc文档
  mEditType=Request("EditType") : mEditType="2"	'取得模式, 0显示 1起草 2批改 3审核
  mUserName=session("RealName")	'取得用户名
'------------------------------------------------
'------------------------------------------------读入工作定义内容
set rs = server.CreateObject("ADODB.RecordSet")
rs.Open "select * from tbioaOffice_Flow_Bldy where blgzbh='" & mGZDBH & "'",oConn,1,1
if not rs.EOF then
	DZLCQX	= rs("DZLCQX")		'允许改变流程
	MBTHDG	= rs("MBTHDG")		'允许模板套红定稿
	mEditType= rs("ZWZT")  		'正文状态  0查阅 1起草 2修改 3审核
	DYZWBB	= rs("DYZWBB")		'允许调用正文版本
	FJZT	= rs("FJZT")		'附件状态  0隐藏 1查看 2管理
	DTCS1	= rs("DTCS1")		'表单单元格显示
	DTCS2	= rs("DTCS2")		'单元格能否编辑
	DTCS3	= rs("DTCS3")		'单元格是否必填
	DTCS4	= rs("DTCS4")		'单元格是否有初值
else
	mEditType=0	'0 显示
end if
rs.close
'------------------------------------------------读入办理情况
sql = "Select gzdxh,blr from tbioaOffice_Flow_Blqk where RecordID='"&mRecordID&"' and blxh="&mBLXH
rs.open sql,oConn,1,1
gzdxh=rs("gzdxh")
blr=rs("blr")
rs.close
'------------------------------------------------读入工作点定义内容
sql="select * from tbioaOffice_FlowPoint where RecordID='"&mRecordID&"' and gzdxh="&gzdxh
rs.Open sql,oConn,1,1
if not rs.EOF then
   tqqx=rs("tqqx")
   jqqx=rs("jqqx")
   cxqx=rs("cxqx")
   gzdmc=rs("gzdmc")
end if
rs.close
'------------------------------------------------读入文档内容
  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  '如果有记录则取记录参数
	'------------------------------------------------
	Pid	  = TbMainRs("DocumentID")'公文ID
	mRecordID = TbMainRs("RecordID")  '公文编号
	mTemplate = TbMainRs("Template")  '模板编号
	mFileType = TbMainRs("FileType")  '文件类型
	mHTMLPath = TbMainRs("HTMLPath")  '生成html文件页面路径及文件名
	mAuthor	  = TbMainRs("Author")    '作者
	mFileDate = TbMainRs("FileDate")  '建立日期
	mStatus   = TbMainRs("Status")    '文件状态
	mLockUserID=TbMainRs("LockUserID")'锁定人
	mLockTime = TbMainRs("LockTime")  '锁定时间
	mStep	  = TbMainRs("Step")	  '流程号
	'---------------------------------
	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")	  '公文标题
	mMainTitle	   = TbMainRs("MainTitle")	  '主题词
	mMemo		   = TbMainRs("Memo")		  '摘要
	mPSend_Dept	   = TbMainRs("PSend_Dept")	  '发文单位
	mMSend_Dept	   = TbMainRs("MSend_Dept")	  '主送单位
	mCSend_Dept	   = TbMainRs("CSend_Dept")	  '抄送机关
	mCReport_Dept	   = TbMainRs("CReport_Dept")	  '报送机关
	mReceive_Dept	   = TbMainRs("Receive_Dept")	  '收文机关
	mMarker_ID	   = TbMainRs("Marker_ID")	  '签字人
	mDo_Advice	   = TbMainRs("Do_Advice")	  '附注
	mNiziMan	   = TbMainRs("NiziMan")	  '拟稿人
	mNiziDate 	   = TbMainRs("FileDate")  	  '拟稿日期
	mNiziDept 	   = TbMainRs("NiziDept")	  '拟稿部门
	mSign_Man 	   = TbMainRs("Sign_Man") 	  '签发人
	mSign_Date 	   = TbMainRs("Sign_Date")	  '签发日期
	mRegistration_Man  = TbMainRs("Registration_Man") '登记人
	mRegistration_Date = TbMainRs("Registration_Date")'登记日期
	'------------------------------------------------

	TbMainRs.Close
	Set TbMainRs=Nothing
	select case  mStatus
	  case "EDIT"
	     if mLockUserID<>int(LoginID) then
	  	response.write "<script>alert('该公文已被 "&getusername(mLockUserID)&" 于 "&mLockTime&" 锁定,你现在不能编辑,只能查看!')</script>"
	 	mEditType=0	'0 显示
	 	DTCS2="0000000000000"
	     end if
	end select

	if mEditType=0 then
	   mDisabled="disabled"
	else
	   mDisabled=""
	end if

	mFileName=mRecordID  & mFileType		'取得完整的文档名称
  end if

'------------------------------------------------------------编辑框显示函数
Sub input_disabled(Str,StrStart,StrLen)
if Str<>"" then
	if mid(Str,StrStart,StrLen)<>"1" then
		response.write "class='inputreadonly' disabled"
	end if
end if
End Sub
'------------------------------------------------------------下一步办理人
set zrs=createobject("adodb.recordset")
zsql="select zgzdxh from tbioaOffice_Flow where RecordID='" & mRecordID & "' and sgzdxh=" & gzdxh
zrs.Open zsql,oConn,1,1
'判断流程是否结束
if zrs.EOF and zrs.bof then
   NextStep="待归档"
   blrylb=getusername(mAuthor)
else
   zrs.close
   zsql="select gzdmc,blrylb from tbioaOffice_FlowPoint where RecordID='"&mRecordID&"' and gzdxh=(select zgzdxh from tbioaOffice_Flow where RecordID='"&mRecordID&"' and sgzdxh=" & gzdxh &")"
   zrs.Open zsql,oConn,1,1
   if not zrs.EOF and not zrs.BOF then
       NextStep=zrs("gzdmc")
   end if
   blrylb=getusernames(zrs("blrylb"),",")

   if blrylb="" then
   	blrylb="未指定"
   	xyblry=zrs("blrylb")
   else
   	xyblry=zrs("blrylb")
   end if
end if
zrs.close
'------------------------------------------------------------
%>
<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 src="../js/user_select.js"></script>
<script language=javascript>
//检查是否必填
function require(form){
	return <%for i=1 to 13
          if mid(dtcs3,i,1)="1" then
             select case i
                case 1
                   response.write "checnull(form.DocFileNo,'请填写公文文号!')&&"
                case 2
                   response.write "checnull(form.DC_Doc_Sort,'请填写公文类别!')&&checnull(form.DC_Doc_Security,'请填写公文公文密级!')&&checnull(form.DC_Doc_Exigence,'请填写公文公文公文紧急程度!')&&"
                case 3
                   response.write "checnull(form.Subject,'请填写主题!')&&"
                case 4
                   response.write "checnull(form.MainTitle,'请填写主题词!')&&"
                case 5
                   response.write "checnull(form.Memo,'请填写摘要!')&&"
                case 6
                   response.write "checnull(form.PSend_Dept,'请填写发文单位!')&&"
                case 7
                   response.write "checnull(form.MSend_Dept,'请填写主送单位!')&&"
                case 8
                   response.write "checnull(form.CSend_Dept,'请填写抄送机关!')&&"
                case 9
                   response.write "checnull(form.Receive_Dept,'请填写收文单位!')&&"
                case 10
                   response.write "checnull(form.Do_Advice,'请填写附注!')&&"
                case 11
                   response.write "checnull(form.NiziMan,'请填写拟制人!')&&checnull(form.NiziDate,'请填写拟制日期!')&&checnull(form.NiziDept,'请填写拟制部门!')&&"
                case 12
                   response.write "checnull(form.Sign_Man,'请填写签发人!')&&checnull(form.Sign_Date,'请填写签发日期!')&&"
                case 13
                   response.write "checnull(form.Registration_Man,'请填写登记人!')&&checnull(form.Registration_Date,'请填写登记日期!')&&"
	      end select
	   end if
	 next%>1==1;
}

function Load(){
//读入文档
  try{
  webform.WebOffice.WebUrl="<%=mServerUrl%>";
  webform.WebOffice.RecordID="<%=mRecordID%>";
  webform.WebOffice.Template="<%=mTemplate%>";
  webform.WebOffice.FileName="<%=mFileName%>";
  webform.WebOffice.FileType="<%=mFileType%>";
  webform.WebOffice.EditType="<%=mEditType%>";
  webform.WebOffice.UserName="<%=mUserName%>";
  webform.WebOffice.WebOpen();  	//打开该文档
  StatusMsg(webform.WebOffice.Status);
  toolbar.location="../inc/toolbar.asp?Status=<%=mEditType%>&Type=<%=mFileType%>&DYZWBB=<%=DYZWBB%>"
  }catch(e){}
}

function WebSaveAsHtml(){
//保存为Html
  try{
    if (webform.WebOffice.WebSaveAsHtml())
    {
      webform.HTMLPath.value="HTML/<%=mRecordID%>.htm";
    }
    StatusMsg(webform.WebOffice.Status);
  }catch(e){}
}

function WindowOpen(strURL){
  DocumentWin = window.open(strURL,"","top=300,left=200,width=350,height=100,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
  DocumentWin.focus();
}

function WindowOpen1(strURL){
  DocumentWin = window.open(strURL,"","toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
  DocumentWin.focus();
}

function selectDep(form){
	Deplist=showModalDialog("../inc/Select_Dep.asp", "", "dialogWidth:32em; dialogHeight:17em; center: Yes; scroll:No; resizable: No; status: No; help: No;");
	if (Deplist!='') {
		form.value=Deplist.split("|")[1];
	}
}

function WindowResize()
{
window.moveTo(0,0)
window.resizeTo(screen.availWidth,screen.availHeight);
}

function dozclz(){//正常流转
	if(webform.xyblry.value=="" && "<%=NextStep%>"!="待归档"){
		strtmpusers = SelectUsers(webform.xyblry.value);
		if (strtmpusers != "") {
			strtmpusers=strtmpusers.split("_")
			if (strtmpusers[0] != "") {
				webform.xyblry.value=strtmpusers[0]
				webform.czlx.value="zclz";
				webform.action="Document_EditSave.asp";
		  	if (require(webform)<%if mEditType<>0 then%>&&SaveDocument()<%end if%>)  webform.submit();
	  	}
		}
	}else{
	  webform.czlx.value="zclz";
	  webform.action="Document_EditSave.asp";
	  if (require(webform)<%if mEditType<>0 then%>&&SaveDocument()<%end if%>)  webform.submit();
  }
}
function dochexiao(){//撤销公文
  if (confirm("确定撤销此公文吗?")==false){
      return false
  }
  webform.czlx.value="chexiao";
  webform.action="Document_EditSave.asp";
     if (require(webform)<%if mEditType<>0 then%>&&SaveDocument()<%end if%>)  webform.submit();
}
function doadd(obj){//加签
  strtmpusers = SelectUsers(webform.jqygbh.value);
  if (strtmpusers != "") {
     strtmpusers=strtmpusers.split("_");

⌨️ 快捷键说明

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