|
@@ -37,6 +37,7 @@ export class HospitalListComponent implements OnInit {
|
|
|
typeLink: string = '';
|
|
|
dataTableNumber: number = 5;
|
|
|
pages = [];
|
|
|
+ typeServices: string = '';
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
@@ -60,8 +61,13 @@ export class HospitalListComponent implements OnInit {
|
|
|
this.pageId = params['typePageId'];
|
|
|
if(this.pageId == 6) {
|
|
|
this.typeLink = 'المستشفيات والمراكز';
|
|
|
+ this.typeServices = 'خدمه إداره المحتوي';
|
|
|
} else if(this.pageId == 10) {
|
|
|
this.typeLink = 'الإدرات';
|
|
|
+ this.typeServices = 'خدمه الصلاحيات';
|
|
|
+ } else if(this.pageId == 30) {
|
|
|
+ this.typeLink = 'المستشفيات والمراكز';
|
|
|
+ this.typeServices = 'خدمه إداره الصفحه الخارجيه';
|
|
|
}
|
|
|
}
|
|
|
);
|
|
@@ -71,7 +77,7 @@ export class HospitalListComponent implements OnInit {
|
|
|
(params: Params) => {
|
|
|
this.userLoginId = params['userID'];
|
|
|
this.serviceId = params['serviceID'];
|
|
|
- if(this.pageId == 6) {
|
|
|
+ if(this.pageId == 6 || this.pageId == 30) {
|
|
|
this.hospitalService.getHospitalsList(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
@@ -100,6 +106,18 @@ export class HospitalListComponent implements OnInit {
|
|
|
this.authSer.showDeleteBtn = true;
|
|
|
}
|
|
|
}
|
|
|
+ } else if(this.pages[i].id == 30){
|
|
|
+ for(let j = 0; j < this.pages[i].permissions.length; j++) {
|
|
|
+ if(this.pages[i].permissions[j].name == 'add_hospitals_centers_ex'){
|
|
|
+ this.authSer.showAddBtn = true;
|
|
|
+ }
|
|
|
+ if(this.pages[i].permissions[j].name == 'edit_hospitals_centers_ex'){
|
|
|
+ this.authSer.showEditBtn = true;
|
|
|
+ }
|
|
|
+ if(this.pages[i].permissions[j].name == 'delete_hospitals_centers_ex'){
|
|
|
+ this.authSer.showDeleteBtn = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}else {
|
|
|
console.log('no roles');
|
|
|
}
|
|
@@ -204,7 +222,7 @@ export class HospitalListComponent implements OnInit {
|
|
|
console.log(error);
|
|
|
}
|
|
|
);
|
|
|
- } else if(this.pageId == 6){
|
|
|
+ } else if(this.pageId == 6 || this.pageId == 30){
|
|
|
this.hospitalService.getHospitalsList(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
@@ -240,7 +258,7 @@ export class HospitalListComponent implements OnInit {
|
|
|
this.currentPage = 1;
|
|
|
console.log('search curent page', this.currentPage);
|
|
|
console.log('search page id', this.pageId);
|
|
|
- if(this.pageId == 6){
|
|
|
+ if(this.pageId == 6 || this.pageId == 30){
|
|
|
this.hospitalService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
@@ -276,7 +294,7 @@ export class HospitalListComponent implements OnInit {
|
|
|
this.spinner.show();
|
|
|
this.dataList = [];
|
|
|
this.dataTableNumber = event.target.value;
|
|
|
- if(this.pageId == 6) {
|
|
|
+ if(this.pageId == 6 || this.pageId == 30) {
|
|
|
this.hospitalService.getHospitalsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
|
|
|
(responce) => {
|
|
|
console.log(responce);
|
|
@@ -309,7 +327,7 @@ export class HospitalListComponent implements OnInit {
|
|
|
|
|
|
//add hospitals
|
|
|
onAdd() {
|
|
|
- if(this.pageId == 6) {
|
|
|
+ if(this.pageId == 6 || this.pageId == 30) {
|
|
|
this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/add/Hospital']);
|
|
|
} else if(this.pageId == 10) {
|
|
|
this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/add/Management']);
|