From 4896dab1007d0388bef3264e14265edde3f2033c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 8 Dec 2017 10:31:13 +0530 Subject: [PATCH] course details changes done --- Apollo/assets/js/controllers/dashboardCtrl.js | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index 3f3ba20a..ef2e9f53 100755 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -13,7 +13,6 @@ app.controller('dashboardCtrl', ["$scope","$rootScope", "toaster", "$filter", "n $scope.initCallTracking = function () { $rootScope.pendingFolloupDetails = []; - if(JSON.parse(localStorage.getItem('localObj')).localUserID!=null){ var getCallTrack = { method: 'POST', url: apiPoint.url + 'getDashboardCallTrack/', @@ -24,7 +23,25 @@ app.controller('dashboardCtrl', ["$scope","$rootScope", "toaster", "$filter", "n requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID } }; -$http(getCallTrack).then(function (response) { + $http(getCallTrack).then(function (response) { + /* if(response.data.status == 200 && response.data.followupStatus){ + $scope.currentDate = new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2); + + $scope.getFollowupDetails = response.data.details; + angular.forEach($scope.getFollowupDetails, function (value, key) { + if (($scope.currentDate) < (value[0].FollowupOn)) { + + $rootScope.pendingFolloupDetails.push(value[0]); + console.log($rootScope.pendingFolloupDetails); + } + + }); + + } + else{ + + }*/ + if (response.data.status == 200) { if (response.data.todayStatus) { @@ -37,15 +54,24 @@ $http(getCallTrack).then(function (response) { } if (response.data.todayPendingStatus) { $scope.currentDate = new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2); - + // $scope.currentDate = new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2); + $scope.currentDate=$filter('date')(new Date(), 'dd-MM-yyyy'); $scope.fetchFolloupDetails = response.data.PendingFolloupDetails.trackingDetails; angular.forEach($scope.fetchFolloupDetails, function (value, key) { - if (($scope.currentDate) < (value.FollowupOn)) { + + if (($scope.currentDate) > (value.FollowupOn) && (value.statusName!='CLOSE')) { + $rootScope.pendingFolloupDetails.push(value); } }); - $scope.emptyDataPending = false; + if($rootScope.pendingFolloupDetails.length==0){ + $scope.emptyDataPending = true; + } + else{ + $scope.emptyDataPending = false; + } + } else { $scope.pendingFolloupDetails = ""; @@ -68,7 +94,7 @@ $http(getCallTrack).then(function (response) { } }); -} + }; }]);