Browse Source

部分单据导出参数出错
销售经理添加所有客户

wangmh 8 years ago
parent
commit
ee9ac1bd7e

+ 5 - 0
src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java

@@ -705,6 +705,11 @@ public class UserServiceImpl implements UserService {
 		for (Role role : roles) {
 			if (role.getIssys() == 1) {
 				isSys = true;
+				break;
+			}
+			if ("ROLE_SALEMANAGER".equals(role.getName())) {
+				isSys = true;
+				break;
 			}
 		}
 		if (!SystemSession.getUser().isSys() && !isSys) {

+ 14 - 11
src/main/webapp/resources/js/index/app.js

@@ -8487,7 +8487,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     if (page) {
                         params.total(page.totalElement);
                         $defer.resolve(page.content);
-                        $scope.keywordXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+                        $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
                     }
                 }, function (response) {
                     $scope.loading = false;
@@ -10597,6 +10597,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             CurrentRole.isManager({}, function(data) {
                $scope.isManager = data.isManager;
             });
+            CurrentRole.roles({}, function(data) {
+               $scope.roles = data.count;
+            });
         };
         getMangagerInfo();
 
@@ -10846,8 +10849,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.removeVendor = function (user) {
             var resultRole = true;
             angular.forEach(user.roles, function (role) {
-                if (role.issys == 1) {
-                    toaster.pop('error', '提示', '管理员无需分配客户');
+                if (role.issys == 1 || role.name == 'ROLE_SALEMANAGER') {
+                    toaster.pop('error', '提示', '管理员和销售经理无需分配客户');
                     resultRole = false;
                     return;
                 }
@@ -10867,14 +10870,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
         // 为用户分配角色(添加企业)
         $scope.addVendor = function (user, isIssy) {
-            if (!isIssy) {
-                toaster.pop('error', '提示', '你不是管理员,无权限分配!请立即联系管理员');
+            if (!$scope.roles) {
+                toaster.pop('error', '提示', '你不是管理员或销售经理,无权限分配!请立即联系管理员');
                 return;
             }
             var resultRole = true;
             angular.forEach(user.roles, function (role) {
-                if (role.issys == 1) {
-                    toaster.pop('error', '提示', '管理员无需分配客户');
+                if (role.issys == 1 || role.name == 'ROLE_SALEMANAGER') {
+                    toaster.pop('error', '提示', '管理员和销售经理无需分配客户');
                     resultRole = false;
                     return;
                 }
@@ -11605,7 +11608,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         if (page) {
                             params.total(page.totalElement);
                             $defer.resolve(page.content);
-                            $scope.keywordXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+                            $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
                         }
                     }, function (response) {
                         $scope.loading = false;
@@ -12079,7 +12082,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.exportXls = function () {
             MakeReturn.exportXls({}, {}, function (data) {
                 if (data.success){
-                    window.location.href = window.location.origin + 'make/return/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+                    window.location.href = window.location.origin + '/make/return/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
                 }
             }, function (response) {
                 toaster.pop('error', '数据加载失败', response.data);
@@ -12156,7 +12159,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     if (page) {
                         params.total(page.totalElement);
                         $defer.resolve(page.content);
-                        $scope.keywordXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+                        $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
                     }
                 }, function (response) {
                     $scope.loading = false;
@@ -12884,7 +12887,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.exportXls = function () {
             GetProductInfo.exportXls({},{}, function (data) {
                 if (data.success) {
-                    window.location.href = window.location.origin + '/product/baseInfo/xls?_state='+$scope.active+'&keyword='+ (keyword || '');
+                    window.location.href = window.location.origin + '/product/baseInfo/xls?_state='+$scope.active+'&keyword='+ ($scope.keywordXls || "");
                 }
             }, function (response) {
                 toaster.pop('error', '数据加载失败', response.data);