course details changes done
This commit is contained in:
parent
e5c7aba490
commit
6c8471feae
@ -1427,7 +1427,26 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
|
||||
* update the follow up details
|
||||
* created by kms
|
||||
* */
|
||||
$rootScope.updateFollowup = function (followupDetails,myModel1, loading) {
|
||||
$rootScope.updateFollowup = function (form,followupDetails,myModel1, loading) {
|
||||
var firstError = null;
|
||||
if (form.$invalid) {
|
||||
|
||||
var field = null, firstError = null;
|
||||
for (field in form) {
|
||||
if (field[0] != '$') {
|
||||
if (firstError === null && !form[field].$valid) {
|
||||
firstError = form[field].$name;
|
||||
}
|
||||
if (form[field].$pristine) {
|
||||
form[field].$dirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
}
|
||||
else{
|
||||
|
||||
if(isNaN(myModel1.date)){
|
||||
$scope.nextFollowupDate = myModel1.date;
|
||||
|
||||
@ -1479,6 +1498,9 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
|
||||
comments: myModel1.comments,
|
||||
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
branchId: $scope.updateBranchID,
|
||||
address: myModel1.Address,
|
||||
alternateMobile: myModel1.AlternateMobile,
|
||||
referredBy: myModel1.ReferredBy,
|
||||
}
|
||||
};
|
||||
$http(update).then(function (response) {
|
||||
@ -1493,6 +1515,7 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
$rootScope.loadFollowupDetails = function (trackID) {
|
||||
|
||||
@ -1515,8 +1538,13 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
|
||||
if (response.data.status==200 && response.data.followupStatus) {
|
||||
$rootScope.followupDetails=response.data.trackingDetails[0];
|
||||
$rootScope.myModel1.status=$rootScope.followupDetails.StatusCode;
|
||||
if($rootScope.followupDetails.followupDetails[0].FollowupOn.length==10){
|
||||
$rootScope.currentDate1 = new Date($rootScope.followupDetails.followupDetails[0].FollowupOn.substring(6,10)+'-'+$rootScope.followupDetails.followupDetails[0].FollowupOn.substring(3,5)+'-'+$rootScope.followupDetails.followupDetails[0].FollowupOn.substring(0,2));
|
||||
}
|
||||
else{
|
||||
$rootScope.currentDate1=new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2);
|
||||
|
||||
$rootScope.currentDate1=new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2);
|
||||
}
|
||||
|
||||
$rootScope.myModel1.date=$rootScope.followupDetails.followupDetails[0].FollowupOn;
|
||||
// get 30 plus date for follwup details
|
||||
@ -1527,6 +1555,9 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
|
||||
$rootScope.trackingStatus=response.data.statusDetails;
|
||||
$rootScope.myModel1.branch=$rootScope.followupDetails.CreatedBranch;
|
||||
$rootScope.myModel1.assignStaff=$rootScope.followupDetails.AssignedTo;
|
||||
$rootScope.myModel1.AlternateMobile=$rootScope.followupDetails.AlternateMobile;
|
||||
$rootScope.myModel1.Address=$rootScope.followupDetails.Address;
|
||||
$rootScope.myModel1.ReferredBy=$rootScope.followupDetails.ReferredBy;
|
||||
$rootScope.staffArray='';
|
||||
$rootScope.staffDetails=response.data.staffDetails;
|
||||
if($scope.userType =='R004'){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user