Commit 79a5b47e authored by liboyang's avatar liboyang

已选择数量

parent 5214116b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
提示 提示
</div> </div>
<div class="ui-dialog-content"> <div class="ui-dialog-content">
<div>本次转出总数:{{cardsTotal}}</div> <div>本次转出总数:{{selectCount}}</div>
</div> </div>
<div class="ui-dialog-confirm"> <div class="ui-dialog-confirm">
<button type="submit" class="btn btn-info" ng-click="confirmGoTo()">确认</button> <button type="submit" class="btn btn-info" ng-click="confirmGoTo()">确认</button>
......
...@@ -168,19 +168,19 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -168,19 +168,19 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
if (action === 'remove' && $scope.selected.indexOf(task) !== -1) $scope.selected.splice($scope.selected.indexOf(task), 1); if (action === 'remove' && $scope.selected.indexOf(task) !== -1) $scope.selected.splice($scope.selected.indexOf(task), 1);
}; };
//更新某一列数据的选择 //更新某一列数据的选择
$rootScope.cardsTotal = 0; $scope.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.cardsTotal=0; $scope.cardsTotal = 0;
var sum = 0; var sum = 0;
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 ; $scope.cardsTotal = $scope.cardsTotal + sum ;
}; };
//全选操作 //全选操作
...@@ -206,6 +206,11 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -206,6 +206,11 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
}; };
$scope.createTaskList = function(typeCode){ $scope.createTaskList = function(typeCode){
$rootScope.selectCount = 0;
for (var i = 0; i < $scope.selected.length; i++) {
$rootScope.selectCount =$rootScope.selectCount + parseInt($scope.selected[i].countyValidCount);
}
console.log("for",$rootScope.selectCount)
var go = function () { var go = function () {
if($scope.selected.length>0||$rootScope.selectedGroup.length>0){ if($scope.selected.length>0||$rootScope.selectedGroup.length>0){
var arr = []; var arr = [];
...@@ -233,8 +238,6 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm ...@@ -233,8 +238,6 @@ angular.module('AvatarCheck.createTaskList', ['ngRoute', 'AvatarCheck.http', 'tm
console.log($scope.searchCurrent) console.log($scope.searchCurrent)
$scope.searchCurrent(); $scope.searchCurrent();
$scope.selected=[]; $scope.selected=[];
$rootScope.selectedGroup=[];
$rootScope.cardsTotal = 0;
$rootScope.closeThis(); $rootScope.closeThis();
}) })
}else{ }else{
......
...@@ -159,6 +159,11 @@ angular.module('AvatarCheck.dispatchTask', ['ngRoute', 'AvatarCheck.http', 'tm.p ...@@ -159,6 +159,11 @@ angular.module('AvatarCheck.dispatchTask', ['ngRoute', 'AvatarCheck.http', 'tm.p
$scope.goes = function(){ $scope.goes = function(){
$rootScope.selectCount = 0;
for (var i = 0; i < $scope.selected.length; i++) {
$rootScope.selectCount =$rootScope.selectCount + parseInt($scope.selected[i].countyValidCount);
}
console.log("for",$rootScope.selectCount)
var go = function () { var go = function () {
var checks = $(".checkOneBox:checked"); var checks = $(".checkOneBox:checked");
if(checks.length>0){ if(checks.length>0){
...@@ -181,7 +186,7 @@ angular.module('AvatarCheck.dispatchTask', ['ngRoute', 'AvatarCheck.http', 'tm.p ...@@ -181,7 +186,7 @@ angular.module('AvatarCheck.dispatchTask', ['ngRoute', 'AvatarCheck.http', 'tm.p
HttpService.updateTaskListProcess(json,function(data){ HttpService.updateTaskListProcess(json,function(data){
$scope.searchTaskList(); $scope.searchTaskList();
MessageService.showAlert("下发完成") MessageService.showAlert("下发完成")
$rootScope.cardsTotal = 0; $scope.selected=[];
$rootScope.closeThis(); $rootScope.closeThis();
}) })
}else{ }else{
...@@ -199,6 +204,7 @@ angular.module('AvatarCheck.dispatchTask', ['ngRoute', 'AvatarCheck.http', 'tm.p ...@@ -199,6 +204,7 @@ angular.module('AvatarCheck.dispatchTask', ['ngRoute', 'AvatarCheck.http', 'tm.p
}] }]
}) })
} }
}); });
......
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