technicalBrokerSelfPublishTaskCtrl.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. angular.module('push')
  2. .controller('technicalBrokerSelfPublishTaskCtrl', function ($scope, TechnicalBrokerPublishTrainService, UserService, UtilService) {
  3. // 已发布的培训类别
  4. $scope.mold = 1;
  5. $scope.act ='train';
  6. $scope.keyfilter = {key: ""};//搜索关键词
  7. var activity = ['train', 'task'];
  8. $scope.changeAct = function (num) {
  9. $scope.act = activity[num];
  10. };
  11. $scope.type = 1;// 我接收的任务类别
  12. $scope.personModel = {
  13. userid: 0,// 用户id
  14. tid: 0// 任务id
  15. };
  16. //获取已发布的培训列表
  17. $scope.traininfolist=[
  18. {
  19. id: 0,
  20. title: "",
  21. content: "",
  22. trainbegintime: "",
  23. signupenddate: "",
  24. areaid: 0,
  25. areaname: "",
  26. detailaddress: "",// 详细地址
  27. isactive: 1,// 培训状态:是否有效,0无效,1有效
  28. sponsors: "",// 传到后台的主办方/协办方json stype:类别:1.主办方 2.协办方
  29. sponsorlist: [],// 取得详情里的主办方
  30. imagelist: [],// app端图片插件进行传递的变量
  31. logo:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
  32. firstpic:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
  33. trainstatus:1,
  34. trainstatusname:"",// 培训状态名称
  35. trainLeaveDays:5,// 报名剩余天数
  36. traincount:5,// 培训总数
  37. signupcount:255,// 已报名总数
  38. isedit:0,// 是否有编辑权限:0无 1有
  39. traintype: 0,// 培训种类
  40. traintypename: "",// 培训种类名称
  41. creator: 0,
  42. creatorname: "",
  43. creatorphoto: ""// 用户logo
  44. }
  45. ];
  46. // 任务列表
  47. $scope.taskinfolist=[
  48. {
  49. userid: 0,
  50. usercomefrom: "000000000",
  51. id: 0,
  52. taskstyle: 0,
  53. taskstylename: "",
  54. title: "",
  55. content: "",
  56. isactive: 1,// 任务状态:是否有效,0无效,1有效
  57. begintime: "",
  58. endtime: "",
  59. taskstatus:1,
  60. taskstatusname:"",// 任务状态名称
  61. signupstatus:1,
  62. signupstatusname:"",// 报名状态名称
  63. taskLeaveDays:5,// 剩余天数
  64. taskcount:5,// 任务总数
  65. signupcount:255,// 已报名任务人总数
  66. isedit:0,// 是否有编辑权限:0无 1有
  67. creator: 0,
  68. creatorname: "",
  69. createtime: "",
  70. creatorphoto: ""// 用户logo
  71. }
  72. ];
  73. // 获取已发布的培训列表
  74. var getTrainInfoList = function () {
  75. $scope.showLoadingToast();
  76. TechnicalBrokerPublishTrainService.getTrainInfoList($scope.mold).then(function (response) {
  77. // console.log(response);
  78. $scope.traincount = response.traincount;
  79. $scope.traininfolist = response.traininfolist;
  80. $scope.hideLoadingToast();
  81. }, function () {
  82. $scope.hideLoadingToast();
  83. })
  84. };
  85. getTrainInfoList();
  86. // 编辑培训
  87. $scope.editTechnicalTask = function (trainid) {
  88. $scope.go('technicalBrokerEditTrain', {trainid: trainid});
  89. };
  90. //进入培训详情页
  91. $scope.goTrainContent=function (trainid) {
  92. $scope.go('technicalBrokerTaskListContent', {trainid: trainid});
  93. };
  94. // 获取参与待接任务列表
  95. var getTaskInfoList = function (type) {
  96. $scope.showLoadingToast();
  97. TechnicalBrokerPublishTrainService.getTaskInfoList(type).then(function (response) {
  98. // console.log(response);
  99. $scope.taskcount = response.taskcount;
  100. $scope.taskinfolist = response.taskinfolist;
  101. // console.log($scope.taskinfolist);
  102. $scope.hideLoadingToast();
  103. }, function () {
  104. $scope.hideLoadingToast();
  105. })
  106. };
  107. getTaskInfoList($scope.type);
  108. //任务详情页
  109. $scope.goTaskContent = function (taskid) {
  110. $scope.go("technicalBrokerTaskDetail", {taskid: taskid});
  111. };
  112. // 编辑任务
  113. $scope.editTaskInfo = function (taskid) {
  114. $scope.go('technicalBrokerEditTask', {taskid: taskid});
  115. };
  116. //虚拟搜索框
  117. $scope.isShowSearchButton = true;
  118. $scope.keyfilter = {key: ""};//搜索关键词
  119. $scope.showSearchButtonLeft = function () {
  120. $scope.isShowSearchButton = false;
  121. $(".showSearchInput").focus();
  122. };
  123. //清空搜索内容
  124. $scope.clearSearch = function () {
  125. $scope.isShowSearchButton = true;
  126. $scope.keyfilter.key = "";
  127. };
  128. // 我已发布的培训列表
  129. $scope.selfTraincount=12;
  130. $scope.selfTraininfolist=[
  131. {creatorname:"创建者名称",
  132. creatorphoto:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
  133. signupbegindate:"2015-05-18",
  134. firstpic:"http://wx3.sinaimg.cn/large/654b47daly1fqo6k1nwbxj21kw11xx6q.jpg",
  135. detailaddress:"培训地点" ,
  136. trainbegintime:"2017-06-18",
  137. sponsorlist:[{
  138. sponsorname:"主办发名称"
  139. }],
  140. trainstatus:1,
  141. trainLeaveDays:"25",
  142. signupcount:23
  143. }
  144. ];
  145. // 获取已发布的培训列表
  146. var getSelfTraininfolist = function () {
  147. $scope.showLoadingToast();
  148. TechnicalBrokerPublishTrainService.getTrainInfoList().then(function (response) {
  149. // console.log(response);
  150. $scope.traincount = response.traincount;
  151. $scope.traininfolist = response.traininfolist;
  152. $scope.hideLoadingToast();
  153. }, function () {
  154. $scope.hideLoadingToast();
  155. })
  156. };
  157. //getSelfTraininfolist();
  158. //进入发布任务页
  159. $scope.goPublisherTask=function () {
  160. $scope.go('technicalBrokerPublishTask');
  161. };
  162. });