<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ 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.flow.*" %>
<%@ include file="/sessionInfoWeixin.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no" />
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //办理的时候，弹出本窗口，可以选择已经办理的、或者后一步开始的步骤
    
    String sOPERATOR = SzConvert.toZeroStr(request.getParameter("OPERATOR"));
    int iFlowID = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("FlowID")));

    //读取数据
    LcStep lcStep = new LcStep();
    LcStepInfo lcStepInfo = null;
    String sCond = "1=1 and BZLC=" + iFlowID;

    String strCond = "";
    Iterator iter = null;
	
    int i = 0;
    SzData szData = null;
    LcFlowControl lcFlowControl = new LcFlowControl();
    boolean isDraft = false;
    int sPKEY = 0;
    //已办的或者待办的
    if (sOPERATOR.equals("transactUntread")) {
    	strCond = sCond + " AND ( BZZT IN (2) ) order by BZXH ASC";
    } else if (sOPERATOR.equals("transactSkip")) {
    	strCond = sCond + " AND BZZT IN (0) order by BZXH ASC"; 
    }
        
%>
<!-----上面的工具栏------>
<form name="formList" method="post">
  <input type="hidden" name="FlowID" value="<%=iFlowID%>"> 
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
<table width="100%">
  <tr>
    <td>
      <input type="button" name="btnAdd" class="btnClass" value="确定" OnClick="javascript:FormSave(formList);">
      <%=SzPageHelp.closeButton()%>    
    </td>
  </tr>
</table>

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

<table id="tableFlow" align="center" width="100%" 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="trClassTitle2">
    <td colspan="20" class="tdClassLine2" align="center">&nbsp;      
    </td>
  </tr>
  </table>
</td>
</tr>
<!--------------------------------------------------------------->
<%    
    iter = lcStep.getArrayList(strCond).iterator();
    while (iter != null && iter.hasNext()) {
        lcStepInfo = (LcStepInfo)iter.next();
        i++;        
%>
<tr id="trFlow">
<td>
  <table align="center" width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr>
    <td>
      <%=lcStepInfo.getBZXH()%>
      <input type="radio" name="BZID" value="<%=lcStepInfo.getBZID()%>" >
      <b><%=lcStepInfo.getBZMC()%>&nbsp;</b>
      <%=lcStepInfo.getBZBLQX()%>&nbsp;
      <%=lcStepInfo.getBZBLSM()%>&nbsp;
    </td>  
  </tr>
  <tr>
    <td>
      <!-----显示人员-------->
      <%=lcFlowControl.getPersonInfo(lcStepInfo.getBZID()) %>&nbsp;
    </td>
  </tr>
  <tr>
    <td>
      <!-----显示人员-------->
      <%//=lcFlowControl.printTransactPersonInfo2(lcStepInfo.getBZID(), iDLID_SESSION, isDraft) %>&nbsp;
      <%=lcFlowControl.printTransactPersonInfo2(lcStepInfo.getBZID(), iDLID_SESSION, isDraft, lcStepInfo.getBZYSTJ(), lcStepInfo.getBZYSBM()) %>&nbsp;
      &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="trClassTitle2">
    <td colspan="20" class="tdClassLine2" align="center">&nbsp;      
    </td>
  </tr>
  </table>
</td>
</tr>

</table>
</form>
<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
  <input type="hidden" name="FlowID" value="<%=iFlowID%>"> 
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">  
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="FlowID" value="<%=iFlowID%>"> 
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">  
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  function FormSave(formName) {
 
    //检查选择一个步骤
    if (ValueOfRadio(formName.BZID) == "") {
      alert("请选择一个步骤");
      return false;
    }

    //父窗口：选择的步骤，设置operator,并且提交
    //var oWindow = window.dialogArguments;
    //var oWindow = window.opener;
    var oWindow = window.parent;

    var vOPERATOR = formList.OPERATOR.value;     
    //保存前把流程ID、流程步骤ID、表单ID、信息ID等写到信息里面
    //流程相关
    var vBZID = ValueOfRadio(formList.BZID)
    
    oWindow.formUpdate.LCID_FLOW.value = formList.FlowID.value;
    oWindow.formUpdate.BZID_FLOW.value = vBZID;    
    oWindow.formUpdate.BZRYID_FLOW.value = eval("ValueOfCheck(formList.BZRYID" + vBZID + ")");;
    oWindow.formUpdate.OPERATOR.value = vOPERATOR;    

    if (   oWindow.formUpdate.BZRYID_FLOW.value == "0" 
        || oWindow.formUpdate.BZRYID_FLOW.value == "" ) {
      alert("请至少选择一个办理人员！");
      return false;
    }   

    var vMessage = "";
    if (vOPERATOR == "transactUntread") {
      vMessage = "确定要退签？";    
    } else if (vOPERATOR == "transactSkip") {
      vMessage = "确定要跳签？";    
    }
 
    if (confirm(vMessage)) {

      oWindow.transactSubmit();
      window.close();      
    }     

  }
</script>

