course details changes done

This commit is contained in:
gandhimathi 2017-12-08 10:31:13 +05:30
parent 08e4f57b4c
commit 4896dab100

View File

@ -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) {
}
});
}
};
}]);