<%@ page contentType="text/html;charset=gbk" %>
<%@ 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.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.flow.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%
  String strLevel = "../../";
%>
<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>
<%
    //获取提交的参数
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String sTable_type = "SZKC_CPFL";
    
    
    String sType2 = SzConvert.toZeroStr(request.getParameter("type2"));
    String sPKEY2 = SzConvert.toZeroStr(request.getParameter("PKEY2"));
    String sPFORM2 = SzConvert.toZeroStr(request.getParameter("PFORM2"));    
%>
<%
    SzData szData = null;
    SzDataInfo szDataInfo = null;

    String sOPERATOR = request.getParameter("OPERATOR");
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));
    String sReadonly = "";
    boolean bReadonly = false;
    if (sOPERATOR.equals("detail")) {
        sReadonly = "readonly";
        bReadonly = true;
    }
    //读取数据
    LcFlowInfo lcFlowInfo = null;
    LcFlow lcFlow = new LcFlow();
    if (!sKEY.equals("0")) {
        lcFlowInfo = (LcFlowInfo)lcFlow.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (lcFlowInfo == null) {
        lcFlowInfo = new LcFlowInfo();
        lcFlowInfo.setLCDLXM(szLoginInfo_SESSION.getDLXM());
        lcFlowInfo.setLCDLID(szLoginInfo_SESSION.getDLID());
        lcFlowInfo.setLCBMID(iBMID_SESSION);
        lcFlowInfo.setLCSJ(SzDateHelp.getTimeStr());
    } else {
    }

%>

<body>
<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="detailCount" value="0">

  <input type="hidden" name="type2" value="<%=sType2%>">
  <input type="hidden" name="PKEY2" value="<%=sPKEY2%>">  
  <input type="hidden" name="PFORM2" value="<%=sPFORM2%>">   
<%@ include file="/flow/title.jsp"%>
<table width="100%">
  <tr>
    <td>
    <% if (!bReadonly) { %>
      <%=SzPageHelp.saveButton()%>
    <% } %>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<TABLE id=SZFORMtable1 style="CURSOR: hand" cellSpacing=0 borderColorDark=#ffffff cellPadding=3 width=650 borderColorLight=#c0c0c0 border=1>
<DIV id=divSZFORMtable1 style="BACKGROUND: #c0c0c0; CURSOR: hand; HEIGHT: 20px">
<INPUT id=XX1 size=10 name=XX1><INPUT id=XX15 size=10 name=XX15><INPUT id=XX16 size=10 name=XX16><INPUT id=XX17 size=10 name=XX17><INPUT id=XX18 size=10 name=XX18></DIV>
<TBODY>
<TR id=SZFORMtr1>
<TD class=trMouseOut id=SZFORMtd1 style="CURSOR: hand">流程分类</TD>
<TD class=trMouseOut id=SZFORMtd2 style="CURSOR: hand" colSpan=3><%=SzPageHelp.idSelectTree2("SZLC_FL","FLID","FLMC","FLBH", "FLGSID=" + szCOMPANY_SESSION, "XX2",  lcFlowInfo.getLCFL(), "txtClass2")%></TD></TR>
<TR id=SZFORMtr7>
<TD id=SZFORMtd25 style="CURSOR: hand">流程名称</TD>
<TD class=trMouseOut id=SZFORMtd26 style="CURSOR: hand" colSpan=3>
  <INPUT class=txtClass2 id=XX3 size=10 name=XX3>

</TD>
</TR>
<TR id=SZFORMtr4>
<TD class=trMouseOut id=SZFORMtd27 style="CURSOR: hand">本流程所属的表单</TD>
<TD class=trMouseOut id=SZFORMtd28 style="CURSOR: hand" colSpan=3><INPUT type='hidden' id=XX10 name=XX10><INPUT class=txtClass300 id=XX10_NAME readOnly size=10 name=XX10_NAME><input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:OpenFormIdSingleWin('SZLC_SPBD', 'formUpdate.XX10','formUpdate.XX10_NAME');">
  &nbsp;表单的默认流程<input type="checkbox" name="LCMR" value="1" <% if (lcFlowInfo.getLCMR() == 1) { %>checked<%} %> >
</TD>
</TR>
<TR id=SZFORMtr2>
<TD class=trMouseOut id=SZFORMtd5 style="CURSOR: hand">流程类型</TD>
<TD class=trMouseOut id=SZFORMtd6 style="CURSOR: hand" colSpan=3>
<input type="hidden" id=XX9 name=XX9 value="<%=lcFlowInfo.getLCLX()%>">
<INPUT id=XX9_temp type=radio CHECKED value=0 name=XX9_temp disabled>模板
<INPUT id=XX9_temp type=radio value=1 name=XX9_temp disabled>从模板发起的流程
<INPUT id=XX9_temp type=radio value=2 name=XX9_temp disabled>临时发起的流程
</TD></TR>
<TR id=SZFORMtr3>
<TD class=trMouseOut id=SZFORMtd9 style="CURSOR: hand">流程说明</TD>
<TD class=trMouseOut id=SZFORMtd10 style="CURSOR: hand" colSpan=3><INPUT class=txtClass2 id=XX4 size=10 name=XX4></TD></TR>
<TR id=SZFORMtr4>
<TD class=trMouseOut id=SZFORMtd13 style="CURSOR: hand" width="120">限制可使用的人<br>

</TD>

<TD class=trMouseOut id=SZFORMtd14 style="CURSOR: hand" colspan="3" align="left">
  部门<br>
	<TEXTAREA class=areaClass2 id=XX11 name=XX11 readOnly></TEXTAREA>
    <% if (!bReadonly) {%>
      <input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:DepartUserWin2('formUpdate.XX18','formUpdate.XX12', 'formUpdate.XX17','formUpdate.XX11');"><br>
    <% } %>	
	人员<br>
	<TEXTAREA class=areaClass2 id=XX12 name=XX12 readOnly></TEXTAREA></TD></TR>
 
<TR id=SZFORMtr9>
<TD class=trMouseOut id=SZFORMtd33 style="CURSOR: hand">录入人员</TD>
<TD class=trMouseOut id=SZFORMtd34 style="CURSOR: hand"><INPUT class=txtClass1 id=XX13 readOnly size=10 name=XX13></TD>
<TD class=trMouseOut id=SZFORMtd35 style="CURSOR: hand">录入时间</TD>
<TD class=trMouseOut id=SZFORMtd36 style="CURSOR: hand"><INPUT class=txtClass1 id=XX19 readOnly size=10 value="2008-04-01 09:54" name=XX19></TD></TR></TBODY></TABLE>

</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  //动态的隐藏
  var oDivSZFORMtable1 = document.getElementById("divSZFORMtable1");
  if (oDivSZFORMtable1 != null) {
    oDivSZFORMtable1.style.display="none";
  }
  //动态的加入XX2的值
  var oXX1 = document.getElementById("XX1");
  if (oXX1 != null) {
    oXX1.value = "<%=lcFlowInfo.getLCID()%>";
  }
  var oXX2 = document.getElementById("XX2");
  if (oXX2 != null) {
    oXX2.value = "<%=lcFlowInfo.getLCFL()%>";
  }
  var oXX3 = document.getElementById("XX3");
  if (oXX3 != null) {
    oXX3.value = "<%=lcFlowInfo.getLCMC()%>";
  }
  var oXX4 = document.getElementById("XX4");
  if (oXX4 != null) {
    oXX4.value = "<%=lcFlowInfo.getLCSM()%>";
  }
  var oXX9 = document.getElementById("XX9_temp");
  if (oXX9 != null) {
    CheckRadio(formUpdate.XX9_temp, "<%=lcFlowInfo.getLCLX()%>");  
  }
  var oXX10 = document.getElementById("XX10");
  if (oXX10 != null) {
  var oXX10_NAME = document.getElementById("XX10_NAME");
  <%
    String XX10_NAME = "";
    szData = new SzData("SZLC_SPBD","BDID","BDMC");
    XX10_NAME = szData.getMainByKey(lcFlowInfo.getLCSYBD());
  %>
    oXX10.value = "<%=lcFlowInfo.getLCSYBD()%>";
    oXX10_NAME.value = "<%=XX10_NAME%>";

  }
  var oXX11 = document.getElementById("XX11");
  if (oXX11 != null) {
    oXX11.value = "<%=lcFlowInfo.getLCSYBMMC()%>";
  }
  var oXX12 = document.getElementById("XX12");
  if (oXX12 != null) {
    oXX12.value = "<%=lcFlowInfo.getLCSYDLXM()%>";
  }
  var oXX13 = document.getElementById("XX13");
  if (oXX13 != null) {
    oXX13.value = "<%=lcFlowInfo.getLCDLXM()%>";
  }
  var oXX15 = document.getElementById("XX15");
  if (oXX15 != null) {
    oXX15.value = "<%=lcFlowInfo.getLCDLID()%>";
  }
  var oXX16 = document.getElementById("XX16");
  if (oXX16 != null) {
    oXX16.value = "<%=lcFlowInfo.getLCBMID()%>";
  }
  var oXX17 = document.getElementById("XX17");
  if (oXX17 != null) {
    oXX17.value = "<%=lcFlowInfo.getLCSYBM()%>";
  }
  var oXX18 = document.getElementById("XX18");
  if (oXX18 != null) {
    oXX18.value = "<%=lcFlowInfo.getLCSYDL()%>";
  }
  var oXX19 = document.getElementById("XX19");
  if (oXX19 != null) {
    oXX19.value = "<%=lcFlowInfo.getLCSJ()%>";
  }
  //判断是否有明细，如果有就动态增加
</script>
<script language="javascript">

  function FormSave(formName, url) {
    //检查是否可以保存
    if (!notSpace(formName.XX2, "流程分类")) {
      return false;
    }
    if (!notNum(formName.XX2, "流程分类")) {
      return false;
    }
    if (!notSpace(formName.XX3, "流程名称")) {
      return false;
    }
    /*
    if (formName.LCMR.checked == true 
        && (formName.XX10.value == "" || formName.XX10.value == "0")
        ) {
      alert("指定能使用的表单才能选择为默认的流程");
      return false;
    }
    */
    /*
    if (!notNum(formName.XX10, "能使用的表单")) {
      return false;
    }
    */
    formName.action = url;
    formName.submit();
  }
</script>
</body>
