最新服务器上的版本,以后用这个
wangzhenxin
2023-04-22 ecd03b1a2da91e65fc8bc7f1bc2c4e961c79752d
对订单列表上的【批量导出订单】按钮增加权限控制,完成
2 files modified
23 ■■■■ changed files
forms/mall/order/BaseOrderForm.php 17 ●●●● patch | view | raw | blame | history
views/components/app-order.php 6 ●●●●● patch | view | raw | blame | history
forms/mall/order/BaseOrderForm.php
@@ -109,8 +109,9 @@
        if (!$this->validate()) {
            return $this->getErrorResponse();
        }
        $role = CommonUser::getUserRole();
        if($role[0]['name'] == '提货客服'){
        if(substr($role[0]['name'],0,12) == '提货客服'){
            $this->plugin = 'exchange';
        }
@@ -294,7 +295,16 @@
        }
        array_unshift($menuList, ['sign' => 'all', 'name' => '全部订单']);
        $list = $this->handleExtraData($list);
        // 判断当前用户是还有批量导出订单的权限
        $userIdentity = CommonUser::getUserIdentity();
        if($userIdentity->is_super_admin){
            $is_show_export = true;
        }else{
            $userPermisson = CommonUser::getUserPermissions();
            $is_show_export = in_array('mall/order/export',$userPermisson);
        }
        return [
            'code' => ApiCode::CODE_SUCCESS,
            'data' => [
@@ -305,7 +315,8 @@
                'plugins' => $menuList,
                'hide_function' => \Yii::$app->role->getHideFunction(),
                'send_type_list' => $this->getSendTypeList(),
                'role' => $role
                'role' => $role,
                'is_show_export' => $is_show_export
            ],
        ];
    }
views/components/app-order.php
@@ -1297,7 +1297,7 @@
            // 批量导出
            isShowExport: {
                type: Boolean,
                default: true
                default: false
            },
            // 订单配送方式
            isShowOrderType: {
@@ -1786,6 +1786,7 @@
                }).then(e => {
                    this.loading = false;
                    if (e.data.code === 0) {
                        this.isShowExport = e.data.data.is_show_export;
                        let newList = e.data.data.list;
                        newList.forEach(function (item) {
                            item.isChecked = false;
@@ -1803,7 +1804,8 @@
                        if(e.data.data.hide_function) {
                            this.hide_function = e.data.data.hide_function;
                        }
                        if(e.data.data.role[0].name == '提货客服'){
                        //alert(e.data.data.role[0].name.slice(0,4));
                        if(e.data.data.role[0].name.slice(0,4) == '提货客服'){
                            this.search.plugin = 'exchange';
                            this.isdisabled = true;
                        }else{