<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Collection" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.flow.*" %>
<%@ page import="net.sz600.online.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.weboffice.*" %>
<%//@ page import="net.fckeditor.*"%>
<%//@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<%@ include file="/sessionInfo.jsp"%>
<% 
  String strLevel = "../../"; 
%> 
<%
    //获取提交的参数
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String sOPERATOR = request.getParameter("OPERATOR");
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));
    String from =  SzConvert.toZeroStr(request.getParameter("from"));
    
    int iFormID = SzConvert.toInt(request.getParameter("FormID"));
    //取得表单的信息
    String moduleName = "";
    String formName = "";
	LcForm lcForm = new LcForm();
	LcFormInfo lcFormInfo = null;    
    if (iFormID == 0) {
    	moduleName = SzConvert.toSpaceStr(request.getParameter("moduleName"));
    	formName = SzConvert.toSpaceStr(request.getParameter("formName")); 
    	//
    	iFormID = lcForm.getKeyByCond(moduleName, formName); 
    } else {
    	lcFormInfo = (LcFormInfo)lcForm.getInfoByKey(iFormID);    
    	if (lcFormInfo != null) {
    		moduleName = lcFormInfo.getBDLJ();
    		formName = lcFormInfo.getBDBY1();  
    	}
    } 	
    //System.out.println("moduleName=" + moduleName);
    //System.out.println("formName=" + formName);
    if (moduleName.equals("") || formName.equals("")) {
    	out.println("还没有设置相关表单信息！");
    	return;
    }   
    
    //2010-2-21
    BdPopedom bdPopedom = new BdPopedom();        
    String strDenyField = bdPopedom.getDenyField(iFormID, 0, iDLID_SESSION);
    String strDenyField2 = bdPopedom.getDenyField(iFormID, SzConvert.toInt(sKEY), iDLID_SESSION);
    bdPopedom.read(iFormID, SzConvert.toInt(sKEY), iDLID_SESSION);
    
    BdFormControl bdFormControl = new BdFormControl();
    //取得关联的名称
    String sTriggerName = bdFormControl.getTriggerName(moduleName, formName);    
  	//根据名称取得关联的条件控件
    String sRelateObject = bdFormControl.getRelateObject(sTriggerName);    
    
    String sHTML = "";    
	BdValueControl bdValueControl = new BdValueControl(moduleName, formName);	
	sHTML = bdValueControl.getHTML();
	String sTable = bdValueControl.getTableName();
	String sFieldID = bdValueControl.getKeyField();
	
	//获取附件名
	String assistant = bdValueControl.getAssistant();
	String sTableAnnex = bdValueControl.getTableAnnex();
	String sEditor    = bdValueControl.getEditor();
	String sWeboffice = bdValueControl.getWebOffice();
	String sTemplateSelect = bdValueControl.getTemplateSelect();
	String printTemp = bdValueControl.getPrintTemp();
	String printTempRelate = bdValueControl.getPrintTempRelate();
	String allograph = bdValueControl.getAllograph();
	
	boolean hasFlow   = bdValueControl.getHasFlow();
	boolean hasAnnex  = false;
	if (!sTableAnnex.equals("")) {
		hasAnnex = true;
	}
	
%>
<%
    SzData szData = null;
    SzDataInfo szDataInfo = null;

    String sReadonly = "";
    boolean bReadonly = false;
    if (sOPERATOR.startsWith("detail")) {
        sReadonly = "readonly";
        bReadonly = true;
    }
    if (sOPERATOR.equals("detailPass")) {
    	LcFlowControl.readPass(iFormID, iDLID_SESSION, Integer.parseInt(sKEY));
        sReadonly = "readonly";
        bReadonly = true;    	
    }
    //读取数据
		String value_str[] = null;
    if (!sKEY.equals("0")) {
    	value_str = (String[])bdValueControl.getInfoByKey(Integer.parseInt(sKEY));
    }
    String loginID2 = SzConvert.toSpaceStr(bdValueControl.getLoginID2(value_str));
    String loginName2 = SzConvert.toSpaceStr(bdValueControl.getLoginName2(value_str));
    String loginID = SzConvert.toSpaceStr(bdValueControl.getLoginID(value_str));
    if (loginID.equals("")) {
    	loginID = Integer.toString(iDLID_SESSION);
    }
    
    //检查是否有权利办理，如果没有就进入待办列表中
    if (sOPERATOR.equals("transact")) {
    	
    	LcFlowControl lcFlowControl = new LcFlowControl();
    	String str_InfoID = lcFlowControl.getTransactInfoID(iFormID, iDLID_SESSION) + ",0"; 
    	//System.out.println(str_InfoID + "==" + sKEY);
    	if (value_str == null || value_str[0] == null || str_InfoID.indexOf(("," + sKEY + ",")) == -1) {
    		//不在待办中，提示已过期
    		out.println(SzPageHelp.jsAlertBack("该文已办理或不存在"));
    		return;
    	} else {
			//读取相关的提醒。
    		OlMessageControl olMessageControl = new OlMessageControl();
    		olMessageControl.readMessage(iFormID, SzConvert.toInt(sKEY), iDLID_SESSION);
    		
    		//2011-07-12 该文设置为已读
    		lcFlowControl.readTransact(iFormID, SzConvert.toInt(sKEY), iDLID_SESSION);    		
    	}
    }   
%>
<%    
    //流程相关
    //根据已经有的信息ID，读取流程ID
    LcFlowControl lcFlowControl = new LcFlowControl();
    //取得流程权限信息
    LcFlowPopedomInfo lcFlowPopedomInfo = lcFlowControl.getFlowPopedomInfo(iFormID, Integer.parseInt(sKEY), iDLID_SESSION);
    
    int iFlowID = lcFlowPopedomInfo.getFlowID();
	boolean hasSend = lcFlowPopedomInfo.isHasSend();
	boolean isLastStep = lcFlowPopedomInfo.isLastStep();
	boolean canSend = lcFlowPopedomInfo.isCanSend();
	boolean canFinish = lcFlowPopedomInfo.isCanFinish();
	boolean canDeny = lcFlowPopedomInfo.isCanDeny();
	boolean canUntread = lcFlowPopedomInfo.isCanUntread();
	boolean canSkip = lcFlowPopedomInfo.isCanSkip();
	boolean canModifyForm = lcFlowPopedomInfo.isCanModifyForm();
	if (bReadonly) {
		canModifyForm = false;
	}
	if (canModifyForm || sOPERATOR.startsWith("add") || sOPERATOR.startsWith("update")) {
		 sReadonly = "";
	} else {
		 sReadonly = "readonly";		
	}
	
	boolean canDraftSave = false;
	boolean canDraftSend = false;
	boolean canTransactSave = false;
	if (hasFlow && !hasSend) {
		canDraftSave = true;
		canDraftSend = true;
	} else if (hasFlow && hasSend) {
		canTransactSave = true;
	} else if (!hasFlow) {
		canDraftSave = true;
	}
	boolean isTransact = false;
	if (sOPERATOR.startsWith("transact")) {
		isTransact = true;	
	}
	if (sOPERATOR.equals("updateWin")) {
		hasSend = false;
		isLastStep = false;
		canSend = false;
		canFinish = false;
		canDeny = false;
		canUntread = false;
		canSkip = false;
		
		canDraftSave = true;
		canDraftSend = false;
		canTransactSave = false;
		isTransact = false;
	}
	
	//EditType //// 0 显示  1 起草 2 批改 3 审核
	String sEditType = "0";
	if (sOPERATOR.startsWith("add") || (sOPERATOR.startsWith("update") && hasFlow)) {
		sEditType = "1";
	} else if (sOPERATOR.startsWith("update") && !hasFlow) {
		sEditType = "2";
	} else if (sOPERATOR.startsWith("transact")) {
		sEditType = "3";
	} 

%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<!--身份证读取--->
<% //if (1!=1 && (iFormID==1384 || iFormID==1403)) { 
if ((iFormID==1384 || iFormID==1403)) { 
%>
<OBJECT
	  classid="clsid:10946843-7507-44FE-ACE8-2B3483D179B7"
	  codebase="CVR100.cab#version=3,0,3,3"
	  id="CVR_IDCard"
          name="CVR_IDCard"
	  width=0
	  height=0
	  align=center
	  hspace=0
	  vspace=0 	 	  
>
</OBJECT> 
<% } %> 

<% if (!sEditor.equals("")) {%>
<script language="javascript">
  function LoadContent1() {
     this.focus();
     window_onresize();
     var vUrl = "http://<%=sServer_SESSION%>:<%=sPort_SESSION%><%=sContext_SESSION%>/share/formEngine2/load.jsp?FormID=<%=iFormID%>&KEY=<%=sKEY%>";
     tbContentElement.LoadURL(vUrl);
  }
</script>
<script type="text/javascript" src="<%=strLevel%>share/ckeditor/ckeditor.js"></script>
</head>
<body onload="javascript:this.focus();" >
<% } else {%>
</head>
<body onload="javascript:this.focus();" >
<% } %>

<!-----上面的工具栏------>
<% if (hasAnnex) { %>
<form name="formUpdate" method="post" ENCTYPE="multipart/form-data">
<% } else { %>
<form name="formUpdate" method="post">
<% } %>
  <!---使用流程的时候需要使用--->
  <input type="hidden" name="LCID_FLOW" value="0">
  <input type="hidden" name="BZID_FLOW" value="0">
  <input type="hidden" name="BZXH_FLOW" value="0">
  <input type="hidden" name="BZRYID_FLOW" value="0">  
  <input type="hidden" name="RYBLYJ_FLOW" value="">
  <input type="hidden" name="RYBLTP_FLOW" value="">
        
  
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="OPERATOR_SOURCE" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="from" value="<%=from%>">
  <input type="hidden" name="detailCount" value="0">
  <input type="hidden" name="detailCount1" value="0">
  <input type="hidden" name="detailCount2" value="0">
  <input type="hidden" name="detailCount3" value="0">
  <input type="hidden" name="detailCount4" value="0">
  <input type="hidden" name="FormID" value="<%=iFormID%>">
  <input type="hidden" name="loginID" value="<%=loginID%>">  
 <!--  <input type="hidden" name="szContent" value="">   -->
  <input type="hidden" name="RecordID" value="">    
  <input type="hidden" name="TriggerName" value="<%= sTriggerName%>">  
  <input type="hidden" name="RelateObject" value="<%= sRelateObject%>">  
  <input type="hidden" name="hasFlow" value="<%=hasFlow %>">
  <input type="hidden" name="hiddenSave" value="not">
<%@ include file="title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <% out.println(bdFormControl.printFormDesc(Integer.parseInt(sMKID_SESSION),iFormID));%>
      <%
      //是否有word模板打印
      if (!printTemp.equals("") && !sOPERATOR.startsWith("detailPass") && !sOPERATOR.startsWith("updateWin") && isBarManager_SESSION ) {
    	  out.println( SzPageHelp.button("单据打印","javascript:PrintWinWord();") );
      }

      if (!sOPERATOR.startsWith("updateWin")) {

  	  	out.println( SzPageHelp.backButton() );
    	} else {
  	 		out.println( SzPageHelp.closeButton() ); 
    	}      
      %>         
    </td>
  </tr>
</table>

<!-- 传阅反馈信息 -->
<% if (sOPERATOR.startsWith("detailPass")) { %>
<% } %>

<% if (allograph.startsWith("1")) { %>
<table width="750" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0"> 
  <tr> 
    <td width="100">所属人员</td> 
    <td><input type="hidden" name="SZOA_BDDLID" class="txtClass" value="<%=loginID2%>">
        <input type="text" name="SZOA_BDDLXM" class="txtClass" value="<%=loginName2%>" readonly>
        <input type="button" value="选择" class="btnClassShort" onClick="javascript:OpenWin12('formUpdate.SZOA_BDDLID', 'formUpdate.SZOA_BDDLXM');">
    </td> 
  </tr> 
</table> 
<% } %>
 

<!-----信息维护------>
<div id="divForm">
<%=sHTML %>
</div>
<!-- 附件 -->
<% if (!sTableAnnex.equals("")) { %>
<table width="750" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0"> 
  <tr> 
    <td class="tdClassTitle">附件</td> 
    <td><%=SzPageHelp.annex(sTableAnnex, sKEY, bReadonly)%></td> 
  </tr> 
</table> 
<% } %>
<% if (!sEditor.equals("")) {%>
<table width="750" border="0" cellpadding="1" cellspacing="0">
  <tr>
    <td>
      <%//@ include file="/share/editor/edit.jsp"%>
      <%
		szData = new SzData();
	  szData.setTableInfo(sTable, sFieldID, sEditor);
	  szDataInfo = (SzDataInfo)szData.getInfoByKey(Integer.parseInt(sKEY));		
	  String sValue = "";
	  if (szDataInfo != null) {
	        sValue = szDataInfo.getName();
	  }	      
      /*
			FCKeditor fckEditor = new FCKeditor(request, "szContent");
			fckEditor.setHeight("400");
			fckEditor.setWidth("750");

			fckEditor.setValue(sValue);		    
			out.println(fckEditor);
			*/
		%>  
		 <textarea id="szContent" name="szContent"><%=sValue %></textarea>       
    </td>
  </tr>
</table>
	<script type="text/javascript">
    CKEDITOR.replace( 'szContent');
   </script>
<% } %>
</form>
<% if (hasFlow && !sOPERATOR.startsWith("updateWin") ) { 
	 //而且不是发文的传阅
	 if (!formName.equals("document2") || !moduleName.equals("document_new.xml") || !sOPERATOR.startsWith("detailPass")) {
%>
<!--流程相关 包含流程的frame页面 -->
<iframe id="flowDraft" src="../../flow/flow/draft.jsp?assistant=<%=assistant%>&type=<%=iFlowID%>&FormID=<%=iFormID%>&InfoID=<%=sKEY%>&OPERATOR=<%=sOPERATOR%>" frameborder="0" scrolling="auto" width="750"></iframe>
<%
	 }
  } 
%>

<% 
   if (!sWeboffice.equals("") && ((";" + assistant + ";").indexOf(";5;") >=0)) {
	  session.setAttribute("SzModuleType", "");
	  session.setAttribute("SzModuleID", "");
	  session.setAttribute("SzInfoID", "");
	   
		String FileType   = sWeboffice;
		String ModuleType = "formEngine";
		int    ModuleID   = iFormID;
		
	    //取得RecordID
	    OfficeRecordID officeRecordID = new OfficeRecordID();
	    String RecordID  = officeRecordID.loadRecordID(ModuleType,ModuleID,Integer.parseInt(sKEY));
	    session.setAttribute("SzModuleType", ModuleType);
	    session.setAttribute("SzModuleID", Integer.toString(ModuleID));
	    session.setAttribute("SzInfoID", sKEY);
%>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
  <tr>
    <td>
      <iframe id="webOffice" width="100%" height="1380" 
              frameborder="0"
              src="../../share/weboffice/DocumentEdit.jsp?InfoID=<%=sKEY%>&FileType=<%=FileType%>&ModuleType=<%=ModuleType %>&ModuleID=<%=ModuleID %>&RecordID=<%=RecordID%>&EditType=<%=sEditType%>&Template=<%=sTemplateSelect%>">
      </iframe>
    </td>
  </tr>
</table>
<% }  else { %>
      <iframe id="webOffice" width="0" height="0" 
              frameborder="0">
      </iframe>

<% } %>
<%
  if (!sOPERATOR.equals("add") && !sOPERATOR.startsWith("updateWin")) {
	BdRelateForm bdRelateForm = new BdRelateForm();
	out.println(bdRelateForm.relateChildList(iFormID, SzConvert.toInt(sKEY), false, canModifyForm, sOPERATOR));
  }

 //System.out.println(bdValueControl.detailJs(Integer.parseInt(sKEY), sOPERATOR, canModifyForm));
%>



<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="FormID" value="<%=iFormID%>"> 
</form>

<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript" src="../../share/js/formTool.js"></script>
<%=bdValueControl.detailCheckJs()%>
<%=bdValueControl.updateJs(Integer.parseInt(sKEY), session, sOPERATOR, canModifyForm, strDenyField, strDenyField2)%>
<%=bdValueControl.detailJs(Integer.parseInt(sKEY), sOPERATOR, canModifyForm)%>
<%=LcFlowControl.fieldPopedom(iFormID, iFlowID, Integer.parseInt(sKEY), canModifyForm, isTransact) %>
<%=bdValueControl.saveCheckJs()%>

<script language="javascript">
  <% if (sReadonly.equals("readonly")) {%>
    hideAll(formUpdate.btnSelect);
    hideAll(formUpdate.pop1);
  <% } %>

  function FormSave(formName, url, vOPERATOR) {
		if (!FormCheck(formName)) {
			return false;
		}
    //保存前把流程ID、流程步骤ID、表单ID、信息ID等写到信息里面
    //流程相关
    <% if (hasFlow && !sOPERATOR.startsWith("updateWin")) {%>
    formName.LCID_FLOW.value = flowDraft.formList.LCID.value;
    formName.BZRYID_FLOW.value = ValueOfCheck(flowDraft.formList.BZRYID);
    formName.BZXH_FLOW.value = flowDraft.formList.BZXH.value;
    formName.RYBLYJ_FLOW.value = flowDraft.formList.RYBLYJ.value;
    formName.RYBLTP_FLOW.value = flowDraft.formList.selectSignature.value;
    <% } %>	
    <% if (!sEditor.equals("")) {%>
    //formName.szContent.value=tbContentElement.DocumentHTML;
    <% } %>	
    <% if (!sWeboffice.equals("") && ((";" + assistant + ";").indexOf(";5;") >=0)) { %>    
    //weboffice
    formName.RecordID.value = webOffice.webform.RecordID.value;
    
    webOffice.webform.save.click(); 
    <% } %>
        
    if (vOPERATOR != "") {
    	formName.OPERATOR.value = vOPERATOR;
    }
    //取消其他按钮
    //alert(formName.OPERATOR.value);
    //alert(formName.RecordID.value);
    document.getElementById("divLine").style.display = "block";
    document.getElementById("saveButtonUpdate").disabled = true;
		//2012-01-11增加
		vBeforeFrameHtmlUnload = false;	
		    
    formName.action = url;
    formName.submit();      
  }   
  
  
  function FormSaveConfirm(formName, url, vOPERATOR) {

    //保存前把流程ID、流程步骤ID、表单ID、信息ID等写到信息里面
    //流程相关
    formName.LCID_FLOW.value = flowDraft.formList.LCID.value;
    formName.BZRYID_FLOW.value = ValueOfCheck(flowDraft.formList.BZRYID);
    formName.BZXH_FLOW.value = flowDraft.formList.BZXH.value;
    formName.BZID_FLOW.value = flowDraft.formList.BZID.value;
    
    formName.RYBLYJ_FLOW.value = flowDraft.formList.RYBLYJ.value;
    formName.RYBLTP_FLOW.value = flowDraft.formList.selectSignature.value;
    <% if (!sOPERATOR.equals("add") && !sOPERATOR.equals("update")) { %>  
    if (formName.RYBLYJ_FLOW.value == "") {
    	alert("办理意见不能为空");
    	return;
    }
    <% } %>
    var vMessage = "";
    if (vOPERATOR == "transact" || vOPERATOR == "send") {
      vMessage = "确定要发送？";
      if (formName.BZRYID_FLOW.value == "0" || formName.BZRYID_FLOW.value == "") {
    	  alert("请至少选择一个办理人员！");
    	  return false;
      } 
      //当multipart/form-data时，request不到后面的值，所以补充了下面      
    } else if (vOPERATOR=="transactFinish") {
      vMessage = "确定要办结？";    
    } else if (vOPERATOR=="transactDeny") {
      vMessage = "确定要否决？";    
    }
    if (vOPERATOR != "") {
    	formName.OPERATOR.value = vOPERATOR;
    }    
    
    if (confirm(vMessage)) {
    	<% if (!sEditor.equals("")) {%>
    	//formName.szContent.value=tbContentElement.DocumentHTML;
    	<% } %>	
    	<% if (!sWeboffice.equals("") && ((";" + assistant + ";").indexOf(";5;") >=0)) { %>    
    	//weboffice
    	formName.RecordID.value = webOffice.webform.RecordID.value;
    	webOffice.webform.save.click(); 
    	<% } %>    
	if (!FormCheck(formName)) {
		return false;
	}
				document.getElementById("divLine").style.display = "block";
				document.getElementById("saveButtonUpdate").disabled = true;
				
			//2012-01-11增加
			vBeforeFrameHtmlUnload = false;	
						
      	formName.action = url;
      	formName.submit();      
    }
  }
  
  function OpenDetailWin(keyValue,formId) {
    var vUrl = "detail_win.jsp?OPERATOR=detail&KEY=" + keyValue + "&FormID=" + formId;
  	window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=700");  
  }
  function OpenUpdateWin(keyValue,formId) {
    var vUrl = "update.jsp?OPERATOR=updateWin&KEY=" + keyValue + "&FormID=" + formId;
  	window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=700");  
  }
  
  function OpenRelateDetailWin(keyValue,formId, pKey, pFormId, relateId) {
    var vUrl = "relate_detail.jsp?OPERATOR=detail&KEY=" + keyValue + "&FormID=" + formId + "&PKEY=" + pKey + "&PFORM=" + pFormId + "&type=" + relateId;
  	window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=700");  
  }     
  function OpenRelateUpdateWin(keyValue,formId, pKey, pFormId, relateId, vOPERATOR) {    
    var vUrl = "relate_update.jsp?OPERATOR=updateWin&OPERATOR_SOURCE=" + vOPERATOR +"&KEY=" + keyValue + "&FormID=" + formId + "&PKEY=" + pKey + "&PFORM=" + pFormId + "&type=" + relateId;
  	window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=700");  
  } 
  function LogWin() {
    var vUrl = "../../share/other/logList.jsp?LogType=FORM&ModuleID=<%=iFormID%>&InfoID=<%=sKEY%>";
  	window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=700");  
  }   
  
  function RelateWin() {     
  	//这里就要取得值
  	var vTriggerName = formUpdate.TriggerName.value;
  	var oObject = formUpdate.RelateObject.value;
  	var vValue = "";
  	if (oObject != "") {
  		vValue = eval("formUpdate." + oObject + ".value;");
  	}
    var vUrl = "relate_win.jsp?moduleName=<%=moduleName%>&formName=<%=formName%>&triggerName=" + vTriggerName + "&relateValue=" + vValue;
  	window.open(vUrl,"","left=1020,top=1020,width=1,height=1");
  	//window.open(vUrl,"","left=102,top=102,width=551,height=551,status=yes");
	
  }  
  
  function PrintWin() {
    var vUrl = "print.jsp?moduleName=<%=moduleName%>&formName=<%=formName%>&OPERATOR=detail&KEY=<%=sKEY%>";
  	//window.open(vUrl,"","left=20,top=20,width=600,height=600");
  	window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;dialogHeight=550px");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;");
  }
  
  function PrintWinWord() {
    var vUrl = "printTemp.jsp?FormID=<%=iFormID%>&KEY=<%=sKEY%>&type=0&printTemp=<%=printTemp%>&printTempRelate=<%=printTempRelate%>";
  	window.open(vUrl,"","left=20,top=20,width=600,height=600");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;dialogHeight=550px");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;");
  }
  
  
  function PrintWinWordRelate() {
    var vUrl = "printTemp.jsp?FormID=<%=iFormID%>&KEY=<%=sKEY%>&type=1&printTemp=<%=printTemp%>&printTempRelate=<%=printTempRelate%>";
  	window.open(vUrl,"","left=20,top=20,width=600,height=600");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;dialogHeight=550px");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;");
  }  

  function OfficeDetailWin(vKey) {
    //hideOperatorWin("div");
    var vRecordId = formUpdate.RecordID.value;
    var vUrl = "documentEdit.jsp?OPERATOR=<%=sOPERATOR%>&WebOffice=<%=sWeboffice%>&FormID=<%=iFormID%>&KEY=" + vKey + "&RecordId=" + vRecordId;
  	//window.open(vUrl,"","left=20,top=20,width=600,height=600");
  	window.showModalDialog(vUrl,window,"status=no;dialogWidth=950px;dialogHeight=800px");
  }   
  
  function StatWin(loginID, condObj) {
  	var condValue = "";
  	
  	if (condObj != "") {
  		condValue = eval("formUpdate." + condObj + ".value");
  	}     
    //alert(condObj + "==" + condValue);
    var vUrl = "stat_month_depart_user.jsp?FormID=<%=iFormID%>&loginID=" + loginID + "&condValue=" + encodeURIComponent(condValue) + "&win=1";
  	window.open(vUrl,"","left=102,top=102,width=851,height=251,status=yes,resize=yes");	
  }    
  
  //这里做退回、跳签需要传递的参数：流程ID，操作类型
  function transactWin(vFlowID, vOPERATOR) {
    var vUrl = "../../flow/flow/untread_win.jsp";
    if (vOPERATOR == "transactUntread") {
    
    } else if (vOPERATOR == "transactSkip") {
    
    }
    vUrl += "?OPERATOR=" + vOPERATOR + "&FlowID=" + vFlowID;
    window.showModalDialog(vUrl,window,"status=no;dialogWidth=680px;dialogHeight=580px");  
  }  
  
  function transactSubmit() {
	  formUpdate.RYBLYJ_FLOW.value = flowDraft.formList.RYBLYJ.value;
	  formUpdate.RYBLTP_FLOW.value = flowDraft.formList.selectSignature.value;  
	  <% if (!sEditor.equals("")) {%>
		  //formUpdate.szContent.value=tbContentElement.DocumentHTML;
	  <% } %>	
	  <% if (!sWeboffice.equals("") && ((";" + assistant + ";").indexOf(";5;") >=0)) { %>   
    	//weboffice
    	formUpdate.RecordID.value = webOffice.webform.RecordID.value;
    	webOffice.webform.save.click(); 
	  <% } %> 	
    <% if (hasAnnex) { %>		  
	    formUpdate.action = "control2.jsp";
	  <% } else {%>
	    formUpdate.action = "control.jsp";
	  <% } %>
	  
		//2012-01-11增加
		//vBeforeFrameHtmlUnload = true;		  
	  formUpdate.submit();  
  }
  
  //document.all.['flowDraft'].style.height = vHeight;  
  
  initialJs("<%=moduleName%>","<%=formName%>");

  //初始化后才能调用AJAX
  <% 
	if (iFormID == 1341) {
		out.println("	qingjiaLeixing();");
	}

	//2012-08-03增加
	if (iFormID == 1384 && sOPERATOR.equals("add") ) {	   
		out.println("	zhaoshengLimit();	");
	}
	if (iFormID == 1384 && !sOPERATOR.equals("add") ) {	   
		out.println("	SearchStudent();	");
	}


	//2012-08-10增加
	if (iFormID == 1403 ) {	   
		out.println("	SearchStudent();	");
	}
  %>
  
</script>
<div id="divLine" class="divLine" align="center" style="position:absolute;width:450;height:150px;left:150px;top:150px;padding:60px 0 0 0; margin:0px;overflow:auto;overflow:hidden;display:none; background-color:#dbdbdb;">
	<img src="<%=strSkin_SESSION%>/bar.gif">
</div><!---------------------------------------------------------------20120112 ting----------------------------------------->

</body>
<%
out.println(SzPageHelp.calendarFrame2());
out.println(SzPageHelp.calendar2Frame2());
%>

