|
|
@@ -2477,8 +2477,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
- app.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'AccountUser', 'toaster', 'AuthenticationService', 'type',
|
|
|
- function ($scope, $modalInstance, customer, AccountUser, toaster, AuthenticationService, type) {
|
|
|
+ app.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'AccountUser', 'toaster', 'AuthenticationService', 'type', 'ngTableParams', 'BaseService',
|
|
|
+ function ($scope, $modalInstance, customer, AccountUser, toaster, AuthenticationService, type, ngTableParams, BaseService) {
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
$scope.thisUser = data;
|
|
|
});
|
|
|
@@ -2491,10 +2491,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
urlData = 'findSaleUsers';
|
|
|
uuData = customer.id;
|
|
|
} else {
|
|
|
- params = {uu : customer.myEnterprise.uu};
|
|
|
+ params = {id : customer.id};
|
|
|
urlSaveData = 'addUserToVendor';
|
|
|
urlData = 'findUsers';
|
|
|
- uuData = customer.myEnterprise.uu;
|
|
|
+ uuData = customer.id;
|
|
|
}
|
|
|
|
|
|
$scope.checkboxes = {
|
|
|
@@ -2502,7 +2502,45 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
$scope.loading = true;
|
|
|
$scope.distribute = [];
|
|
|
- AccountUser[urlData](params, null, function (data) {
|
|
|
+
|
|
|
+ $scope.userParams = new ngTableParams({ // ng-Table参数
|
|
|
+ page: 1,
|
|
|
+ count: 20,
|
|
|
+ sorting: {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ counts: [5, 10, 15, 25, 50],
|
|
|
+ getData: function ($defer, params) {// 获取数据的方法
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.keyword = $scope.keyword;
|
|
|
+ pageParams.id = uuData;
|
|
|
+ AccountUser[urlData].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (page) {
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ $scope.userinfos = page.content;
|
|
|
+ $scope.total = page.totalElement;
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的条件
|
|
|
+ }
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function () {
|
|
|
+ $scope.userParams.page(1);
|
|
|
+ $scope.userParams.reload();
|
|
|
+ $scope.isChanged = false;
|
|
|
+ $scope.isChangedAll = false;
|
|
|
+ };
|
|
|
+
|
|
|
+ /*AccountUser[urlData](params, null, function (data) {
|
|
|
$scope.userinfos = data;
|
|
|
var distribute = [];
|
|
|
angular.forEach($scope.userinfos, function (user, index) {
|
|
|
@@ -2516,8 +2554,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}, function (res) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('error', res.data);
|
|
|
- });
|
|
|
-
|
|
|
+ });*/
|
|
|
var checkStatus = function (userinfos) {
|
|
|
var distribute = [];
|
|
|
angular.forEach(userinfos, function (user, index) {
|
|
|
@@ -2583,19 +2620,20 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
// 转移权限
|
|
|
- app.controller('TransferUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'AccountUser', 'toaster', 'AuthenticationService', 'type', function ($scope, $modalInstance, customer, AccountUser, toaster, AuthenticationService, type) {
|
|
|
+ app.controller('TransferUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'AccountUser', 'toaster', 'AuthenticationService', 'type', 'ngTableParams', 'BaseService',
|
|
|
+ function ($scope, $modalInstance, customer, AccountUser, toaster, AuthenticationService, type, ngTableParams, BaseService) {
|
|
|
var urlData, urlSaveData, uuData;
|
|
|
var params = {};
|
|
|
if (type === 'sale') {
|
|
|
params = {id : customer.id};
|
|
|
urlSaveData = 'transferSaleUserToVendor';
|
|
|
urlData = 'findSaleUsers';
|
|
|
- uuData = customer.vendorEnterprise.uu;
|
|
|
+ uuData = id;
|
|
|
} else {
|
|
|
- params = {uu : customer.myEnterprise.uu};
|
|
|
+ params = {id : customer.id};
|
|
|
urlSaveData = 'transferUserToVendor';
|
|
|
urlData = 'findUsers';
|
|
|
- uuData = customer.myEnterprise.uu;
|
|
|
+ uuData = customer.id;
|
|
|
}
|
|
|
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
@@ -2607,7 +2645,35 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
$scope.loading = true;
|
|
|
$scope.transfer = [];
|
|
|
- AccountUser[urlData](params, {}, function (data) {
|
|
|
+ $scope.userParams = new ngTableParams({ // ng-Table参数
|
|
|
+ page: 1,
|
|
|
+ count: 20,
|
|
|
+ sorting: {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ total: 0,
|
|
|
+ counts: [5, 10, 15, 25, 50],
|
|
|
+ getData: function ($defer, params) {// 获取数据的方法
|
|
|
+ $scope.loading = true;
|
|
|
+ var pageParams = params.url();
|
|
|
+ pageParams.keyword = $scope.keyword;
|
|
|
+ pageParams.id = uuData;
|
|
|
+ AccountUser[urlData].call(null, BaseService.parseParams(pageParams), function (page) {
|
|
|
+ $scope.loading = false;
|
|
|
+ if (page) {
|
|
|
+ $defer.resolve(page.content);
|
|
|
+ $scope.userinfos = page.content;
|
|
|
+ $scope.total = page.totalElement;
|
|
|
+ params.total(page.totalElement);
|
|
|
+ $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的条件
|
|
|
+ }
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '数据加载失败', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ /*AccountUser[urlData](params, {}, function (data) {
|
|
|
$scope.userinfos = data;
|
|
|
var transfer = [];
|
|
|
angular.forEach($scope.userinfos, function (user, index) {
|
|
|
@@ -2634,7 +2700,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.loading = false;
|
|
|
}, function (res) {
|
|
|
toaster.pop('error', res.data);
|
|
|
- });
|
|
|
+ });*/
|
|
|
+
|
|
|
+ // 搜索框回车
|
|
|
+ $scope.onSearch = function () {
|
|
|
+ $scope.userParams.page(1);
|
|
|
+ $scope.userParams.reload();
|
|
|
+ $scope.isChanged = false;
|
|
|
+ $scope.isChangedAll = false;
|
|
|
+ };
|
|
|
|
|
|
var checkStatus = function (userinfos) {
|
|
|
var transfer = [];
|
|
|
@@ -14774,38 +14848,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
$scope.customerParams.reload();
|
|
|
});
|
|
|
- // if (!$scope.enabled) {
|
|
|
- // toaster.pop('error', '您没有为当前客户分配用户的权限!');
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // 获取当前用户在当前企业是否被转移权限
|
|
|
- // AccountUser.getEnTransfer({custUU: customer.myEnterprise.uu}, function (data) {
|
|
|
- // customer.enTransfer = data.result;
|
|
|
- // //是管理员,或者被转移了权限时
|
|
|
- // if ($scope.enabled || customer.enTransfer) {
|
|
|
- // var modalInstance = $modal.open({
|
|
|
- // animation: true,
|
|
|
- // templateUrl: 'static/tpl/index/account/add_userInfo.html',
|
|
|
- // controller: 'AddUserInfoCtrl',
|
|
|
- // resolve: {
|
|
|
- // customer: function () {
|
|
|
- // return customer;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // modalInstance.result.then(function (changed, checked) {
|
|
|
- // if (changed) {
|
|
|
- // if (checked)
|
|
|
- // $scope.newUser.roles = checked;
|
|
|
- // else
|
|
|
- // loadUsers();
|
|
|
- // }
|
|
|
- // $scope.customerParams.reload();
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // toaster.pop('error', '您没有为当前客户分配用户的权限!');
|
|
|
- // }
|
|
|
- // });
|
|
|
};
|
|
|
|
|
|
// 转移权限
|