Explorar el Código

feat: 调整客户供应商分配、转移功能,优化效率

hejq hace 7 años
padre
commit
e6b3c4e198

+ 18 - 35
src/main/java/com/uas/platform/b2b/controller/UserController.java

@@ -91,14 +91,14 @@ public class UserController {
 	/**
 	 * 通过客户UU查询分配的用户
 	 *
-	 * @param custUu 客户UU
+	 * @param id 客户UU
 	 * @return
 	 */
-	@RequestMapping(value = "/customer/{uu}", method = RequestMethod.POST)
+	@RequestMapping(value = "/customer/{id}", method = RequestMethod.GET)
 	@ResponseBody
-	public List<UserBaseInfo> getUsersAndDistribute(@PathVariable("uu") Long custUu) {
-        LOGGER.log("用户信息", "查询[" + custUu +"]客户分配信息");
-		return userService.findUserInfoDistribute(custUu);
+	public SPage<UserBaseInfo> getUsersAndDistribute(@PathVariable("id") Long id, PageParams params, String keyword) {
+        LOGGER.log("用户信息", "查询[" + id +"]客户分配信息");
+		return userService.findUserInfoDistribute(id, params, keyword);
 	}
 
 	/**
@@ -313,8 +313,8 @@ public class UserController {
 	@RequestMapping(value = "/addVendor/{uu}", method = RequestMethod.POST)
 	@ResponseBody
 	public ResponseEntity<String> bindVendor(@PathVariable("uu") Long userUU, @RequestBody String json) {
-		List<Vendor> ids = FlexJsonUtils.fromJsonArray(json, Vendor.class);
-		boolean result = userService.addCustomerToUser(userUU, ids);
+		List<Vendor> vendors = FlexJsonUtils.fromJsonArray(json, Vendor.class);
+		boolean result = userService.addCustomerToUser(userUU, vendors);
 		String resultInfo = result ? "成功" : "失败";
         LOGGER.log("客户权限", "分配客户权限", "userUU: " + userUU + "结果: 分配" + resultInfo);
 		if (result) {
@@ -327,22 +327,18 @@ public class UserController {
 	/**
 	 * 客户权限转移
      *
-	 * @param custUU
-	 * @param json
-	 * @return
+	 * @param id 客户关系id
+	 * @param json 用户信息
+	 * @return 转移结果
 	 */
-	@RequestMapping(value = "/bindUserToVendor/{uu}", method = RequestMethod.POST)
+	@RequestMapping(value = "/bindUserToVendor/{id}", method = RequestMethod.POST)
 	@ResponseBody
-	public ResponseEntity<String> bindUserToVendor(@PathVariable("uu") Long custUU, @RequestBody String json) {
+	public ResponseEntity<String> bindUserToVendor(@PathVariable("id") Long id, @RequestBody String json) {
 		List<UserBaseInfo> users = FlexJsonUtils.fromJsonArray(json, UserBaseInfo.class);
-		boolean result = userService.addUserToVendor(custUU, users);
+		boolean result = userService.addUserToVendor(id, users);
         String resultInfo = result ? "成功" : "失败";
-        LOGGER.log("客户分配", "绑定用户到指定客户", "客户UU: " + custUU + "结果: 绑定" + resultInfo);
-		if (result) {
-			return new ResponseEntity<>(HttpStatus.OK);
-		} else {
-			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
-		}
+        LOGGER.log("客户分配", "绑定用户到指定客户", "客户UU: " + id + "结果: 绑定" + resultInfo);
+        return new ResponseEntity<>(result ? HttpStatus.OK : HttpStatus.INTERNAL_SERVER_ERROR);
 	}
 
 	/**
@@ -358,11 +354,7 @@ public class UserController {
 		boolean result = userService.transferUserToVendor(custUU, users);
         String resultInfo = result ? "成功" : "失败";
         LOGGER.log("客户分配", "将客户权限转移给用户", "客户UU: " + custUU + "结果: 绑定" + resultInfo);
-		if (result) {
-			return new ResponseEntity<>(HttpStatus.OK);
-		} else {
-			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
-		}
+        return new ResponseEntity<>(result ? HttpStatus.OK : HttpStatus.INTERNAL_SERVER_ERROR);
 	}
 
 	/**
@@ -377,11 +369,7 @@ public class UserController {
 		boolean result = userService.transferMyDistribute(custUU, userUU);
         String resultInfo = result ? "成功" : "失败";
         LOGGER.log("客户分配", "将客户权限转移给用户", "客户UU: " + custUU + "结果: 绑定" + resultInfo);
-		if (result) {
-			return new ResponseEntity<String>(HttpStatus.OK);
-		} else {
-			return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR);
-		}
+        return new ResponseEntity<>(result ? HttpStatus.OK : HttpStatus.INTERNAL_SERVER_ERROR);
 	}
 
 	/**
@@ -398,11 +386,7 @@ public class UserController {
 		boolean result = userService.removeChooseVendor(userUU, ids);
         String resultInfo = result ? "成功" : "失败";
         LOGGER.log("客户分配", "删除被选中客户", "用户UU: " + userUU + "结果: " + resultInfo);
-		if (result) {
-			return new ResponseEntity<>(HttpStatus.OK);
-		} else {
-			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
-		}
+        return new ResponseEntity<>(result ? HttpStatus.OK : HttpStatus.INTERNAL_SERVER_ERROR);
 	}
 
 	/**
@@ -429,7 +413,6 @@ public class UserController {
 		return userService.findDistribute();
 	}
 
-
 	/**
 	 * 查询当前登录用户是否被转移权限
 	 *

+ 3 - 3
src/main/java/com/uas/platform/b2b/controller/VendorDistributeController.java

@@ -71,10 +71,10 @@ public class VendorDistributeController {
      * @param id 供应商客户关系id
      * @return 符合条件的数据
      */
-    @RequestMapping(value = "/{id}", method = RequestMethod.POST)
-    public List<UserBaseInfo> getUsersAndDistribute(@PathVariable("id") Long id) throws IllegalAccessException {
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    public SPage<UserBaseInfo> getUsersAndDistribute(@PathVariable("id") Long id, PageParams params, String keyword) throws IllegalAccessException {
         LOGGER.log("用户信息", "查询[" + id +"]供应商分配信息");
-        return vendorService.findUserInfoVendDistribute(id);
+        return vendorService.findUserInfoVendDistribute(id, params, keyword);
     }
 
     /**

+ 9 - 0
src/main/java/com/uas/platform/b2b/dao/VendorDistributeDao.java

@@ -51,4 +51,13 @@ public interface VendorDistributeDao extends JpaSpecificationExecutor<VendorDist
      * @return 权限转移结果
      */
     List<VendorDistribute> findByVendorIdAndLeaderUU(Long vendorId, Long userUU);
+
+    /**
+     * 通过供应商客户id和转移状态查询供应商分配结果
+     *
+     * @param vendorId 供应商客户关系id
+     * @param status 转移状态
+     * @return 分配结果
+     */
+    List<VendorDistribute> findByVendorIdAndIsTransfer(Long vendorId, Short status);
 }

+ 3 - 2
src/main/java/com/uas/platform/b2b/service/UserService.java

@@ -7,6 +7,7 @@ import com.uas.platform.b2b.model.UserBaseInfo;
 import com.uas.platform.b2b.model.UserInfo;
 import com.uas.platform.b2b.model.Vendor;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
 import com.uas.search.b2b.model.SPage;
 
 import javax.servlet.http.HttpServletRequest;
@@ -264,7 +265,7 @@ public interface UserService {
 	 * @param enUu
 	 * @return
 	 */
-    List<UserBaseInfo> findUserInfoDistribute(Long enUu);
+    SPage<UserBaseInfo> findUserInfoDistribute(Long id, PageParams params, String keyword);
 
 	/**
 	 * 为客户分配企业用户
@@ -273,7 +274,7 @@ public interface UserService {
 	 * @param users
 	 * @return
 	 */
-    boolean addUserToVendor(Long custUU, List<UserBaseInfo> users);
+    boolean addUserToVendor(Long id, List<UserBaseInfo> users);
 
 	/**
 	 * 将客户权限转移给用户(管理员操作)

+ 12 - 2
src/main/java/com/uas/platform/b2b/service/VendorService.java

@@ -205,11 +205,13 @@ public interface VendorService {
     /**
      * 通过供应商UU查询供应商分配信息
      *
-     * @param vendUU 供应商UU
+     * @param id 供应商关系表id
+     * @param params  分页参数
+     * @param keyword 搜索词
      * @return 分配的供应商
      * @throws IllegalAccessException
      */
-    List<UserBaseInfo> findUserInfoVendDistribute(Long vendUU) throws IllegalAccessException;
+    SPage<UserBaseInfo> findUserInfoVendDistribute(Long id, PageParams params, String keyword) throws IllegalAccessException;
 
     /**
      * 通过分页信息和关键词查询用户信息
@@ -219,4 +221,12 @@ public interface VendorService {
      * @return 符合条件的数据
      */
     SPage<UserBaseInfo> findUserInfoByPage(PageParams params, String keyword);
+
+    /**
+     * 通过客户关系表id查询分配关系
+     *
+     * @param id 客户关系表id
+     * @return 分配的客户
+     */
+    List<Distribute> findByVeId(Long id);
 }

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

@@ -28,6 +28,7 @@ import com.uas.platform.core.exception.SystemException;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.util.AgentUtils;
 import com.uas.platform.core.util.encry.Md5Utils;
@@ -831,12 +832,12 @@ public class UserServiceImpl implements UserService {
 	}
 
 	@Override
-	public List<UserBaseInfo> findUserInfoDistribute(Long enUu) {
-		List<Distribute> butes = vendorService.findUserInfo(enUu);
-		List<UserBaseInfo> users = userBaseInfoDao.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
-		if (!CollectionUtils.isEmpty(users)) {
+	public SPage<UserBaseInfo> findUserInfoDistribute(Long id, PageParams params, String keyword) {
+		List<Distribute> butes = vendorService.findByVeId(id);
+        SPage<UserBaseInfo> userBaseInfoSPage = vendorService.findUserInfoByPage(params, keyword);
+		if (!CollectionUtils.isEmpty(userBaseInfoSPage.getContent())) {
 			if (!CollectionUtils.isEmpty(butes)) {
-				for (UserBaseInfo u : users) {
+				for (UserBaseInfo u : userBaseInfoSPage.getContent()) {
 					for (Distribute d : butes) {
 						if (u.getUserUU().equals(d.getUserUU())) {
 							u.setDistribute(true);
@@ -847,25 +848,25 @@ public class UserServiceImpl implements UserService {
 					}
 				}
 			}
-			return users;
+			return userBaseInfoSPage;
 		}
-		return null;
+		return new SPage<>();
 	}
 
 	@Override
-	public boolean addUserToVendor(Long custUU, List<UserBaseInfo> users) {
-		List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(custUU, SystemSession.getUser().getEnterprise().getUu());
+	public boolean addUserToVendor(Long id, List<UserBaseInfo> users) {
+		Vendor vendor = vendorDao.findOne(id);
 		if (!CollectionUtils.isEmpty(users)) {
 		    List<Distribute> saveList = new ArrayList<>();
 			for (UserBaseInfo u : users) {
 				List<Distribute> deleteList = new ArrayList<>();
 				if (null != u.getUserUU()) {
                     Distribute distribute = new Distribute();
-                    List<Distribute> butes = distributeDao.findByUserUUAndVendorId(u.getUserUU(), vendors.get(0).getId());
+                    List<Distribute> butes = distributeDao.findByUserUUAndVendorId(u.getUserUU(), vendor.getId());
                     if (u.isDistribute()) {
                         if (CollectionUtils.isEmpty(butes)) {
                             distribute.setUserUU(u.getUserUU());
-                            distribute.setVendorId(vendors.get(0).getId());
+                            distribute.setVendorId(vendor.getId());
                             distribute.setLeaderUU(SystemSession.getUser().getUserUU());
                             saveList.add(distribute);
                         }
@@ -874,10 +875,9 @@ public class UserServiceImpl implements UserService {
                         if (!CollectionUtils.isEmpty(butes)) {
                             // 当前用户
                             deleteList.add(butes.get(0));
-                            Long vendorId = vendors.get(0).getId();
                             Long userUU = u.getUserUU();
 							if (null != butes.get(0).getIsTransfer() && 1 == butes.get(0).getIsTransfer()) {
-								deleteList = deleteChildrenDistributes(vendorId, userUU, deleteList);
+								deleteList = deleteChildrenDistributes(id, userUU, deleteList);
 							}
                             // 防止出现作为参数的用户之间存在权限父子节点关系,导致重复查询,所以每次递归完成,执行一次删除
                             distributeDao.delete(deleteList);

+ 33 - 13
src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java

@@ -587,6 +587,7 @@ public class VendorsServiceImpl implements VendorService {
                 if (null != u.getUserUU()) {
                     VendorDistribute distribute = new VendorDistribute();
                     List<VendorDistribute> distributes = vendorDistributeDao.findByUserUUAndVendorId(u.getUserUU(), vendor.getId());
+                    List<VendorDistribute> transferDistributes = vendorDistributeDao.findByVendorIdAndIsTransfer(id, Constant.YES);
                     if (u.isTransfer()) {
                         if (CollectionUtils.isEmpty(distributes)) {
                             distribute.setUserUU(u.getUserUU());
@@ -609,6 +610,12 @@ public class VendorsServiceImpl implements VendorService {
                                 saveList.add(distribute);
                             }
                         }
+                        // 删除该企业以前转移的用户
+                        if (!CollectionUtil.isEmpty(transferDistributes) && !Objects.equals(u.getUserUU(), transferDistributes.get(0).getUserUU())) {
+                            distribute = transferDistributes.get(0);
+                            distribute.setIsTransfer(Constant.NO);
+                            saveList.add(distribute);
+                        }
                     } else {
                         // 删除当前用户的权限子节点用户
                         if (!CollectionUtils.isEmpty(distributes)) {
@@ -662,23 +669,25 @@ public class VendorsServiceImpl implements VendorService {
      * @return 分配的供应商
      */
     @Override
-    public List<UserBaseInfo> findUserInfoVendDistribute(Long veId) throws IllegalAccessException {
+    public SPage<UserBaseInfo> findUserInfoVendDistribute(Long veId, PageParams params, String keyword) throws IllegalAccessException {
         checkAuthority(veId);
         List<VendorDistribute> distributes = vendorDistributeDao.findByVendorId(veId);
-        List<UserBaseInfo> users = userBaseInfoDao.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
-        users.forEach(user -> {
-            distributes.forEach(distribute -> {
-                if (user.getUserUU().equals(distribute.getUserUU())) {
-                    if (Constant.YES == distribute.getDistribute()) {
-                        user.setDistribute(true);
-                    }
-                    if (null != distribute.getIsTransfer() && Constant.YES == distribute.getIsTransfer()) {
-                        user.setTransfer(true);
+        SPage<UserBaseInfo> userBaseInfoSPage = findUserInfoByPage(params, keyword);
+        if (!CollectionUtil.isEmpty(userBaseInfoSPage.getContent())) {
+            userBaseInfoSPage.getContent().forEach(user -> {
+                distributes.forEach(distribute -> {
+                    if (user.getUserUU().equals(distribute.getUserUU())) {
+                        if (Constant.YES == distribute.getDistribute()) {
+                            user.setDistribute(true);
+                        }
+                        if (null != distribute.getIsTransfer() && Constant.YES == distribute.getIsTransfer()) {
+                            user.setTransfer(true);
+                        }
                     }
-                }
+                });
             });
-        });
-        return users;
+        }
+        return userBaseInfoSPage;
     }
 
     /**
@@ -704,4 +713,15 @@ public class VendorsServiceImpl implements VendorService {
         }
         return SPageUtils.covertSPage(new PageImpl<>(userList, pageInfo, total));
     }
+
+    /**
+     * 通过客户关系表id查询分配关系
+     *
+     * @param id 客户关系表id
+     * @return 分配的客户
+     */
+    @Override
+    public List<Distribute> findByVeId(Long id) {
+        return distributeDao.findByVendorId(id);
+    }
 }

+ 4 - 6
src/main/webapp/resources/js/common/services.js

@@ -365,21 +365,19 @@ define(['angular', 'toaster', 'big'], function(angular, big) {
                 method: 'GET'
             },
             findUsers: {
-                url: 'account/user/customer/:uu',
-                method: 'POST',
-                isArray: true
+                url: 'account/user/customer/:id',
+                method: 'GET',
             },
             findSaleUsers: {
                 url: 'vendorDistribute/:id',
-                method: 'POST',
-                isArray: true
+                method: 'GET',
             },
             addSaleUserToVendor: {
                 url: 'vendorDistribute/bindVendor/:id',
                 method: 'POST'
             },
             addUserToVendor: {
-                url: 'account/user/bindUserToVendor/:uu',
+                url: 'account/user/bindUserToVendor/:id',
                 method: 'POST'
             },
             transferSaleUserToVendor: {

+ 87 - 45
src/main/webapp/resources/js/index/app.js

@@ -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', '您没有为当前客户分配用户的权限!');
-            //     }
-            // });
         };
 
         // 转移权限

+ 4 - 4
src/main/webapp/resources/tpl/index/account/add_userInfo.html

@@ -34,16 +34,16 @@
 </div>
 <div class="modal-body" id="user-lists">
 	<div>
-		<table width="99%" class="block table table-bordered table-striped table-hover">
+		<table width="99%" class="block table table-bordered table-striped table-hover" ng-table="userParams">
 		<thead>
-			<th width="80px;">用户UU</th>
+			<th width="80px;">用户电话</th>
 			<th width="100px;">用户名称</th>
 			<th width="40px;" style="text-align: center"><input type="checkbox" name="checkbox" ng-model="checkboxes.checked" ng-click="checkAll();"></th>
 		</thead>
 		<tbody>
 				<div style="overflow-y:scroll; width:100%;max-height:500px">			
-					<tr ng-repeat="user in userinfos| filter: keyword">
-						<td width="80px;">{{user.userUU}}</td>
+					<tr ng-repeat="user in $data">
+						<td width="80px;">{{user.userTel}}</td>
 						<td width="100px;">{{user.userName}}</td>
 						<td width="40px;" style="text-align: center"><input ng-model="user.distribute" name="checkbox" ng-click="checkOne()" type="checkbox"></td>
 					</tr>

+ 8 - 8
src/main/webapp/resources/tpl/index/account/transfer_userInfo.html

@@ -28,32 +28,32 @@
 </div>
 <div class="modal-body" id="user-lists">
 	<div>
-		<table width="99%" class="block table table-bordered table-striped table-hover">
+		<table width="99%" class="block table table-bordered table-striped table-hover" ng-table="userParams">
 		<thead>
-			<th width="80px;">用户UU</th>
+			<th width="80px;">用户电话</th>
 			<th width="100px;">用户名称</th>
 			<th width="40px;"></th>
 		</thead>
 		<tbody ng-if="thisUser.sys">
 			<!-- 当前用户是管理员时 -->
-			<tr ng-repeat="user in userinfos| filter: keyword" style="overflow-y:scroll; width:100%;max-height:500px" >
-				<td width="80px;">{{user.userUU}}</td>
+			<tr ng-repeat="user in $data" style="overflow-y:scroll; width:100%;max-height:500px" >
+				<td width="80px;">{{user.userTel}}</td>
 				<td width="100px;">{{user.userName}}</td>
 				<td width="40px;" style="text-align: center"><input ng-model="user.transfer" name="checkbox" ng-click="checkOne(user)" ng-checked="user.checked" type="checkbox" title="选择"></td>
 			</tr>
 		</tbody>
 		<tbody ng-if="!thisUser.sys && thisUser.transfer">
 			<!-- 当前用户是被管理员转移权限时 -->
-			<tr ng-repeat="user in userinfos| filter: keyword">
-				<td width="80px;">{{user.userUU}}</td>
+			<tr ng-repeat="user in $data">
+				<td width="80px;">{{user.userTel}}</td>
 				<td width="100px;">{{user.userName}}</td>
 				<td width="40px;" style="text-align: center"><input ng-model="user.transfer" name="checkbox" ng-click="checkOne(user)" ng-checked="user.checked" type="checkbox" title="选择"></td>
 			</tr>
 		</tbody>
 		<tbody ng-if="!thisUser.sys && !thisUser.transfer">
 			<!-- 当前用户是非管理员,但有查看权限时 -->
-			<tr ng-repeat="user in userinfos| filter: keyword" ng-if="!user.distribute">
-				<td width="80px;">{{user.userUU}}</td>
+			<tr ng-repeat="user in $data" ng-if="!user.distribute">
+				<td width="80px;">{{user.userTel}}</td>
 				<td width="100px;">{{user.userName}}</td>
 				<td width="40px;" style="text-align: center"><input ng-model="user.transfer" name="distribute" ng-click="checkOne(user)" ng-checked="user.checked" type="checkbox" title="选择"></td>
 			</tr>