123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- angular.module('push')
- .controller('activityCompanySignUpMangerCtrl', function ($scope, $stateParams, ActivityService, UtilService) {
- /* $scope.setStatusBar(1);*/
- var activityid = $stateParams.activityid;
- $scope.title = $stateParams.title;
- $scope.visittime = $stateParams.visittime;
- var getManageCompanyList = function () {
- $scope.showLoadingToast();
- ActivityService.getManageCompanyList(activityid).then(function (response) {
- // console.log(response);
- $scope.companylist = response.recordList;
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- getManageCompanyList();
- // 记录选中列表索引
- var indexlist = [];
- $scope.selectedLength = 0;
- $scope.selectOrgType = function (companyid, index) {
- if ($scope.companylist[index].isChecked) {
- var ind = indexlist.indexOf(index);
- indexlist.splice(ind);
- } else {
- indexlist.push(companyid);
- }
- $scope.companylist[index].isChecked = !$scope.companylist[index].isChecked;
- $scope.selectedLength = indexlist.length;
- };
- // 移除专家
- $scope.deleteCompany = function () {
- $scope.showLoadingToast();
- var idlist = indexlist.join(",");
- ActivityService.deleteSignupInfo(activityid, 1, idlist).then(function (response) {
- // console.log(response);
- if (response == 1) {
- UtilService.showMess("移除成功");
- getManageCompanyList();
- indexlist = [];
- $scope.selectedLength = 0;
- }
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- });
|