Browse Source

修改企业绑定直接查询sso

liuam 7 years ago
parent
commit
df13897649

+ 37 - 14
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js

@@ -35,29 +35,52 @@ define(['app/app'], function(app) {
                     }
                     //param.page = param.page;
                     param.size = param.count;
-                    param.spaceUU = $scope.userInfo.enterprise.uu;
+                    param.speaceUU = $scope.userInfo.enterprise.uu;
                     if (!($scope.searchParams.keyword.trim() == '')) {
                         param.keyword = $scope.searchParams.keyword.trim();
                     }
                     // 状态为申请中
                     param.status = 311;
-                    Enterprise.findApplyToMall(param, {}, function (page) {
-                        $defer.resolve(page.content || []);
-                        params.total(page.totalElements);
-                        $scope.page = page;
-                        $scope.totalPages = page.totalPages;
-                        $scope.content = page.content;
-                    }, function (error) {
-                        console.log(error);
-                        $defer.resolve([]);
-                        params.total(0);
-                        $scope.totalPages = 0;
-                        toaster.pop('error', '数据获取失败,请重新刷新页面!');
+                    $http({
+                        method: 'get',
+                        dataType: 'json',
+                        url: $scope.urlPrex + '/api/userspace/apply/info/mall',
+                        params: {speaceUU: param.speaceUU, page: param.page, size: param.size, status: param.status, keyword: param.keyword}
+                    }).success(function (page) {
+                        params.total(page.content.totalElements);
+                        $scope.page = page.content;
+                        $scope.totalPages = page.content.totalPages;
+                        $scope.content = page.content.content;
+                        $scope.totalElements = page.content.totalElements;
+                    }).error(function (response) {
+                        toaster.pop('error', '获取未处理审批数据失败');
                     });
+                    // Enterprise.findApplyToMall(param, {}, function (page) {
+                    //     $defer.resolve(page.content || []);
+                    //     params.total(page.totalElements);
+                    //     $scope.page = page;
+                    //     $scope.totalPages = page.totalPages;
+                    //     $scope.content = page.content;
+                    // }, function (error) {
+                    //     console.log(error);
+                    //     $defer.resolve([]);
+                    //     params.total(0);
+                    //     $scope.totalPages = 0;
+                    //     toaster.pop('error', '数据获取失败,请重新刷新页面!');
+                    // });
                 }
             });
         };
-        applyToEnterpriseTableParams();
+
+        if ($scope.isAdmin) {
+                User.isDevOrProd(null, function (data) {
+                    // $scope.isProd = data.data;
+                    $scope.urlPrex = data.data == 'success' ? 'https://sso.ubtob.com' : 'http://192.168.253.6:32323';
+                    applyToEnterpriseTableParams();
+                }, function (response) {
+                    toaster.pop('error', '获取运行环境失败');
+                });
+        }
         // 申请
         $scope.auditApply = function (status, id, UU) {
             var param = {

+ 27 - 32
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_index_ctrl.js

@@ -36,42 +36,34 @@ define(['app/app', 'calendar'], function(app) {
             var param = {};
             param.page = params.page;
             param.size = params.count;
-            param.spaceUU = $scope.userInfo.enterprise.uu;
+            param.speaceUU = $scope.userInfo.enterprise.uu;
             // 状态为申请中
             param.status = 311;
-            if ($rootScope.userInfo.enterprise.enAdminuu === $rootScope.userInfo.userUU ? true : false) {
-
-                User.isDevOrProd(null, function (data) {
-                    // $scope.isProd = data.data;
-                    $scope.urlPrex = data.data == 'success' ? 'https://sso.ubtob.com' : 'http://192.168.253.6:32323';
-                    $http({
-                        method: 'get',
-                        dataType: 'json',
-                        url: $scope.urlPrex + '/api/userspace/apply/info/mall',
-                        params: {spaceUU: param.spaceUU, page: param.page, size: param.size, status: param.status, keyword: null}
-                    }).success(function (page) {
-                        console.log(page);
-                        $scope.totalPages = page.totalPages;
-                        $scope.content = page.content;
-                        $scope.totalElements = page.totalElements;
-                    }).error(function (response) {
-                        toaster.pop('error', '获取未处理审批数据失败');
-                    });
-                }, function (response) {
-                    toaster.pop('error', '获取运行环境失败');
-                });
 
-                // Enterprise.findApplyToMall(param, {}, function (page) {
-                //     $scope.totalPages = page.totalPages;
-                //     $scope.content = page.content;
-                //     $scope.totalElements = page.totalElements;
-                // }, function (error) {
-                //     $scope.totalPages = 0;
-                //     toaster.pop('error', '数据获取失败,请重新刷新页面!');
-                // });
-            }
+            $http({
+                method: 'get',
+                dataType: 'json',
+                url: $scope.urlPrex + '/api/userspace/apply/info/mall',
+                params: {speaceUU: param.speaceUU, page: param.page, size: param.size, status: param.status, keyword: null}
+            }).success(function (data) {
+                $scope.totalPages = data.content.totalPages;
+                $scope.content = data.content.content;
+                $scope.totalElements = data.content.totalElements;
+            }).error(function (response) {
+                toaster.pop('error', '获取未处理审批数据失败');
+            });
+
+
+            // Enterprise.findApplyToMall(param, {}, function (page) {
+            //     $scope.totalPages = page.totalPages;
+            //     $scope.content = page.content;
+            //     $scope.totalElements = page.totalElements;
+            // }, function (error) {
+            //     $scope.totalPages = 0;
+            //     toaster.pop('error', '数据获取失败,请重新刷新页面!');
+            // });
         }
-        applyToEnterpriseTableParams();
+        // applyToEnterpriseTableParams();
 
         $scope.findMore = function () {
             window.location.href = '#/account/management/';
@@ -133,6 +125,9 @@ define(['app/app', 'calendar'], function(app) {
                 }).error(function (response) {
                     toaster.pop('error', '获取未处理审批数据失败');
                 });
+
+                // 查询企业绑定列表
+                applyToEnterpriseTableParams();
                 // VendorService.getNotDealApplyCount({spaceUU: $scope.userInfo.enterprise.uu}, function (data) {
                 //     console.log(data);
                 //     $scope.count = data.content[311];