|
@@ -39,6 +39,7 @@ export class ReviewTraineeDataListComponent implements OnInit {
|
|
|
dataTableNumber: number = 5;
|
|
|
viewTableData: string = 'all';
|
|
|
serviceName: string = '';
|
|
|
+ filtterDepartmentVal: string = 'all';
|
|
|
pages = [];
|
|
|
|
|
|
|
|
@@ -113,24 +114,27 @@ export class ReviewTraineeDataListComponent implements OnInit {
|
|
|
);
|
|
|
|
|
|
|
|
|
- this.dashBoardService.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
|
|
|
- (responce) => {
|
|
|
- console.log(responce);
|
|
|
- this.dataList = responce['requests'];
|
|
|
+ this.getListData(this.currentPage,
|
|
|
+ this.dataTableNumber ,
|
|
|
+ this.viewTableData,
|
|
|
+ this.filtterDepartmentVal,
|
|
|
+ '').subscribe(
|
|
|
+ (response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.dataList = response['requests'];
|
|
|
if(this.dataList.length == 0) {
|
|
|
this.toastr.warning('القائمه فارغه من الطلبات ');
|
|
|
}
|
|
|
- this.count = responce['count'];
|
|
|
- this.perPagePagenation = responce['per_page'];
|
|
|
+ this.count = response['count'];
|
|
|
+ this.perPagePagenation = response['per_page'];
|
|
|
console.log('evennnnts', this.dataList);
|
|
|
this.spinner.hide();
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- console.log(error);
|
|
|
- this.spinner.hide();
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.log('error list =>', error);
|
|
|
+ this.spinner.hide();
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
|
|
|
|
|
@@ -152,19 +156,27 @@ export class ReviewTraineeDataListComponent implements OnInit {
|
|
|
console.log(data.target.value);
|
|
|
const dataSearch = data.target.value;
|
|
|
this.currentPage = 1;
|
|
|
- this.dashBoardService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
- (responce) => {
|
|
|
- console.log(responce);
|
|
|
- this.dataList = responce['requests'];
|
|
|
- this.count = responce['count'];
|
|
|
- this.perPagePagenation = responce['per_page'];
|
|
|
- console.log('filtter count', this.count);
|
|
|
- console.log('filtter perPagePAgenation', this.perPagePagenation);
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- );
|
|
|
+ this.filtterSearch(this.currentPage,
|
|
|
+ this.dataTableNumber ,
|
|
|
+ this.viewTableData,
|
|
|
+ this.filtterDepartmentVal,
|
|
|
+ dataSearch).subscribe(
|
|
|
+ (response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.dataList = response['requests'];
|
|
|
+ if(this.dataList.length == 0) {
|
|
|
+ this.toastr.warning('القائمه فارغه من الطلبات ');
|
|
|
+ }
|
|
|
+ this.count = response['count'];
|
|
|
+ this.perPagePagenation = response['per_page'];
|
|
|
+ console.log('evennnnts', this.dataList);
|
|
|
+ this.spinner.hide();
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.log('error list =>', error);
|
|
|
+ this.spinner.hide();
|
|
|
+ }
|
|
|
+ )
|
|
|
};
|
|
|
|
|
|
|
|
@@ -172,22 +184,29 @@ export class ReviewTraineeDataListComponent implements OnInit {
|
|
|
this.spinner.show();
|
|
|
this.currentPage = pagenationNumber;
|
|
|
this.dataList = [];
|
|
|
-
|
|
|
-
|
|
|
- this.dashBoardService.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
|
|
|
- (responce) => {
|
|
|
- console.log(responce);
|
|
|
- this.dataList = responce['requests'];
|
|
|
- this.count = responce['count'];
|
|
|
- this.perPagePagenation = responce['per_page'];
|
|
|
- console.log(this.dataList);
|
|
|
- this.spinner.hide();
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- console.log(error);
|
|
|
+
|
|
|
+ this.getListData(this.currentPage,
|
|
|
+ this.dataTableNumber ,
|
|
|
+ this.viewTableData,
|
|
|
+ this.filtterDepartmentVal,
|
|
|
+ '').subscribe(
|
|
|
+ (response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.dataList = response['requests'];
|
|
|
+ if(this.dataList.length == 0) {
|
|
|
+ this.toastr.warning('القائمه فارغه من الطلبات ');
|
|
|
+ }
|
|
|
+ this.count = response['count'];
|
|
|
+ this.perPagePagenation = response['per_page'];
|
|
|
+ console.log('evennnnts', this.dataList);
|
|
|
this.spinner.hide();
|
|
|
- }
|
|
|
- );
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.log('error list =>', error);
|
|
|
+ this.spinner.hide();
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -195,109 +214,123 @@ onGetValue(event) {
|
|
|
this.spinner.show();
|
|
|
this.dataList = [];
|
|
|
this.dataTableNumber = event.target.value;
|
|
|
- this.dashBoardService.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
- (responce) => {
|
|
|
- console.log(responce);
|
|
|
- this.dataList = responce['requests'];
|
|
|
- this.count = responce['count'];
|
|
|
- this.perPagePagenation = responce['per_page'];
|
|
|
+
|
|
|
+ this.getListData(this.currentPage,
|
|
|
+ this.dataTableNumber ,
|
|
|
+ this.viewTableData,
|
|
|
+ this.filtterDepartmentVal,
|
|
|
+ '').subscribe(
|
|
|
+ (response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.dataList = response['requests'];
|
|
|
if(this.dataList.length == 0) {
|
|
|
- this.toastr.warning('لا يوجد بيانات لعرضها');
|
|
|
+ this.toastr.warning('القائمه فارغه من الطلبات ');
|
|
|
}
|
|
|
+ this.count = response['count'];
|
|
|
+ this.perPagePagenation = response['per_page'];
|
|
|
+ console.log('evennnnts', this.dataList);
|
|
|
this.spinner.hide();
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- console.log(error);
|
|
|
- this.spinner.hide();
|
|
|
- }
|
|
|
- );
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.log('error list =>', error);
|
|
|
+ this.spinner.hide();
|
|
|
+ }
|
|
|
+ )
|
|
|
};
|
|
|
|
|
|
onFiltterChosen(event) {
|
|
|
this.spinner.show();
|
|
|
this.dataList = [];
|
|
|
console.log(event.target.value);
|
|
|
- console.log(this.authSer.pathApi + '/page_list/' +this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + event.target.value);
|
|
|
- this.http.get(this.authSer.pathApi + '/page_list/' +this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + event.target.value).subscribe(
|
|
|
- (responce) => {
|
|
|
- console.log(responce);
|
|
|
- console.log(responce);
|
|
|
- this.dataList = responce['requests'];
|
|
|
+ this.viewTableData = event.target.value;
|
|
|
+
|
|
|
+ this.getListData(this.currentPage,
|
|
|
+ this.dataTableNumber ,
|
|
|
+ this.viewTableData,
|
|
|
+ this.filtterDepartmentVal,
|
|
|
+ '').subscribe(
|
|
|
+ (response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.dataList = response['requests'];
|
|
|
if(this.dataList.length == 0) {
|
|
|
- this.toastr.warning('لا يوجد بيانات لعرضها');
|
|
|
+ this.toastr.warning('القائمه فارغه من الطلبات ');
|
|
|
}
|
|
|
- this.count = responce['count'];
|
|
|
- this.perPagePagenation = responce['per_page'];
|
|
|
+ this.count = response['count'];
|
|
|
+ this.perPagePagenation = response['per_page'];
|
|
|
+ console.log('evennnnts', this.dataList);
|
|
|
this.spinner.hide();
|
|
|
- },
|
|
|
- (error) => {
|
|
|
- console.log(error);
|
|
|
- }
|
|
|
- )
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.log('error list =>', error);
|
|
|
+ this.spinner.hide();
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-onAdd() {
|
|
|
- console.log('service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add');
|
|
|
- this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add']);
|
|
|
+onFiltterDepartment(event) {
|
|
|
+ console.log(event.target.value);
|
|
|
+ this.filtterDepartmentVal = event.target.value;
|
|
|
+
|
|
|
+ this.getListData(this.currentPage,
|
|
|
+ this.dataTableNumber ,
|
|
|
+ this.viewTableData,
|
|
|
+ this.filtterDepartmentVal,
|
|
|
+ '').subscribe(
|
|
|
+ (response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.dataList = response['requests'];
|
|
|
+ if(this.dataList.length == 0) {
|
|
|
+ this.toastr.warning('القائمه فارغه من الطلبات ');
|
|
|
+ }
|
|
|
+ this.count = response['count'];
|
|
|
+ this.perPagePagenation = response['per_page'];
|
|
|
+ console.log('evennnnts', this.dataList);
|
|
|
+ this.spinner.hide();
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ console.log('error list =>', error);
|
|
|
+ this.spinner.hide();
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ onAdd() {
|
|
|
+ console.log('service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add');
|
|
|
+ this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add']);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
onEdit(editNewID) {
|
|
|
- this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'reviewTraineeData/edit/' + editNewID]);
|
|
|
-}
|
|
|
+ this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'reviewTraineeData/edit/' + editNewID]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ getListData(currentPage: number, per_page: number, status: string, department: string, keySearch: string) {
|
|
|
+ return this.http.get(this.authSer.pathApi + '/training_requests_list/'
|
|
|
+ + currentPage + '/'
|
|
|
+ + per_page + '/'
|
|
|
+ + status + '/'
|
|
|
+ + department);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ filtterSearch(currentPage: number, per_page: number, status: string, department: string, keySearch: string) {
|
|
|
+ console.log(this.authSer.pathApi + '/training_requests_list/'
|
|
|
+ + this.currentPage + '/'
|
|
|
+ + this.dataTableNumber + '/'
|
|
|
+ + this.viewTableData + '/'
|
|
|
+ + this.filtterDepartmentVal + '/' + keySearch);
|
|
|
+
|
|
|
+ return this.http.get(this.authSer.pathApi + '/training_requests_list/'
|
|
|
+ + currentPage + '/'
|
|
|
+ + per_page + '/'
|
|
|
+ + status + '/'
|
|
|
+ + department + '/'
|
|
|
+ + keySearch);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|