对订单列表上的【批量导出订单】按钮增加权限控制,完成
| | |
| | | if (!$this->validate()) { |
| | | return $this->getErrorResponse(); |
| | | } |
| | | |
| | | $role = CommonUser::getUserRole(); |
| | | if($role[0]['name'] == '提货客服'){ |
| | | if(substr($role[0]['name'],0,12) == '提货客服'){ |
| | | $this->plugin = 'exchange'; |
| | | } |
| | | |
| | |
| | | } |
| | | 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' => [ |
| | |
| | | 'plugins' => $menuList, |
| | | 'hide_function' => \Yii::$app->role->getHideFunction(), |
| | | 'send_type_list' => $this->getSendTypeList(), |
| | | 'role' => $role |
| | | 'role' => $role, |
| | | 'is_show_export' => $is_show_export |
| | | ], |
| | | ]; |
| | | } |
| | |
| | | // 批量导出 |
| | | isShowExport: { |
| | | type: Boolean, |
| | | default: true |
| | | default: false |
| | | }, |
| | | // 订单配送方式 |
| | | isShowOrderType: { |
| | |
| | | }).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; |
| | |
| | | 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{ |