<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.flow.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<base target="_self">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    int iFormID = SzConvert.toInt(request.getParameter("FormID"));
    String ChkValue = SzConvert.toSpaceStr(request.getParameter("ChkValue"));
    String ChkNumber = SzConvert.toZeroStr(request.getParameter("ChkNumber"));
	String sType = "0";
	String sRange = "0";
	String sRangeInfo = "";
	if (!ChkNumber.equals("0")) {
		sRange = "1";
		sRangeInfo = "[已选中数据:" + ChkNumber + "]";
	}
	
    BdPopedom bdPopedom = new BdPopedom();   
%>
<form name="formUpdate" method="post">
<input type="hidden" name="FormID" value="<%=iFormID%>">
<input type="hidden" name="ChkValue" value="<%=ChkValue%>">
<input type="hidden" name="ChkNumber" value="<%=ChkNumber%>">

<table width="100%" align="center">
  <tr>
    <td>
	<%
	out.println(SzPageHelp.button("查看授权","javascript:Detail();"));	
	out.println(SzPageHelp.button("保存","javascript:Save();"));
    out.println(SzPageHelp.closeButton() );     
    %>    
    </td>
  </tr>
</table>
<table width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0" align="center"> 
  <tr>
    <td width="100">授权类型</td>
    <td align="left">
    <%
      	//String s_id[] = {"4","5","0","2","3","1"};
      	//String s_name[] = {"<font color='red'>禁止</font>","<font color='blue'>转移</font>","查看","通知","任务","咨询"};
      	String s_id[] = {"4","0"};
      	String s_name[] = {"<font color='red'>禁止</font>","查看"};

      	out.println(SzPageHelp.radioFunc("type", s_id, s_name, sType, "ClickType()"));
      	
	%>
    </td>
  </tr>
  <tr>
    <td>数据范围</td>
    <td>
    <%
		out.println(bdPopedom.rangeButton(iFormID, isBarManager_SESSION, sRange));
      	out.println(sRangeInfo);
	%>    
    </td>
  </tr>
  <tr id="trField" style="display:none;">
    <td>字段范围
<input type="button" class="btnClassShort" value="选择" OnClick="javascript:SelectFormField('../../../', '<%=iFormID%>', 'formUpdate.SQZDMC');"></TD>    
    </td>
    <td>
	<textarea name="SQZDMC" class="areaClass2" readonly></textarea>
    </td>
  </tr>  
  <tr>
    <td>人员范围
<input type="button" class="btnClassShort" value="选择" OnClick="javascript:OpenWin34('../../../','formUpdate.RYDLID1', 'formUpdate.RYDLXM1', 'formUpdate.RYDLID2', 'formUpdate.RYDLXM2', 'formUpdate.RYDLID3', 'formUpdate.RYDLXM3');"></TD>
    </td>
    <td>
    <input type="hidden" name="RYDLID1" value="" >
    <input type="hidden" name="RYDLID2" value="" >
    <input type="hidden" name="RYDLID3" value="" >
    直接选择人员
    <textarea name="RYDLXM1" class="areaClass2" readonly></textarea><br>
<!--     
    直接选择部门
    <textarea name="RYDLXM2" class="areaClass2" readonly></textarea><br>
    直接选择职务
    <textarea name="RYDLXM3" class="areaClass2" readonly></textarea>
 -->    
    </td>
  </tr>  
</table> 
</form>

<script language="javascript" src="../../../share/js/commonTool.js"></script>
<script language="javascript">
  function Save() {
    //请选择办理人员
    if ( (formUpdate.RYDLID1.value == "" || formUpdate.RYDLID1.value == "0")
      && (formUpdate.RYDLID2.value == "" || formUpdate.RYDLID2.value == "0") 
      && (formUpdate.RYDLID3.value == "" || formUpdate.RYDLID3.value == "0")      
      ) {
      alert("至少选择一个人员！");
      return false;      
    }
    
	if (confirm("确定要保存此授权？")) {
		formUpdate.action = "control.jsp";
		formUpdate.submit();
	}
  }
  
  function SelectFormField(vLevel, vFormID, vObj) {
    var url = vLevel + "share/page/form_field_select.jsp";
    url = url + "?objId=" + vObj + "&FormID=" + vFormID;
    window.showModalDialog(url,window,"status=no;dialogWidth=680px;dialogHeight=450px");
  }
  
  function Detail() {
  	formUpdate.action = "index.jsp";
  	formUpdate.submit();
  }
  
  function ClickType() {
  	var v = ValueOfRadio(formUpdate.type);
  	if (v == 4) {
  	  trField.style.display = "";
  	} else {
  	  trField.style.display = "none";
  	}
  }
</script>

