activityCompanySignUpMangerCtrl.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. angular.module('push')
  2. .controller('activityCompanySignUpMangerCtrl', function ($scope, $stateParams, ActivityService, UtilService) {
  3. /* $scope.setStatusBar(1);*/
  4. var activityid = $stateParams.activityid;
  5. $scope.title = $stateParams.title;
  6. $scope.visittime = $stateParams.visittime;
  7. var getManageCompanyList = function () {
  8. $scope.showLoadingToast();
  9. ActivityService.getManageCompanyList(activityid).then(function (response) {
  10. // console.log(response);
  11. $scope.companylist = response.recordList;
  12. $scope.hideLoadingToast();
  13. }, function () {
  14. $scope.hideLoadingToast();
  15. })
  16. };
  17. getManageCompanyList();
  18. // 记录选中列表索引
  19. var indexlist = [];
  20. $scope.selectedLength = 0;
  21. $scope.selectOrgType = function (companyid, index) {
  22. if ($scope.companylist[index].isChecked) {
  23. var ind = indexlist.indexOf(index);
  24. indexlist.splice(ind);
  25. } else {
  26. indexlist.push(companyid);
  27. }
  28. $scope.companylist[index].isChecked = !$scope.companylist[index].isChecked;
  29. $scope.selectedLength = indexlist.length;
  30. };
  31. // 移除专家
  32. $scope.deleteCompany = function () {
  33. $scope.showLoadingToast();
  34. var idlist = indexlist.join(",");
  35. ActivityService.deleteSignupInfo(activityid, 1, idlist).then(function (response) {
  36. // console.log(response);
  37. if (response == 1) {
  38. UtilService.showMess("移除成功");
  39. getManageCompanyList();
  40. indexlist = [];
  41. $scope.selectedLength = 0;
  42. }
  43. $scope.hideLoadingToast();
  44. }, function () {
  45. $scope.hideLoadingToast();
  46. })
  47. };
  48. });