<%@ page contentType="text/html; charset=GBK"  errorPage="../error.jsp" %>
<%@ page import = "zr.zrpower.ejb.sys.UnitService" %>
<%@ page import = "zr.zrpower.ejb.sys.UdictService" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.flowengine.service.FlowControl" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_UNIT" %>
<%@ page import = "zr.zrpower.common.util.DateWork" %>

<%@ page import = "zr.zrpower.ejb.sys.UIService"%>
<html>
<head>
<%
  UnitService depMgr = new UnitService();
  UdictService dictMgr = new UdictService();
  SessionUser user = (SessionUser)session.getAttribute("userinfo");
  FlowControl FControl = new FlowControl();
  UIService userUI =new UIService();
  String strUnitid = request.getParameter("nodeId");
  String str_th = request.getParameter("th");
  if (str_th==null){str_th="";}

  BPIP_UNIT uInfo =  depMgr.GetUnit(strUnitid);
  //得到流程待处理人为指定单位时接收人类别
  String DeptInsideType = "1";

  String strDeptInside ="";
  String strDeptInsideName="";
  if (DeptInsideType.equals("1"))//部门内勤
  {
     //得到选择单位下的部门内勤用户编号串
     strDeptInside = FControl.GetDeptInside(strUnitid);
     //得到选择单位下的部门内勤用户名称串
     strDeptInsideName = FControl.GetDeptInsideName(strUnitid);
  }else//部门下的所有人员
  {
     //得到选择单位下的用户编号串
     strDeptInside = FControl.GetDeptUsers(strUnitid);
     //得到选择单位下的用户名称串
     strDeptInsideName = FControl.GetDeptUserNames(strUnitid);
  }

%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></title>
<link REL="stylesheet" type="text/css" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">
<script src="../../zrsysmanage/html5/script/jquery-2.0.3.min.js" type="text/jscript" ></script>
<script src="../../zrsysmanage/html5/layer/layer.js" type="text/jscript" ></script>

<SCRIPT LANGUAGE="javascript">
//确定
function ok(){
   <%if (strDeptInside.length()==0){%>
     <%if (DeptInsideType.equals("1")){%>

        <%if(!user.getUserWINDOWTYPE().equals("6")){ %>
         alert("选择的单位或部门下没有设置部门内勤,请联系管理员!");
        <%}else{%>
         layer.alert("选择的单位或部门下没有设置部门内勤,请联系管理员!", {icon: 7});
        <%}%>

     <%}else{%>

        <%if(!user.getUserWINDOWTYPE().equals("6")){ %>
         alert("选择的单位或部门下没有人员,请联系管理员!");
        <%}else{%>
         layer.alert("选择的单位或部门下没有人员,请联系管理员!", {icon: 7});
        <%}%>

     <%}%>

   <%}else{%>

     <%if(!user.getUserWINDOWTYPE().equals("6")){ %>
       window.returnValue = "<%=strDeptInside%>";
       window.close();
      <%}else{%>

      <%if (str_th.equals("1")){%>
      parent.parent.parent.SelectUpDept_x_f('<%=strDeptInside%>');
      <%}else{%>
      parent.parent.parent.SelectDoDept_x_f('<%=strDeptInside%>');
      <%}%>

      <%}%>
   <%}%>
}
</SCRIPT>
</head>
<BODY class="BodyMain">
<%
  if(uInfo!=null){
%>

    <br>&nbsp;
   <fieldset style="width: 95%">
    <legend>待选择的单位或部门的详细资料</legend>
    <table border="0" class="inputTable" cellspacing="0"  height="240" cellpadding="0" width="98%">
          <tr>
            <td class="PutdSet">单位名称:</td>
            <td><%=uInfo.getUNITNAME()%></td>
          </tr>

          <tr>
            <td class="PutdSet">
            <%if (DeptInsideType.equals("1")){%>
            部门内勤:
            <%}else{%>
            部门人员:
            <%}%>
            </td>
            <td><%=strDeptInsideName%></td>
          </tr>

      </table>
      </fieldset>
        <br>
        <center>
        <table cellspacing="0" cellpadding="0" border='0'><tr>
             <%=userUI.ClickButton1("确定","ok();","buttonSure.gif",user.getUserImage())%>
             <%if(!user.getUserWINDOWTYPE().equals("6")){ %>
             <%=userUI.ClickButton1("关闭","parent.parent.window.close();","buttonClose.gif",user.getUserImage())%>
             <%}else{%>
             <%=userUI.ClickButton1("关闭","parent.parent.parent.layer.closeAll();","buttonClose.gif",user.getUserImage())%>
             <%}%>
         </tr></table>
         </center>
  <%
  }else{
     %>
     <br><div align="center"> 请选择单位或部门...</div>
     <%
  }
%>
</body>
</html>
<%
//清空相关对象
user = null;
userUI = null;
depMgr = null;
dictMgr = null;
FControl = null;
uInfo = null;
%>
