<%@ 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="/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">
</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="660" border="0" cellpadding="0" cellspacing="0">
<tr id="trFlow">
<td>
  <table align="center" width="660" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle">
    <td align="center" width="40">序号</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>
  </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="660" 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>

  <tr>
    <td width="40"><%=lcStepInfo.getBZXH()%>
      <input type="radio" name="BZID" value="<%=lcStepInfo.getBZID()%>" >
    </td>
    <td width="80" title="办理名称"><%=lcStepInfo.getBZMC()%>&nbsp;</td>
    <td width="120" title="办理期限"><%=lcStepInfo.getBZBLQX()%>&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;</td>  
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td colspan="20">
      <!-----显示人员-------->
      <%=lcFlowControl.getPersonInfo(lcStepInfo.getBZID()) %>&nbsp;
    </td>
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td colspan="20">
      <!-----显示人员-------->
      <%//=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="660" 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 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;    
    //oWindow.formUpdate.RYBLYJ_FLOW.value = oWindow.flowDraft.formList.RYBLYJ.value;
    //oWindow.formUpdate.RYBLTP_FLOW.value = oWindow.flowDraft.formList.selectSignature.value;

    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.formUpdate.action = url;
      //oWindow.formUpdate.submit();
      oWindow.transactSubmit();
      window.close();      
    }     

  }
</script>

