Commit 5c1c7095 authored by liboyang's avatar liboyang

修改页面

parent f8419d08
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
</table> </table>
<!-- /.table --> <!-- /.table -->
<div class="box-footer" style="text-align: right;"> <div class="box-footer" style="text-align: right;">
<h4>已选择数量:{{cardsTotal}}</h4> <h4>已选择数量:{{cardsTotal+groupCardsTotal}}</h4>
<button class="btn btn-primary" ng-click="createTaskList(type.typeCode)">创建任务单</button> <button class="btn btn-primary" ng-click="createTaskList(type.typeCode)">创建任务单</button>
</div> </div>
</div> </div>
......
...@@ -101,7 +101,6 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -101,7 +101,6 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
// }] // }]
// }); // });
// } // }
$rootScope.selectedGroup = []; $rootScope.selectedGroup = [];
$scope.getPoliceList = function(groupList){ $scope.getPoliceList = function(groupList){
ngDialog.open({ ngDialog.open({
...@@ -111,6 +110,7 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -111,6 +110,7 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
closeByDocument:false, closeByDocument:false,
controller: ['$scope', 'HttpService',function ($scope) { controller: ['$scope', 'HttpService',function ($scope) {
$scope.policeList=groupList; $scope.policeList=groupList;
$rootScope.groupCardsTotal = 0;
//创建变量用来保存选中结果 //创建变量用来保存选中结果
var updateSelected = function (action, task) { var updateSelected = function (action, task) {
if (action === 'add' &&$rootScope.selectedGroup.indexOf(task) === -1) { if (action === 'add' &&$rootScope.selectedGroup.indexOf(task) === -1) {
...@@ -119,12 +119,17 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -119,12 +119,17 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
if (action === 'remove' && $rootScope.selectedGroup.indexOf(task) !== -1) $rootScope.selectedGroup.splice($rootScope.selectedGroup.indexOf(task), 1); if (action === 'remove' && $rootScope.selectedGroup.indexOf(task) !== -1) $rootScope.selectedGroup.splice($rootScope.selectedGroup.indexOf(task), 1);
}; };
//更新某一列数据的选择 //更新某一列数据的选择
var temp = 0;
$rootScope.cardsTotal = 0;
$scope.updateSelection = function ($event, task) { $scope.updateSelection = function ($event, task) {
var checkbox = $event.target; var checkbox = $event.target;
var action = (checkbox.checked ? 'add' : 'remove'); var action = (checkbox.checked ? 'add' : 'remove');
updateSelected(action, task); updateSelected(action, task);
$rootScope.groupCardsTotal=0
var sum = 0;
for (var i = 0; i < $scope.selectedGroup.length; i++) {
sum += parseInt($scope.selectedGroup[i].VALID_COUNT);
}
$rootScope.groupCardsTotal = $rootScope.groupCardsTotal + sum ;
}; };
//全选操作 //全选操作
$scope.selectAll = function (task,$event) { $scope.selectAll = function (task,$event) {
...@@ -133,7 +138,15 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -133,7 +138,15 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
for (var i = 0; i < task.length; i++) { for (var i = 0; i < task.length; i++) {
var contact = task[i]; var contact = task[i];
updateSelected(action, contact); updateSelected(action, contact);
$rootScope.groupCardsTotal=0
} }
var sum = 0;
for (var i = 0; i < $scope.selectedGroup.length; i++) {
sum += parseInt($scope.selectedGroup[i].VALID_COUNT);
}
$rootScope.groupCardsTotal = $rootScope.groupCardsTotal + sum ;
}; };
$scope.isSelected = function (task) { $scope.isSelected = function (task) {
return $rootScope.selectedGroup.indexOf(task) >= 0; return $rootScope.selectedGroup.indexOf(task) >= 0;
...@@ -165,7 +178,8 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -165,7 +178,8 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
for (var i = 0; i < $scope.selected.length; i++) { for (var i = 0; i < $scope.selected.length; i++) {
sum += parseInt($scope.selected[i].countyValidCount); sum += parseInt($scope.selected[i].countyValidCount);
} }
$rootScope.cardsTotal = $rootScope.cardsTotal + sum;
$rootScope.cardsTotal = $rootScope.cardsTotal + sum ;
}; };
//全选操作 //全选操作
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment