Incentive Done!!

Employee Benefit Done!!
This commit is contained in:
tanshu
2020-05-23 09:45:02 +05:30
parent 814d289758
commit e3286c87ba
20 changed files with 515 additions and 415 deletions
@@ -11,7 +11,7 @@ const incentiveRoutes: Routes = [
component: IncentiveComponent,
canActivate: [AuthGuard],
data: {
permission: 'Incentive'
permission: 'incentive'
},
resolve: {
voucher: IncentiveResolver
@@ -23,7 +23,7 @@ const incentiveRoutes: Routes = [
component: IncentiveComponent,
canActivate: [AuthGuard],
data: {
permission: 'Incentive'
permission: 'incentive'
},
resolve: {
voucher: IncentiveResolver
@@ -51,7 +51,7 @@
<button matPrefix (click)="less(row, i)">
<mat-icon>remove</mat-icon>
</button>
<input matInput formControlName="points" autocomplete="off">
<input matInput formControlName="points" autocomplete="off" (change)="change(row, i)">
<button matSuffix color="warn" (click)="more(row, i)">
<mat-icon>add</mat-icon>
</button>
@@ -109,6 +109,11 @@ export class IncentiveComponent implements OnInit {
}
}
change(row: Incentive, i: number) {
row.points = +(this.form.get('incentives').get('' + i).get('points').value);
this.form.get('incentives').get('' + i).setValue({'points': '' + row.points});
}
more(row: Incentive, i: number) {
row.points += 1;
this.form.get('incentives').get('' + i).setValue({'points': '' + row.points});
@@ -160,7 +165,6 @@ export class IncentiveComponent implements OnInit {
this.voucher.incentives.forEach((item, index) => {
item.points = array.controls[index].value.points;
});
this.voucher.narration = formModel.narration;
return this.voucher;
}