common.menu.js 11.9 KB
/**
 * 通用菜单函数
 */
(function($){
    /**
     * 声明主窗口 ID
     */
    var id_MainTabs = '#main_tabs';
    var id_MainIframe = '#main_iframe';
    $.h.menu = {
        /**
         * 首页
         * SysMain
         */
        onMenuSysMain : function(e) {

            var objMainTabs = $(id_MainTabs);
            if (objMainTabs.tabs("existsById", 'SysMain')) {
                objMainTabs.tabs('selectById', 'SysMain');
            } else {
                objMainTabs.tabs('update', {
                    tab: objMainTabs.tabs('getTab',0),
                    options: {
                        id: 'SysMain',
                        title: '首页'
                    }
                });
                $(id_MainIframe).attr('src','/manage/index/main');
                objMainTabs.tabs('selectById', 'SysMain');
            }
        },
        /**
         * 用户冲账
         * UserStrikeList
         */
        onMenuUserStrikeList : function(e) {
            var objMainTabs = $(id_MainTabs);
            if (objMainTabs.tabs("existsById", 'UserStrikeList')) {
                objMainTabs.tabs('selectById', 'UserStrikeList');
            } else {
                objMainTabs.tabs('update', {
                    tab: objMainTabs.tabs('getTab',0),
                    options: {
                        id: 'UserStrikeList',
                        title: '用户冲账'
                    }
                });
                $(id_MainIframe).attr('src','/manage/user/user_strike_main');
                objMainTabs.tabs('selectById', 'UserStrikeList');
            }
        },
        /**
         * 用户分润
         * UserRewardList
         */
        onMenuUserRewardList : function(e) {
            var objMainTabs = $(id_MainTabs);
            if (objMainTabs.tabs("existsById", 'UserRewardList')) {
                objMainTabs.tabs('selectById', 'UserRewardList');
            } else {
                objMainTabs.tabs('update', {
                    tab: objMainTabs.tabs('getTab',0),
                    options: {
                        id: 'UserRewardList',
                        title: '用户分润'
                    }
                });
                $(id_MainIframe).attr('src','/manage/user/user_reward_main');
                objMainTabs.tabs('selectById', 'UserRewardList');
            }
        },
        /**
         * 用户流水
         * UserFlowList
         */
        onMenuUserFlowList : function(e) {
            var objMainTabs = $(id_MainTabs);
            if (objMainTabs.tabs("existsById", 'UserFlowList')) {
                objMainTabs.tabs('selectById', 'UserFlowList');
            } else {
                objMainTabs.tabs('update', {
                    tab: objMainTabs.tabs('getTab',0),
                    options: {
                        id: 'UserFlowList',
                        title: '用户流水'
                    }
                });
                $(id_MainIframe).attr('src','/manage/user/user_flow_main');
                objMainTabs.tabs('selectById', 'UserFlowList');
            }
        },
        /**
         * 团队结构
         * UserTeamTree
         */
        onMenuUserTeamTree : function(e) {
            var objMainTabs = $(id_MainTabs);
            if (objMainTabs.tabs("existsById", 'UserTeamTree')) {
                objMainTabs.tabs('selectById', 'UserTeamTree');
            } else {
                objMainTabs.tabs('update', {
                    tab: objMainTabs.tabs('getTab',0),
                    options: {
                        id: 'UserTeamTree',
                        title: '团队结构'
                    }
                });
                $(id_MainIframe).attr('src','/manage/user/user_team_tree_main');
                objMainTabs.tabs('selectById', 'UserTeamTree');
            }
        },
        /**
         * 审核管理*
         * AuthManage
         */
        onMenuAuthManage : function(e) {
            var objMainTabs = $(id_MainTabs);
            if (objMainTabs.tabs("existsById", 'AuthManage')) {
                objMainTabs.tabs('selectById', 'AuthManage');
            } else {
                objMainTabs.tabs('update', {
                    tab: objMainTabs.tabs('getTab',0),
                    options: {
                        id: 'AuthManage',
                        title: '审核管理'
                    }
                });
                $(id_MainIframe).attr('src','/manage/auth/auth_manage_main');
                objMainTabs.tabs('selectById', 'AuthManage');
            }
        },
        /**
         * 组织机构管理
         * @param e
         */
        onMenuOrgManage:function(e){
            var objMainTabs = $(id_MainTabs);
            if (objMainTabs.tabs("existsById", 'OrgManage')) {
                objMainTabs.tabs('selectById', 'OrgManage');
            } else {
                objMainTabs.tabs('update', {
                    tab: objMainTabs.tabs('getTab',0),
                    options: {
                        id: 'OrgManage',
                        title: '组织机构'
                    }
                });
                $(id_MainIframe).attr('src','/web/organization/org_manage_main');
                objMainTabs.tabs('selectById', 'OrgManage');
            }
        },

        /**
         * 转盘抽奖管理
         * @param e
         */
        onMenuTurnPrizeManage:function(e){
            console.log("onMenuTurnPrizeManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentTurnPrizeManage',
                    title: '奖品列表'
                }
            });
            $(id_MainIframe).attr('src','/web/Turn_prize/index');
            objMainTabs.tabs('selectById', 'AgentTurnPrizeManage');

        },
        onMenuTurnPrizeUserManage:function(e){
            console.log("onMenuTurnPrizeUserManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentTurnPrizeManage',
                    title: '用户管理'
                }
            });
            $(id_MainIframe).attr('src','/web/Turn_prize/user');
            objMainTabs.tabs('selectById', 'AgentTurnPrizeManage');

        },
        onMenuTurnPrizeRuleManage:function(e){
            console.log("onMenuTurnPrizeRuleManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentTurnPrizeManage',
                    title: '规则管理'
                }
            });
            $(id_MainIframe).attr('src','/web/Turn_prize/rule');
            objMainTabs.tabs('selectById', 'AgentTurnPrizeManage');
        },




        /**
         * 抽奖管理
         * @param e
         */
        onMenuPrizeManage:function(e){
            console.log("onMenuPrizeManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentCarManage',
                    title: '抽奖管理'
                }
            });
            $(id_MainIframe).attr('src','/web/prize/index');
            objMainTabs.tabs('selectById', 'AgentCarManage');

        },
        onMenuPrizeUserManage:function(e){
            console.log("onMenuPrizeUserManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentCarManage',
                    title: '用户管理'
                }
            });
            $(id_MainIframe).attr('src','/web/prize/user');
            objMainTabs.tabs('selectById', 'AgentCarManage');

        },
        onMenuPrizeRuleManage:function(e){
            console.log("onMenuPrizeUserManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentCarManage',
                    title: '规则管理'
                }
            });
            $(id_MainIframe).attr('src','/web/prize/rule');
            objMainTabs.tabs('selectById', 'AgentCarManage');
        },


        /**
         * 产品管理
         * @param e
         */
        onMenuProductManage:function(e){
            console.log("onMenuProductManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentProductManage',
                    title: '产品管理'
                }
            });
            $(id_MainIframe).attr('src','/web/Product/index');
            objMainTabs.tabs('selectById', 'AgentCarManage');

        },
        /**
         * 妇记通获客
         * @param e
         */
        onMenuFuJiTongManage:function(e){
            console.log("onMenuFuJiTongManage")
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentFuJiTongManage',
                    title: '客户管理'
                }
            });
            $(id_MainIframe).attr('src','/web/Fu_ji_tong/index');
            objMainTabs.tabs('selectById', 'AgentCarManage');

        },




        /**
         * 人事管理 角色列表
         * @param e
         */
        onMenuRoleManage:function(e){
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentRoleManage',
                    title: '管理员列表'
                }
            });
            $(id_MainIframe).attr('src','/web/Role/index');
            objMainTabs.tabs('selectById', 'AgentCarManage');

        },
        /**
         * 人事管理 机构管理
         * @param e
         */
        onMenuMechanismManage:function(e){
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentSecondaryManage',
                    title: '机构管理'
                }
            });
            $(id_MainIframe).attr('src','/web/Role/mechanism');
            objMainTabs.tabs('selectById', 'AgentCarManage');
        },
        /**
         * 人事管理 二级菜单
         * @param e
         */
        onMenuDepartmentManage:function(e){
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentSecondaryManage',
                    title: '部门管理'
                }
            });
            $(id_MainIframe).attr('src','/web/Fu_ji_tong/index');
            objMainTabs.tabs('selectById', 'AgentCarManage');
        },
        /**
         * 人事管理 二级菜单
         * @param e
         */
        onMenuPersonnelManage:function(e){
            var objMainTabs = $(id_MainTabs);

            objMainTabs.tabs('update', {
                tab: objMainTabs.tabs('getTab',0),
                options: {
                    id: 'AgentSecondaryManage',
                    title: '人员列表'
                }
            });
            $(id_MainIframe).attr('src','/web/Fu_ji_tong/index');
            objMainTabs.tabs('selectById', 'AgentCarManage');
        },


    }
})(jQuery);
//表单验证 手机号
$.extend($.fn.validatebox.defaults.rules, {
    phone: {
        validator: function(value, param){
            return /^1[3456789]\d{9}$/.test(value);
        },
        message: '请填写正确手机号'
    }
});