<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>选择菜单</title> <link href="style_cn.css" rel="stylesheet" type="text/css"> <script src="../js/jquery-1.4.2.js" type="text/javascript"></script> <style type="text/css"> <!-- fieldset div { float:left; width:24%; text-align:left; line-height:25px; } td div { float:left; width:24%; text-align:left; line-height:25px; } --> </style> <script language="javascript"> //全部选中 function SelectAllBox() { $("input[name=menuModule]").attr("checked","checked"); } //全部不选中 function UnSelectAllBox() { $("input[name=menuModule]").attr("checked",null); } function goSelect(id) { //获取到的值以","分割 var menuModule = $("#" + id).val(); var array = menuModule.split(","); //如果操作的是子[客户拜访 联系人列表 联系记录列表 客户查重设置] if(array[0] != array[1]) { //如果子[客户拜访 联系人列表 联系记录列表 客户查重设置]中有一个处于选中状态,则父[客户管理]处于选中状态 if($("#" + id)[0].checked) { //组织父id var superid = array[0] + "_" + array[0]; $("#" + superid).attr("checked","checked"); } else { //false:表示子[客户拜访 联系人列表 联系记录列表 客户查重设置]没有被选中的 //true:表示子[客户拜访 联系人列表 联系记录列表 客户查重设置]至少有一个选中 var flag = false; //如果子[客户拜访 联系人列表 联系记录列表 客户查重设置]中取消选中状态 var $sub = $("input[name=menuModule][value^=" + array[0] + "]:not([value$=" + array[0] + "])"); //遍历所有的子[客户拜访 联系人列表 联系记录列表 客户查重设置] $sub.each(function(index, domEle) { if(domEle.checked) { flag = true; } }); //如果子[客户拜访 联系人列表 联系记录列表 客户查重设置]都没选中,则客户管理处于不选中状态 if(!flag) { //组织父id var superid = array[0] + "_" + array[0]; $("#" + superid).attr("checked",null); } //如果子[客户拜访 联系人列表 联系记录列表 客户查重设置]至少有一个选中,则客户管理选中 if(flag) { //不用处理 } } } //如果操作的是父[客户管理] if(array[0] == array[1]) { //如果父[客户管理]处于选中状态,则子[客户拜访 联系人列表 联系记录列表 客户查重设置]处于选中状态 if($("#" + id)[0].checked) { $("input[name=menuModule][value^=" + array[0] + "]:not([value$=" + array[0] + "])").attr("checked","checked"); } else { //如果父[客户管理]处于未选中状态,则子[客户拜访 联系人列表 联系记录列表 客户查重设置]处于不选中状态 $("input[name=menuModule][value^=" + array[0] + "]:not([value$=" + array[0] + "])").attr("checked",null); } } } </script> </head> <body> <form name="ActionForm" method="post" action="/webcrm0527/sys/sysRoleAction_set.do"> <input type="hidden" name="method" value="updateMenu"> <input type="hidden" name="roleId" value="402881e42ab919a5012ab91a0b110001"> <br/> <div class="control"> <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';" onClick="SelectAllBox()"> <img src="./button/quanbuxz.png" border='0' align='absmiddle'> 全部选中</button> <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';" onClick="UnSelectAllBox()"> <img src="./button/quanbubxz.png" border='0' align='absmiddle'> 全部不选中</button> <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';" onClick="document.ActionForm.submit();"> <img src="./button/baocun.png" border='0' align='absmiddle'> 保存</button> <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';" onClick="parent.close();"> <img src="./button/guanbi.png" border='0' align='absmiddle'> 关闭</button> </div> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#6A82A8"> <tr> <td align="center" height="25"><span style="color:#FFFFFF; font-weight:bold">操作权限组:人力资源部权限组</span></td> </tr> </table> <div class="border" style="padding:3px"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <fieldset style='padding:5px;clear:left;'> <legend><input type='checkbox' class='checkbox' name='menuModule' value='company,company' id='company_company' onClick='goSelect(this.id)' title="客户管理" >客户管理 </legend> <div id="dd"><input type='checkbox' class='checkbox' name='menuModule' value='company,base' id='company_base' onClick='goSelect(this.id)' title='客户拜访'>客户拜访</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='company,linkMan' id='company_linkMan' onClick='goSelect(this.id)' title='联系人列表' >联系人列表</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='company,linkTouch' id='company_linkTouch' onClick='goSelect(this.id)' title='联系记录列表' >联系记录列表</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='company,rule' id='company_rule' onClick='goSelect(this.id)' title='客户查重设置 ' >客户查重设置 </div> </fieldset> <fieldset style='padding:5px;clear:left;'> <legend><input type='checkbox' class='checkbox' name='menuModule' value='sys,sys' id='sys_sys' onClick='goSelect(this.id)' title="系统设置 " >系统设置 </legend> <div><input type='checkbox' class='checkbox' name='menuModule' value='sys,group' id='sys_group' onClick='goSelect(this.id)' title='部门设置' >部门设置</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='sys,user' id='sys_user' onClick='goSelect(this.id)' title='人事管理' >人事管理</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='sys,role' id='sys_role' onClick='goSelect(this.id)' title='操作权限组' >操作权限组</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='sys,province' id='sys_province' onClick='goSelect(this.id)' title='省份资料' >省份资料</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='sys,city' id='sys_city' onClick='goSelect(this.id)' title='城市资料' >城市资料</div> <div><input type='checkbox' class='checkbox' name='menuModule' value='sys,code' id='sys_code' onClick='goSelect(this.id)' title='编码规则' >编码规则</div> </fieldset> <fieldset style='padding:5px;clear:left;'> <legend><input type='checkbox' class='checkbox' name='menuModule' value='report,report' id='report_report' onClick='goSelect(this.id)' title="报表与分析" >报表与分析 </legend> <div><input type='checkbox' class='checkbox' name='menuModule' value='report,khflfx' id='report_khflfx' onClick='goSelect(this.id)' title='客户分类分析 ' >客户分类分析 </div> <div><input type='checkbox' class='checkbox' name='menuModule' value='report,khfx' id='report_khfx' onClick='goSelect(this.id)' title='客户分析 ' >客户分析 </div> </fieldset> </td> </tr> </table> </div> </form> </body> </html>
CRM项目中使用jquery权限控制(界面)
猜你喜欢
转载自cookieandsession.iteye.com/blog/1899604
今日推荐
周排行