Commit 00214a68 authored by Prayas Jain's avatar Prayas Jain

Update_Team_Details

parent fe57dccc
...@@ -619,7 +619,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -619,7 +619,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
{ field: 'employeeName', displayName: 'Emp Name ', enableColumnMenu: false, enableSorting: false,enableFiltering:true }, { field: 'employeeName', displayName: 'Emp Name ', enableColumnMenu: false, enableSorting: false,enableFiltering:true },
// { field: 'emailId', displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false }, // { field: 'emailId', displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false },
// { field: 'experience', displayName: 'Exp', enableColumnMenu: true, enableSorting: true, width: 80 }, // { field: 'experience', displayName: 'Exp', enableColumnMenu: true, enableSorting: true, width: 80 },
{field: 'role', displayName:'Role', enableColumnMenu: true, enableSorting: false,enableFiltering:false}, {field: 'resourceRole', displayName:'Role', enableColumnMenu: true, enableSorting: false,enableFiltering:false},
{ field: 'designation', displayName: 'Designation ', enableColumnMenu: false, enableSorting: false,enableFiltering:false }, { field: 'designation', displayName: 'Designation ', enableColumnMenu: false, enableSorting: false,enableFiltering:false },
// { field: 'active', displayName: 'Status ', enableColumnMenu: false, enableSorting: false, cellTemplate: getCellActiveTemplate }, // { field: 'active', displayName: 'Status ', enableColumnMenu: false, enableSorting: false, cellTemplate: getCellActiveTemplate },
{ field: 'billableStatus', displayName: 'Billability ', enableColumnMenu: false, enableSorting: false ,enableFiltering:false}, { field: 'billableStatus', displayName: 'Billability ', enableColumnMenu: false, enableSorting: false ,enableFiltering:false},
...@@ -644,10 +644,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -644,10 +644,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
} }
$scope.gridOptions.data = response.data.records; $scope.gridOptions.data = response.data.records;
for(i=0;i<response.data.records.length;i++){ for(i=0;i<response.data.records.length;i++){
if(response.data.records[i].role == 'Lead'){ if(response.data.records[i].resourceRole == 'Lead'){
$scope.gridOptions.data[i].role = "Lead"; $scope.gridOptions.data[i].resourceRole = "Lead";
}else{ }else{
$scope.gridOptions.data[i].role = "Individual Contributor"; $scope.gridOptions.data[i].resourceRole = "Individual Contributor";
} }
} }
}, function myError(response) { }, function myError(response) {
...@@ -683,6 +683,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -683,6 +683,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}; };
$scope.getRowData = function(row, action){ $scope.getRowData = function(row, action){
console.log(row.entity)
$scope.parentData.employeeId = row.entity.employeeId; $scope.parentData.employeeId = row.entity.employeeId;
$scope.parentData.employeeName = row.entity.employeeName; $scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId; $scope.parentData.emailId = row.entity.emailId;
...@@ -697,9 +698,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -697,9 +698,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.parentData.shift = row.entity.shift; $scope.parentData.shift = row.entity.shift;
$scope.parentData.mobileNumber = row.entity.mobileNumber; $scope.parentData.mobileNumber = row.entity.mobileNumber;
$scope.parentData.employeeModel = {} $scope.parentData.employeeModel = {}
$scope.parentData.newBillingStartDate = row.entity.newBillingStartDate; $scope.parentData.newBillingStartDate = row.entity.billingStartDate;
$scope.parentData.startDate = new Date(row.entity.startDate); $scope.parentData.startDate = new Date(row.entity.startDate);
$scope.parentData.endDate = new Date(row.entity.endDate); $scope.parentData.endDate = new Date(row.entity.billingEndDate);
console.log($scope.parentData)
if(action == "UpdateTeam"){ if(action == "UpdateTeam"){
$scope.updateTeamMate(action, $scope.parentData); $scope.updateTeamMate(action, $scope.parentData);
} }
...@@ -757,7 +759,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -757,7 +759,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
// $scope.employeeModel.employeeName = userData.employeeName; // $scope.employeeModel.employeeName = userData.employeeName;
// $scope.employeeModel.emailId = userData.emailId; // $scope.employeeModel.emailId = userData.emailId;
$scope.empBillableStatus = userData.billableStatus; $scope.empBillableStatus = userData.billableStatus;
if(userData.role == "Individual Contributor"){ if(userData.resourceRole == "Individual Contributor"){
$scope.employeeRole = "Employee"; $scope.employeeRole = "Employee";
}else{ }else{
$scope.employeeRole = "Lead"; $scope.employeeRole = "Lead";
...@@ -924,7 +926,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -924,7 +926,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$('.md-datepicker-input')[0].value = null; $('.md-datepicker-input')[0].value = null;
} }
else{ else{
$('.md-datepicker-input')[3].value = null; $('.md-datepicker-input')[3].value = new Date($scope.projectEndDate).toISOString().slice(0,10);
} }
} }
...@@ -1188,9 +1190,6 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1188,9 +1190,6 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
else if($scope.empBillableStatus == undefined){ else if($scope.empBillableStatus == undefined){
$scope.alertMsg = "Please select a billable status"; $scope.alertMsg = "Please select a billable status";
angular.element(document.getElementById('empBillableStatus')).focus(); angular.element(document.getElementById('empBillableStatus')).focus();
}else if($scope.startDate == undefined) {
$scope.alertMsg = "Please select Start Date";
angular.element(document.getElementById('startDate')).focus();
} }
else if($scope.endDate == undefined) { else if($scope.endDate == undefined) {
$scope.alertMsg = "Please select End Date"; $scope.alertMsg = "Please select End Date";
...@@ -1207,7 +1206,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1207,7 +1206,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
else if(!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate))){ else if(!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate))){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date"; $scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date";
} }
else if (!(($scope.newBillingStartDate >= $scope.startDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){ else if (!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date"; $scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date";
}else if($scope.endDate > new Date(dataToPass.projectEndDate)){ }else if($scope.endDate > new Date(dataToPass.projectEndDate)){
$scope.alertMsg = "End date should not exceed project end date"; $scope.alertMsg = "End date should not exceed project end date";
...@@ -1357,7 +1356,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1357,7 +1356,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
}; };
$scope.DataUpdate = function () { $scope.DataUpdate = function () {
var data = $scope.parentData; var data = $scope.parentData;
if (data.role == "Individual Contributor") { if (data.resourceRole == "Individual Contributor") {
var roleselected = "Employee"; var roleselected = "Employee";
} else { } else {
roleselected = data.role; roleselected = data.role;
...@@ -1485,10 +1484,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1485,10 +1484,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
else if(action == "Add"){ else if(action == "Add"){
$scope.gridOptions.data.push(record); $scope.gridOptions.data.push(record);
for(i=0;i<$scope.gridOptions.data.length;i++){ for(i=0;i<$scope.gridOptions.data.length;i++){
if($scope.gridOptions.data[i].role == 'Lead'){ if($scope.gridOptions.data[i].resourceRole == 'Lead'){
$scope.gridOptions.data[i].role = "Lead"; $scope.gridOptions.data[i].resourceRole = "Lead";
}else{ }else{
$scope.gridOptions.data[i].role = "Individual Contributor"; $scope.gridOptions.data[i].resourceRole = "Individual Contributor";
} }
} }
} }
...@@ -1532,7 +1531,6 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1532,7 +1531,6 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
else{ else{
$scope.alertMsg=response.data.message; $scope.alertMsg=response.data.message;
} }
}, function myError(response){ }, function myError(response){
$scope.result = "Error"; $scope.result = "Error";
}); });
...@@ -1550,10 +1548,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1550,10 +1548,10 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.gridOptions.columnDefs[5].visible = true; $scope.gridOptions.columnDefs[5].visible = true;
} }
for(i=0;i<$scope.gridOptions.data.length;i++){ for(i=0;i<$scope.gridOptions.data.length;i++){
if($scope.gridOptions.data[i].role == 'Lead'){ if($scope.gridOptions.data[i].resourceRole == 'Lead'){
$scope.gridOptions.data[i].role = "Lead"; $scope.gridOptions.data[i].resourceRole = "Lead";
}else{ }else{
$scope.gridOptions.data[i].role = "Individual Contributor"; $scope.gridOptions.data[i].resourceRole = "Individual Contributor";
} }
} }
}, function myError(response) { }, function myError(response) {
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</md-select> </md-select>
</td> </td>
</tr> </tr>
<!-- <tr> <!-- <tr>
<td class="Employee">Employee Name : </td> <td class="Employee">Employee Name : </td>
<td>{{employeeModel.employeeName}}</td> <td>{{employeeModel.employeeName}}</td>
</tr> --> </tr> -->
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</md-select> </md-select>
</td> </td>
</tr> </tr>
<tr> <!-- <tr>
<td class="Employee">Shift</td> <td class="Employee">Shift</td>
<td> <td>
<md-select ng-model="employeeShift" md-selected-text="getSelectedEmpShift()" id="empShift"> <md-select ng-model="employeeShift" md-selected-text="getSelectedEmpShift()" id="empShift">
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</md-optgroup> </md-optgroup>
</md-select> </md-select>
</td> </td>
</tr> </tr> -->
<tr> <tr>
<td class="Employee">Billability Status</td> <td class="Employee">Billability Status</td>
<td> <td>
...@@ -281,16 +281,16 @@ ...@@ -281,16 +281,16 @@
</td> </td>
</tr> </tr>
<tr> <!-- <tr>
<td class="Employee">Start Date</td> <td class="Employee">Start Date</td>
<td> <td>
<md-datepicker ng-model="startDate" ng-disabled = "true" md-placeholder="Please select Date" id="startDate " md-min-date="minDate " md-max-date="maxDate " <md-datepicker ng-model="startDate" ng-disabled = "true" md-placeholder="Please select Date" id="startDate " md-min-date="minDate " md-max-date="maxDate "
onkeydown="return false " name="startDate"></md-datepicker> onkeydown="return false " name="startDate"></md-datepicker>
</td> </td>
</tr> </tr> -->
<tr> <tr ng-show="empBillableStatus">
<td class="Employee">End Date</td> <td class="Employee">{{empBillableStatus}} End Date</td>
<td> <td>
<md-datepicker ng-model="endDate " md-placeholder="Please select Date" id="endDate " md-min-date="minDate " md-max-date="maxDate " <md-datepicker ng-model="endDate " md-placeholder="Please select Date" id="endDate " md-min-date="minDate " md-max-date="maxDate "
onkeydown="return false " name="endDate"></md-datepicker> onkeydown="return false " name="endDate"></md-datepicker>
......
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