<%@ page contentType="text/html;charset=gbk" %>
<%@ 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=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //获取提交的参数
    //type就是流程ID
    //PKEY就是流程前一步骤ID
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    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 = "";
    //读取流程的名称
    LcFlow lcFlow = new LcFlow();
    //获取流程的属性
    LcFlowInfo lcFlowInfo = (LcFlowInfo)lcFlow.getInfoByKey(Integer.parseInt(sType));    
    String str_name = lcFlowInfo.getLCMC();
    //读取数据
    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 (!sType.equals("0")) {
        sCond += " and BZLC=" + sType;
    }
    sCond += " order by BZXH ASC";
    Iterator iter = lcStep.getArrayList(sCond).iterator();

    int i = 0;
    SzData szData = null;
    
    LcCond lcCond = new LcCond();
    LcCondInfo lcCondInfo = null;
    
%>
<!-----上面的工具栏------>
<%@ include file="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%>">
  <tr>
    <td>
      &nbsp;
    </td>
  </tr>
  </form>
</table>

<!-----信息列表----->
<form name="formList" method="post">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">

<table id="tableFlow" align="center" width="650" border="0" cellpadding="0" cellspacing="0">
<tr>
  <td><b>流程名称：</b>
  	<a href="../flow/update.jsp?OPERATOR=update&type=0&KEY=<%=sType%>"><%=str_name%></a>
  </td>
</tr>
<tr id="trFlow">
<td>
  <table align="center" width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle">
    <td align="center" width="30">步骤</td>
    <td align="center" width="80">办理名称</td>
    <td align="center" width="120">办理期限/跳转时间</td>
    <td align="center">办理说明</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>
  </tr>
  </table>
</td>
</tr>

<!--------------------------------------------------------------->
<%
    sPKEY = 0;
	  int iStepID_PRIO = 0;
    LcPerson lcPerson = new LcPerson();
    boolean flag = false;
    while (iter != null && iter.hasNext()) {
        lcStepInfo = (LcStepInfo)iter.next();
        i++;
%>
<% if (i>1) { %>
<tr id="trFlow">
<td align="center">
<image src="<%=strSkin_SESSION%>/flowArrow.gif">
</td>
</tr>
<% } %>
<tr id="trFlow">
<td>
  <table align="center" width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">

  <tr class="trClassTitle3">
    <td colspan="20" class="tdClassLine2" align="center">
    <%if (isBarManager_SESSION) { %>
    <% if (lcFlowInfo.getLCLX().equals("0") && lcStepInfo.getBZXH() == 1) { %>
      <a href="javascript:FormSubmit(formList,'control.jsp?OPERATOR=updateDraft&type=<%=sType%>&KEY=<%=lcStepInfo.getBZID()%>');">保存拟稿步骤属性</a>
    <% } else { %>
      <a href="javascript:FormSubmit(formPage,'update.jsp?OPERATOR=add&type=<%=sType%>&PKEY=<%=sPKEY%>');">增加步骤</a>
      <a href="javascript:FormSubmit(formPage,'update.jsp?OPERATOR=update&type=<%=sType%>&KEY=<%=lcStepInfo.getBZID()%>');">修改步骤</a>
      <a href="javascript:FormSubmitConfirm(formPage,'control.jsp?OPERATOR=delete&type=<%=sType%>&KEY=<%=lcStepInfo.getBZID()%>','确定要删除步骤？');">删除步骤</a>
      <% if (lcFlowInfo.getLCSYBD() >0) { %>
      <a href="javascript:FormSubmit(formPage,'popedom_update.jsp?FormID=<%=lcFlowInfo.getLCSYBD()%>&FlowID=<%=sType%>&StepID=<%=lcStepInfo.getBZID()%>');">设置字段权限</a>
      <% } %>
      <% if (!flag && 1!=1) { %>
      <a href="javascript:FormSubmit(formPage,'cond_update.jsp?OPERATOR=add&FormID=<%=lcFlowInfo.getLCSYBD()%>&FlowID=<%=sType%>&StepID=<%=iStepID_PRIO%>');">增加判断条件</a>
      <% } %>
    <% } %>
    <% } %>
    </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 title="办理说明"><%=lcStepInfo.getBZBLSM()%>&nbsp;</td>

    <% if (lcFlowInfo.getLCLX().equals("0") && lcStepInfo.getBZXH() == 1) { %>
    <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.checkbox("BZQXLC", 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.checkbox("BZQXTQ", lcStepInfo.getBZQXTQ())%>
    </td>    
    <% } else { %>        
    <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>
    <% } %>
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td colspan="20">
      <!-----显示人员-------->
      <%=lcPerson.getPersonInfo(lcStepInfo.getBZID()) %>&nbsp;
      <br><%=lcStep.getLimitInfo(lcStepInfo.getBZYSTJ(), lcStepInfo.getBZYSBMMC()) %>
    </td>
  </tr>
  </table>
</td>
</tr>
<!-- ---------------------判断是否有条件 -->
<%
	lcCondInfo = (LcCondInfo)lcCond.getInfoByKey(lcStepInfo.getBZQY());
	flag = false;
    if (lcCondInfo != null) {
    	flag = true; 
%>
<tr id="trFlow">
<td align="center">
<image src="<%=strSkin_SESSION%>/flowArrow.gif">
</td>
</tr>

  
<tr id="trFlow">
<td>
  <table align="center" width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle2" >
    <TD colspan="2">
      <a href="javascript:FormSubmit(formPage,'cond_update.jsp?OPERATOR=add&FormID=<%=lcFlowInfo.getLCSYBD()%>&FlowID=<%=sType%>&TJID=<%=lcCondInfo.getTJID()%>');">修改判断条件</a>
      <a href="javascript:FormSubmit(formPage,'cond_control.jsp?OPERATOR=deleteCond&FormID=<%=lcFlowInfo.getLCSYBD()%>&FlowID=<%=sType%>&TJID=<%=lcCondInfo.getTJID()%>');">删除判断条件</a>
    </TD>
  </tr>
  <tr><td width="20%">条件名称</td><td><%=lcCondInfo.getTJMC() %></td></tr>
  </table>
</td>
</tr>
<%    	
    }
%>
<!--------------------------------------------------------------->
<%
        sPKEY = lcStepInfo.getBZXH(); //上一步骤的顺序
		iStepID_PRIO =  lcStepInfo.getBZID(); //上一步骤的ID
    }
%>
<tr id="trFlow">
<td>
  <table align="center" width="650" 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:FormSubmit(formPage,'update.jsp?OPERATOR=add&type=<%=sType%>&PKEY=<%=sPKEY%>');">增加步骤</a>
    </td>
  </tr>
  </table>
</td>
</tr>

</table>
</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%>">
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
