<%@ 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.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.docEngine.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%@ include file="/docEngine/docEngineSession.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";
%>
<%
    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;
    }
    //读取数据
    WdyqTypeInfo wdyqTypeInfo = null;
    WdyqType wdyqType = new WdyqType(moduleId);
    if (!sKEY.equals("0")) {
        wdyqTypeInfo = (WdyqTypeInfo)wdyqType.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (wdyqTypeInfo == null) {
        wdyqTypeInfo = new WdyqTypeInfo();
        wdyqTypeInfo.setFLDLID(szLoginInfo_SESSION.getDLID());
        wdyqTypeInfo.setFLDLXM(szLoginInfo_SESSION.getDLXM());
        wdyqTypeInfo.setFLBMID(iBMID_SESSION);
        wdyqTypeInfo.setFLBMMC(sBMMC_SESSION);
    } 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="FLID" value="<%=wdyqTypeInfo.getFLID()%>">
  <input type="hidden" name="FLDLID" value="<%=wdyqTypeInfo.getFLDLID()%>">
  <input type="hidden" name="type" value="<%=sType%>">
<%@ include file="/docEngine/title.jsp"%>
<table width="100%">
  <tr>
    <td>
    <% if (!bReadonly) { %>
      <%=SzPageHelp.saveButton()%>
    <% } %>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">分类名称</td>
    <td colspan="3"><input type="text" name="FLMC" class="txtClass1" value="<%=wdyqTypeInfo.getFLMC()%>" <%=sReadonly%> ></td>
  </tr>
  <tr>
    <td class="tdClassTitle">上级分类</td>
    <td colspan="3">
    <input type="hidden" name="FLBH" value="<%=wdyqTypeInfo.getFLBH()%>" >
      <select name="FLBH_SJ" class="txtClass2">
        <option value="">===请选择===</option>
<%
    String FLBH_SJ = SzLevelNumber.getParentNumber(wdyqTypeInfo.getFLBH());
    String sCond = "FLGSID=" + szCOMPANY_SESSION;
	if (docEngineInfo.getModulePopedom().equals("0")) {
		sCond += " AND FLDLID=" + szDLID_SESSION + " order by FLBH ASC";
	} else {
		sCond += " AND 1=1 order by FLBH ASC";
	}
    Iterator iter = wdyqType.getArrayList(sCond).iterator();
    WdyqTypeInfo info = null;
    while (iter != null && iter.hasNext()) {
        info = (WdyqTypeInfo)iter.next();
%>
        <option value="<%=info.getFLBH()%>" <% if (info.getFLBH().equals(FLBH_SJ)) {%>selected<%}%> >
          <%=SzLevelNumber.getLevelSpace(info.getFLBH())%><%=info.getFLMC()%>
        </option>
<%
    }
%>
      </select>
    </td>
  </tr>

  <tr>
    <td class="tdClassTitle">分类备注</td>
    <td colspan="3">
      <textarea name="FLBZ" class="areaClass2" <%=sReadonly%> ><%=wdyqTypeInfo.getFLBZ()%></textarea>
    </td>
  </tr>
    <input type="hidden" name="FLCKBM" class="txtClass1" value="<%=wdyqTypeInfo.getFLCKBM()%>" readonly>
    <input type="hidden" name="FLCKDL" class="txtClass1" value="<%=wdyqTypeInfo.getFLCKDL()%>" readonly>
    <input type="hidden" name="FLTJDL" class="txtClass1" value="<%=wdyqTypeInfo.getFLTJDL()%>" readonly>
    <input type="hidden" name="FLGLDL" class="txtClass1" value="<%=wdyqTypeInfo.getFLGLDL()%>" readonly>
    <input type="hidden" name="FLKTJDL" class="txtClass1" value="<%=wdyqTypeInfo.getFLKTJDL()%>" readonly>
  <% if (docEngineInfo.getModulePopedom().equals("1") && docEngineInfo.getTypeDepartManager().equals("1")) {%>
  <tr>
    <td class="tdClassTitle">可管理的人员
    <% if (!bReadonly) {%>
      <input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:OpenWin14('formUpdate.FLGLDL','formUpdate.FLGLDLXM');">
    <% } %>
    </td>
    <td colspan="3">
      <textarea name="FLGLDLXM" class="areaClass2" readonly><%=wdyqTypeInfo.getFLGLDLXM()%></textarea>
    </td>
  </tr>
  <% } %>
  <% if (docEngineInfo.getTypeHasDepartLimit().equals("1")) {%>
  <tr>
    <td class="tdClassTitle">可查看的部门
    <% if (!bReadonly) {%>
      <input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:OpenWin24('formUpdate.FLCKBM','formUpdate.FLCKBMMC');">
    <% } %>
    </td>
    <td colspan="3">
      <textarea name="FLCKBMMC" class="areaClass2" readonly><%=wdyqTypeInfo.getFLCKBMMC()%></textarea>
    </td>
  </tr>
  <% } %>  
  <% if (docEngineInfo.getTypeHasUserLimit().equals("1")) {%>
  <tr>
    <td class="tdClassTitle">可查看的人员
    <% if (!bReadonly) {%>
      <input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:OpenWin14('formUpdate.FLCKDL','formUpdate.FLCKDLXM');">
    <% } %>
    </td>
    <td colspan="3">
      <textarea name="FLCKDLXM" class="areaClass2" readonly><%=wdyqTypeInfo.getFLCKDLXM()%></textarea>
    </td>
  </tr>
  <% } %>  
  <% if (docEngineInfo.getTypeHasUserAdd().equals("1")) {%>
  <tr>
    <td class="tdClassTitle">可添加的人员
    <% if (!bReadonly) {%>
      <input type="button" name="btnSelect" class="btnClassShort" value="选择" OnClick="javascript:OpenWin14('formUpdate.FLKTJDL','formUpdate.FLKTJDLXM');">
    <% } %>
    </td>
    <td colspan="3">
      <textarea name="FLKTJDLXM" class="areaClass2" readonly><%=wdyqTypeInfo.getFLKTJDLXM()%></textarea>
    </td>
  </tr>  
  <% } %>  
  <tr>
    <td class="tdClassTitle">添加人员姓名</td>
    <td><input type="text" name="FLDLXM" class="txtClass1" value="<%=wdyqTypeInfo.getFLDLXM()%>" readonly>
    </td>

    <td class="tdClassTitle">添加部门名称</td>
    <td><input type="text" name="FLBMMC" class="txtClass1" value="<%=wdyqTypeInfo.getFLBMMC()%>" readonly>
    </td>
  </tr>
</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">

  function FormSave(formName, url) {
    //检查是否可以保存
    if (!notSpace(formName.FLMC, "分类名称")) {
      return false;
    }

    formName.action = url;
    formName.submit();
  }
</script>
</body>
