angular.module('push') .controller('technicalBrokerNotReceiveTaskCtrl', function ($scope, TechnicalBrokerPublishTrainService, UserService, UtilService) { $scope.type = 3;// 待接收类别 //虚拟搜索框 $scope.isShowSearchButton = true; $scope.showSearchButtonLeft = function () { $scope.isShowSearchButton = false; $(".showSearchInput").focus(); }; $scope.keyfilter = {key: ""};//搜索关键词 //清空搜索内容 $scope.clearSearch = function () { $scope.isShowSearchButton = true; $scope.keyfilter.key = ""; }; $scope.personModel = { userid: 0,// 用户id tid: 0// 任务id }; // 任务列表 $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 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.signupTask = function (infoid) { $scope.personModel.userid = UserService.id; $scope.personModel.tid = infoid; console.log($scope.personModel); TechnicalBrokerPublishTrainService.signupTask($scope.personModel).then(function (response) { // console.log(response); if (response.result > 0) { UtilService.showMess("接取成功"); $timeout(function () { }, 1500); } else { UtilService.showMess("网络不给力,请重试"); } $scope.hideLoadingToast(); }, function () { UtilService.showMess("网络不给力,请重试"); $scope.hideLoadingToast(); }) }; //跳转到已接取的任务 $scope.goHaveReciveTask=function () { $scope.go("technicalBrokerSelfReceiveTask"); } });