86 lines
2.8 KiB
TypeScript
86 lines
2.8 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { EnumDefaultValidatorType, EnumDynamicControlType } from '../../form-builder/Basic-Entry-form';
|
|
import { basicformbuilderService } from '../../form-builder/basic-form-builder.service';
|
|
import { BasicMasterListColumn, BasicMasterView, EnumColumnDataTypes, EnumFormView } from '../../form-builder/Basic-Master-View';
|
|
import { Router } from '@angular/router';
|
|
import { FSHead } from '../final-settlement-heads/final-settlement-head/final-settlement';
|
|
import { FinalSettlementService } from '../../_services/final-settlement/final-settlement.service';
|
|
import { loadingPanelService } from '../../hrm-loding panel/loding.panel.service';
|
|
import { HRMNotificationService } from '../../app.notification.service';
|
|
import { DataTransferService } from '../../data.transfer.service';
|
|
|
|
@Component({
|
|
selector: 'app-final-settlement-heads',
|
|
templateUrl: './final-settlement-heads.component.html',
|
|
styleUrls: ['./final-settlement-heads.component.css']
|
|
})
|
|
export class FinalSettlementHeadsComponent implements OnInit {
|
|
|
|
ListviewData: any;
|
|
msv: BasicMasterView = new BasicMasterView();
|
|
thebaseurl: string;
|
|
fsHeadList: FSHead[] = [];
|
|
|
|
public config = {
|
|
animated: true,
|
|
keyboard: true,
|
|
backdrop: true,
|
|
ignoreBackdropClick: true
|
|
};
|
|
|
|
/** user ctor */
|
|
constructor(public msvs: basicformbuilderService,
|
|
public loadingService: loadingPanelService,
|
|
public notificationService: HRMNotificationService,
|
|
public finalSettlementService: FinalSettlementService,
|
|
public dataTransferService: DataTransferService,
|
|
public router: Router) {
|
|
}
|
|
|
|
ngOnInit() {
|
|
this.loadData();
|
|
|
|
}
|
|
|
|
add() {
|
|
this.router.navigateByUrl('/payroll/final-settlement-head');
|
|
}
|
|
|
|
loadData() {
|
|
this.loadingService.ShowLoadingPanel = true;
|
|
this.finalSettlementService.GetFSHeads().subscribe(
|
|
(resp) => {
|
|
this.fsHeadList = resp;
|
|
},
|
|
(x) => {
|
|
console.log(x);
|
|
this.loadingService.ShowLoadingPanel = false;
|
|
},
|
|
() => {
|
|
this.loadingService.ShowLoadingPanel = false;
|
|
},
|
|
);
|
|
}
|
|
|
|
edit(dataItem: FSHead) {
|
|
this.dataTransferService.setData(dataItem);
|
|
this.router.navigateByUrl('/payroll/final-settlement-head');
|
|
}
|
|
|
|
public remove(dataItem: FSHead) {
|
|
//console.log(dataItem);
|
|
this.finalSettlementService.deleteFsHead(dataItem).subscribe(
|
|
() => { },
|
|
(x) => {
|
|
console.log(x);
|
|
},
|
|
() => {
|
|
this.notificationService.showError("data has been deleted successfully!");
|
|
this.loadData();
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
|