Amr 5 years ago
parent
commit
aebd810345
17 changed files with 121 additions and 92 deletions
  1. 1 1
      src/app/dashboard/application-for-housing/application-for-housing.component.html
  2. 24 9
      src/app/dashboard/application-for-housing/application-for-housing.component.ts
  3. 2 2
      src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.html
  4. 3 15
      src/app/dashboard/females_request_types/females-request-types-add/females-request-types-add.component.html
  5. 10 30
      src/app/dashboard/females_request_types/females-request-types-add/females-request-types-add.component.ts
  6. 5 5
      src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-list/link-unit-to-covenants-list.component.html
  7. 11 1
      src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.ts
  8. 20 2
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.html
  9. 6 0
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.ts
  10. 4 4
      src/app/dashboard/unit-building-information/unit-building-information-list/unit-building-information-list.component.html
  11. 8 4
      src/app/dashboard/view_my_female_requests/view-my-female-requests-list/view-my-female-requests-list.component.html
  12. 1 1
      src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-details/view-requests-for-adminstration-details.component.html
  13. 8 6
      src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-details/view-requests-for-adminstration-details.component.ts
  14. 2 2
      src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-list/view-requests-for-adminstration-list.component.html
  15. 6 2
      src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.html
  16. 8 6
      src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.ts
  17. 2 2
      src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant/view-requests-for-tenant.component.html

+ 1 - 1
src/app/dashboard/application-for-housing/application-for-housing.component.html

@@ -13,7 +13,7 @@
     <div class="contentBorder-w">
 
       <form (ngSubmit)="onSubmitted()" #f="ngForm">
-        <div class="row" *ngIf="applyForOther">
+        <div class="row" *ngIf="showSearch">
           <div class="col-12 col-md-4">
             <div class="form-group">
               <input type="number" placeholder="" class="form-control numberReport-s" [(ngModel)]="searchValue" [ngModelOptions]="{standalone: true} "/>

+ 24 - 9
src/app/dashboard/application-for-housing/application-for-housing.component.ts

@@ -18,6 +18,7 @@ import { AuthServiceService } from 'src/app/shared/auth-service.service';
 })
 export class ApplicationForHousingComponent implements OnInit {
   departmentUserLoginId: any;
+  userLoginId: any;
 
   constructor(
     private route: ActivatedRoute, 
@@ -45,6 +46,7 @@ export class ApplicationForHousingComponent implements OnInit {
   whosend = '';
   applyForOther : boolean = false;
   showdetails : boolean = false;
+  applyForOtherSearch: boolean =false;
   showSearch: boolean = false;
   send: boolean = true;
   searchValue = null;
@@ -95,6 +97,12 @@ export class ApplicationForHousingComponent implements OnInit {
         }
       );
 
+    this.route.parent.params.subscribe(
+      (params:Params) => {
+          this.userLoginId = params['userID'];
+          this.serviceId = params['serviceID'];
+          })
+
       if(this.whosend == 'new'){
       this.http.get(this.authService.pathApi + '/profile').subscribe(
         res => {
@@ -117,28 +125,35 @@ export class ApplicationForHousingComponent implements OnInit {
         this.showSearch = true;
       }
       
+      
       if(this.whosend == 'new'){
       this.http.get(this.authService.pathApi + '/get_employee_request_status/' +   this.userId).subscribe(
         res => {
           console.log('ser' , res);
           const status = res['status']
-          if(status == 'employee free to make new request'){
-            this.location.back();
-            this.toastr.warning('لديك طلب بالفعل');
-            console.log("Fuck");
-            
-            
-          }else if(status == 'employee free to make new request'){
-            console.log('Done');
+          if(status == 'employee already has an un finished request'){
+            this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewRequestsForTenant/' + this.userLoginId])
+            this.toastr.warning('لديك  طلب بالفعل ');
+                  
+          }else if(status ==  "employee free to make new request"){
             
           }
         },
         err => {
-            console.log(err);
+          if(err.error.error == 'employee already has an un finished request'){
+            this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewRequestsForTenant/' + this.userLoginId])
+            this.toastr.warning('لديك طلب بالفعل');
+                  
+          }else if(err.error.error ==  "employee free to make new request"){
+            
+          }
             
         }
       );
       }
+      if(this.whosend == 'Ad547'){
+        this.applyForOtherSearch = true;
+      }
   }
 
   plusImage() {

+ 2 - 2
src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.html

@@ -27,24 +27,24 @@
         <div class="col-12 col-sm-12 col-md-12 col-lg-6">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
+                من العناصر يتم عرضها
               <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                 <option value="5">5</option>
                 <option value="10">10</option>
                 <option value="15">15</option>
                 <option value="20">20</option>
               </select>
-              من العناصر يتم عرضها
             </span>
           </div>
         </div>
         <div class="col-12 col-sm-12 col-md-12 col-lg-6">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
+                تصنيف العهدة
               <select [ngModel]="type" class="form-control selectButton-w" (input)="getCategories($event.target.value)" >
                 <option  value="all">الكل</option>
                 <option *ngFor="let item of categories" [value]="item.id">{{item.name}}</option>   
               </select>
-              تصنيف العهدة
             </span>
           </div>
         </div>

+ 3 - 15
src/app/dashboard/females_request_types/females-request-types-add/females-request-types-add.component.html

@@ -93,7 +93,7 @@
                         <div class="col-6">
                             <label > نعم
                               <label class="form-check-inline">
-                                <input class="form-check-input" type="radio" name="require_date" value="1" [(ngModel)]="formData.require_date" (input)="make_require_date_true()">
+                                <input class="form-check-input" type="radio" name="require_date" value="1" [(ngModel)]="formData.require_date" >
                             </label> 
                             </label>
                         </div>
@@ -102,29 +102,17 @@
                           <div class="col-6">
                               <label > لا
                                 <label class="form-check-inline">
-                                  <input class="form-check-input" type="radio" name="require_date" value="0" [(ngModel)]="formData.require_date" (input)="make_require_date_false()">
+                                  <input class="form-check-input" type="radio" name="require_date" value="0" [(ngModel)]="formData.require_date">
                                 </label>
                               </label>
                           </div>    
                           </div>
                    </div>
                   </div>
-                  <div class="col-12 col-sm-12 col-md-4" *ngIf="require_date">
-                    <div class="form-group">
-                        <label style="float: right; margin-right: 5px"> تاريخ العوده <span class="spanReqired-w">*</span></label>
-                        <input type="date" class="form-control" id="return_date" name="return_date" placeholder="" ngModel [(ngModel)]="formData.return_date" (input)="makeTrue()" />   
-                    </div>
-                  </div>
-                  <div class="col-12 col-sm-12 col-md-4" *ngIf="require_date">
-                      <div class="form-group">
-                          <label style="float: right; margin-right: 5px"> وقت العوده <span class="spanReqired-w">*</span></label>
-                          <input type="time" class="form-control" id="return_time" name="return_time" placeholder="" ngModel [(ngModel)]="formData.return_time" (input)="makeTrue()"/>   
-                      </div>
-                    </div>
             </div>
           
           <div class=" row col-6">
-              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || disable">حفظ</button>
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid ">حفظ</button>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
           </div>
         </form>

+ 10 - 30
src/app/dashboard/females_request_types/females-request-types-add/females-request-types-add.component.ts

@@ -20,7 +20,6 @@ export class FemalesRequestTypesAddComponent implements OnInit {
   typePage: string;
   checkSaveclick: boolean;
   disable: boolean;
-  require_date: boolean = false;
 
   constructor(
     private dashBoardSer: DashboardService,
@@ -40,8 +39,6 @@ export class FemalesRequestTypesAddComponent implements OnInit {
     require_attachments:'1',
     require_approval:'1',
     require_date:'0',
-    return_date:'',
-    return_time:''
   }
 
   ngOnInit() {
@@ -79,13 +76,8 @@ export class FemalesRequestTypesAddComponent implements OnInit {
          this.formData.require_attachments = res['type'].require_attachments;
          this.formData.require_approval = res['type'].require_approval;
          this.formData.require_date = res['type'].require_date;
-         if(this.formData.require_date == '1'){
-          this.make_require_date_true()
-         }else{
-           this.make_require_date_false()
-         }
-         this.formData.return_date = res['type'].return_date;
-         this.formData.return_time = res['type'].return_time;
+       
+
    
           this.spinner.hide();
         },
@@ -99,31 +91,19 @@ export class FemalesRequestTypesAddComponent implements OnInit {
 
   }
 
-  make_require_date_true(){
-      this.require_date = true;
+  // make_require_date_true(){
+  //     this.require_date = true;
       
-  }
-  make_require_date_false(){
-    this.require_date = false;
+  // }
+  // make_require_date_false(){
+  //   this.require_date = false;
 
-  }
-  makeTrue(){
-    this.disable = false;
-
-  }
+  // }
+ 
 
   onSubmitted() {
     console.log('HERE',this.formData);
-    if(this.formData.require_date == '0'){
-      this.formData.return_date = null;
-      this.formData.return_time = null;
-    }else if(this.formData.require_date == '1'){
-      if(this.formData.return_date == '' || this.formData.return_time == ''){
-        this.toastr.warning('يجب تحديد تاريخ و وقت العوده')
-        this.disable = true;
-        return 0;
-      }
-    }
+ 
     this.disable = true;
     if(this.editPageId) {
       this.dashBoardSer.editItem(this.editPageId, this.formData, 'femalesRequestTypes').subscribe(

+ 5 - 5
src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-list/link-unit-to-covenants-list.component.html

@@ -26,13 +26,13 @@
           <div class="col-12 col-sm-12 col-md-12 col-lg-3">
               <div class="form-group">
                 <span class="spanSelect-w" style="margin-right:10px;">
+                    من العناصر يتم عرضها
                   <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                     <option value="5">5</option>
                     <option value="10">10</option>
                     <option value="15">15</option>
                     <option value="20">20</option>
                   </select>
-                  من العناصر يتم عرضها
                 </span>
               </div>
             </div>
@@ -43,20 +43,20 @@
           <div class="col-12 col-sm-12 col-md-12 col-lg-3">
               <div class="form-group">
                 <span class="spanSelect-w" style="margin-right:10px;">
+                    المجمع السكني
                   <select [ngModel]="housing_complex_id" class="form-control selectButton-w" (input)="getBuildingsType($event.target.value)">
                     <option *ngFor="let complex of complex_list" [value]="complex.id">{{complex.name}}</option>
                   </select>
-                 المجمع السكني
                 </span>
               </div>
             </div>
             <div class="col-12 col-sm-12 col-md-12 col-lg-3" *ngIf="isComplex">
                 <div class="form-group">
+                  نوع المبنى
                   <span class="spanSelect-w" style="margin-right:10px;">
                     <select [ngModel]="building_type_id" class="form-control selectButton-w" (input)="getBuilding($event.target.value)">
                     <option *ngFor="let type of building_types" [value]="type.id">{{type.name}}</option>
                     </select>
-                     نوع المبنى
                   </span>
                 </div>
               </div>
@@ -64,10 +64,10 @@
               <div class="col-12 col-sm-12 col-md-12 col-lg-3" *ngIf="isBuildingType">
                   <div class="form-group">
                     <span class="spanSelect-w" style="margin-right:10px;">
+                        اسم المبنى
                       <select [ngModel]="building_id" class="form-control selectButton-w" (input)="getBuildingID($event.target.value)">
                        <option *ngFor="let building of building" [value]="building.id">{{building.building_name}}</option>
                       </select>
-                      اسم المبنى
                     </span>
                   </div>
                 </div>  
@@ -75,10 +75,10 @@
                 <div class="col-12 col-sm-12 col-md-12 col-lg-3" *ngIf="isUnit">
                     <div class="form-group">
                       <span class="spanSelect-w" style="margin-right:10px;">
+                          رقم الوحدة
                         <select [ngModel]="unitId" class="form-control selectButton-w" (input)="unitNum($event.target.value)" >
                          <option *ngFor="let unit of units" [value]="unit.id">{{unit.unit_number}}</option>
                         </select>
-                         رقم الوحدة
                       </span>
                     </div>
                   </div>   

+ 11 - 1
src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.ts

@@ -180,8 +180,13 @@ getBuildingID(event){
         unit_number:'أختار رقم الوحدة',
       });
 
-      if(x > 1)
+             if(this.reportValue == 1){
+            this.showSearchBtn = true;
+
+          }else{
+            if(x > 1)
             this.isUnit = true;
+          }
 
     },
 
@@ -219,12 +224,15 @@ unitNum(event){
       this.secondReport = false;
       this.thirdReport = false;
       this.fourthReport = false;
+
       this.reportName ='الوحدات الساكنيه'
     }
     if(this.reportValue == 2){
       this.fristReport = false;
       this.thirdReport = false;
       this.fourthReport = false;
+      this.showSearchBtn = true;
+      
       this.reportName ='تقرير السكان في المحمع و المباني'
 
     }
@@ -232,6 +240,7 @@ unitNum(event){
       this.fristReport = false;
       this.secondReport = false;
       this.fourthReport = false;
+      this.showSearchBtn = true;
       this.placeholder = 'ادخل رقم هوية الموظف'
       this.searchValue = '';
       this.reportName ='تقرير ساكن'
@@ -241,6 +250,7 @@ unitNum(event){
       this.fristReport = false;
       this.secondReport = false;
       this.thirdReport = false;
+      this.showSearchBtn = true;
       this.placeholder = 'ادخل رقم او كود الوحدة'
       this.searchValue = '';
       this.reportName ='تقرير العهد'

+ 20 - 2
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.html

@@ -34,6 +34,7 @@
                     </select>
                   </div>
                 </div>
+
               <div class="col-12 col-sm-12 col-md-4">
                 <div class="form-group">
                    <label for="vehicle_recipient_name" style="float: right; margin-right: 5px">إسم الموظف</label>
@@ -62,7 +63,7 @@
 
               <div class="col-12 col-sm-12 col-md-4 col-lg-4">
                 <div class="form-group">
-                  <label for="endDate" style="float:right" >تاريخ تسليم البطاقه <span class="spanReqired-w">*</span></label>
+                  <label for="endDate" style="float:right" >تاريخ تسليم المركبة <span class="spanReqired-w">*</span></label>
                   <div *ngIf='bindingDateSplitEnd && typeMode'>
                     <app-end-higri-date  (onDatePicked)="getDate($event, 'end')" [myEndDate]="bindingDateSplitEnd"> </app-end-higri-date>
                   </div>
@@ -71,7 +72,24 @@
                   </div>
                 </div>
               </div>
-
+              <div class="col-12 col-sm-12 col-md-4 col-lg-4">
+                  <div class="form-group">
+                    <label for="time" style="float:right" >وقت استلام المركبة <span class="spanReqired-w">*</span></label>
+                    <input type="time" class="form-control" placeholder="" name="vehicle_receipt_time" id="vehicle_receipt_time" appOnlyNumber [(ngModel)]="formData.vehicle_receipt_time" ngModel required />
+                  </div>
+                </div>
+                <div class="col-12 col-sm-12 col-md-4 col-lg-4">
+                    <div class="form-group">
+                      <label for="time" style="float:right" >وقت تسليم المركبة <span class="spanReqired-w">*</span></label>
+                      <input type="time" class="form-control" placeholder="" name="vehicle_delivery_time" id="vehicle_delivery_time" appOnlyNumber [(ngModel)]="formData.vehicle_delivery_time" ngModel required />
+                    </div>
+                  </div>
+                    <div class="col-12 col-sm-12 col-md-4 col-lg-4">
+                        <div class="form-group">
+                          <label  style="float:right" >سبب مهمة العمل<span class="spanReqired-w">*</span></label>
+                          <input type="text" class="form-control" placeholder="" name="job_task_reason" id="job_task_reason"  [(ngModel)]="formData.job_task_reason" ngModel required />
+                        </div>
+                      </div>
               <div class="col-12 col-sm-12 col-md-4">
                 <div class="form-group">
                     <label for="start_mileage_recording" style="float: right; margin-right: 5px">تسجيل عدد الكيلومترات البداية</label>

+ 6 - 0
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.ts

@@ -61,6 +61,9 @@ export class RegisterMovementVehicleAddComponent implements OnInit {
     start_mileage_recording: '',
     end_mileage_recording: '',
     movement_notes: '',
+    vehicle_receipt_time:'',
+    vehicle_delivery_time:'',
+    job_task_reason:'',
   }
 
   ngOnInit() {
@@ -93,6 +96,9 @@ export class RegisterMovementVehicleAddComponent implements OnInit {
             this.formData.end_mileage_recording = responce['movement'].end_mileage_recording;
             this.formData.start_mileage_recording = responce['movement'].start_mileage_recording;
             this.formData.vehicle_type_id = responce['movement'].vehicle_type_id;
+            this.formData.vehicle_delivery_time = responce['movement'].vehicle_delivery_time;
+            this.formData.vehicle_receipt_time = responce['movement'].vehicle_receipt_time;
+            this.formData.job_task_reason = responce['movement'].job_task_reason;
             this.getLicenseNum(this.formData.vehicle_type_id);
 
             this.formData.vehicle_id = responce['movement'].vehicle_id;

+ 4 - 4
src/app/dashboard/unit-building-information/unit-building-information-list/unit-building-information-list.component.html

@@ -27,33 +27,33 @@
           <div class="col-12 col-sm-12 col-md-12 col-lg-3">
             <div class="form-group">
               <span class="spanSelect-w" style="margin-right:10px;">
+                  من العناصر يتم عرضها
                 <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                   <option value="5">5</option>
                   <option value="10">10</option>
                   <option value="15">15</option>
                   <option value="20">20</option>
                 </select>
-                من العناصر يتم عرضها
               </span>
             </div>
           </div>
           <div class="col-12 col-sm-12 col-md-12 col-lg-3">
               <div class="form-group">
                 <span class="spanSelect-w" style="margin-right:10px;">
+                    المجمع السكني
                   <select [ngModel]="housing_complex_id" class="form-control selectButton-w" (input)="getBuildingsType($event.target.value)">
                     <option *ngFor="let complex of complex_list" [value]="complex.id">{{complex.name}}</option>
                   </select>
-                 المجمع السكني
                 </span>
               </div>
             </div>
             <div class="col-12 col-sm-12 col-md-12 col-lg-3" *ngIf="isComplex">
                 <div class="form-group">
                   <span class="spanSelect-w" style="margin-right:10px;">
+                      نوع المبنى
                     <select [ngModel]="building_type_id" class="form-control selectButton-w" (input)="getBuilding($event.target.value)">
                     <option *ngFor="let type of building_types" [value]="type.id">{{type.name}}</option>
                     </select>
-                     نوع المبنى
                   </span>
                 </div>
               </div>
@@ -61,10 +61,10 @@
               <div class="col-12 col-sm-12 col-md-12 col-lg-3" *ngIf="isBuildingType">
                   <div class="form-group">
                     <span class="spanSelect-w" style="margin-right:10px;">
+                        اسم المبنى
                       <select [ngModel]="building_id" class="form-control selectButton-w" (input)="getBuildingID($event.target.value)">
                        <option *ngFor="let building of building" [value]="building.id">{{building.building_name}}</option>
                       </select>
-                      اسم المبنى
                     </span>
                   </div>
                 </div>  

+ 8 - 4
src/app/dashboard/view_my_female_requests/view-my-female-requests-list/view-my-female-requests-list.component.html

@@ -17,7 +17,7 @@
         </div>
         <div class="col-12 col-sm-12 col-md-6 col-lg-6">
           <div class="form-group">
-            <input type="text" placeholder="البحث (اسم المبني او رمز المبنى)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
+            <input type="text" placeholder="البحث (اسم الطلب او اسم صاحب الطلب)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
             <hr>
           </div>
         </div>
@@ -27,26 +27,26 @@
           <div class="col-6 col-sm-12 col-md-12 col-lg-6">
             <div class="form-group">
               <span class="spanSelect-w" style="margin-right:10px;">
+                  من العناصر يتم عرضها
                 <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                   <option value="5">5</option>
                   <option value="10">10</option>
                   <option value="15">15</option>
                   <option value="20">20</option>
                 </select>
-                من العناصر يتم عرضها
               </span>
             </div>
           </div>
           <div class="col-6 col-sm-12 col-md-12 col-lg-6">
               <div class="form-group">
                 <span class="spanSelect-w" style="margin-right:10px;">
+                    الحالة
                   <select [ngModel]="status" class="form-control selectButton-w" (input)="onGetStatus($event.target.value)">
                     <option value="all">الكل</option>
                     <option value="new">جديد</option>
                     <option value="accepted">مقبول</option>
                     <option value="refused">مرفوض</option>
                   </select>
-                 الحالة
                 </span>
               </div>
             </div>
@@ -61,6 +61,8 @@
                 <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
               </div>
             </th>
+            <th>اسم صاحب الطلب</th>
+            <th>رقم الهويه</th>
             <th> رقم الطلب</th>
             <th *ngIf="accept">نوع الطلب</th>
             <th>الحاله</th>
@@ -76,9 +78,11 @@
               <!-- <label class="custom-control-label disblayBlock-w" for="{{tab.id}}" style="color:#2a2a2a"></label> -->
               </div>
             </td>
+            <td>{{data.name}}</td>
+            <td>{{data.identity_number}}</td>
             <td>{{data.id}}</td>
             <td>{{data.type_name}}</td>
-            <td *ngIf="accept">{{data.status == 'new' ? 'جديد' : data.status == 'accepted' ? 'مقبول' : data.status == 'refused' ? 'مرفوض' : 'not found'}}</td>
+            <td *ngIf="accept">{{data.status == 'new' ? 'جديد' : data.status == 'accepted' ? 'مقبول' : data.status == 'refused' ? 'مرفوض' : data.status == 'confirmed' ? 'طلب مؤكد':'not found'}}</td>
             
           <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>
         </tr>

+ 1 - 1
src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-details/view-requests-for-adminstration-details.component.html

@@ -149,7 +149,7 @@
                                   <div class="col-12 col-sm-12 col-md-4" *ngIf="isBuildingType">
                                       <div class="form-group">
                                           <label style="float: right; margin-right: 5px">اسم المبنى </label>
-                                          <select class="form-control" name="building_id" [(ngModel)]="unitInformation.building_id " (input)="getUnit($event.target.value)" required>
+                                          <select class="form-control" name="building_id" [(ngModel)]="unitInformation.building_id " (input)="getUnit($event.target.value, 0)" required>
                                             <option *ngFor="let building of buildings" [value]="building.id" >{{building.building_name}}</option>
                                           </select>
                                       </div>

+ 8 - 6
src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-details/view-requests-for-adminstration-details.component.ts

@@ -94,7 +94,6 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
         this.formData.request_id = res['request'].id;
         this.formData.refused_reason = res['request'].refused_reason;
         this.formData.waiting_reason = res['request'].waiting_reason;
-        this.formData.unit_id = res['request'].unit_id;
         this.formData.status = res['request'].status
         if(this.formData.status == 'accepted' ||  this.formData.status == 'ended' ){
           this.unitInformation.housing_complex_id = res['request'].unit_information.housing_complex_id;
@@ -103,7 +102,7 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
           this.unitInformation.building_type_id = res['request'].unit_information.building_type_id;
           this.getBuilding(this.unitInformation.building_type_id);
           this.unitInformation.building_id = res['request'].unit_information.building_id;
-          this.unitInformation.unit_id = res['request'].unit_information.unit_id;
+          this.unitInformation.unit_id = res['request'].unit_id;
            this.accept();
         }else if(this.formData.status == 'confirmed'){
           this.confirmed = false
@@ -243,7 +242,10 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
         if(this.buildings.length > 0){
           this.isBuildingType = true;
           console.log(this.buildings);
-          this.getUnit(this.unitInformation.building_id);         
+          if(this.formData.status == 'accepted' ||  this.formData.status == 'ended' ){
+
+            this.getUnit(this.unitInformation.building_id , 1);         
+          }
         }else{
              this.isBuildingType = false;
              this.isBuilding = false;
@@ -258,14 +260,14 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
     );
 }
 
-getUnit(event){
-  this.http.get(this.authSer.pathApi + '/units_list_by_building_id/' + event ).subscribe(
+getUnit(event , s){
+  this.http.get(this.authSer.pathApi + '/units_list_by_building_id/' + event + '/' +s).subscribe(
     res => {
       console.log(res);
       this.units = res['units'];
       if(this.units.length > 0){
         this.isBuilding = true;
-        console.log(this.units);
+        console.log(this.units); 
 
       }else{
            this.isBuilding = false;

+ 2 - 2
src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-list/view-requests-for-adminstration-list.component.html

@@ -27,19 +27,20 @@
         <div class="col-6 col-sm-12 col-md-12 col-lg-6">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
+                من العناصر يتم عرضها
               <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                 <option value="5">5</option>
                 <option value="10">10</option>
                 <option value="15">15</option>
                 <option value="20">20</option>
               </select>
-              من العناصر يتم عرضها
             </span>
           </div>
         </div>
         <div class="col-6 col-sm-12 col-md-12 col-lg-6">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
+                الحالة
               <select [ngModel]="status" class="form-control selectButton-w" (input)="onGetStatus($event.target.value)">
                 <option value="all">الكل</option>
                 <option value="new">جديد</option>
@@ -49,7 +50,6 @@
                 <option value="waiting">الانتظار</option>
                 <option value="ended">أنتهاء</option>
               </select>
-             الحالة
             </span>
           </div>
         </div>

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

@@ -167,7 +167,10 @@
                           <div class="row">
                             <div class="col-12">
                               <div class="wrapper">
-                                  
+                                  <div class="form-group" *ngFor="let item of covenants">
+                                      <label style="float: right; margin-right: 5px"> {{item.covenant_name}} </label>
+                                      <h3>{{item.covenant_amount}}</h3>
+                                    </div>
                               </div>
                           </div>
                         </div>
@@ -185,7 +188,8 @@
               
             <div class="row">
               <div class="col-12">
-                  <button type="submit" class="btn btn-success rightW"  [disabled]="notvailed" *ngIf="acceptCheak" >تأكيد الطلب</button>
+                  <button type="button" class="btn btn-success rightW"  [disabled]="notvailed" (click)="onSubmitted('confirmed')" *ngIf="acceptCheak" >تأكيد الطلب</button>
+                  <button type="button" class="btn btn-danger rightW"  [disabled]="notvailed"  (click)="onSubmitted('refused')" *ngIf="acceptCheak" >رفض الطلب</button>
                 <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()" style="margin:20px 10px;">رجوع</button>
               </div>
             </div>

+ 8 - 6
src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.ts

@@ -32,7 +32,7 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
   isBuilding = false;
   status = ''
   notvailed: boolean = true
-
+  covenants= []
   constructor(
     private dashBoardSer: DashboardService,
     private toastr: ToastrService,
@@ -56,7 +56,7 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
   }
   onSending = {
     request_id:'',
-    status:'confirmed',
+    status:'',
   }
   userData = {
     name:'',
@@ -100,13 +100,13 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
     this.dashBoardSer.getItemData(this.detailsId, 'viewRequestsForAdminstrationDetails' ).subscribe(
       res => {
         console.log('ssss', res);
+        // this.editFunction()
        
         this.employeeId = res['request'].employee_id;
         this.files = res['request'].files;
         this.formData.request_id = res['request'].id;
         this.formData.refused_reason = res['request'].refused_reason;
         this.formData.waiting_reason = res['request'].waiting_reason;
-        this.formData.unit_id = res['request'].unit_id;
         this.formData.status = res['request'].status
         if(this.formData.status == 'accepted' ||  this.formData.status == 'ended' ){
           this.unitInformation.housing_complex_id = res['request'].unit_information.housing_complex_id;
@@ -115,12 +115,13 @@ export class ViewRequestsForTenantDetailsComponent implements OnInit {
           this.unitInformation.building_type_id = res['request'].unit_information.building_type_id;
           this.getBuilding(this.unitInformation.building_type_id);
           this.unitInformation.building_id = res['request'].unit_information.building_id;
-          this.unitInformation.unit_id = res['request'].unit_information.unit_id;
+          this.unitInformation.unit_id = res['request'].unit_id;
           this.unitInformation.bedrooms_number = res['request'].unit_information.bedrooms_number;
           this.unitInformation.bathrooms_number = res['request'].unit_information.bathrooms_number;
           this.unitInformation.covenants = res['request'].unit_information.covenants;
           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();
         }else if(this.formData.status == 'waiting'){
           this.waiting()
@@ -266,14 +267,15 @@ getUnit(event){
 }
 
 
-onSubmitted() {
+onSubmitted(status) {
   this.onSending.request_id = this.formData.request_id; 
   this.notvailed = true;
+  this.onSending.status = status;
   console.log(this.onSending);
   this.http.post(this.authSer.pathApi + '/employee_handle_housing_request' , this.onSending).subscribe(
     res => {
       console.log(res);
-      this.toastr.success('تم التأكيد');
+      this.toastr.success();
       this.location.back()
       
     },

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

@@ -27,19 +27,20 @@
         <div class="col-6 col-sm-12 col-md-12 col-lg-6">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
+                من العناصر يتم عرضها
               <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                 <option value="5">5</option>
                 <option value="10">10</option>
                 <option value="15">15</option>
                 <option value="20">20</option>
               </select>
-              من العناصر يتم عرضها
             </span>
           </div>
         </div>
         <div class="col-6 col-sm-12 col-md-12 col-lg-6">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
+                الحالة
               <select [ngModel]="status" class="form-control selectButton-w" (input)="onGetStatus($event.target.value)">
                 <option value="all">الكل</option>
                 <option value="new">جديد</option>
@@ -49,7 +50,6 @@
                 <option value="waiting">الانتظار</option>
                 <option value="ended">أنتهاء</option>
               </select>
-             الحالة
             </span>
           </div>
         </div>