amr 5 years ago
parent
commit
92195e5262

+ 2 - 2
src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.html

@@ -95,7 +95,7 @@
                           </div>
                         </div>
                       </div>
-                      <div class="col-12" *ngIf="acceptCheak">
+                      <div class="col-12" *ngIf="acceptCheak || confirmedcheck">
                         <h2 class="title" style="background-color: #5cce5c">تفاصيل السكن</h2>
                         <div class="row">
                           <div class="col-12">
@@ -136,7 +136,7 @@
                             </div>
                           </div>
                         </div>
-                        <div class="col-12" *ngIf="acceptCheak">
+                        <div class="col-12" *ngIf="acceptCheak || confirmedcheck  ">
                           <h2 class="title" style="background-color: #5cce5c">تفاصيل الوحدة</h2>
                           <div class="row">
                             <div class="col-12">

+ 14 - 4
src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.ts

@@ -33,6 +33,7 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
   status = ''
   notvailed: boolean = true
   covenants= []
+  confirmedcheck: boolean;
   constructor(
     private dashBoardSer: DashboardService,
     private toastr: ToastrService,
@@ -108,7 +109,7 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
         this.formData.refused_reason = res['request'].refused_reason;
         this.formData.waiting_reason = res['request'].waiting_reason;
         this.formData.status = res['request'].status
-        if(this.formData.status == 'accepted' ||  this.formData.status == 'ended' ){
+        if(this.formData.status == 'accepted' ||  this.formData.status == 'ended' || this.formData.status == 'confirmed'){
           this.unitInformation.housing_complex_id = res['request'].unit_information.housing_complex_id;
           console.log(this.unitInformation.housing_complex_id );
           this.getBuildingType(this.unitInformation.housing_complex_id);
@@ -122,12 +123,16 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
           this.unitInformation.independent_kitchen = res['request'].unit_information.independent_kitchen;
           this.unitInformation.sittingrooms_number = res['request'].unit_information.sittingrooms_number;
           this.covenants =  res['request'].unit_information.covenants;
-           this.accept();
+           if( this.formData.status == 'confirmed'){
+            this.confirmed()
+           }else{
+            this.accept()
+           }
         }else if(this.formData.status == 'waiting'){
           this.waiting()
          }else if(this.formData.status == 'refused') {
           this.refuse()
-         }
+         }else
         this.http.get(this.authSer.pathApi + '/get_user/' + this.employeeId).subscribe(
           res =>{
             console.log('=>',res);
@@ -155,7 +160,12 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
 
 
   }
-
+  confirmed(){
+    this.confirmedcheck = true;
+    this.refusedCheak = false;
+    this.waitingCheak = false;
+  }
+  
   accept(){
     this.formData.status = 'accepted'
     this.acceptCheak = true;