technicalBrokerRegisteredPerListCtrl.js 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. angular.module('push')
  2. .controller('technicalBrokerRegisteredPerListCtrl', function ($scope, $stateParams, ActivityService, UtilService, $timeout) {
  3. $scope.registeredPerList=[
  4. { logo:"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1524721590&di=b377d06910612acb485ea1f5f9cb0287&src=http://cdnq.duitang.com/uploads/item/201501/16/20150116012601_zrzZh.jpeg",
  5. registeredPerName:"报名人姓名",//报名人
  6. authenstatus:"官方认证",//认证状态
  7. industry:"机械",//方向
  8. dateSource:"企业",//来源
  9. trainTime:"1天4h",//历史培训数
  10. signTime:"2018-05-18"
  11. },
  12. {
  13. logo:"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1524721590&di=b377d06910612acb485ea1f5f9cb0287&src=http://cdnq.duitang.com/uploads/item/201501/16/20150116012601_zrzZh.jpeg",
  14. registeredPerName:"报名人姓名",//报名人
  15. authenstatus:"官方认证",//认证状态
  16. industry:"机械",//方向
  17. dateSource:"企业",//来源
  18. trainTime:"1天4h",//历史培训数
  19. signTime:"2018-05-18"
  20. },
  21. {
  22. logo:"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1524721590&di=b377d06910612acb485ea1f5f9cb0287&src=http://cdnq.duitang.com/uploads/item/201501/16/20150116012601_zrzZh.jpeg",
  23. registeredPerName:"报名人姓名",//报名人
  24. authenstatus:"官方认证",//认证状态
  25. industry:"机械",//方向
  26. dateSource:"企业",//来源
  27. trainTime:"1天4h",//历史培训数
  28. signTime:"2018-05-18"
  29. }
  30. ];
  31. $scope.perCount=100;//报名人数
  32. $scope.intentionstatus=0;
  33. // 获取已报名的培训列表
  34. var trainid = $stateParams.trainid;
  35. var getTrainSignupUserList = function () {
  36. $scope.showLoadingToast();
  37. TechnicalBrokerPublishTrainService.getTrainSignupUserList(trainid).then(function (response) {
  38. console.log(response);
  39. $scope.trainSignupUserCount = response.list.length;
  40. $scope.trainSignupUserList = response.list;
  41. $scope.hideLoadingToast();
  42. }, function () {
  43. $scope.hideLoadingToast();
  44. })
  45. };
  46. getTrainInfoList();
  47. // 记录选中列表索引
  48. var indexlist = [];
  49. $scope.selectedLength = 0;
  50. // 选择报名人员
  51. $scope.selectOrgType = function (index) {
  52. if ($scope.intentionstatus != 0) {
  53. return;
  54. }
  55. if ($scope.registeredPerList[index].isChecked) {
  56. var ind = indexlist.indexOf(index);
  57. indexlist.splice(ind);
  58. } else {
  59. indexlist.push(ind);
  60. }
  61. $scope.registeredPerList[index].isChecked = !$scope.registeredPerList[index].isChecked;
  62. $scope.selectedLength = indexlist.length;
  63. };
  64. // 提交剔除的报名人员
  65. $scope.submitCompany = function () {
  66. $scope.showLoadingToast();
  67. var idlist = indexlist.join(",");
  68. // console.log(idlist);
  69. ActivityService.submitSelCompanyInfo(idlist).then(function (response) {
  70. // console.log(response);
  71. if (response.result == 1) {
  72. UtilService.showMess("提交成功!");
  73. $timeout(function () {
  74. $scope.goback();
  75. }, 1000);
  76. }
  77. $scope.hideLoadingToast();
  78. }, function () {
  79. $scope.hideLoadingToast();
  80. })
  81. };
  82. $scope.goDetail = function () {
  83. $scope.go("");
  84. };
  85. });