|
|
@@ -1825,12 +1825,18 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
// 客户
|
|
|
- app.controller('CustomerCtrl', ['$scope', 'VendorService', 'BaseService', 'AuthenticationService', 'ngTableParams', '$modal', 'toaster', 'Vendor', 'AccountUser', function ($scope, VendorService, BaseService, AuthenticationService, ngTableParams, $modal, toaster, Vendor, AccountUser) {
|
|
|
+ app.controller('CustomerCtrl', ['$scope', 'VendorService', 'BaseService', 'AuthenticationService', 'ngTableParams', '$modal', 'toaster', 'Vendor', 'AccountUser', 'CurrentRole', function ($scope, VendorService, BaseService, AuthenticationService, ngTableParams, $modal, toaster, Vendor, AccountUser, CurrentRole) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.userInfoResult = true;
|
|
|
AuthenticationService.getAuthentication().success(function (data) {
|
|
|
$scope.loading = false;
|
|
|
$scope.thisUser = data;
|
|
|
+ });
|
|
|
+ // 获取当前用户分配客户的操作权限
|
|
|
+ CurrentRole.roles({}, function (data) {
|
|
|
+ $scope.enabled = data.count > 0 ? true : false ;
|
|
|
+ }, function (response) {
|
|
|
+
|
|
|
});
|
|
|
var getCustInfos = function (custuu) {
|
|
|
if (custuu) {
|
|
|
@@ -1874,8 +1880,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
AccountUser.getEnTransfer ({custUU: customer.myEnterprise.uu}, function(data) {
|
|
|
customer.enTransfer = data.result;
|
|
|
//是管理员,或者被转移了权限时
|
|
|
- console.log(customer.enTransfer);
|
|
|
- if ($scope.thisUser.sys || customer.enTransfer) {
|
|
|
+ console.log($scope.thisUser);
|
|
|
+ if ($scope.enabled || customer.enTransfer) {
|
|
|
var modalInstance = $modal.open({
|
|
|
animation: true,
|
|
|
templateUrl: 'static/tpl/index/account/add_userInfo.html',
|
|
|
@@ -13511,6 +13517,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 分配权限
|
|
|
$scope.addUserInfo = function (customer) {
|
|
|
//TODO
|
|
|
+ console.log($scope.thisUser);
|
|
|
if ($scope.thisUser.sys) {
|
|
|
var modalInstance = $modal.open({
|
|
|
animation: true,
|