course details changes done

This commit is contained in:
gandhimathi 2018-01-24 16:30:17 +05:30
parent bbb625aacd
commit 7f93c9f9a3

View File

@ -497,11 +497,6 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
}
}]);
/*
@ -512,7 +507,10 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
localStorage.setItem('searchMobile','');
$scope.myModel = {
"leadDate": new Date(),
};
"search":$filter('date')(new Date(), 'yyyy-MM-dd')
};
$scope.hideDateSearch=true;
//get current date
@ -522,21 +520,33 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
$scope.modifyDate = moment();
$scope.modifyDate.add(30, 'days');
$scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy');
if(localStorage.getItem('searchObj') !='' && localStorage.getItem('searchObj') !=null && localStorage.getItem('searchObj') !=undefined){
$scope.myModel.leadDate = $filter('date')(JSON.parse(localStorage.getItem('searchObj')).fromDate, 'dd-MM-yyyy');
$scope.myModel.search = JSON.parse(localStorage.getItem('searchObj')).fromDate;
localStorage.setItem('searchObj','');
}
else{
$scope.myModel.leadDate=$scope.currentDate;
}
$scope.myModel.leadDate=$scope.currentDate;
/*
* edit track details
* created by kms
* */
$scope.setEditId = function (p,search1,search2,search3,search4,search5) {
$scope.setEditId = function (p,search1,search2,search3,search4,search5,fromDate) {
$scope.changeFromDate= $filter('date')(fromDate, 'yyyy-MM-dd');
$scope.searchData = {
"searchDate": search1,
"searchName": search2,
'serachActivity': search3,
'searchAssignTo': search4,
'searchStatus': search5,
'callFrom': "lead"
'callFrom': "lead",
'fromDate':$scope.changeFromDate
}
@ -561,13 +571,58 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
}
/*
* mark call as important
* created by kms
* */
$scope.markAsImportant = function (trackID,flag) {
var markas = {
method: 'POST',
url: apiPoint.url + 'callAsImportantFlag/',
headers: {
'Content-Type': 'application/json'
},
data: {
flag:flag,
trackId:trackID,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(markas).then(function (response) {
if (response.data.status==200 && response.data.updatedStatus) {
$scope.init($scope.myModel);
} else {
$scope.init($scope.myModel);
}
});
}
//from date change
$scope.checkDate = function (value) {
$scope.myModel.search = $filter('date')(value.leadDate, 'yyyy-MM-dd');
$scope.init($scope.myModel);
}
/*
*get tracking list
* created by kms
* */
$scope.init = function (form,myModel) {
$scope.init = function (myModel) {
if(isNaN(myModel.leadDate)){
/* if(isNaN(myModel.leadDate)){
$scope.loadDate= $filter('date')(new Date(), 'yyyy-MM-dd');
}
@ -578,7 +633,9 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
$scope.getdate=new Date(myModel.leadDate).toDateString();
$scope.loadDate = $filter('date')(new Date($scope.getdate), 'yyyy-MM-dd');
}
}*/
$scope.loader = true;
var getRecentlead = {
@ -588,7 +645,7 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
'Content-Type': 'application/json'
},
data: {
loadDate:$scope.loadDate,
loadDate:myModel.search,
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID
@ -639,7 +696,9 @@ app.controller('callTrackingCloseCtrl', ["$scope","$rootScope","toaster", "$filt
localStorage.setItem('searchMobile','');
$scope.myModel = {
"closeDate": new Date(),
"search":$filter('date')(new Date(), 'yyyy-MM-dd')
};
$scope.hideDateSearch=true;
//get current date
@ -650,23 +709,34 @@ app.controller('callTrackingCloseCtrl', ["$scope","$rootScope","toaster", "$filt
$scope.modifyDate.add(30, 'days');
$scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy');
$scope.myModel.closeDate=$scope.currentDate;
if(localStorage.getItem('searchObj') !='' && localStorage.getItem('searchObj') !=null && localStorage.getItem('searchObj') !=undefined){
$scope.myModel.closeDate = $filter('date')(JSON.parse(localStorage.getItem('searchObj')).fromDate, 'dd-MM-yyyy');
$scope.myModel.search = JSON.parse(localStorage.getItem('searchObj')).fromDate;
localStorage.setItem('searchObj','');
}
else{
$scope.myModel.closeDate=$scope.currentDate;
}
/*
* edit track details
* created by kms
* */
$scope.setEditId = function (p,search1,search2,search3,search4,search5) {
$scope.setEditId = function (p,search1,search2,search3,search4,search5,fromDate) {
$scope.changeFromDate= $filter('date')(fromDate, 'yyyy-MM-dd');
$scope.searchData = {
"searchDate": search1,
"searchName": search2,
'serachActivity': search3,
'searchAssignTo': search4,
'searchStatus': search5,
'callFrom': "close"
'callFrom': "close",
'fromDate':$scope.changeFromDate
}
localStorage.setItem('searchObj', JSON.stringify($scope.searchData));
localStorage.setItem('trackID', p.TrackingID);
localStorage.setItem('count', 0);
@ -685,6 +755,48 @@ app.controller('callTrackingCloseCtrl', ["$scope","$rootScope","toaster", "$filt
$scope.sortKey = keyname; //set the sortKey to the param passed
$scope.reverse = !$scope.reverse; //if true make it false and vice versa
}
//from date change
$scope.checkDate = function (value) {
$scope.myModel.search = $filter('date')(value.closeDate, 'yyyy-MM-dd');
$scope.init($scope.myModel);
}
/*
* mark call as important
* created by kms
* */
$scope.markAsImportant = function (trackID,flag) {
var markas = {
method: 'POST',
url: apiPoint.url + 'callAsImportantFlag/',
headers: {
'Content-Type': 'application/json'
},
data: {
flag:flag,
trackId:trackID,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(markas).then(function (response) {
if (response.data.status==200 && response.data.updatedStatus) {
$scope.init($scope.myModel);
} else {
$scope.init($scope.myModel);
}
});
}
@ -692,9 +804,9 @@ app.controller('callTrackingCloseCtrl', ["$scope","$rootScope","toaster", "$filt
*get tracking list
* created by kms
* */
$scope.init = function (form,myModel) {
$scope.init = function (myModel) {
if(isNaN(myModel.closeDate)){
/* if(isNaN(myModel.closeDate)){
$scope.loadDate= $filter('date')(new Date(), 'yyyy-MM-dd');
}
@ -705,7 +817,7 @@ app.controller('callTrackingCloseCtrl', ["$scope","$rootScope","toaster", "$filt
$scope.getdate=new Date(myModel.closeDate).toDateString();
$scope.loadDate = $filter('date')(new Date($scope.getdate), 'yyyy-MM-dd');
}
}*/
$scope.loader = true;
var getRecentclose = {
@ -715,7 +827,7 @@ app.controller('callTrackingCloseCtrl', ["$scope","$rootScope","toaster", "$filt
'Content-Type': 'application/json'
},
data: {
loadDate:$scope.loadDate,
loadDate:myModel.search,
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID
@ -767,7 +879,9 @@ app.controller('callTrackingPendingCtrl', ["$scope","$rootScope","toaster", "$fi
localStorage.setItem('searchMobile','');
$scope.myModel = {
"pendingDate": new Date(),
"search":$filter('date')(new Date(), 'yyyy-MM-dd')
};
$scope.hideDateSearch=true;
//get current date
@ -778,20 +892,32 @@ app.controller('callTrackingPendingCtrl', ["$scope","$rootScope","toaster", "$fi
$scope.modifyDate.add(30, 'days');
$scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy');
$scope.myModel.pendingDate=$scope.currentDate;
if(localStorage.getItem('searchObj') !='' && localStorage.getItem('searchObj') !=null && localStorage.getItem('searchObj') !=undefined){
$scope.myModel.pendingDate = $filter('date')(JSON.parse(localStorage.getItem('searchObj')).fromDate, 'dd-MM-yyyy');
$scope.myModel.search = JSON.parse(localStorage.getItem('searchObj')).fromDate;
localStorage.setItem('searchObj','');
}
else{
$scope.myModel.pendingDate=$scope.currentDate;
}
/*
* edit track details
* created by kms
* */
$scope.setEditId = function (p,search1,search2,search3,search4,search5) {
$scope.setEditId = function (p,search1,search2,search3,search4,search5,fromDate) {
$scope.changeFromDate= $filter('date')(fromDate, 'yyyy-MM-dd');
$scope.searchData = {
"searchDate": search1,
"searchName": search2,
'serachActivity': search3,
'searchAssignTo': search4,
'searchStatus': search5,
'callFrom': "pending"
'callFrom': "pending",
'fromDate':$scope.changeFromDate
}
@ -814,15 +940,56 @@ app.controller('callTrackingPendingCtrl', ["$scope","$rootScope","toaster", "$fi
$scope.reverse = !$scope.reverse; //if true make it false and vice versa
}
/*
* mark call as important
* created by kms
* */
$scope.markAsImportant = function (trackID,flag) {
var markas = {
method: 'POST',
url: apiPoint.url + 'callAsImportantFlag/',
headers: {
'Content-Type': 'application/json'
},
data: {
flag:flag,
trackId:trackID,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID
}
};
$http(markas).then(function (response) {
if (response.data.status==200 && response.data.updatedStatus) {
$scope.init($scope.myModel);
} else {
$scope.init($scope.myModel);
}
});
}
//from date change
$scope.checkDate = function (value) {
$scope.myModel.search = $filter('date')(value.pendingDate, 'yyyy-MM-dd');
$scope.init($scope.myModel);
}
/*
*get tracking list
* created by kms
* */
$scope.init = function (form,myModel) {
$scope.init = function (myModel) {
if(isNaN(myModel.pendingDate)){
/* if(isNaN(myModel.pendingDate)){
$scope.loadDate= $filter('date')(new Date(), 'yyyy-MM-dd');
}
@ -833,7 +1000,7 @@ app.controller('callTrackingPendingCtrl', ["$scope","$rootScope","toaster", "$fi
$scope.getdate=new Date(myModel.pendingDate).toDateString();
$scope.loadDate = $filter('date')(new Date($scope.getdate), 'yyyy-MM-dd');
}
}*/
$scope.loader = true;
var getRecentclose = {
@ -843,7 +1010,7 @@ app.controller('callTrackingPendingCtrl', ["$scope","$rootScope","toaster", "$fi
'Content-Type': 'application/json'
},
data: {
loadDate:$scope.loadDate,
loadDate:myModel.search,
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID