|
|
@@ -200,47 +200,24 @@ define(['app/app'], function(app) {
|
|
|
if (save) {
|
|
|
if (customer.vendorEnterprise.uu) {
|
|
|
// 当前用户是管理员时
|
|
|
- if ($scope.thisUser.sys) {
|
|
|
- angular.forEach($scope.userinfos, function (item, i) {
|
|
|
- chooseResult.push(item);
|
|
|
- });
|
|
|
- if (chooseResult.length > 0) {
|
|
|
- $scope.loading = true;
|
|
|
- AccountUser.transferSaleUserToVendor({id : customer.id}, chooseResult, function (data) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('success', '提示', '保存成功');
|
|
|
- $modalInstance.close(false);
|
|
|
- }, function (response) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('error', '保存失败', response.data);
|
|
|
- $modalInstance.close(false);
|
|
|
- })
|
|
|
- } else {
|
|
|
- toaster.pop('error', '保存失败', "您未勾选任何记录");
|
|
|
- }
|
|
|
+ angular.forEach($scope.userinfos, function (item, i) {
|
|
|
+ chooseResult.push(item);
|
|
|
+ });
|
|
|
+ if (chooseResult.length > 0) {
|
|
|
+ $scope.loading = true;
|
|
|
+ AccountUser.transferSaleUserToVendor({id : customer.id}, chooseResult, function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('success', '提示', '保存成功');
|
|
|
+ $modalInstance.close(false);
|
|
|
+ }, function (response) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '保存失败', response.data);
|
|
|
+ $modalInstance.close(false);
|
|
|
+ })
|
|
|
} else {
|
|
|
- toaster.pop('info', '提示', "您没有权限转移对象");
|
|
|
- // 非管理员转移自己的权限时
|
|
|
- // angular.forEach($scope.userinfos, function (item, i) {
|
|
|
- // if (item.transfer && item.userUU !== $scope.thisUser.userUU) {
|
|
|
- // $scope.target = item;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // if (!$scope.target) {
|
|
|
- // toaster.pop('error', '保存失败', "您未选择权限转移对象");
|
|
|
- // } else {
|
|
|
- // $scope.loading = true;
|
|
|
- // AccountUser.transferMyDistribute({custUU: customer.myEnterprise.uu, userUU: $scope.target.userUU}, {} ,function (data) {
|
|
|
- // $scope.loading = false;
|
|
|
- // toaster.pop('success', '提示', '保存成功');
|
|
|
- // $modalInstance.close(false);
|
|
|
- // }, function (response) {
|
|
|
- // $scope.loading = false;
|
|
|
- // toaster.pop('error', '保存失败', response.data);
|
|
|
- // $modalInstance.close(false);
|
|
|
- // });
|
|
|
- // }
|
|
|
+ toaster.pop('error', '保存失败', "您未勾选任何记录");
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
$modalInstance.close(true, $scope.checkboxes.checked);
|
|
|
}
|