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

📄 document_swdj_add.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

  Response.buffer=true
  mScriptName="Document_Swdj_Add.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="1"	'取得模式, 0显示 1起草 2批改 3审核
  mUserName=session("RealName")	'取得用户名
  FJZT="2" '附件状态设为管理
'------------------------------------------------
'------------------------------------------------读入文档内容
  mSql="Select * From tbioaOffice_Document Where RecordID='"+ mRecordID + "'"
  Set TbMainRs=Server.CreateObject("ADODB.RecordSet")
  TbMainRs.Open mSql,oConn,1,3

  If TbMainRs.Eof then '如果无文档记录则新建
	'取得唯一值(mRecordID)
        mRecordID=Session.SessionID&minute(now())&Second(now())	'保存的是文档的编号,通过该编号,可以在里找到所有属于这条纪录的文档
        mTemplate=mTemplate
        mSubject=""
        mAuthor=LoginID
        mDept=Session("DepID")
        mFileDate=CDate(now())
        mStatus="NONE" '起草
        mFileType=mFileType
        mHTMLPath=""
  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")    '文件状态
	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

	if cstr(mAuthor)<>cstr(LoginID) then
		call MsgOut("你无权查阅该公文","javascript:history.back()",1)
	end if

	'设置为查看属性
	if mStep<>"SW" then
		mEditType=0	'0 显示
		mDisabled="class='inputreadonly' disabled"
		FJZT="1" '附件状态设为查看
	end if
  end if
'------------------------------------------------
%>

<html>
<head>
<title>收文登记</title>
<link rel='stylesheet' type='text/css' href='../css/main.css'>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
<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 checnull(form.DC_Doc_Sort,'请填写公文类别!')&&
        checnull(form.DC_Doc_Security,'请填写公文公文密级!')&&
        checnull(form.DC_Doc_Exigence,'请填写公文公文公文紧急程度!')&&
        checnull(form.DocFileNo,'请填写公文文号!')&&
        checnull(form.Subject,'请填写标题!')
}

function Load(type){
//读入文档
  try{
  webform.WebOffice.WebUrl="<%=mServerUrl%>";
  webform.WebOffice.RecordID="<%=mRecordID%>";
  if (type==".doc"){
  	webform.WebOffice.FileName="<%=mRecordID%>.doc";
	webform.WebOffice.FileType=".doc";

  }
  else {
  	webform.WebOffice.FileName="<%=mRecordID%>.xls";
  	webform.WebOffice.FileType=".xls";
  }
  webform.WebOffice.EditType="<%=mEditType%>";
  webform.WebOffice.UserName="<%=mUserName%>";
  webform.WebOffice.WebOpen();  	//打开该文档
  StatusMsg(webform.WebOffice.Status);
  toolbar.location="../inc/toolbar.asp?Status=<%=mEditType%>&Type="+type+"&DYZWBB=1"
  }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 selectTemp(form){
	TempLateName=showModalDialog("../inc/SelectTemplate.asp", "", "dialogWidth:32em; dialogHeight:10em; center: Yes; scroll:No; resizable: No; status: No; help: No;");
	if (TempLateName) {
		form.TempLate.value=TempLateName.split("|")[0];
		doctype=TempLateName.split("|")[1];
		form.TempLateName.value=TempLateName.split("|")[2];
		form.FileType.value=doctype;
		webform.WebOffice.Template=form.TempLate.value;
		Load(doctype);
	}
}
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 select_Marker(form){
	strtmpusers = SelectUsers(form.Marker_ID.value);
	if (strtmpusers != "") {
		strtmpusers=strtmpusers.split("_")
		form.Marker_ID.value=strtmpusers[0]
		form.Marker_name.value=strtmpusers[1]
	}
}
</script>
</head>
<body class="tdbottom" onload="WindowResize();Load('<%=mFileType%>')" onunload="UnLoad()" topmargin="1" leftmargin="1">
<form action="DocumentSave.asp" method="post" name="webform" onsubmit="return require(this) && SaveDocument();">
<input type=hidden name=RecordID value="<%=mRecordID%>">
<input type=hidden name=FileType value="<%=mFileType%>">
<input type=hidden name=EditType value="<%=mEditType%>">
<input type=hidden name=HTMLPath value="<%=mHTMLPath%>">
<input type=hidden name=Author value="<%=mAuthor%>">
<input type=hidden name=FileDate value="<%=date()%>">
<input type=hidden name=Status value="<%=mStatus%>">
<input type=hidden name=Step value="SW">
<input type=hidden name=DocMod value="收文">
<table border=0 cellspacing='1' cellpadding='3' width=100%align=center>
  <tr>
    <td align=left class="td3"><img src="../images/icon_title.gif" align="absmiddle"> <b>收文登记</td>
  </tr>
</table>
<br>
<table border=0 cellspacing='0' cellpadding='1' width=100% height=100% align=center>
  <%if mStep="" then%>
  <tr>
    <td align="right" class="tdBottom">公文模板:</td>
    <Td class="tdBottom"><input type=hidden name=TempLate value="">
    <input type=text name=TempLateName value="" size="69" class="inputreadonly" readonly>
    <input name="button0" type="button" id="button1" value="选择模板" class=button0 onclick="selectTemp(webform)" onmouseout=className="button0" onmouseover=className="button1" > </td>
  </tr>
  <%end if%>
  <tr>
    <td align="right" class="tdBottom">公文种类:</td>
    <td class="tdBottom">
      <select name='DocType' size='1' <%=mDisabled%>>
        <option value='内部' <%if mDocType="内部" then response.write "selected"%>>内部</option>
        <option value='外部' <%if mDocType="外部" then response.write "selected"%>>外部</option>
      </select>
      <select name='DC_Doc_Sort' size='1' <%=mDisabled%>>
      <%Call pOptions("tbioaOffice_Document_Sort","doc_sort",0,mDC_Doc_Sort,"")%>
      </select>
       紧急程度:
      <select name='DC_Doc_Exigence' class='SelectStyle' <%=mDisabled%>>
        <option value='一般' <%if mDC_Doc_Exigence="一般" then response.write "selected"%>>一般</option>
        <option value='紧急' <%if mDC_Doc_Exigence="紧急" then response.write "selected"%>>紧急</option>
        <option value='特急' <%if mDC_Doc_Exigence="特急" then response.write "selected"%>>特急</option>
      </select>
       公文密级:
	<select name='DC_Doc_Security' class='SelectStyle' <%=mDisabled%>>
          <option value='普通' <%if mDC_Doc_Security="普通" then response.write "selected"%>>普通</option>
          <option value='秘密' <%if mDC_Doc_Security="秘密" then response.write "selected"%>>秘密</option>
          <option value='机密' <%if mDC_Doc_Security="机密" then response.write "selected"%>>机密</option>
          <option value='绝密' <%if mDC_Doc_Security="绝密" then response.write "selected"%>>绝密</option>
	</select>
	</td>
  </tr>
  <tr>
    <td align="right" class="tdBottom">公文文号:</td>
    <td class="tdBottom">
      <input type="text" name="DocFileNo" value="<%=mDocFileNo%>" size="80" maxlength="15" <%=mDisabled%> class="input">
    </td>
  </tr>
  <tr>
    <td align="right" class="tdBottom">公文标题:</td>
    <td class="tdBottom">
      <input <%=mDisabled%> class="input2" type="text" name="Subject" value="<%=mSubject%>" size="80" maxlength="150" onBlur="SetBookmarks('Subject',this.value);">
    </td>
  </tr>
  <tr>
    <td align="right" class="tdBottom">主题词:</td>
    <td class="tdBottom">
      <input <%=mDisabled%> class="input2" type="text" name="MainTitle" value="<%=mMainTitle%>" size="80" maxlength="150" >
    </td>
  </tr>
  <tr class="tdBottom">
    <td align="right" align="right" valign="top" class="tdBottom">摘要:</td>
    <td><textarea name="Memo" rows="3" cols="78" class="input2" <%=mDisabled%>><%=mMemo%></textarea></td>
  </tr>
  <tr>
    <td align="right" class="tdBottom">发文单位:</td>
    <td class="tdBottom">
      <input  type="text" name="PSend_Dept" size="80" maxlength="100" value="<%=mPSend_Dept%>" <%=mDisabled%> class="input2">
      <input name="button1" type="button" id="button1" value="选择部门" class=button0 onclick="selectDep(webform.PSend_Dept)" onmouseout=className="button0" onmouseover=className="button1" <%=mDisabled%>>
    </td>
  </tr>
  <tr>
    <td align="right" class="tdBottom">收文单位:</td>
    <td class="tdBottom">
      <%if mReceive_Dept&""="" then mReceive_Dept=GetTableValue("tbioaDepartment","Name","id",Session("DepID"))%>
      <input  type="text" name="Receive_Dept" size="80" maxlength="100" value="<%=mReceive_Dept%>" <%=mDisabled%> class="input2">
      <input name="button1" type="button" id="button1" value="选择部门" class=button0 onclick="selectDep(webform.Receive_Dept)" onmouseout=className="button0" onmouseover=className="button1" <%=mDisabled%>>
    </td>
  </tr>
  <tr>
    <td align="right" class="tdBottom">签字人:</td>
    <td class="tdBottom">
      <input name="Marker_name" size="80" value="<%=getusernames(mMarker_ID,",")%>" <%=mDisabled%> class="input2" readonly>
      <input name="button1" type="button" id="button1" value="选择人员" class=button0 onclick="select_Marker(webform)" onmouseout=className="button0" onmouseover=className="button1" <%=mDisabled%>>
      <input type="hidden" name="Marker_ID" value="<%=mMarker_ID%>">
    </td>
  </tr>
  <tr>
    <td align="right" valign="top" class="tdBottom">附注:</td>
    <td class="tdBottom">
      <textarea name="Do_Advice" rows="3" cols="78" class=input2 <%=mDisabled%>><%=mDo_Advice%></textarea>
    </td>
  </tr>
  <tr>
    <td align=right class="tdBottom">登记人:</td>
    <td class="tdBottom">
    	<input type=text name=Registration_Man value="<%=session("RealName")%>" <%=mDisabled%> class="inputreadonly" readonly>
    	登记日期:<input type=text name=Registration_Date value="<%=date()%>" <%=mDisabled%> class="inputreadonly" readonly>
    </td>
  </tr>
<%if FJZT="1" or FJZT="2" then%>
  <tr>
    <td colspan=2 align="center" class="tdBottom" valign="top" align=right>
    <fieldset style="width:98%" align="center"> <legend>相关附件 <%if fjzt="2" then%>[<img src="../images/icon_close.gif" align="absmiddle"> <a href='javascript:WindowOpen("FileUpForm.asp?infoid=<%=mRecordID%>")'>添加附件</a>]<%end if%></legend>
    <iframe id="Accessory" src="accessory.asp?infoid=<%=mRecordID%>&fjzt=<%=FJZT%>" frameBorder="0" width="100%" height="70" marginHeight="0" marginWidth="0" scrolling="auto"></iframe>
    </td>
  </tr>
<%end if%>
  <tr>
   <td colspan=2 class="td1">
        <table border=0 cellspacing='0' cellpadding='0' width='100%' height='100%'>
        <tr>
          <td height="28">
            <iframe id="toolbar" src="../inc/toolbar.asp?Status=<%=mEditType%>&Type=<%=mFileType%>&DYZWBB=1" frameBorder="0" width="100%" height="28" marginHeight="0" marginWidth="0" scrolling="no"></iframe>
          </td>
        </tr>
        <tr>
          <td colspan=2 height="640">
            <OBJECT id="WebOffice" width="100%" height="100%" classid="clsid:23739A7E-5741-4D1C-88D5-D50B18F7C347" codebase="<%=mClientUrl%>"></OBJECT>
          </td>
        </tr>
        <tr>
          <td bgcolor=menu height='20'>
		<div id=StatusBar>状态栏</div>
          </td>
        </tr>
        </table>
  </td>
</tr>
<tr>
  <td colspan=2 height=100% class="tdBottom">
	<input type=submit value="  保存  " class=td3 <%=mDisabled%>>
	<input type=reset value="  清除  " class=td3>
	<input type=button value="  退出  " onclick="window.close()" class=td3> 注意:只有选择《保存》后,所做的操作才有效!
  </td>
</tr>
</table>
</form>
</body>
</html>
<%'释放对象变量
<!--#include file="../inc/conn_close.asp"-->
%> 

⌨️ 快捷键说明

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