<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Collection" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ 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.weboffice.*" %>
<%@ page import="net.sz600.flow.*" %>
<%@ include file="/sessionInfo.jsp"%>
<html>
<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 language="javascript">
	//办理的时候重新选择人员
  function OpenSelectUserWin(iFormID, iInfoID, iFlowID, iStepID) {
    var type = "all";
    var url = "../step/select_user_win.jsp";
    var RYBLYJ = encodeURIComponent(formList.RYBLYJ.value);
    var BZRYID = ValueOfCheck(formList.BZRYID);
    //alert(BZRYID);
 
    //url = url + "?objId=formList.RYDLID1&objName=formList.RYDLXM1";
    url = url + "?FormID=" + iFormID;
    url = url + "&InfoID=" + iInfoID;
    url = url + "&FlowID=" + iFlowID;
    url = url + "&StepID=" + iStepID;
    url = url + "&BZRYID=" + BZRYID;
    url = url + "&RYBLYJ=" + RYBLYJ;
    url = url + "&OPERATOR=selectUser";

    //window.showModalDialog(url,window,"status=no;dialogWidth=800px;dialogHeight=450px");
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=450");
  }
  
  //由管理员处理异常，选择人员后，将该步骤设置为：办理中。之前的步骤设置未已办。
  function OpenSelectUserWin2(iFormID, iInfoID, iFlowID, iStepID) {
    var type = "all";
    var url = "../step/select_user_win.jsp";
 
    //url = url + "?objId=formList.RYDLID1&objName=formList.RYDLXM1";
    url = url + "?FormID=" + iFormID;
    url = url + "&InfoID=" + iInfoID;
    url = url + "&FlowID=" + iFlowID;
    url = url + "&StepID=" + iStepID;
    url = url + "&OPERATOR=selectUser2";

    //window.showModalDialog(url,window,"status=no;dialogWidth=800px;dialogHeight=450px");
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=800,height=450");
  }  
</script>
</head>
<body onLoad="javascript:ReSize();">
<%

    LcFlowControl lcFlowControl = new LcFlowControl();
    //获取提交的参数
    //type就是流程ID
    //PKEY就是流程前一步骤ID
    //detail, add, update, transact
    String sOPERATOR = SzConvert.toZeroStr(request.getParameter("OPERATOR"));    
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    //System.out.println("operator==" + sOPERATOR);
    
    int iFormID = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("FormID")));
    int iInfoID = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("InfoID")));
    
    String sType2 = SzConvert.toZeroStr(request.getParameter("type2"));
    String sPKEY2 = SzConvert.toZeroStr(request.getParameter("PKEY2"));
    String sPFORM2 = SzConvert.toZeroStr(request.getParameter("PFORM2"));
    
    String sLCID = SzConvert.toZeroStr(request.getParameter("LCID"));
   
    String sLCMC = SzConvert.strWriteData(request.getParameter("LCMC"));
    if (sOPERATOR.equals("add") && sLCID.equals("0")) {
    	//取出默认流程。根据表单取出当前表单的默认流程
    	LcFlowInfo lcFlowInfo = lcFlowControl.getDefaultFlow(iFormID, iDLID_SESSION, iBMID_SESSION);
    	if (lcFlowInfo != null) {
    		sLCID = Integer.toString(lcFlowInfo.getLCID());
    		sLCMC = lcFlowInfo.getLCMC();
    	}
    }      
    if (sLCID.equals("-1")) {
    	sLCID = "0";
    }
    int sPKEY = 0;
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sSearchName = SzConvert.strWriteData(request.getParameter("txtSearchName"));

    String sTable_type = "";
    //读取数据
    LcStep lcStep = new LcStep();
    LcStepInfo lcStepInfo = null;
    String sCond = "1=1";
    boolean canAdd_SESSION = false;
    boolean canPrint_SESSION = false;
    boolean canDelete_SESSION = false;
    boolean canUpdate_SESSION = false;
    //管理资料，只有管理员和有权限的人才能添加。有权限的人员可以查看、修改、删除
    if (isBarManager_SESSION) {
        canAdd_SESSION = true;
        canPrint_SESSION = true;
        canDelete_SESSION = true;
        canUpdate_SESSION = true;
    }
    if (!sLCID.equals("0")) {
    	sType = sLCID;
    }
    
    if (!sType.equals("0")) {
        sCond += " and BZLC=" + sType;
    } else {
    	sCond += " and 1<>1";
    }
    //sCond += " order by BZXH ASC";
    String strCond = "";
    Iterator iter = null;
    
    iter = lcStep.getArrayList(sCond).iterator();
	
    int i = 0;
    SzData szData = null;
    
    //////流程相关
    //根据流程获取当前办理节点

    //取得流程权限信息
    LcFlowPopedomInfo lcFlowPopedomInfo = lcFlowControl.getFlowPopedomInfo(iFormID, iInfoID);    
    
    int iFlowID = lcFlowPopedomInfo.getFlowID();
    int iCurrentStep = lcFlowPopedomInfo.getStepID();
    int iCurrentOrder = lcFlowControl.getCurrentOrder(iCurrentStep);
    boolean hasSend = lcFlowPopedomInfo.isHasSend();
    boolean hasFinish = lcFlowPopedomInfo.isHasFinish();
    boolean isSelect = lcFlowPopedomInfo.isSelect();
    boolean isDraft = true;    

    if (!sOPERATOR.equals("add") && !sOPERATOR.equals("update")) {
    	isDraft = false;
    }  
    int iNextStep = 0;
    //未保存流程或者重新选择流程的时候不能修改

    boolean canModifyFlow = lcFlowPopedomInfo.isCanModifyFlow(iFlowID, Integer.parseInt(sType));
    String firstSign = "";
    String strOpinion_temp = lcFlowControl.getOpinion(iFormID, iCurrentStep, iDLID_SESSION);
    if (strOpinion_temp.equals("")) {
			//strOpinion_temp = "同意";
    	strOpinion_temp = ReadOaConfig.getDefault_opinion();
    }

    //System.out.println("iFlowID==" + iFlowID);
    //System.out.println("sType=="   + sType);    
    //System.out.println("canModifyFlow=="   + canModifyFlow);     
    //System.out.println("==hasSend==" + hasSend);
    //System.out.println("==iCurrentStep==" + iCurrentStep);
 
    //System.out.println("iCurrentStep==" + iCurrentStep);
    //System.out.println("iCurrentOrder==" + iCurrentOrder);
    int iBZXH = 0;
    int iBZID = 0;
    int iBZXH_Parent = 0;
    //2014-06增加
    LcCondFinish lcCondFinish = new LcCondFinish();
    String sCondFinish = "";

%>
<!-----上面的工具栏------>
<form name="formList" method="post">
<table width="100%">
  <tr>
    <td>
    	<%
    	if (sOPERATOR.equals("detailWin")) {
    		out.println( SzPageHelp.closeButton() );
    	}
      %>         
    </td>
  </tr>
</table>
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="LCID" value="<%=sLCID%>">
  
  
<% if (sOPERATOR.equals("transact")) { %>
<table width="100%">
  <tr>
    <td colspan="2">
办理意见
<%
  if (ReadOaConfig.getSelect_opinion().equals("1")) {
	  String str_opinion_temp[] = {"已阅","同意"};
	  out.println(SzPageHelp.selectFunc("意见", "opition_temp", "opition_temp", str_opinion_temp,
			str_opinion_temp, "", "txtClass100", "SelectOptionTemp()"));
	  out.println("<script language='javascript'>");
	  out.println("function SelectOptionTemp() {");
	  out.println(" var opition_temp = document.getElementById('opition_temp').value;");
	  out.println(" document.getElementById('RYBLYJ').value= opition_temp;");
	  out.println("}");
	  out.println("</script>");
  }
	if (ReadOaConfig.getSelect_sign().equals("1")) {
		out.print("或");
    OfficeHelp officeHelp = new OfficeHelp();
    out.println(officeHelp.selectSignature(iDLID_SESSION, 140, "selectSignature"));
    firstSign = officeHelp.getFirstSign();
	} else {
		out.print("<input type='hidden' name='selectSignature' id='selectSignature' value=''>");
	}

%>
    </td>
  </tr>
  <tr>
    <td width="50%">
<textarea name="RYBLYJ" id="RYBLYJ" class="areaClass2" style="width:320"><%=strOpinion_temp%></textarea>
    </td>
    <td width="50%" align="left" valign="top">
<img id="imgSignature" style="display:none" height="100"> 
    </td>
  </tr>
</table>
<% } else { %>
<input type="hidden" name="RYBLYJ">
<input type="hidden" name="selectSignature">
<% } %>  
<!-- 拟稿状态，不管添加还是修改都可以选择流程 -->  
<% if (isDraft) { %>  
<table width="100%">
  <tr>
    <td>
      <%//=SzPageHelp.idSelectTreeSubmit("SZLC_FL","FLID","FLMC","","LCFL",Integer.parseInt(LCFL), "txtClass1")%>      
      请选择流程：<input type="text" class="txtClass2" readonly name="LCMC" value="<%=sLCMC%>">
      <input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:OpenFlowSingleWinSubmit('<%=iFormID %>', 'SZLC_LCMB', 'formList.LCID','formList.LCMC', 'formList');">                   
    </td>
  </tr>
</table>
<% } %>  

<!-------------- 选择下一步骤办理人员------------->
<% 
  if (!hasFinish) { 

	  //未办理的
    //2011-09-16增加判断,减少表头的影响
    strCond = sCond + " AND BZZT IN (0) order by BZXH ASC"; 
    Collection coll = lcStep.getArrayList(strCond);
    iter = null;
    if (coll != null) {
	  iter = coll.iterator();
    }
    iNextStep = 0;  

    //if (iter != null && iter.hasNext()) {
    //2015-03修改：增加循环，如果是自己的话，要找下一步骤	
    boolean default_selected = false;
    if (ReadOaConfig.getDefault_selected().equals("1")) {
    	default_selected = true;
    } 
    while (iter != null && iter.hasNext()) {
      lcStepInfo = (LcStepInfo)iter.next();

      if (iNextStep == 0) {
        	iNextStep = lcStepInfo.getBZID();
      }      
      //判断是否有下一步骤
	    if (!sOPERATOR.startsWith("detail") && !lcFlowControl.stepCanTransact(iNextStep, iDLID_SESSION, isDraft)) {
        iNextStep = 0;
      	//2015-03修改：增加循环，如果是自己的话，要找下一步骤
        continue;        
	    } else if (!sOPERATOR.startsWith("detail") && iNextStep == lcStepInfo.getBZID()) {
	      iBZXH = lcStepInfo.getBZXH();
	      iBZID = lcStepInfo.getBZID();
	      //下一个办理步骤
	      out.println("<table id='tableFlow' width='748' border='0' cellpadding='0' cellspacing='0'>");
	      out.println("<tr id='trFlow'><td>");
	      out.println("<table width='748' border='1' bordercolorlight='#C0C0C0' bordercolordark='#FFFFFF' class='tableClass' cellpadding='1' cellspacing='0'>");
	      out.println("<tr class='trClassTitleYellow'><td  width='30' align='center'></td><td >");
	      out.println("下一步骤:");
	      out.println(lcStepInfo.getBZXH());
	      //out.print("、");
	      out.println(lcStepInfo.getBZMC());
    	  out.println(lcStepInfo.getBZBLSM());
    	  if (lcStepInfo.getBZSX() == 1) {
    		  out.print("<span><b>");
    		  out.print("(会签)");
    		  out.print("</b></span>");
    	  }
	      //out.println(" 请选择办理人员");
	      out.println("<input type='hidden' name='RYDLID1'>");
	      //out.println("<input type='hidden' name='RYDLXM1'>");
	      if (!sOPERATOR.equals("add") && isSelect) {
	      	out.println("<input type='button' name=selectUser id=selectUser class='btnClass100' value='重新选择人' OnClick=\"javascript:OpenSelectUserWin('" + iFormID + "','" + iInfoID + "','" + lcStepInfo.getBZLC() + "','" + iBZID + "');\">");
	      }
	      out.println("</td></tr>");
	      //out.println("<tr><td></td><td>");
	      //out.println(lcFlowControl.getPersonInfo(lcStepInfo.getBZID()));	
	      //out.println("&nbsp;</td></tr>");

    	  out.println("<tr class='trClassTitleYellow'><td width='30' align='center'><input type=\"checkbox\" name=\"ChkBZRYID\" title=\"全选或全部反选\" OnClick=\"javascript:CheckAll(formList, ChkBZRYID, 'BZRYID');\"></td><td>");
 	  		//2015-10-22增加参数defaultCheck,默认为false表示不选中。
	      out.println(lcFlowControl.printTransactPersonInfo(lcStepInfo.getBZID(), iDLID_SESSION, isDraft, lcStepInfo.getBZYSTJ(), lcStepInfo.getBZYSBM(), default_selected));

      	out.println("&nbsp;</td></tr>");
	      out.println("</table>");
	     	out.println("</td></tr>");
		    out.println("</table>");	  
	    } 

      iBZXH_Parent = lcStepInfo.getBZXH(); //上一步骤的顺序
    	//2015-03修改：增加循环，如果是自己的话，要找下一步骤
      break;

    } //if (iter != null && iter.hasNext()) {
  } //if (!hasFinish) {      
%>

<!-- 显示已经办理完成的人员姓名、办理时间、状态、办理意见 -->
<table id="tableFlow" align="center" width="748" border="0" cellpadding="0" cellspacing="0">
<!-- 只要选择了流程，就可以看到已办的或者待办的 -->
<%
    sPKEY = 0;
    i = 0;
    strCond = sCond + " AND ( BZXH=1 OR BZZT IN (1,2,5,4) ) order by BZXH ASC";
    iter = lcStep.getArrayList(strCond).iterator();
    while (iter != null && iter.hasNext()) {
        lcStepInfo = (LcStepInfo)iter.next();
        i++; 
       //2014-06
       sCondFinish = lcCondFinish.getMainByCond("TJLCID=" + lcStepInfo.getBZLC() + " AND TJBZID=" + lcStepInfo.getBZID());
        if (i==1) {
%>
<tr id="trFlow">
<td>
  <table align="center" width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle_c">
    <td align="center" width="30">序号</td>
    <td align="center" width="80">步骤/人员</td>    
    <td align="center" width="120">接收时间/办理时间</td>
    <td align="center" width="80">状态</td>
    <td align="center">办理意见</td>    
  </tr>
  </table>
</td>
</tr>
<%        	
        }
%>    
<tr id="trFlow">
<td>
  <table align="center" width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle2" style="cursor:hand;">
    <a href="javascript:ModifyStepWin('detail','<%=sType%>','<%=lcStepInfo.getBZID()%>');">
    <td width="30"><%=lcStepInfo.getBZXH()%></td>
    <td width="80" title="办理名称"><b><%=lcStepInfo.getBZMC()%></b>&nbsp;</td>       
    <td width="120" title="接收时间"><%=lcStepInfo.getBZKSSJ()%>&nbsp;</td>
    <td width="80" title="步骤状态"><%=lcFlowControl.getStepStateName(lcStepInfo.getBZZT())%>&nbsp;</td>    
    <td title="办理说明"><%=lcStepInfo.getBZBLSM()%>&nbsp;
      <%
        if (!sCondFinish.equals("")) {
          out.println("<br><font color='red'>自动办结条件:</font>" + sCondFinish);
	 }
      %>
    </td>
    </a> 
  </tr>
  <%=lcFlowControl.getTransactedPersonInfo(lcStepInfo.getBZID()) %>
  </table>
</td>
</tr>
<!--------------------------------------------------------------->
<%
        sPKEY = lcStepInfo.getBZXH(); //上一步骤的顺序

    }
%>

</table>

<!-------------- 显示已经办理完成的人员姓名、办理时间、状态、办理意见结束 ------------->
<!-----流程分类、流程列表的选择，以及显示流程的剩余办理步骤----->

<% if (!hasFinish) { %>

<table id="tableFlow" align="center" width="748" border="0" cellpadding="0" cellspacing="0">
<tr id="trFlow">
<td>
  <table align="center" width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <%
	//未办理的
	//2011-09-16增加判断,减少表头的影响
  strCond = sCond + " AND BZZT IN (0) order by BZXH ASC"; 
  Collection coll = lcStep.getArrayList(strCond);
  iter = null;
  if (coll != null) {
	  iter = coll.iterator();
  }
  iNextStep = 0;  
  if (coll.size() >0 || (canModifyFlow && !sOPERATOR.startsWith("detail"))) {
  %>
  <tr class="trClassTitle_c">
    <td align="center" width="30">序号</td>
    <td align="center" width="80">办理名称</td>
    <td align="center" width="120">办理期限/跳转时间</td>
    <td align="center" width="30" title="是否会签">会签</td>
    <td align="center" width="30" title="是否可以修改表单">表单</td>
    <td align="center" width="30" title="是否可以修改流程">流程</td>
    <td align="center" width="30" title="是否可以退回">退回</td>
    <td align="center" width="30" title="是否可以办结">办结</td>
    <td align="center" width="30" title="是否可以否决">否决</td>
    <td align="center" width="30" title="是否可以跳签">跳签</td>
    <td align="center">办理说明</td>    
  </tr>
  <% } %>
  <% if (1!=1) { %>
  <tr>
    <td width="30">0</td>
    <td width="80">拟稿</td>
    <td width="120">&nbsp;</td>
    <td align="center" width="30" title="是否会签">&nbsp;</td>
    <td align="center" width="30" title="是否可以修改表单">&nbsp;</td>
    <td align="center" width="30" title="是否可以修改流程">&nbsp;</td>
    <td align="center" width="30" title="是否可以退回">&nbsp;</td>
    <td align="center" width="30" title="是否可以办结">&nbsp;</td>
    <td align="center" width="30" title="是否可以否决">&nbsp;</td>
    <td align="center" width="30" title="是否可以跳签">&nbsp;</td>
    <td>&nbsp;</td>    
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td colspan="20">
      <table border="0" width="100%">
        <!-- 拟稿人节点 -->
        <tr>
          <td width="25%"><input type="checkbox" checked disabled>起草人</td>
          <td width="25%">&nbsp;</td>
          <td width="25%">&nbsp;</td>
          <td width="25%">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
  <% } %>
  </table>
</td>
</tr>

<!---------------显示未办理的------------------------------------------------>
<%
		boolean bFirst = true;
    while (iter != null && iter.hasNext()) {
      lcStepInfo = (LcStepInfo)iter.next();

      if (iNextStep == 0) {
        	iNextStep = lcStepInfo.getBZID();
      }
      //判断是否有下一步骤
		  if (!sOPERATOR.startsWith("detail") && !lcFlowControl.stepCanTransact(iNextStep, iDLID_SESSION, isDraft)) {
        iNextStep = 0;
	      continue;
	    }
      i++;  

      //2014-06
      sCondFinish = lcCondFinish.getMainByCond("TJLCID=" + lcStepInfo.getBZLC() + " AND TJBZID=" + lcStepInfo.getBZID());
      
%>
<tr id="trFlow">
<td>
  <table align="center" width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle3">
    <td colspan="20" class="tdClassLine2" align="center">
  <a href="javascript:ModifyStepWin('detail','<%=sType%>','<%=lcStepInfo.getBZID()%>');">
  查看步骤
  </a>     
  
  <% 
  if (hasSend && isBarManager_SESSION && sOPERATOR.equals("detail") && bFirst) {
	  out.println("<input type='button' name=selectUser id=selectUser class='btnClass100' value='重新选择人' OnClick=\"javascript:OpenSelectUserWin2('" + iFormID + "','" + iInfoID + "','" + lcStepInfo.getBZLC() + "','" + lcStepInfo.getBZID() + "');\">");
  }
  bFirst = false;
  %>
  <% if ( (hasSend && i == 1) || sOPERATOR.equals("detail") ) { %> 
  <% } else {%>    
      <% if (iCurrentOrder < lcStepInfo.getBZXH() && canModifyFlow && !sOPERATOR.equals("detailWin") ) { %>
      <a href="javascript:ModifyStepWin('add','<%=sType%>', '<%=sPKEY%>');">增加步骤</a>
      <a href="javascript:ModifyStepWin('update','<%=sType%>','<%=lcStepInfo.getBZID()%>');">修改步骤</a>
      <a href="javascript:ModifyStepWin('delete','<%=sType%>','<%=lcStepInfo.getBZID()%>');">删除步骤</a>
      <% } %>
  <% } %>&nbsp;  
    </td>
  </tr>

  <tr>
    <td width="30"><%=lcStepInfo.getBZXH()%></td>
    <td width="80" title="办理名称"><%=lcStepInfo.getBZMC()%>&nbsp;</td>
    <td width="120" title="期限/跳转时间">
      <%
      	if (lcStepInfo.getBZBLQX().equals("0") || lcStepInfo.getBZBLQX().equals("")) {
      		out.println("无 / ");
      	} else {
      		out.println(lcStepInfo.getBZBLQX() + "小时 / ");
      	}
      
      	if (lcStepInfo.getBZTXRY().equals("0") || lcStepInfo.getBZTXRY().equals("")) {
      		out.println("无");
      	} else {
      		out.println(lcStepInfo.getBZTXRY() + "小时");
      	}      
      %>&nbsp;    
    </td>
    <td align="center" width="30" title="是否会签"><%=SzPageHelp.checkboxDisabled(lcStepInfo.getBZSX())%></td>
    <td align="center" width="30" title="是否可以修改表单"><%=SzPageHelp.checkboxDisabled(lcStepInfo.getBZQXBD())%></td>
    <td align="center" width="30" title="是否可以修改流程"><%=SzPageHelp.checkboxDisabled(lcStepInfo.getBZQXLC())%></td>
    <td align="center" width="30" title="是否可以退回"><%=SzPageHelp.checkboxDisabled(lcStepInfo.getBZQXTH())%></td>
    <td align="center" width="30" title="是否可以办结"><%=SzPageHelp.checkboxDisabled(lcStepInfo.getBZQXBJ())%></td>
    <td align="center" width="30" title="是否可以否决"><%=SzPageHelp.checkboxDisabled(lcStepInfo.getBZQXFJ())%></td>
    <td align="center" width="30" title="是否可以跳签"><%=SzPageHelp.checkboxDisabled(lcStepInfo.getBZQXTQ())%></td>
    <td title="办理说明"><%=lcStepInfo.getBZBLSM()%>&nbsp;
      <%
        if (!sCondFinish.equals("")) {
          out.println("<br><font color='red'>自动办结条件:</font>" + sCondFinish);
	 }
      %>
    </td>  
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td colspan="20">
      <!-----显示人员设置的人员，包括部门、职务等其他-------->
      <%=lcFlowControl.getPersonInfo(lcStepInfo.getBZID()) %>&nbsp;

    </td>
  </tr>
  </table>
</td>
</tr>

<!--------------------------------------------------------------->
<%
        sPKEY = lcStepInfo.getBZXH(); //上一步骤的顺序
    }
%>

<tr id="trFlow">
<td>
  <table align="center" width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle3">
    <td colspan="20" class="tdClassLine2" align="center">
    <% if ( (hasSend && i == 1) || sOPERATOR.startsWith("detail")) { %>
      &nbsp;
    <% } else if (canModifyFlow) { %> 
      <a href="javascript:ModifyStepWin('add','<%=sType%>', '<%=sPKEY%>');">增加步骤</a>
    <% } %>      
    </td>
  </tr>
  </table>
</td>
</tr>

</table>
<% } %>
<table id="tableFlow" align="center" width="748" border="0" cellpadding="0" cellspacing="0">
<tr id="trFlow">
<td>
  <table align="center" width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle3">
    <td colspan="20" class="tdClassLine2" align="left">
		&nbsp;<b>流程总状态: </b> <%=lcFlowControl.getFlowStateName(iFormID, iInfoID) %>
    </td>
  </tr>
  </table>
</td>
</tr>
</table>
      <input type="hidden" name="BZXH" value="<%=iBZXH%>">
      <input type="hidden" name="BZID" value="<%=iBZID%>">      
</form>
<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="firstSign" value="<%=firstSign%>">
</form>
</body>
</html>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  function ModifyStepWin(vOPERATOR, vType, vKey) {
    var vUrl = "../../flow/step/update.jsp";
    var vPKEY = "0";
    if (vOPERATOR == "delete") {     
      vUrl = "../../flow/step/control.jsp";
    } else if (vOPERATOR == "add") {
      vPKEY = vKey;
      vKey = "0";     
      vUrl = "../../flow/step/update.jsp";
    } else if (vOPERATOR == "update") {    
      vUrl = "../../flow/step/update.jsp";    
    }
    var vUrl = vUrl
            + "?OPERATOR=" + vOPERATOR + "&type=" + vType 
            + "&KEY=" + vKey + "&PKEY=" + vPKEY + "&win=win" + "&type2=<%=sType2%>&PKEY2=<%=sPKEY2%>&PFORM2=<%=sPFORM2%>"
    //window.showModalDialog(vUrl,window,"status=no;dialogWidth=680px;dialogHeight=780px");
    //window.open(vUrl,"","");
     window.open(vUrl,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=680,height=780");
  }
  
  function OpenFlowSingleWinSubmit(vFormID, vTableName, objId, objName, vFormName) {
    var type= "";
    var url = "../../flow/flow/id_single_win.jsp";
    url = url + "?objId=" + objId + "&objName=" + objName 
        + "&tableName=" + vTableName + "&formName=" + vFormName
        + "&FormID=" + vFormID;
    //window.showModalDialog(url,window,"status=no;dialogWidth=620px;dialogHeight=420px");
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=600,height=400");
  }  
  
  function ReSize() {
    //自动调节窗口的大小
  	//var vHeight = document.body.scrollHeight + 130;
    var vHeight = document.body.scrollHeight + 30;
  	//alert(document.body.scrollHeight);
  	window.resizeTo(748, vHeight);

  }
  	//var vHeight = document.body.scrollHeight + 30;
  	//window.resizeTo(650, vHeight);
  	
  function LoadSignature() {
	//选择印章
	var vId = formList.selectSignature.value;
	displaySignature(vId);
  }

  function displaySignature(vId) {
	if (formList.imgSignature == null) {
		return false;
	}
	if (vId == "" || vId == "0") {
		formList.imgSignature.style.display="none";
	} else {
	    	formList.imgSignature.src= "../../share/weboffice/signature/selectSignature.jsp?id=" + vId;
		formList.imgSignature.style.display="";
		formList.selectSignature.value = vId;
	}
  }
  

  var firstSign = formHidden.firstSign.value;
  displaySignature(firstSign);

</script>

