瀏覽代碼

finish report

Hima 6 年之前
父節點
當前提交
7a8a017ded

+ 1 - 1
src/app/dashboard/Registration-trainee-movement/registration-trainee-movement-add/registration-trainee-movement-add.component.ts

@@ -263,7 +263,7 @@ export class RegistrationTraineeMovementAddComponent implements OnInit {
 
   onSubmittedForm() {
     console.log(this.actionForm);
-    this.http.post(this.authSer.pathApi + '/final_accreditation_of_trainees', this.actionForm).subscribe(
+    this.http.post(this.authSer.pathApi + '/trace_trainee_movement', this.actionForm).subscribe(
       (responce) => {
         console.log(responce);
         this.toastr.success('تم بنجاح');

+ 24 - 22
src/app/dashboard/dashboard-routing.ts

@@ -1,3 +1,4 @@
+import { FinalTraineeReportComponent } from './final-trainee-report/final-trainee-report.component';
 import { ExistingReportComponent } from './reports-existing-vehicles/existing-report/existing-report.component';
 import { VehicleMaintenanceAddComponent } from './vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component';
 import { VehicleMaintenanceListComponent } from './vehicle-maintenance/vehicle-maintenance-list/vehicle-maintenance-list.component';
@@ -176,28 +177,29 @@ const dashboardRouting: Routes = [
     {path: 'reviewSectionForTrainee/:listPageId', component: SectionReviewTraineeListComponent},
     {path: 'reviewSectionForTrainee/edit/:reviewSectionAddId', component: SectionReviewTraineeAddComponent},
     {path: 'registrationTraineeList/:listPageId', component: RegistrationTraineeMovementListComponent},
-    {path: 'registrationTraineeList/edit/:registrationTraineereviewSectionAddId', component: RegistrationTraineeMovementAddComponent},
-    {path: 'printCardTraineeList/:listPageId', component: PrintCardTraineeListComponent},
-    {path: 'printCardTrainee/edit/:printCardAddId', component: PrintCardTraineeAddComponent},
-    {path: 'finalAccerditationList/:listPageId', component: FinalAccerditationListComponent},
-    {path: 'finalAccerditationList/edit/:finalAccerditationEdit', component: FinalAccerditationAddComponent},
-    {path: 'vehicleList/:listPageId', component: VehicleListComponent},
-    {path: 'vehicle/add', component: VehicleAddComponent},
-    {path: 'vehicle/edit/:vehicleEditId', component: VehicleAddComponent},
-    {path: 'vehicleModelList/:listPageId' , component: ModelVehicleListComponent},
-    {path: 'vehicleModel/add' , component: ModelVehicleAddComponent},
-    {path: 'vehicleModel/edit/:modelVehicleEditId', component:ModelVehicleAddComponent },
-    {path: 'registrationVehicleList/:listPageId', component: RegistrationVehicleListComponent},
-    {path: 'registrationVehicle/add', component: RegistrationVehicleAddComponent},
-    {path: 'registrationVehicle/edit/:registrationVehicleEditId', component:RegistrationVehicleAddComponent },
-    {path: 'registerMovementVehicleList/:listPageId', component: RegisterMovementVehicleListComponent},
-    {path: 'registerMovementVehicle/add', component: RegisterMovementVehicleAddComponent},
-    {path: 'registerMovementVehicle/edit/:registerMovementVehicleEditId', component: RegisterMovementVehicleAddComponent },
-    {path: 'vehicleMaintenanceList/:listPageId', component: VehicleMaintenanceListComponent},
-    {path: 'vehicleMaintenance/add', component: VehicleMaintenanceAddComponent},
-    {path: 'vehicleMaintenance/edit/:vehicleMaintenanceEditId', component: VehicleMaintenanceAddComponent },
-    {path: 'existingReportVehicle', component: ExistingReportComponent},
-    {path: 'VehicleReport/:typeReport', component: VehicleMovementReportComponent},
+    {path: 'registrationTraineeList/edit/:registrationTraineereviewSectionAddId', component: RegistrationTraineeMovementAddComponent, canActivate: [AuthGuard]},
+    {path: 'printCardTraineeList/:listPageId', component: PrintCardTraineeListComponent, canActivate: [AuthGuard]},
+    {path: 'printCardTrainee/edit/:printCardAddId', component: PrintCardTraineeAddComponent, canActivate: [AuthGuard]},
+    {path: 'finalAccerditationList/:listPageId', component: FinalAccerditationListComponent, canActivate: [AuthGuard]},
+    {path: 'finalAccerditationList/edit/:finalAccerditationEdit', component: FinalAccerditationAddComponent, canActivate: [AuthGuard]},
+    {path: 'vehicleList/:listPageId', component: VehicleListComponent, canActivate: [AuthGuard]},
+    {path: 'vehicle/add', component: VehicleAddComponent, canActivate: [AuthGuard]},
+    {path: 'vehicle/edit/:vehicleEditId', component: VehicleAddComponent, canActivate: [AuthGuard]},
+    {path: 'vehicleModelList/:listPageId' , component: ModelVehicleListComponent, canActivate: [AuthGuard]},
+    {path: 'vehicleModel/add' , component: ModelVehicleAddComponent, canActivate: [AuthGuard]},
+    {path: 'vehicleModel/edit/:modelVehicleEditId', component:ModelVehicleAddComponent, canActivate: [AuthGuard] },
+    {path: 'registrationVehicleList/:listPageId', component: RegistrationVehicleListComponent, canActivate: [AuthGuard]},
+    {path: 'registrationVehicle/add', component: RegistrationVehicleAddComponent, canActivate: [AuthGuard]},
+    {path: 'registrationVehicle/edit/:registrationVehicleEditId', component:RegistrationVehicleAddComponent, canActivate: [AuthGuard] },
+    {path: 'registerMovementVehicleList/:listPageId', component: RegisterMovementVehicleListComponent, canActivate: [AuthGuard]},
+    {path: 'registerMovementVehicle/add', component: RegisterMovementVehicleAddComponent, canActivate: [AuthGuard]},
+    {path: 'registerMovementVehicle/edit/:registerMovementVehicleEditId', component: RegisterMovementVehicleAddComponent, canActivate: [AuthGuard] },
+    {path: 'vehicleMaintenanceList/:listPageId', component: VehicleMaintenanceListComponent, canActivate: [AuthGuard]},
+    {path: 'vehicleMaintenance/add', component: VehicleMaintenanceAddComponent, canActivate: [AuthGuard]},
+    {path: 'vehicleMaintenance/edit/:vehicleMaintenanceEditId', component: VehicleMaintenanceAddComponent, canActivate: [AuthGuard] },
+    {path: 'existingReportVehicle', component: ExistingReportComponent, canActivate: [AuthGuard]},
+    {path: 'VehicleReport/:typeReport', component: VehicleMovementReportComponent, canActivate: [AuthGuard]},
+    {path: 'finalAccerditationReprot', component: FinalTraineeReportComponent, canActivate: [AuthGuard]},
   ]},
 ];
 

+ 2 - 0
src/app/dashboard/dashboard.module.ts

@@ -127,6 +127,7 @@ import { VehicleMaintenanceListComponent } from './vehicle-maintenance/vehicle-m
 import { VehicleMaintenanceAddComponent } from './vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component';
 import { ExistingReportComponent } from './reports-existing-vehicles/existing-report/existing-report.component';
 import { VehicleMovementReportComponent } from './vehicle-movement-report/vehicle-movement-report/vehicle-movement-report.component';
+import { FinalTraineeReportComponent } from './final-trainee-report/final-trainee-report.component';
 
 
 @NgModule({
@@ -220,6 +221,7 @@ import { VehicleMovementReportComponent } from './vehicle-movement-report/vehicl
         VehicleMaintenanceAddComponent,
         ExistingReportComponent,
         VehicleMovementReportComponent,
+        FinalTraineeReportComponent,
     ],
     imports: [
         CommonModule,

+ 15 - 8
src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.css

@@ -66,7 +66,7 @@ select.ng-invalid{
     border-radius: 20px;
     margin: 30px auto;
 }
-.iconUpload-w {
+/* .iconUpload-w {
     width: 30px;
     font-size: 1.25em;
     font-weight: 700;
@@ -78,7 +78,7 @@ select.ng-invalid{
     border: 1px solid #ccc;
     border-radius: 50%;
     bottom: 0;
-}
+} */
 
 .inputfile {
 	width: 0.1px;
@@ -102,7 +102,6 @@ select.ng-invalid{
 
 .inputfile:focus + label,
 .inputfile + label:hover {
-    background-color: #00a99d;
     color: #fff;
 }
 
@@ -207,17 +206,25 @@ select.ng-invalid{
 }
 
 .wrapper .iconUpload-w {
-    width: 265px;
-    height: 37px;
+    width: 60px;
+    height: 30px;
     border-radius: 5px;
     font-size: 1.25em;
     font-weight: 700;
     display: inline-block;
-    background-color: #fff;
-    border: 1px solid #ccc;
     padding: 0 10px;
     position: absolute;
-    right: 75px;
+    right: 125px;
+    margin: 2px 0;
+}
+
+.downloadFile-w {
+    color: #b28c5e;
+    font-size: 19px;
+}
+
+.downloadFile-w a {
+    margin: 5px 0;
 }
 
 .wrapper .deleteRow-w {

+ 17 - 28
src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.html

@@ -189,28 +189,9 @@
                 <!-- <h2 class="departmentHeading-w">أختر الأقسام <span>(قم بإختيار قسم كحد أدني)</span></h2> -->
                   <div class="col-12 col-sm-12 col-md-4 col-lg-4">
                     <div class="form-group">
-                      <label for="department1" style="float:right;">القسم الأول</label>
-                      <select class="form-control selectStyle-w" id="department1" name="department1" (input)="changeDepartment($event , 1)" [(ngModel)]="formData.department1" [disabled]="disabledInput">
+                      <label for="department" style="float:right;">القسم المناسب</label>
+                      <select class="form-control selectStyle-w" id="department" name="department" (input)="changeDepartment($event , 1)" [ngModel]="formData.department" [disabled]="disabledInput">
                         <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2001">حذف</option>
-                      </select>
-                    </div>
-                  </div>
-                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department2" style="float:right;">القسم الثاني</label>
-                      <select class="form-control selectStyle-w" id="department2" name="department2" (input)="changeDepartment($event , 2)" [(ngModel)]="formData.department2" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2002">حذف</option>
-                      </select>
-                    </div>
-                  </div>
-                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department3" style="float:right;">القسم الثالث</label>
-                      <select class="form-control selectStyle-w" id="department3" name="department3" (input)="changeDepartment($event , 3)" [(ngModel)]="formData.department3" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2003">حذف</option>
                       </select>
                     </div>
                   </div>
@@ -232,18 +213,20 @@
                       <tr>
                         <th> إسم المرفق</th>
                         <th>رفع املف ( بصيغه pdf )</th>
+                        <th>عرض الملف</th>
                         <th>حذف</th>
                       </tr>
                     </thead>
                     <tbody>
                       <tr style="text-align:center;" *ngFor="let file of files; let i = index">
-                        <td><input type="text" class="form-control" placeholder="إسم الملف" [(ngModel)]="file.title" [ngModelOptions]="{standalone: true}" [disabled]="disabledInput"/></td>
+                        <td><input type="text" class="form-control" placeholder="إسم الملف" [(ngModel)]="file.title" [ngModelOptions]="{standalone: true}"/></td>
                         <td style="position: relative;">
-                          <input type="file" name="file{{i}}" id="file{{i}}" class="inputfile" alife-file-to-base64 (onFileChanged)="onFileChanges($event,i)" [disabled]="disabledInput"/>
-                          <label for="file{{i}}" class="iconUpload-w"><i class="fas fa-upload"></i></label>
-                          <span class="fileName-w">{{file.nameFile}}</span>
+                          <input type="file" name="file{{i}}" id="file{{i}}" class="inputfile" alife-file-to-base64 (onFileChanged)="onFileChanges($event,i)"/>
+                          <label for="file{{i}}" class="iconUpload-w"><i class="fas fa-upload" style="color: #03aa9e"></i></label>
+                          <!-- <span class="fileName-w">{{file.nameFile}}</span> -->
                         </td>
-                        <td><button type="button" class="btn btn-danger form-control deleteRow-w" (click)="onDeleteRow(i)" [disabled]="disabledInput">حذف</button></td>
+                        <td><a class="downloadFile-w" href="{{authSer.pathImg + file.file}}" target="_blank"><i class="fas fa-download"></i></a></td>
+                        <td><button type="button" class="btn btn-danger form-control deleteRow-w" (click)="onDeleteRow(i)">حذف</button></td>
                       </tr>
                     </tbody>
                   </table>
@@ -274,14 +257,20 @@
                     <div class="col-12 col-md-4">
                       <div class="form-group">
                         <label style="float:right;">إستلام البطاقه</label>
-                        <button type="button" class="btn btn-success" style="width: 100%;" (click)="recieveCard()"> إستلام</button>
+                        <button type="button" class="btn btn-success" style="width: 100%;" (click)="recieveCard()"> إستلام البطاقه</button>
+                      </div>
+                    </div>
+                    <div class="col-12 col-md-4">
+                      <div class="form-group">
+                        <label style="float:right;">طباعه المشهد</label>
+                        <button type="button" class="btn btn-primary" style="width: 100%;" (click)="printCard()"> طباعه المشهد</button>
                       </div>
                     </div>
                   </div>
                 </div>
             </div>
 
-            <div class="col-12">
+            <div class="col-12 ">
               <button type="submit" class="btn btn-success rightW" [disabled]="checkSaveClick">حفظ</button>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()" style="margin:20px 10px;">إلغاء</button>
             </div>

+ 137 - 26
src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.ts

@@ -1,5 +1,5 @@
 import { NgxSpinnerService } from 'ngx-spinner';
-import { ActivatedRoute, Params } from '@angular/router';
+import { ActivatedRoute, Params, Router } from '@angular/router';
 import { DashboardService } from './../../../shared/dashboard.service';
 import { HttpClient } from '@angular/common/http';
 import { UserService } from './../../../shared/user.service';
@@ -20,6 +20,7 @@ export class FinalAccerditationAddComponent implements OnInit {
     private toastr: ToastrService,
     private route: ActivatedRoute,
     private dashBoardSer: DashboardService,
+    private router: Router,
     private spinner: NgxSpinnerService,
     private location: Location,
     private authSer: AuthServiceService) { }
@@ -33,11 +34,14 @@ export class FinalAccerditationAddComponent implements OnInit {
   reportId: number;
   stoppedShow: boolean = false;
   endedShow: boolean = false;
+  userLoginId: number;
+  serviceId: number;
   countries: any[] = [];
   identities: any[] = [];
   trainees:any[] = [];
   departments:any[] = [];
   departmentsId:any[] = [];
+  attachments_ids: any[] =[];
 
   @ViewChild('f') traineeForm: NgForm;
 
@@ -56,9 +60,7 @@ export class FinalAccerditationAddComponent implements OnInit {
     contract_type: '',
     status: '',
     organization_affiliated_with: '',
-    department1: '',
-    department2: '',
-    department3: '',
+    department: '',
   }
 
   //user data object
@@ -106,6 +108,22 @@ export class FinalAccerditationAddComponent implements OnInit {
      this.authSer.showHeaderDashBoard = true;
      this.authSer.showDashboardHeader = true;
      this.authSer.internalHeader = false;
+
+     //catch params id from activated route
+     this.route.params.subscribe(
+      (params: Params) => {
+        this.reportId = +params['finalAccerditationEdit'];
+      }
+    );
+
+    //catch parent params id from activated route
+     this.route.parent.params.subscribe(
+      (params:Params) => {
+          this.userLoginId = +params['userID'];
+          this.serviceId = +params['serviceID'];
+        }
+  
+      );
  
      //get nationality data
      this.userSer.getNationality().subscribe(
@@ -150,12 +168,7 @@ export class FinalAccerditationAddComponent implements OnInit {
          console.log(error);
        }
      );
- 
-     this.route.params.subscribe(
-       (params: Params) => {
-         this.reportId = params['finalAccerditationEdit'];
-       }
-     );
+
 
      if(this.reportId) {
 
@@ -190,22 +203,16 @@ export class FinalAccerditationAddComponent implements OnInit {
           this.userData.nationality_id = responce['data']['user'].nationality_id;
           this.userId = responce['data']['user'].id;
           this.userData['id'] = this.userId;
-
-             //add departmrnts ids 
-             if(responce['data']['request'].departments.length > 0) {
-              for(let i = 0; i < responce['data']['request'].departments.length; i++) {
-                if(i == 0) {
-                  this.formData.department1 = responce['data']['request'].departments[0].department_id;
-                  this.departmentsId[i] = responce['data']['request'].departments[i].department_id;
-                } else if(i == 1) {
-                  this.formData.department2 = responce['data']['request'].departments[i].department_id;
-                  this.departmentsId[i] = responce['data']['request'].departments[i].department_id;
-                } else if(i == 2) {
-                  this.formData.department3 = responce['data']['request'].departments[i].department_id;
-                  this.departmentsId[i] = responce['data']['request'].departments[i].department_id;
-              }
+          for(let i = 0; i < responce['data']['request'].attachments.length; i++) {
+            this.attachments_ids.push(responce['data']['request'].attachments[i].id);
+          }
+          console.log('attachemnts ids ', this.attachments_ids);
+          for(let i = 0; i < responce['data']['request'].departments.length; i++) {
+            if(responce['data']['request'].departments[i].is_confirmed == 1) {
+              this.formData.department = responce['data']['request'].departments[i].department_id;
             }
           }
+        
 
          
 
@@ -228,6 +235,7 @@ export class FinalAccerditationAddComponent implements OnInit {
           console.log(error);
         }
       );
+
     }
  
   }
@@ -237,20 +245,123 @@ export class FinalAccerditationAddComponent implements OnInit {
     this.actionForm.card_received = 1
   }
 
+  printCard() {
+    this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/finalAccerditationReprot']);
+  }
+
+
+  //delete row of files
+  onDeleteRow(rowIndex: number) {
+    this.files.splice(rowIndex , 1);
+    if(this.attachments_ids.length > 0) {
+      this.attachments_ids.splice(rowIndex, 1);
+    }
+    console.log('files after delete ',this.files);
+    console.log('attachements ids', this.attachments_ids);
+  }
+
+  //add attachements 
+  plusImage() {
+    this.files.push({
+      title: '',
+      file: '',
+      file_type: '',
+      nameFile: '',
+      id: null,
+    });
+    console.log('files after plus ', this.files);
+  }
+//finalAccerditationReprot
+  //on file change 
+    //change file 
+    onFileChanges(event, index:number) {
+      console.log(event);
+      console.log(index);
+       this.files[index].nameFile = event[0].name.substring(0,20) + '....';
+       this.files[index].file = event[0].base64;
+       this.files[index].file_type = event[0].type.split('/')[1];
+         //validate in pdf type file in edit mode 
+         if(this.files[index].file_type != '') {
+           if(this.files[index].file_type != 'pdf') {
+             this.toastr.warning('يجب أن تكون صيغه الملف pdf !');
+             this.checkSaveClick = true;
+           } else {
+             this.checkSaveClick = false;
+           }
+         }
+  
+         console.log(this.files);
+   
+    }
+
+  //submitted form 
   onSubmittedForm() {
+
     console.log(this.actionForm);
+
+    //get the attchiements edit 
+    const editAttachements = [];
+    for(let i = 0; i < this.files.length; i++) {
+      for(let j = 0; j < this.attachments_ids.length; j++) {
+       if(this.files[i].id == this.attachments_ids[j]) {
+        editAttachements[i] = this.files[i];
+       }
+      }
+    };
+
+    //delete file & file type if not change it in old file
+    for(let i = 0; i < editAttachements.length; i++) {
+      if(editAttachements[i].file_type == '') {
+        delete editAttachements[i].file;
+        delete editAttachements[i].file_type;
+      }
+    };
+
+    //delete the extera key file name 
+    for(let i = 0; i < editAttachements.length; i++) {
+      delete editAttachements[i].nameFile;
+    };
+    
+    
+    //remove old file from files object
+    for(let i = 0; i < editAttachements.length; i++) {
+      for(let j = 0; j < this.files.length; j++) {
+        if(editAttachements[i].id == this.files[j].id) {
+          this.files.splice(j , 1);
+        }
+      }
+    };
+
+    //remove nameFile and id from object
+    for(let i = 0; i < this.files.length; i++) {
+      delete this.files[i].nameFile;
+      delete this.files[i].id;
+    };
+    
+    console.log('files after update ', this.files);
+    console.log('edit files after update ', editAttachements);
+    
+    this.actionForm['attachments_ids'] = this.attachments_ids;
+    this.actionForm['editable_attachments'] = editAttachements;
+    this.actionForm['attachments'] = this.files;
+
+    this.checkSaveClick = true;
+
     this.http.post(this.authSer.pathApi + '/final_accreditation_of_trainees', this.actionForm).subscribe(
       (responce) => {
         console.log(responce),
         this.toastr.success('تم بنجاح');
+        this.checkSaveClick = false;
         this.location.back();
       },
       (error) => {
         console.log(error);
-        this.toastr.error('يوجد خطأ في السيرفر ، حاول لاحقاَ');
+        this.checkSaveClick = false;
+        this.toastr.error('يوجد خطأ ، حاول لاحقاَ');
         this.location.back();
       }
-    )
+    );
+
   }
 
 }

+ 43 - 0
src/app/dashboard/final-trainee-report/final-trainee-report.component.css

@@ -0,0 +1,43 @@
+.containerContent-w h2 {
+    font-size: 20px;
+    color: #007a71;
+    margin: 20px 0;
+}
+
+.head {
+    text-align: center;
+    margin-right: 10px;
+    color: #888;
+}
+
+.head p {
+    margin: 0 10px;
+
+}
+
+.headTd {
+    width: 150px;
+    text-align: center;
+}
+
+.rightLogo {
+    width: 100%;
+    text-align: right;
+    margin: 20px 0;
+}
+
+.rightLogo p {
+    color: #007a71;
+}
+
+.rightLogo p span {
+    color: #888;
+}
+
+
+.signature {
+    width: 100%;
+    padding: 10px 0;
+    border-bottom: 1px solid #888;
+    border-top: 1px solid #888;
+}

File diff suppressed because it is too large
+ 139 - 0
src/app/dashboard/final-trainee-report/final-trainee-report.component.html


+ 19 - 0
src/app/dashboard/final-trainee-report/final-trainee-report.component.ts

@@ -0,0 +1,19 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-final-trainee-report',
+  templateUrl: './final-trainee-report.component.html',
+  styleUrls: ['./final-trainee-report.component.css']
+})
+export class FinalTraineeReportComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+  onPrint() {
+    window.print();
+  }
+
+}

+ 1 - 3
src/app/dashboard/print-card-trainee/print-card-trainee-list/print-card-trainee-list.component.ts

@@ -105,9 +105,7 @@ export class PrintCardTraineeListComponent implements OnInit {
             this.count = responce['count'];
             this.perPagePagenation = responce['per_page'];
             console.log('evennnnts', this.dataList);
-            if(this.dataList.length > 0) {
-              this.spinner.hide();
-            }
+            this.spinner.hide();
           },
           (error) => {
             console.log(error);

+ 11 - 11
src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.ts

@@ -485,17 +485,17 @@ export class ReviewTraineeAddComponent implements OnInit {
         formArraySend[1] = this.formData;
         console.log('data send' , formArraySend);
 
-        // this.http.post(this.authSer.pathApi + '/edit_request', formArraySend).subscribe(
-        //   (responce) => {
-        //     console.log(responce);
-        //     this.toastr.success('تم التعديل بنجاح');
-        //     this.location.back();
-        //   },
-        //   (error) => {
-        //     console.log(error);
-        //     this.toastr.error('يوجد مشكله في السيرفر يتم العمل عليها حالياً');
-        //   }
-        // );
+        this.http.post(this.authSer.pathApi + '/edit_request', formArraySend).subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تم التعديل بنجاح');
+            this.location.back();
+          },
+          (error) => {
+            console.log(error);
+            this.toastr.error('يوجد مشكله في السيرفر يتم العمل عليها حالياً');
+          }
+        );
       }
     } else {
       //add attachements to json in craete mode

+ 1 - 1
src/app/trainning-service/add-request/add-request.component.html

@@ -143,7 +143,7 @@
               </div>
             </div>
             <div class="col-12">
-              <button type="submit" class="btn btn-success rightW" *ngIf="statusType == 'pending'" [disabled]="!f.valid || checkSaveClick">حفظ</button>
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || checkSaveClick">حفظ</button>
               <button type="button" class="btn btn-warning rightW" (click)="authService.backFromEdit()" style="margin:20px 10px;">إلغاء</button>
             </div>
           </form>

+ 3 - 1
src/app/trainning-service/all-requests/all-requests.component.ts

@@ -25,6 +25,7 @@ export class AllRequestsComponent implements OnInit {
   
 
   ngOnInit() {
+
     this.spinner.show();
 
 
@@ -58,7 +59,8 @@ export class AllRequestsComponent implements OnInit {
       (error) => {
         console.log(error);
       }
-    )
+    );
+    
   }
 
   onEdit(requestData) {