<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzLevelNumber" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.flow.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<%=strLevel_SESSION%>/share/js/operatorWin.js"></script>
<style type="text/css">
.div{
	position: absolute;
	z-index: 1;
	display:none;
	background-color: #cccccc;
	border: 0px;
	border-color: black;
	border-style: solid;
}
td{
	word-break : break-all; 
}
</style>
</head>

<%

    int iFormID = SzConvert.toInt(request.getParameter("FormID"));
    //取得表单的信息
    String moduleName = "";
    String formName = "";
		//根据表单取得moduleName, 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;
    }

    //找出关联的信息
    BdRelateForm bdRelateForm = new BdRelateForm();
    ArrayList listRelate = bdRelateForm.getRelateList(moduleName, formName);
    Iterator iterRelate = null;
    BdRelateFormInfo bdRelateFormInfo = null;

    BdFormHelp bdFormHelp = new BdFormHelp();
		BdValueControl bdValueControl = new BdValueControl(moduleName, formName);
    //int iIndexLogin = bdValueControl.getIndexLogin();
    //System.out.println(iIndexLogin);
  	String assistant = bdValueControl.getAssistant();  
  	String sTableAnnex = bdValueControl.getTableAnnex();
  	String sKeyField = bdValueControl.getKeyField();
		boolean hasFlow = bdValueControl.getHasFlow();
		String allograph = bdValueControl.getAllograph(); //是否有代录人
		String printTemp = bdValueControl.getPrintTemp();
		String sWeboffice = bdValueControl.getWebOffice();
		String sNameField = bdValueControl.getNameField();
		String sDepartNameField = bdValueControl.getDepartNameField();
		//2015-01
		String sModulePopedom = bdValueControl.getModulePopedom();

		int iFlowID = 0;

		String strSelectName = bdValueControl.getSelectName(); //是否有关联选择
		//是否有关联选择:支持逗号或分号
		BdListSelect bdListSelect = new BdListSelect();
		String strSelectCond = bdListSelect.genSelectCond(strSelectName, request, "selectName");

    /////////////////////////////////////////流程相关
    LcFlowControl lcFlowControl = new LcFlowControl();
    //根据信息ID，获取流程总体办理状态FlowState
    String sState = "";
    //sState = lcFlowControl.getFlowStateName(iFormID, iInfoID); 
    //判断是否能删除、修改
    boolean hasSend = false; //是否已经发送出去
    //hasSend = lcFlowControl.hasSend(iFormID, iInfoID);
    //获取提交的参数
    String flowType = SzConvert.toSpaceStr(request.getParameter("flowType"));
		if (flowType.equals("")) {
			flowType = "-2";
		}	    
    //获取提交的参数
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.toHTMLString(SzConvert.strWriteDataHTML(request.getParameter("txtSearch"))) ;
    String sSearch2 = SzConvert.strWriteData(request.getParameter("txtSearch"));    

		String datefield = SzConvert.strWriteData(request.getParameter("datefield"));   //日期字段， 
	  String sSearchName = SzConvert.strWriteData(request.getParameter("txtSearchName")); //查询的人员姓名
	  String sSearchDepart = SzConvert.strWriteData(request.getParameter("txtSearchDepart")); //查询的部门名称
	  //查询时间段
	  String sSearchBegin = SzConvert.strWriteData(request.getParameter("txtSearchBegin")); //开始日期
	  String sSearchEnd = SzConvert.strWriteData(request.getParameter("txtSearchEnd"));     //结束日期    
    
    String sTable_type = "";
    //读取数据
    String sSearchCond = SzConvert.strWriteDataHTML(request.getParameter("searchCond"));


    String sCond = bdValueControl.getCond(iFormID, iDLID_SESSION, iBMID_SESSION
    		, isBarManager_SESSION, sSearchCond, isDataCanSee_SESSION
    		, szCOMPANY_SESSION, "", "", flowType, strSelectCond);


    //2014-11扩展条件：日期区间；姓名；部门
    sCond = bdValueControl.appendCond(sCond, datefield, sSearchBegin,sSearchEnd, sSearchName, sSearchDepart);

    String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField")); 
    int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder"))); 
    if (sSortField.equals("")) { 
      sSortField = bdValueControl.getKeyField();
      iSortOrder = SzProperties.I_SortOrder_DESC;
    } 

    int iCurrentPage = 1;
    
    try {
        iCurrentPage =  Integer.parseInt(sPage);
    }catch(Exception e) {
    }
       
    Collection coll = bdValueControl.getArrayList(sCond, sSortField, iSortOrder, iCurrentPage, sSearch2); 
    BdFormControl bdFormControl = new BdFormControl(); 
    Iterator iter = null;
    if (coll != null) {
    	iter = coll.iterator();
    } else {
    	out.println(bdFormControl.getFormCheckInfo(iFormID));
    	return;
    }
    SzPageInfo pageInfo = bdValueControl.getPageInfo();
    int iPageCount = pageInfo.getPageCount();
    int iRecordCount = pageInfo.getRecordCount();
    iCurrentPage = pageInfo.getCurrentPage();
    int i = 0;
    SzData szData = null;     

    
    //2010-2-21
    BdPopedom bdPopedom = new BdPopedom();        
    String strDenyField = bdPopedom.getDenyField(iFormID, 0, iDLID_SESSION);
    
    boolean bPress = bdFormHelp.needPress(assistant);
    boolean bSkip = bdFormHelp.needSkip(assistant);
    boolean bRead = bdFormHelp.needRead(assistant, hasFlow);
		
    SzAnnex szAnnex = new SzAnnex(sTableAnnex);
    SzReadForm szReadForm = new SzReadForm(iFormID);   	 
    
    String sSelectButton = bdListSelect.selectButton(strSelectName,request, "selectName", "txtClass1", true);
    
%>
<!-----上面的工具栏------>
<%@ include file="/share/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>"> 
  <input type="hidden" name="searchCond" value="<%=sSearchCond%>">
  <input type="hidden" name="sCond" value="<%=sCond%>">
  <input type="hidden" name="FormID" value="<%=iFormID%>"> 
  
  <input type="hidden" name="datefield" value="<%=datefield%>">
  <!-- txtSearchBegin, txtSearchEnd, txtSearchName, txtSearchDepart 在方法appendSearchInfo中实现 -->
    
  <tr>
    <td>
    	<% out.println(bdFormControl.printFormDesc(Integer.parseInt(sMKID_SESSION),iFormID));%>
      <%//=SzPageHelp.addButtonSubmit()%>
      <%//=SzPageHelp.deleteButton()%>      
      <%=bdFormControl.addButton(moduleName, formName, isBarManager_SESSION)%>
      <%=bdFormControl.deleteButton(moduleName, formName, isBarManager_SESSION)%>

 
      <%=bdFormControl.exportButton(bdValueControl.getHasExport()) %>
      <%=bdFormControl.importButton(bdValueControl.getHasImport(), bdValueControl, isBarManager_SESSION) %>
 
      <%//=SzPageHelp.button("综合查询","javascript:FormSubmit(formBar, 'search.jsp');") %>
      <%=bdFormControl.searchButton(iFormID, "综合查询", true, sSearchCond) %>
      
      <%=bdFormControl.statButton(moduleName, formName, isBarManager_SESSION, "统计汇总", "stat.jsp", isBarManager_SESSION, ";2;") %>         

      <% out.println(SzPageHelp.indexerButton("form", Integer.toString(iFormID), isBarManager_SESSION, assistant)); %>                 
	    <%=bdPopedom.setPopedomButton(iFormID, isBarManager_SESSION, assistant) %>
	    <%=bdPopedom.listPopedomButton(iFormID, isBarManager_SESSION, assistant) %>
	    <%=bdPopedom.setTransferButton(iFormID, isBarManager_SESSION, assistant) %>       
	    <%
      if (isBarManager_SESSION) {
     	 out.println( SzPageHelp.button("操作日志","javascript:LogWin();") );
      } 
	    %>
      <%=bdListSelect.selectButton(strSelectName,request, "selectName", "txtClass1") %>   
      <%
      if (hasFlow) {
      	String s_id[] = {"-2","-1","0","1","2"};
      	String s_name[] = {"全部","草稿","办理中","否决","办结"};
      	out.println(SzPageHelp.radioSubmit("flowType", s_id, s_name, flowType));
      }
      %>  
      <%
      	out.println(bdFormHelp.appendSearchInfo(bdValueControl, datefield, sSearchBegin, sSearchEnd, sSearchName, sSearchDepart));
      %>
      
       
	                
    </td>
  </tr>
  </form>
</table>
<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">
  <input type="hidden" name="page" value="<%=iCurrentPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>"> 
  <input type="hidden" name="FormID" value="<%=iFormID%>">  
  
  <input type="hidden" name="datefield" value="<%=datefield%>">
  <input type="hidden" name="txtSearchName" value="<%=sSearchName%>">  
  <input type="hidden" name="txtSearchDepart" value="<%=sSearchDepart%>">
  <input type="hidden" name="txtSearchBegin" value="<%=sSearchBegin%>">
  <input type="hidden" name="txtSearchEnd" value="<%=sSearchEnd%>">   
  <input type="hidden" name="searchCond" value="<%=sSearchCond%>">
  <%=sSelectButton%>
  <tr class="trClassTitle">
    <td width="5"><input type="checkbox" name="chkCheckAll" OnClick="javascript:CheckAll(formList, chkCheckAll, 'chkId');"></td>
    <%
    if (!sTableAnnex.equals("")) {
    	out.println("<td width='5' align='center'>" + SzPageHelp.annexImage(strSkin_SESSION, true) + "</td>");
    }
    if (bRead) {
    	out.println("<td>&nbsp;</td>");
    }    
    if (allograph.equals("1")) {
    	out.println("<td>所属人员</td>");
    }
    %>
	<%=bdValueControl.printTableTitle(sSortField, iSortOrder)%>    
	<% 
		if (hasFlow) { 
			if (flowType.equals("0")) {
				out.println("<td>当前办理人员</td>");
				out.println("<td>剩余时间</td>");
				if (bPress) {
					out.println("<td>被催办</td>");
				}
			} else if (flowType.equals("2")) {
				out.println("<td>办结时间</td>");
				out.println("<td>是否超时</td>");				
			}
			out.println("<td>总状态</td>"); 
		}	
	%>     	
    <td>操作</td>
  </tr>
  
<%
    String value_str[] = null;
    int iKeyValue = 0;
    int iIndexKey = bdValueControl.getIndexKey();

    if (iIndexKey == -1) {
    	iIndexKey = 0;
    }
    int iListFieldLen = 0;

	
		if (hasFlow) {
    	iListFieldLen = 3 + bdValueControl.getListFieldLen() ;
    	if (flowType.equals("0")) {
    		iListFieldLen = iListFieldLen + 2;
				if (bPress) {
					iListFieldLen ++;
				}				
    	} else if (flowType.equals("2")) {
    		iListFieldLen += 2;
    	}
    } else {
    	iListFieldLen = 2 + bdValueControl.getListFieldLen() ;
    }
    if (allograph.equals("1")) {
    	iListFieldLen ++;
    }
    if (!sTableAnnex.equals("")) {
    	iListFieldLen++;
    }
    if (bRead) {
    	iListFieldLen++;
    }    
    boolean sameLogin = false;
    boolean sameDepart = false;
    //2011-06-08 部门负责人可修改部门内人员的数据
    boolean departManager = false;	//判断本人是否该数据的部门负责人。
    
    //2015-01细化
    String managerDepartID = "0";
    if (sModulePopedom.equals("6") || sModulePopedom.equals("7")) {
    	managerDepartID = SzUserHelp.getInstance().getManageDepartID(iDLID_SESSION);
    } else if (sModulePopedom.equals("8") || sModulePopedom.equals("9")) {
    	managerDepartID = SzUserHelp.getInstance().getManagerDepartIDTree(iDLID_SESSION);
    }
		
    
    //归档状态
    LcPigonhole pigonhole = new LcPigonhole();
    boolean hasPigonhole = false;
    int iState = 0;   
    
    String sRelateInfo = "";
    String loginName2 = "";
    
    boolean canUpdate = false;
    
    String strDenyField2 = "";
    boolean readonly = false;
    String s_transact[] = null;
    String sPressCount = "";
 
    LcAssistant lcAssistant = new LcAssistant();
    LcStep lcStep = new LcStep();

    BdModifyButton bdModifyButton = new BdModifyButton();
    boolean flagModifyButton = canUpdate;
  
    while (iter != null && iter.hasNext()) {
    	value_str = (String[])iter.next();
    	iKeyValue = SzConvert.toInt(value_str[iIndexKey]);
    	if (value_str == null) {
    		continue;
    	}
    		strDenyField2 = bdPopedom.getDenyField(iFormID, iKeyValue, iDLID_SESSION);
        hasSend = lcFlowControl.hasSend(iFormID, iKeyValue); 
        iState = lcFlowControl.getFlowState(iFormID, iKeyValue);    
	//2015-03-05    
        hasPigonhole = pigonhole.pigonholeStateSelf(iFormID, iKeyValue, iDLID_SESSION);
        iFlowID = lcFlowControl.getFlowID(iFormID, iKeyValue);
        i++;
        
        sameLogin = bdValueControl.sameLogin(iDLID_SESSION, value_str);        
        sameDepart = bdValueControl.sameDepart(iBMID_SESSION, value_str); 
  	
        loginName2 = bdValueControl.getLoginName2(value_str);
        //2011-06-08 部门负责人可修改部门内人员的数据
        //canUpdate = bdFormControl.canUpdate(moduleName, formName, isBarManager_SESSION, hasSend, sType, iKeyValue, sameLogin, sameDepart);
        departManager = bdValueControl.departManager(managerDepartID, value_str);
        canUpdate = bdFormControl.canUpdate(moduleName, formName, isBarManager_SESSION, hasSend, sType, iKeyValue, sameLogin, sameDepart, departManager);
        //=================================================	
        if ( !sRelateInfo.equals("") && canUpdate) {
        	//canUpdate = bdRelateForm.canUpdate(iFormID, iKeyValue); 
        }
        
        if ((hasFlow && hasSend) || !canUpdate) {        
        	readonly = true;
        } else {
        	readonly = false;
        }
        //2014-06注释掉，这个是下级表单，在标准版客户管理中使用。新版已弃
        //sRelateInfo = bdRelateForm.relateButton(iFormID, listRelate, iKeyValue, readonly, true);
        
%>
  <tr  onMouseOver="javascript:this.className='trMouseOver'" 
       onMouseOut="javascript:this.className='trMouseOut'"
       onDblClick="javascript:showOperatorWin('div','<%=i %>',85)"       
       >
    <td width="5" title="<%=i%>">
      <% if (readonly) {%> 
      <input type="checkbox" disabled>
      <% } else { %>
      <input type="checkbox" name="chkId" id="chkId" value="<%=iKeyValue%>">	  
      <% } %>    
    </td>
    <%
    if (!sTableAnnex.equals("")) {
    	out.println("<td width='20' align='center'>" + SzPageHelp.annexImage(strSkin_SESSION, szAnnex.hasAnnex(iKeyValue)) + "</td>");
    }
    if (bRead) {
    	out.println("<td width='30' align='center'>" + SzPageHelp.newImage(strSkin_SESSION, szReadForm.hasReaded(iKeyValue, iDLID_SESSION)) + "</td>");
    }    
    if (allograph.equals("1")) {
    	out.println("<td>所属人员</td>");
    }
    %>    
    <% if (allograph.equals("1")) { %>
    <td><%=loginName2%>&nbsp;</td>
    <% } %>
    <%=bdValueControl.printTableValue(value_str, strDenyField, strDenyField2, 0, sType, iKeyValue)%>
	<% 
	   if (hasFlow) { 
			if (flowType.equals("0")) {
				s_transact = lcFlowControl.getCurrentTransactingInfo(iFormID, iKeyValue, "<br>", true);
				sPressCount = Integer.toString(lcAssistant.getPressCount(iFormID, iKeyValue, SzConvert.toInt(s_transact[3])))
				            + "次/总"
				            + Integer.toString(lcAssistant.getPressCount(iFormID, iKeyValue, 0))
				            + "次";
				out.println("<td>" + s_transact[0] + "</td>");
				out.println("<td>" + s_transact[1] + "</td>");
				if (bPress) {
				out.println("<td>" + sPressCount + "</td>");
				}
			} else if (flowType.equals("2")) {
				s_transact = lcFlowControl.getFinishInfo(iFormID, iKeyValue);
				out.println("<td>" + s_transact[0] + "</td>");
				out.println("<td>" + s_transact[1] + "</td>");				
			}
			out.println("<td>" + lcFlowControl.getFlowStateName(iFormID, iKeyValue) + "&nbsp;</td>"); 
	   } 
	%>   
    <td>   
      <a class="aHrefClass" onclick="showOperatorWin('div','<%=i %>',85)" >操作</a>
      <div id="div<%=i %>" class="div" style="left: 10px;top: 190px;width:70px;">
      	<div style="padding-top:5px;padding-bottom:5px;position:relative; background-color:#cccccc;border: 0px;">
 		<div  class="Operation">    
      <a href="javascript:<%=bdFormHelp.getDetailFunc(assistant) %>(formPage,'update.jsp?OPERATOR=detail&type=<%=sType%>&KEY=<%=iKeyValue%>', '_blank');">详情</a>
      <%= bdFormHelp.feedbackOperator(assistant, iKeyValue) %>   
      <!-- 自己的留言可以修改 -->      
      <% 
      if (canUpdate) {
      	out.println("<br>");
      	out.println(bdFormControl.updateButton(canUpdate, sType, iKeyValue));
      }
      %>
      <%
      //2014-10-09修改，避免重复定义  
      flagModifyButton = canUpdate;
      if (hasFlow && sameLogin) {
        flagModifyButton = true;
      }
      out.println(bdModifyButton.modifyButton(moduleName, formName, iKeyValue, flagModifyButton ));
      %>
      <% 
      	if (iState == 0) {
      		 if (bPress) {
    	%>
      <br><a href="#" OnClick="javascript:OpenPressWin(<%=iFormID%>,<%=iKeyValue%>,'0');">催办</a>
      <%
      		}
      		if (bSkip) { 
      %>
      <br><a href="#" OnClick="javascript:OpenPressWin(<%=iFormID%>,<%=iKeyValue%>,'1');">跳转</a>
			<% 
      		}
				} 
			%>
      <% if (iState == 2) { %>
      	<% if (!hasPigonhole) { %>
      <br><a href="#" OnClick="javascript:OpenPigonholeWin(<%=iFormID%>,<%=iKeyValue%>);">归档</a>
        <% } else { %>
      <font color='red'>已归档</font>
	<% } %>
      <% } %> 
      <%= bdPopedom.setPopedomButton2(iFormID, isBarManager_SESSION, sameLogin, iKeyValue, assistant) %>
      <%= bdPopedom.listPopedomButton2(iFormID, isBarManager_SESSION, sameLogin, iKeyValue, assistant) %>
      <%//=sRelateInfo %>      
      <% if (!printTemp.equals("") && BdFormHelp.canPrint(assistant, hasFlow, iState)  ) { %>
      <br><a href="#" OnClick="javascript:PrintWinWord('<%=iKeyValue%>')">打印浏览</a>
      <% } %>
      <% if (hasFlow) { %>
      <br><a href="#" OnClick="javascript:FlowDetailWin('<%=iFlowID%>','<%=iKeyValue%>');">查看流程</a>
      <% } %>
      <% if (!sWeboffice.equals("")) { %>
      <br><a href="#" OnClick="javascript:OfficeDetailWin('<%=iKeyValue%>');">查看正文</a>
      <% } %>
      
      <br><a href="javascript:hideOperatorWin('div');">取消菜单</a>
   		</div>
   		</div>
   	</div>      
    </td>
  </tr>
<%
    }
    out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, iListFieldLen));
%>
    
  </form>  
</table>  

<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
  <input type="hidden" name="flowType" value="<%=flowType%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>"> 
  <input type="hidden" name="FormID" value="<%=iFormID%>">   
  
  <input type="hidden" name="datefield" value="<%=datefield%>">
  <input type="hidden" name="txtSearchName" value="<%=sSearchName%>">  
  <input type="hidden" name="txtSearchDepart" value="<%=sSearchDepart%>">
  <input type="hidden" name="txtSearchBegin" value="<%=sSearchBegin%>">
  <input type="hidden" name="txtSearchEnd" value="<%=sSearchEnd%>">  
  <input type="hidden" name="searchCond" value="<%=sSearchCond%>">   
  <%=sSelectButton%>
  <tr>
    <td align="right">
      <%@ include file="/share/page/page_include.jsp"%>
    </td>
  </tr>
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="page" value="<%=iCurrentPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>"> 
  <input type="hidden" name="FormID" value="<%=iFormID%>">   
  
  <input type="hidden" name="datefield" value="<%=datefield%>">
  <input type="hidden" name="txtSearchName" value="<%=sSearchName%>">  
  <input type="hidden" name="txtSearchDepart" value="<%=sSearchDepart%>">
  <input type="hidden" name="txtSearchBegin" value="<%=sSearchBegin%>">
  <input type="hidden" name="txtSearchEnd" value="<%=sSearchEnd%>">     
  <input type="hidden" name="searchCond" value="<%=sSearchCond%>">
  <%=sSelectButton%>
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  function ExcelImportWin(vModule, vForm) {
		var url ="../../share/page/excel_import_win.jsp?module=" + vModule + "&formName=" + vForm;
		//window.showModalDialog(url,window,"status=no;dialogWidth=580px;dialogHeight=350px");
		window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=620,height=350");    
  }
 
</script>  
<script language="javascript">
  //弹出窗口，选择人员。这里特定是流程里某个步骤的选择人员。
  function OpenPigonholeWin(vFormID, vInfoID) {
     hideOperatorWin("div");  
    var type = "all";
    var url = "../../flow/pigonhole/type_select.jsp?moduleId=23&FormID=" + vFormID + "&InfoID=" + vInfoID;
    //window.showModalDialog(url,window,"status=no;dialogWidth=750px;dialogHeight=450px");
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=750,height=450");    
  }  
  function OpenPressWin(vFormID, vInfoID, vType) {
    hideOperatorWin("div");
    var type = "all";
    var url = "../../flow/press/win.jsp?FormID=" + vFormID + "&InfoID=" + vInfoID + "&type=" + vType;
    //window.showModalDialog(url,window,"status=no;dialogWidth=650px;dialogHeight=300px");
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=650,height=300");    
  }   
  
  function SetPopedom() {
     hideOperatorWin("div");
    var vChkNumber = NumberOfCheck(formList.chkId);
    var vChkValue  = ValueOfCheck(formList.chkId);
    var url = "popedom/update.jsp?FormID=<%=iFormID%>&ChkNumber=" + vChkNumber + "&ChkValue=" + vChkValue;
    //window.showModalDialog(url,window,"status=no;dialogWidth=700px;dialogHeight=550px");
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=700,height=550");    	
  }
  
  function SetPopedom2(vKeyValue) {
       hideOperatorWin("div");
    CheckCheckBox(formList.chkId, ";" + vKeyValue);
    var vChkNumber = "1";
    var vChkValue  = vKeyValue;
    var url = "popedom/update.jsp?FormID=<%=iFormID%>&ChkNumber=" + vChkNumber + "&ChkValue=" + vChkValue;
    //window.showModalDialog(url,window,"status=no;dialogWidth=700px;dialogHeight=550px");	
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=700,height=550");    
  }  
  
  function ListPopedom() {
    hideOperatorWin("div");
    var vChkNumber = NumberOfCheck(formList.chkId);
    var vChkValue  = ValueOfCheck(formList.chkId);
    var url = "popedom/index.jsp?type=-1&FormID=<%=iFormID%>&ChkNumber=" + vChkNumber + "&ChkValue=" + vChkValue;
    //window.showModalDialog(url,window,"status=no;dialogWidth=700px;dialogHeight=550px");	
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=700,height=550");    
  }  
  
  function ListPopedom2(vKeyValue) {
    hideOperatorWin("div");
    CheckCheckBox(formList.chkId, ";" + vKeyValue);
    var vChkNumber = "1";
    var vChkValue  = vKeyValue;
    var url = "popedom/index.jsp?type=-1&FormID=<%=iFormID%>&ChkNumber=" + vChkNumber + "&ChkValue=" + vChkValue;
    //window.showModalDialog(url,window,"status=no;dialogWidth=700px;dialogHeight=550px");	
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=700,height=550");    
  }   
  
  function SetTransfer() {
     hideOperatorWin("div");     
    var vChkNumber = NumberOfCheck(formList.chkId);
    if (vChkNumber == 0) {
    	alert("请至少选择一条数据");
    	return;
    }
    var vChkValue  = ValueOfCheck(formList.chkId);
    var url = "popedom/transfer.jsp?FormID=<%=iFormID%>&ChkNumber=" + vChkNumber + "&ChkValue=" + vChkValue;
    //window.showModalDialog(url,window,"status=no;dialogWidth=700px;dialogHeight=550px");	
  	window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=700,height=550");    
  }
     
  function PrintWinWord(vKey) {
    hideOperatorWin("div");  
    var vUrl = "printTemp.jsp?FormID=<%=iFormID%>&KEY=" + vKey + "&type=0&printTemp=<%=printTemp%>";
  	window.open(vUrl,"","left=20,top=20,width=600,height=600,resizable=yes");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;dialogHeight=550px");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;");
  }
  
  function FlowDetailWin(vFlowID, vKey) {
  	hideOperatorWin("div");
    var vUrl = "../../flow/flow/draft.jsp?type=" + vFlowID + "&FormID=<%=iFormID%>&InfoID=" + vKey + "&OPERATOR=detailWin"; 
  	window.open(vUrl,"","left=20,top=20,width=720,height=550");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=720px;dialogHeight=550px");
  }  
  function OfficeDetailWin(vKey) {
    hideOperatorWin("div");
    var vUrl = "documentEdit.jsp?WebOffice=<%=sWeboffice%>&FormID=<%=iFormID%>&KEY=" + vKey; 
  	window.open(vUrl,"","left=20,top=20,width=850,height=800");
  	//window.showModalDialog(vUrl,window,"status=no;dialogWidth=850px;dialogHeight=800px");
  } 
  function LogWin() {
    var vUrl = "../../share/other/logList.jsp?LogType=FORM&ModuleID=<%=iFormID%>";
  	window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=700");  
  } 
  function feedbackWin(vKey) {
    var vUrl = "feedback.jsp?FormID=<%=iFormID%>&KEY=" + vKey; 
  	window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=700");  
  	hideOperatorWin('div');
  }           
</script>
<%
    ////如果要使用日历控件，必须输出这个calendarFrame
    out.println(SzPageHelp.calendar2Frame2());
%>
