123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- angular.module('push')
- .controller('technicalBrokerSelfPublishTaskCtrl', function ($scope, TechnicalBrokerPublishTrainService, UserService, UtilService) {
- // 已发布的培训类别
- $scope.mold = 1;
- $scope.act ='train';
- $scope.keyfilter = {key: ""};//搜索关键词
- var activity = ['train', 'task'];
- $scope.changeAct = function (num) {
- $scope.act = activity[num];
- };
- $scope.type = 1;// 我接收的任务类别
- $scope.personModel = {
- userid: 0,// 用户id
- tid: 0// 任务id
- };
- //获取已发布的培训列表
- $scope.traininfolist=[
- {
- id: 0,
- title: "",
- content: "",
- trainbegintime: "",
- signupenddate: "",
- areaid: 0,
- areaname: "",
- detailaddress: "",// 详细地址
- isactive: 1,// 培训状态:是否有效,0无效,1有效
- sponsors: "",// 传到后台的主办方/协办方json stype:类别:1.主办方 2.协办方
- sponsorlist: [],// 取得详情里的主办方
- imagelist: [],// app端图片插件进行传递的变量
- logo:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
- firstpic:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
- trainstatus:1,
- trainstatusname:"",// 培训状态名称
- trainLeaveDays:5,// 报名剩余天数
- traincount:5,// 培训总数
- signupcount:255,// 已报名总数
- isedit:0,// 是否有编辑权限:0无 1有
- traintype: 0,// 培训种类
- traintypename: "",// 培训种类名称
- creator: 0,
- creatorname: "",
- creatorphoto: ""// 用户logo
- }
- ];
- // 任务列表
- $scope.taskinfolist=[
- {
- userid: 0,
- usercomefrom: "000000000",
- id: 0,
- taskstyle: 0,
- taskstylename: "",
- title: "",
- content: "",
- isactive: 1,// 任务状态:是否有效,0无效,1有效
- begintime: "",
- endtime: "",
- taskstatus:1,
- taskstatusname:"",// 任务状态名称
- signupstatus:1,
- signupstatusname:"",// 报名状态名称
- taskLeaveDays:5,// 剩余天数
- taskcount:5,// 任务总数
- signupcount:255,// 已报名任务人总数
- isedit:0,// 是否有编辑权限:0无 1有
- creator: 0,
- creatorname: "",
- createtime: "",
- creatorphoto: ""// 用户logo
- }
- ];
- // 获取已发布的培训列表
- var getTrainInfoList = function () {
- $scope.showLoadingToast();
- TechnicalBrokerPublishTrainService.getTrainInfoList($scope.mold).then(function (response) {
- // console.log(response);
- $scope.traincount = response.traincount;
- $scope.traininfolist = response.traininfolist;
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- getTrainInfoList();
- // 编辑培训
- $scope.editTechnicalTask = function (trainid) {
- $scope.go('technicalBrokerEditTrain', {trainid: trainid});
- };
- //进入培训详情页
- $scope.goTrainContent=function (trainid) {
- $scope.go('technicalBrokerTaskListContent', {trainid: trainid});
- };
- // 获取参与待接任务列表
- var getTaskInfoList = function (type) {
- $scope.showLoadingToast();
- TechnicalBrokerPublishTrainService.getTaskInfoList(type).then(function (response) {
- // console.log(response);
- $scope.taskcount = response.taskcount;
- $scope.taskinfolist = response.taskinfolist;
- // console.log($scope.taskinfolist);
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- getTaskInfoList($scope.type);
- //任务详情页
- $scope.goTaskContent = function (taskid) {
- $scope.go("technicalBrokerTaskDetail", {taskid: taskid});
- };
- // 编辑任务
- $scope.editTaskInfo = function (taskid) {
- $scope.go('technicalBrokerEditTask', {taskid: taskid});
- };
- //虚拟搜索框
- $scope.isShowSearchButton = true;
- $scope.keyfilter = {key: ""};//搜索关键词
- $scope.showSearchButtonLeft = function () {
- $scope.isShowSearchButton = false;
- $(".showSearchInput").focus();
- };
- //清空搜索内容
- $scope.clearSearch = function () {
- $scope.isShowSearchButton = true;
- $scope.keyfilter.key = "";
- };
- // 我已发布的培训列表
- $scope.selfTraincount=12;
- $scope.selfTraininfolist=[
- {creatorname:"创建者名称",
- creatorphoto:"//img4.mukewang.com/szimg/5abe148300014c3305400300.jpg",
- signupbegindate:"2015-05-18",
- firstpic:"http://wx3.sinaimg.cn/large/654b47daly1fqo6k1nwbxj21kw11xx6q.jpg",
- detailaddress:"培训地点" ,
- trainbegintime:"2017-06-18",
- sponsorlist:[{
- sponsorname:"主办发名称"
- }],
- trainstatus:1,
- trainLeaveDays:"25",
- signupcount:23
- }
- ];
- // 获取已发布的培训列表
- var getSelfTraininfolist = function () {
- $scope.showLoadingToast();
- TechnicalBrokerPublishTrainService.getTrainInfoList().then(function (response) {
- // console.log(response);
- $scope.traincount = response.traincount;
- $scope.traininfolist = response.traininfolist;
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- //getSelfTraininfolist();
- //进入发布任务页
- $scope.goPublisherTask=function () {
- $scope.go('technicalBrokerPublishTask');
- };
- });
|