Browse Source

批量发货翻页全选框根据当前页选择情况设置为全选或非全选

hejq 8 years ago
parent
commit
48d4c2ba51
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/main/webapp/resources/js/index/app.js

+ 9 - 2
src/main/webapp/resources/js/index/app.js

@@ -6606,12 +6606,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         $scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
                         $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
                         $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
-
+                        $scope.checkall = true;
                         angular.forEach(page.content, function (notice) {
                             if ($rootScope.ids.indexOf(notice.id) > -1) {
                                 notice.$selected = true;
+                            } else {
+                                $scope.checkall = false;
                             }
                         });
+                        $scope.checkboxes = {
+                            checked: $scope.checkall
+                        };
                     }
                 }, function (response) {
                     $scope.loading = false;
@@ -6782,7 +6787,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
                 }
             });
-            console.log($rootScope.ids);
         };
 
         // 判断数组中是否存在某个对象
@@ -6818,6 +6822,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     $rootScope.ids.remove(order.id);
                 }
             }
+            $scope.checkboxes = {
+                checked: result
+            };
         };
 
         // 打开批量发货模态框