|
|
@@ -54,10 +54,6 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
// 分配用户
|
|
|
$scope.addUserInfo = function (customer) {
|
|
|
- if (!$scope.enabled) {
|
|
|
- toaster.pop('error', '您没有为当前客户分配用户的权限!');
|
|
|
- return;
|
|
|
- }
|
|
|
// 获取当前用户在当前企业是否被转移权限
|
|
|
AccountUser.getEnTransfer ({custUU: customer.myEnterprise.uu}, function(data) {
|
|
|
customer.enTransfer = data.result;
|
|
|
@@ -80,6 +76,7 @@ define(['app/app'], function (app) {
|
|
|
else
|
|
|
loadUsers();
|
|
|
}
|
|
|
+ $scope.customerParams.reload();
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
@@ -91,10 +88,6 @@ define(['app/app'], function (app) {
|
|
|
// 转移权限
|
|
|
$scope.transferUserInfo = function (customer) {
|
|
|
customer.enDistribute = null;
|
|
|
- if (!$scope.enabled) {
|
|
|
- toaster.pop('error', '您没有转移当前客户权限的权限!');
|
|
|
- return;
|
|
|
- }
|
|
|
// 获取当前用户在当前企业是否被转移权限
|
|
|
AccountUser.getDistribute ({custUU: customer.myEnterprise.uu}, function(data) {
|
|
|
customer.enDistribute = data.result;
|
|
|
@@ -117,6 +110,7 @@ define(['app/app'], function (app) {
|
|
|
else
|
|
|
loadUsers();
|
|
|
}
|
|
|
+ $scope.customerParams.reload();
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
@@ -234,14 +228,8 @@ define(['app/app'], function (app) {
|
|
|
var checkStatus = function (userinfos) {
|
|
|
var transfer = [];
|
|
|
angular.forEach(userinfos, function (user, index) {
|
|
|
- if ($scope.thisUser.sys || $scope.thisUser.transfer) {
|
|
|
- if (user.transfer) {
|
|
|
- transfer.push({num: index});
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (user.transfer) {
|
|
|
- transfer.push({num: index});
|
|
|
- }
|
|
|
+ if (user.transfer) {
|
|
|
+ transfer.push({num: index});
|
|
|
}
|
|
|
});
|
|
|
$scope.transfer = transfer;
|
|
|
@@ -342,24 +330,28 @@ define(['app/app'], function (app) {
|
|
|
};
|
|
|
|
|
|
}]);
|
|
|
- app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', function ($scope, $modalInstance, customer, AccountUser, toaster) {
|
|
|
- $scope.checkboxes = {
|
|
|
- checked: false
|
|
|
- };
|
|
|
- $scope.loading = true;
|
|
|
- $scope.distribute = [];
|
|
|
- AccountUser.findUsers({uu: customer.myEnterprise.uu}, null, function (data) {
|
|
|
- $scope.userinfos = data;
|
|
|
- var distribute = [];
|
|
|
- angular.forEach($scope.userinfos, function (user, index) {
|
|
|
- if (user.distribute) {
|
|
|
- distribute.push({num: index});
|
|
|
- }
|
|
|
+ app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', 'AuthenticationService',
|
|
|
+ function ($scope, $modalInstance, customer, AccountUser, toaster, AuthenticationService) {
|
|
|
+ AuthenticationService.getAuthentication().success(function (data) {
|
|
|
+ $scope.thisUser = data;
|
|
|
+ $scope.checkboxes = {
|
|
|
+ checked: false
|
|
|
+ };
|
|
|
+ $scope.loading = true;
|
|
|
+ $scope.distribute = [];
|
|
|
+ AccountUser.findUsers({uu: customer.myEnterprise.uu}, null, function (data) {
|
|
|
+ $scope.userinfos = data;
|
|
|
+ var distribute = [];
|
|
|
+ angular.forEach($scope.userinfos, function (user, index) {
|
|
|
+ if (user.distribute) {
|
|
|
+ distribute.push({num: index});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $scope.distribute = distribute;
|
|
|
+ $scope.havedone = angular.copy($scope.distribute);
|
|
|
+ $scope.loading = false;
|
|
|
});
|
|
|
- $scope.distribute = distribute;
|
|
|
- $scope.havedone = angular.copy($scope.distribute);
|
|
|
- $scope.loading = false;
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
var checkStatus = function (userinfos) {
|
|
|
var distribute = [];
|