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