angular.module('push') .controller('activitySchoolSignUpMangerCtrl', function ($scope, $stateParams, ActivityService, UtilService) { /* $scope.setStatusBar(1);*/ var activityid = $stateParams.activityid; $scope.title = $stateParams.title; $scope.visittime = $stateParams.visittime; var getManageUnivList = function () { $scope.showLoadingToast(); ActivityService.getManageUnivList(activityid).then(function (response) { // console.log(response); $scope.expertlist = response.recordList; $scope.hideLoadingToast(); }, function () { $scope.hideLoadingToast(); }) }; getManageUnivList(); // 记录选中列表索引 var indexlist = []; $scope.selectedLength = 0; $scope.selectOrgType = function (signupid, index) { if ($scope.expertlist[index].isChecked) { var ind = indexlist.indexOf(index); indexlist.splice(ind); } else { indexlist.push(signupid); } $scope.expertlist[index].isChecked = !$scope.expertlist[index].isChecked; $scope.selectedLength = indexlist.length; }; // 移除企业 $scope.deleteExpert = function () { $scope.showLoadingToast(); var idlist = indexlist.join(","); ActivityService.deleteSignupInfo(activityid, 2, idlist).then(function (response) { // console.log(response); if(response == 1){ UtilService.showMess("移除成功"); getManageUnivList(); indexlist = []; $scope.selectedLength = 0; } $scope.hideLoadingToast(); }, function () { $scope.hideLoadingToast(); }) }; });