technicalBrokerTaskListCtrl.js 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. angular.module('push')
  2. .controller('technicalBrokerTaskListCtrl', function ($scope, TechnicalBrokerPublishTrainService, UtilService, UserService, $stateParams, $timeout) {
  3. $scope.act ='train';
  4. $scope.act = $stateParams.act;
  5. $scope.keyfilter = {key: ""};//搜索关键词
  6. // 待参加的培训类别
  7. $scope.mold = 3;
  8. var activity = ['train', 'task'];
  9. $scope.changeAct = function (num) {
  10. $scope.act = activity[num];
  11. };
  12. $scope.signupModel = {
  13. userid: 0,// 用户id
  14. tid: 0,// 培训id
  15. type: 1100// 培训类别
  16. };
  17. // 培训列表
  18. $scope.traininfolist=[
  19. {
  20. id: 0,
  21. title: "",
  22. content: "",
  23. trainbegintime: "",
  24. signupenddate: "",
  25. areaid: 0,
  26. areaname: "",
  27. detailaddress: "",// 详细地址
  28. isactive: 1,// 培训状态:是否有效,0无效,1有效
  29. sponsors: "",// 传到后台的主办方/协办方json stype:类别:1.主办方 2.协办方
  30. sponsorlist: [],// 取得详情里的主办方
  31. imagelist: [],// app端图片插件进行传递的变量
  32. logo:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
  33. firstpic:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
  34. trainstatus:1,
  35. trainstatusname:"",// 培训状态名称
  36. trainLeaveDays:5,// 报名剩余天数
  37. traincount:5,// 培训总数
  38. signupcount:255,// 已报名总数
  39. isedit:0,// 是否有编辑权限:0无 1有
  40. traintype: 0,// 培训种类
  41. traintypename: "",// 培训种类名称
  42. creator: 0,
  43. creatorname: "",
  44. creatorphoto: ""// 用户logo
  45. }
  46. ];
  47. // 任务列表
  48. $scope.taskinfolist=[
  49. {
  50. userid: 0,
  51. usercomefrom: "000000000",
  52. id: 0,
  53. taskstyle: 0,
  54. taskstylename: "",
  55. title: "",
  56. content: "",
  57. isactive: 1,// 培训状态:是否有效,0无效,1有效
  58. begintime: "",
  59. endtime: "",
  60. creator: 0,
  61. creatorname: "",
  62. creatorphoto: ""// 用户logo
  63. }
  64. ];
  65. // 获取培训列表
  66. var getTrainInfoList = function () {
  67. $scope.showLoadingToast();
  68. TechnicalBrokerPublishTrainService.getTrainInfoList($scope.mold).then(function (response) {
  69. console.log(response);
  70. $scope.traincount = response.traincount;
  71. $scope.traininfolist = response.traininfolist;
  72. $scope.hideLoadingToast();
  73. }, function () {
  74. $scope.hideLoadingToast();
  75. })
  76. };
  77. getTrainInfoList();
  78. // 获取任务列表
  79. var getTaskInfoList = function () {
  80. $scope.showLoadingToast();
  81. TechnicalBrokerPublishTrainService.getTaskInfoList().then(function (response) {
  82. console.log(response);
  83. $scope.taskcount = response.taskcount;
  84. $scope.taskinfolist = response.taskinfolist;
  85. $scope.hideLoadingToast();
  86. }, function () {
  87. $scope.hideLoadingToast();
  88. })
  89. };
  90. getTaskInfoList();
  91. // 点击报名
  92. $scope.traincheckin = function (infoid) {
  93. $scope.signupModel.userid = UserService.id;
  94. $scope.signupModel.tid = infoid;
  95. $scope.signupModel.type = 1100;
  96. console.log($scope.signupModel);
  97. TechnicalBrokerPublishTrainService.traincheckin($scope.signupModel).then(function (response) {
  98. // console.log(response);
  99. if (response.result > 0) {
  100. UtilService.showMess("报名成功");
  101. $timeout(function () {
  102. // 报名后刷新列表
  103. getTrainInfoList();
  104. }, 1500);
  105. } else {
  106. UtilService.showMess("网络不给力,请重试");
  107. }
  108. $scope.hideLoadingToast();
  109. }, function () {
  110. UtilService.showMess("网络不给力,请重试");
  111. $scope.hideLoadingToast();
  112. })
  113. };
  114. //虚拟搜索框
  115. $scope.isShowSearchButton = true;
  116. $scope.showSearchButtonLeft = function () {
  117. $scope.isShowSearchButton = false;
  118. $(".showSearchInput").focus();
  119. };
  120. //清空搜索内容
  121. $scope.clearSearch = function () {
  122. $scope.isShowSearchButton = true;
  123. $scope.keyfilter.key = "";
  124. };
  125. // 编辑培训
  126. $scope.editTechnicalTask = function (trainid) {
  127. $scope.go('technicalBrokerEditTrain', {trainid: trainid});
  128. };
  129. //进入培训详情页
  130. $scope.goTrainContent=function (trainid) {
  131. $scope.go('technicalBrokerTaskListContent', {trainid: trainid});
  132. };
  133. //进入任务详情页
  134. $scope.goTaskContent=function () {
  135. $scope.go('technicalBrokerTaskDetail');
  136. };
  137. //进入发布培训页
  138. $scope.goPublisherTrain=function () {
  139. $scope.go('technicalBrokerPublishTrain');
  140. };
  141. //进入发布培训页
  142. $scope.goPublisherTask=function () {
  143. $scope.go('technicalBrokerPublishTask');
  144. };
  145. //进入编辑任务页
  146. $scope.goEditTask=function (trainid) {
  147. $scope.go('technicalBrokerEditTask', {trainid: trainid});
  148. };
  149. $scope.taskLists=[
  150. { logo:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
  151. title:"任务A",
  152. type:"认证",
  153. activitystatus:1,
  154. activityLeaveDays:5,
  155. taskStartTime:"2017-05-18",
  156. taskEndTime:"2017-08-18",
  157. taskPublisher:"武进科技在线",
  158. isEnterTask:false,
  159. context:"这是目前看到的最好的swoole课程,singwa老师的课每出必入,必跟,质量没得说!慕课出的几门实战都给了我不小的启发。人也超nice! 持续支持关注!",
  160. roleActivitySetupList:[
  161. { setupid:"3",
  162. funcname:"报名"
  163. }
  164. ],
  165. styles:[
  166. { styleType:"走企业"},
  167. { styleType:"录入需求"},
  168. { styleType:"录入成果转化"}
  169. ]
  170. },
  171. {logo:"//img.mukewang.com/574669dc0001993606000338-240-135.jpg",
  172. title:"任务B",
  173. type:"入门培训",
  174. activitystatus:2,
  175. activityLeaveDays:5,
  176. taskStartTime:"2017-05-18",
  177. taskEndTime:"2017-08-18",
  178. taskPublisher:"武进科技在线",
  179. isEnterTask:true,
  180. context:"一直想学习Swoole,看到出这门实战课没犹豫的直接买了,讲得很细,从编译,安装,异步,协程以及这中间穿插的各种小坑都给提到了,觉得很不错,更希望singwa老师出更多精品课程!!总之加油吧",
  181. roleActivitySetupList:[
  182. { setupid:"3",
  183. funcname:"报名"
  184. }
  185. ],
  186. styles:[
  187. { styleType:"走企业"},
  188. { styleType:"录入需求"},
  189. { styleType:"录入成果转化"}
  190. ]
  191. },
  192. {logo:"//img.mukewang.com/570761d200014d8b06000338-240-135.jpg",
  193. title:"任务C",
  194. type:"实战",
  195. activitystatus:3,
  196. activityLeaveDays:5,
  197. taskStartTime:"2017-05-18",
  198. taskEndTime:"2017-08-18",
  199. taskPublisher:"武进科技在线",
  200. isEnterTask:true,
  201. context:"丝袜老师我一直很崇拜,向来干货满满注重思想,所以新课程一出我就买了,swoole未来会很火,是PHPer必须掌握的技能,丝袜老师讲的很细致,也教了你如何去看swoole文档,公司下个项目本来要用wokerman,出于对丝袜老师教学质量的信",
  202. roleActivitySetupList:[
  203. { setupid:"3",
  204. funcname:"报名"
  205. }
  206. ],
  207. styles:[
  208. { styleType:"走企业"},
  209. { styleType:"录入需求"},
  210. { styleType:"录入成果转化"}
  211. ]
  212. },
  213. {logo:"//img.mukewang.com/564a92e8000171b006000338-240-135.jpg",
  214. title:"任务D",
  215. type:"项目申报",
  216. activitystatus:4,
  217. activityLeaveDays:5,
  218. taskStartTime:"2017-05-18",
  219. taskEndTime:"2017-08-18",
  220. hostunit:"武进科技在线",
  221. otherunit:"普适科技",
  222. isEnterTask:true,
  223. context:"用workerman开发过项目,其实很多东西和swoole差不多, swoole在技术选型的时候也看过文档,后来选了workerman自带分布式部署,性能其实也很够了,看到老师出了swoole也来支持一下,看了下前面的都偏基础,我主要看第6和10章,如果能学到自己没接触到或者一直不理解的,哪怕是一个知识点我觉得钱就没白花,希望以后会出偏大中型一点的实战项目,最后感谢老师,感谢自己,投资自己就是投资未来",
  224. roleActivitySetupList:[
  225. { setupid:"3",
  226. funcname:"报名"
  227. }
  228. ],
  229. styles:[
  230. { styleType:"走企业"},
  231. { styleType:"录入需求"},
  232. { styleType:"录入成果转化"}
  233. ]
  234. }
  235. ];
  236. //查看已报名的人员
  237. $scope.goReceivePer=function (trainid) {
  238. $scope.go("technicalBrokerRegisteredPerList", {trainid: trainid});
  239. };
  240. //查看接取任务人员列表
  241. $scope.goReceiveTaskPer=function () {
  242. $scope.go("technicalBrokerReceiveTaskPerList");
  243. }
  244. });