Commit 1d6f10ce authored by Prayas Jain's avatar Prayas Jain

Updated EmpSubStatus as per the changed status from backend

parent 85d15817
...@@ -25,7 +25,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -25,7 +25,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: true, enableSorting: true,enableFiltering: true,cellClass: 'grid-align',width:180}, {field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: true, enableSorting: true,enableFiltering: true,cellClass: 'grid-align',width:180},
{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'}, {field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false,cellClass: 'grid-align'},
{field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80}, {field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80},
{field : 'empSubStatus',displayName: 'Sub Status', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:140,cellClass:function(grid,row,col){ {field : 'empSubStatus.subStatus',displayName: 'Sub Status', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:140,cellClass:function(grid,row,col){
if(grid.getCellValue(row,col)==='Maternity Leave') { if(grid.getCellValue(row,col)==='Maternity Leave') {
return 'blue'; return 'blue';
...@@ -78,7 +78,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -78,7 +78,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.parentData.designation = row.entity.designation; $scope.parentData.designation = row.entity.designation;
$scope.parentData.functionalGroup = row.entity.functionalGroup; $scope.parentData.functionalGroup = row.entity.functionalGroup;
$scope.parentData.empStatus = row.entity.empStatus; $scope.parentData.empStatus = row.entity.empStatus;
$scope.parentData.empSubStatus =row.entity.empSubStatus; $scope.parentData.empSubStatus = (row.entity.empSubStatus == null) ? null : row.entity.empSubStatus.subStatus;
$scope.parentData.employmentType = row.entity.employmentType; $scope.parentData.employmentType = row.entity.employmentType;
$scope.parentData.domain = row.entity.domain; $scope.parentData.domain = row.entity.domain;
$scope.parentData.dateOfJoining = row.entity.dateOfJoining; $scope.parentData.dateOfJoining = row.entity.dateOfJoining;
...@@ -88,8 +88,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -88,8 +88,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.parentData.passportExpiryDate = row.entity.passportExpiryDate; $scope.parentData.passportExpiryDate = row.entity.passportExpiryDate;
$scope.parentData.b1ExpiryDate = row.entity.b1ExpiryDate; $scope.parentData.b1ExpiryDate = row.entity.b1ExpiryDate;
$scope.parentData.endDate = row.entity.endDate; $scope.parentData.endDate = row.entity.endDate;
$scope.parentData.subStatusStartDate = row.entity.subStatusStartDate; $scope.parentData.subStatusStartDate = (row.entity.empSubStatus == null) ? null : row.entity.empSubStatus.fromDate;
$scope.parentData.subStatusEndDate = row.entity.subStatusEndDate; $scope.parentData.subStatusEndDate = (row.entity.empSubStatus == null) ? null : row.entity.empSubStatus.toDate;
if(action == "Update") if(action == "Update")
$scope.assignRole(action, $scope.parentData); $scope.assignRole(action, $scope.parentData);
else if(action == "Delete") else if(action == "Delete")
...@@ -439,10 +439,14 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -439,10 +439,14 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
} }
return false; return false;
} }
$scope.changeEmpSubStatus = function(){
$scope.subStatusStartDate = null;
$scope.subStatusEndDate = null;
$('.md-datepicker-input')[3].value = null;
$('.md-datepicker-input')[4].value = null;
}
$scope.validateFields = function(){ $scope.validateFields = function(){
var today = new Date(); var today = new Date();
if($scope.templateTitle == "Add"){ if($scope.templateTitle == "Add"){
$scope.empStatus ="Active"; $scope.empStatus ="Active";
} }
...@@ -474,8 +478,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -474,8 +478,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
var prevEmpSubStatusObj = { var prevEmpSubStatusObj = {
employeeID: dataToPass.employeeId, employeeID: dataToPass.employeeId,
subStatus : dataToPass.empSubStatus, subStatus : dataToPass.empSubStatus,
fromDate: dataToPass.subStatusStartDate, fromDate: (dataToPass.subStatusStartDate == null) ? null : new Date(dataToPass.subStatusStartDate),
toDate: dataToPass.subStatusEndDate toDate: (dataToPass.subStatusEndDate == null) ? null : new Date(dataToPass.subStatusEndDate)
}; };
if(searchId == ""){ if(searchId == ""){
$scope.alertMsg = "Employee Id is mandatory"; $scope.alertMsg = "Employee Id is mandatory";
...@@ -510,7 +514,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -510,7 +514,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.alertMsg = "Please select a SubStatus start Date"; $scope.alertMsg = "Please select a SubStatus start Date";
document.getElementById('subStatusStartDate').focus(); document.getElementById('subStatusStartDate').focus();
} }
else if($scope.templateTitle != "Add" && subStatusStartDate == undefined && empSubStatus != null && empSubStatus != ''){ else if($scope.templateTitle != "Add" && subStatusEndDate == undefined && empSubStatus != null && empSubStatus != ''){
$scope.alertMsg = "Please select a SubStatus end Date"; $scope.alertMsg = "Please select a SubStatus end Date";
document.getElementById('subStatusEndDate').focus(); document.getElementById('subStatusEndDate').focus();
} }
...@@ -647,8 +651,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -647,8 +651,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
var prevEmpSubStatusObj = { var prevEmpSubStatusObj = {
employeeID: dataToPass.employeeId, employeeID: dataToPass.employeeId,
subStatus : dataToPass.empSubStatus, subStatus : dataToPass.empSubStatus,
fromDate: dataToPass.subStatusStartDate, fromDate: (dataToPass.subStatusStartDate == null) ? null : new Date(dataToPass.subStatusStartDate),
toDate: dataToPass.subStatusEndDate toDate: (dataToPass.subStatusEndDate == null) ? null : new Date(dataToPass.subStatusEndDate)
}; };
var record = { var record = {
"employeeId":$scope.empId, "employeeName": $scope.empName, "gender": $scope.gender,"emailId": $scope.empEmail, "employeeId":$scope.empId, "employeeName": $scope.empName, "gender": $scope.gender,"emailId": $scope.empEmail,
......
...@@ -609,7 +609,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -609,7 +609,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
'<i ng-show="row.entity.editrow" class="fa fa-save fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Save" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.saveRow(row.entity,\'Update\')"></i>' '<i ng-show="row.entity.editrow" class="fa fa-save fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Save" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.saveRow(row.entity,\'Update\')"></i>'
+'&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.cancelEdit(row.entity)"></i>' +'&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.cancelEdit(row.entity)"></i>'
+'<i ng-show="grid.appScope.showMoveToBenchIcon(row.entity) && !row.entity.editrow" id="moveResource" class="fa fa-arrow-circle-right fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Release" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.moveToBench(row.entity)"></i>'+ +'<i ng-show="grid.appScope.showMoveToBenchIcon(row.entity) && !row.entity.editrow" id="moveResource" class="fa fa-arrow-circle-right fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Release" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.moveToBench(row.entity)"></i>'+
'<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="moveToProject" class="fa fa-arrow-circle-left fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Engage" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.changeAllocationStatusToEngaged(row.entity)"></i>'+ '<i ng-show="grid.appScope.showMoveToEngageIcon(row.entity)" id="moveToProject" class="fa fa-arrow-circle-left fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Engage" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.changeAllocationStatusToEngaged(row.entity)"></i>'+
'&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="deleteResource" class="fa fa-trash fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.deleteProposedResource(row.entity)"></i></p>'; '&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="deleteResource" class="fa fa-trash fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.deleteProposedResource(row.entity)"></i></p>';
//'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>'; //'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>';
...@@ -700,6 +700,14 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -700,6 +700,14 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
return true; return true;
} }
} }
$scope.showMoveToEngageIcon = function(row){
var today = new Date();
today.setHours(0, 0, 0, 0);
if(row.status =="Proposed" && !row.editrow && today >= new Date(row.billingStartDate)) {
return true;
}
}
$scope.parentData = { $scope.parentData = {
"employeeId":"", "employeeId":"",
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<tr ng-show="empStatus == 'Active' && templateTitle != 'Add' " > <tr ng-show="empStatus == 'Active' && templateTitle != 'Add' " >
<td colspan="4"><b>Select Sub Status :</b></td> <td colspan="4"><b>Select Sub Status :</b></td>
<td colspan="8"><md-select ng-model="empSubStatus" name ="empSubStatus" <td colspan="8"><md-select ng-model="empSubStatus" name ="empSubStatus"
ng-model ="empSubStatus" placeholder ="Select a Sub Status Type" id="empSubStatus"> ng-model ="empSubStatus" placeholder ="Select a Sub Status Type" id="empSubStatus" ng-change="changeEmpSubStatus()">
<md-optgroup label="Sub Status Type"> <md-optgroup label="Sub Status Type">
<md-option ng-value ="None">None</md-option> <md-option ng-value ="None">None</md-option>
<md-option ng-value="status" ng-repeat="status in empSubStatuses">{{status}}</md-option> <md-option ng-value="status" ng-repeat="status in empSubStatuses">{{status}}</md-option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment