Amr 5 éve
szülő
commit
305479394f
39 módosított fájl, 313 hozzáadás és 186 törlés
  1. 3 3
      src/app/auth-services/regester/regester.component.html
  2. 5 5
      src/app/dashboard/application-for-housing/application-for-housing.component.html
  3. 11 5
      src/app/dashboard/application-for-housing/application-for-housing.component.ts
  4. 1 1
      src/app/dashboard/dashboard-routing.ts
  5. 3 2
      src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.html
  6. 3 3
      src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.html
  7. 3 0
      src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.ts
  8. 4 3
      src/app/dashboard/females_request_types/females-request-types-add/females-request-types-add.component.html
  9. 1 1
      src/app/dashboard/females_request_types/females-request-types-add/females-request-types-add.component.ts
  10. 1 0
      src/app/dashboard/females_request_types/females-request-types-list/females-request-types-list.component.ts
  11. 3 3
      src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-add/link-unit-to-covenants-add.component.html
  12. 20 6
      src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-add/link-unit-to-covenants-add.component.ts
  13. 6 8
      src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-list/link-unit-to-covenants-list.component.html
  14. 3 2
      src/app/dashboard/living-service/living-service-add/living-service-add.component.html
  15. 3 2
      src/app/dashboard/living-service/living-service-add/living-service-add.component.ts
  16. 9 1
      src/app/dashboard/living-service/living-service-list/living-service-list.component.ts
  17. 2 2
      src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.css
  18. 34 28
      src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.html
  19. 6 14
      src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.ts
  20. 6 5
      src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.html
  21. 11 3
      src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.ts
  22. 4 1
      src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.ts
  23. 5 4
      src/app/dashboard/unit-building-information/unit-building-information-add/unit-building-information-add.component.html
  24. 9 2
      src/app/dashboard/unit-building-information/unit-building-information-add/unit-building-information-add.component.ts
  25. 6 6
      src/app/dashboard/unit-building-information/unit-building-information-list/unit-building-information-list.component.html
  26. 3 0
      src/app/dashboard/unit-building-information/unit-building-information-list/unit-building-information-list.component.ts
  27. 4 3
      src/app/dashboard/unit-information/unit-information-add/unit-information-add.component.html
  28. 4 0
      src/app/dashboard/unit-information/unit-information-list/unit-information-list.component.ts
  29. 5 4
      src/app/dashboard/view_my_female_requests/view-my-female-requests-add/view-my-female-requests-add.component.html
  30. 57 17
      src/app/dashboard/view_my_female_requests/view-my-female-requests-add/view-my-female-requests-add.component.ts
  31. 10 10
      src/app/dashboard/view_my_female_requests/view-my-female-requests-list/view-my-female-requests-list.component.html
  32. 3 3
      src/app/dashboard/view_my_female_requests/view-my-female-requests-list/view-my-female-requests-list.component.ts
  33. 7 6
      src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-details/view-requests-for-adminstration-details.component.html
  34. 18 10
      src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-details/view-requests-for-adminstration-details.component.ts
  35. 8 8
      src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-list/view-requests-for-adminstration-list.component.html
  36. 11 1
      src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-list/view-requests-for-adminstration-list.component.ts
  37. 7 4
      src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.html
  38. 5 1
      src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.ts
  39. 9 9
      src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant/view-requests-for-tenant.component.html

+ 3 - 3
src/app/auth-services/regester/regester.component.html

@@ -25,7 +25,7 @@
             </div>
           </div>
 
-          <!-- <div class="col-12 col-sm-12 col-md-6 col-lg-4" *ngIf="showTypeInput">
+          <div class="col-12 col-sm-12 col-md-6 col-lg-4" *ngIf="showTypeInput">
             <div class="form-group">
               <label style="float: right; margin-right:5px;margin-top:10px">الحاله <span class="spanReqired-w">*</span></label>
               <div class="custom-control custom-radio inlineBlock-w" style="padding: 2px 31px;background: #bd90592e;color: #a98559;border: 1px solid #b38553c2;">
@@ -39,7 +39,7 @@
               </div>
 
             </div>
-          </div> -->
+          </div>
 			
 			<div class="col-sm-12 col-md-12 col-lg-12">
 				<div class="row">
@@ -148,7 +148,7 @@
 					<fieldset class="formfieldset">
 
 					  <legend>
-						<span>المعلومات الوظيفية</span>
+						  <span>المعلومات الوظيفية</span>
 						</legend>
 					
 						  

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

@@ -16,8 +16,8 @@
         <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} "/>
-              <button type="button" class="btn btn-success buttonS" (click)="SearchOnUser()">أبحث</button>
+              <input type="number" placeholder="ابحث برقم الهوية" class="form-control numberReport-s" [(ngModel)]="searchValue" [ngModelOptions]="{standalone: true} "/>
+              <button type="button" class="btn btn-success buttonS"   (click)="SearchOnUser()">أبحث</button>
             </div>
           </div> 
         </div>
@@ -87,9 +87,9 @@
                             <td style="position: relative;">
                                 <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"></i></label>
-                                <span class="fileName-w" *ngIf="file.nameFile" style="color:green"> <i class='fas fa-check'style=" float: left; padding-top: 4px; "></i>
+                                <span class="fileName-w" *ngIf="file.nameFile" style="color:green"> <i class='fas fa-check'style=" float: left; position: relative; top: -23px;"></i>
                                 </span>
-                              </td>
+                              </td> 
                               <!-- <td><a href="{{authSer.pathImg + file.nameFile}}" 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>
@@ -110,7 +110,7 @@
              
             <div class="row">
               <div class="col-12">
-                  <button type="submit" class="btn btn-success rightW"  [disabled]="send || saveTherequist" >حفظ</button>
+                  <button type="submit" class="btn btn-success rightW"  [disabled]=" saveTherequist" >حفظ</button>
                 <button type="button" class="btn btn-warning rightW" (click)="authService.backFromEdit()" style="margin:20px 10px;">إلغاء</button>
               </div>
             </div>

+ 11 - 5
src/app/dashboard/application-for-housing/application-for-housing.component.ts

@@ -206,15 +206,21 @@ export class ApplicationForHousingComponent implements OnInit {
           res => {
             console.log('ser' , res);
             const status = res['status']
-            if(status == 'employee free to make new request'){
-              this.toastr.warning('لديه طلب بالفعل');
-              this.applyForOther = false;
-              this.showdetails = false;
+            if(status == 'employee already has an un finished request'){
+              this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewRequestsForAdminstration/70'])
+              this.toastr.warning('لديك  طلب بالفعل ');
+                    
+            }else if(status !=  "employee free to make new request"){
+              this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewRequestsForAdminstration/70'])
+              this.toastr.warning('لديك  طلب بالفعل ');
             }
           },
           err => {
               console.log(err);
-              
+              if(err.error.error !=  "employee free to make new request"){
+                this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewRequestsForAdminstration/70' ])
+                this.toastr.warning('لديك  طلب بالفعل ');
+              }
           }
         );
 

+ 1 - 1
src/app/dashboard/dashboard-routing.ts

@@ -287,7 +287,7 @@ const dashboardRouting: Routes = [
     {path: 'femalesRequestTypesAdd', component: FemalesRequestTypesAddComponent, canActivate: [AuthGuard]},
     {path: 'femalesRequestTypes/edit/:editPageId', component: FemalesRequestTypesAddComponent, canActivate: [AuthGuard]},
     {path: 'viewMyFemaleRequestsList/:listPageId', component: ViewMyFemaleRequestsListComponent, canActivate: [AuthGuard]},
-    {path: 'viewMyFemaleRequestsAdd', component: ViewMyFemaleRequestsAddComponent, canActivate: [AuthGuard]},
+    {path: 'viewMyFemaleRequestsAdd/:type', component: ViewMyFemaleRequestsAddComponent, canActivate: [AuthGuard]},
     {path: 'viewMyFemaleRequests/edit/:editPageId/:type', component: ViewMyFemaleRequestsAddComponent, canActivate: [AuthGuard]},
     {path: 'livingSystemReports/:listPageId', component: LivingSystemReportsComponent, canActivate: [AuthGuard]},
     

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

@@ -5,7 +5,8 @@
       <div class="row">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w"> خدمه البلاغات </li>
+            <li class="headingText-w"> خدمه السكن </li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px; cursor: pointer;" (click)="authSer.backFromEdit()">تعريف  العهد</li>
             <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
           </ul>
         </div>
@@ -25,7 +26,7 @@
               <div class="col-12 col-sm-12 col-md-4">
                 <div class="form-group">
                   <label style="float: right; margin-right: 5px">اسم المادة او العهدة<span class="spanReqired-w">*</span></label>
-                  <input type="text" class="form-control" id="name" name="name" placeholder=" اسم المادة او العهدة" ngModel [ngModel]="formData.name" required/>
+                  <input type="text" class="form-control" id="name" name="name" maxlength="255" placeholder=" اسم المادة او العهدة" ngModel [ngModel]="formData.name" required/>
                </div>
               </div>
           

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

@@ -24,20 +24,20 @@
     </div>
 
     <div class="row">
-        <div class="col-12 col-sm-12 col-md-12 col-lg-6">
+        <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-6">
+        <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;">
                 تصنيف العهدة

+ 3 - 0
src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.ts

@@ -297,6 +297,9 @@ onDelete() {
           (error) => {
             console.log(error);
             this.spinner.hide();
+            if(error.error.status == 'covenant is already taken in units'){
+              this.toastr.warning('لا يمكنك حذف العهده لانها جزء من النظام')
+            }
             },
           )
       );

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

@@ -5,7 +5,8 @@
       <div class="row">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w"> خدمه البلاغات </li>
+            <li class="headingText-w"> خدمه السكن </li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px; cursor: pointer;" (click)="authSer.backFromEdit()" >تحديد انواع الطلبات</li>  
             <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
           </ul>
         </div>
@@ -23,7 +24,7 @@
               <div class="col-12 col-sm-12 col-md-4">
                 <div class="form-group">
                   <label style="float: right; margin-right: 5px"> وصف الطلب</label>
-                  <input type="text" class="form-control" id="description" name="description" placeholder="اسم الطلب " ngModel [(ngModel)]="formData.description" />
+                  <input type="text" class="form-control" id="description" name="description" placeholder="وصف الطلب " ngModel [(ngModel)]="formData.description" />
 
                    <!-- <textarea name="description" id="description"  [(ngModel)]="formData.description" maxlength="250"  cols="20" rows="5" ></textarea>  -->
                </div>
@@ -112,7 +113,7 @@
             </div>
           
           <div class=" row col-6">
-              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid ">حفظ</button>
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || disable ">حفظ</button>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
           </div>
         </form>

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

@@ -104,7 +104,7 @@ export class FemalesRequestTypesAddComponent implements OnInit {
   onSubmitted() {
     console.log('HERE',this.formData);
  
-    this.disable = true;
+    this.disable = false;
     if(this.editPageId) {
       this.dashBoardSer.editItem(this.editPageId, this.formData, 'femalesRequestTypes').subscribe(
         (responce) => {

+ 1 - 0
src/app/dashboard/females_request_types/females-request-types-list/females-request-types-list.component.ts

@@ -110,6 +110,7 @@ export class FemalesRequestTypesListComponent implements OnInit {
           this.dataList = res['types'];
           this.count = res['count'];
           this.perPagePagenation = res['per_page'];
+          this.spinner.hide();
         },
         err => {
           console.log(err);

+ 3 - 3
src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-add/link-unit-to-covenants-add.component.html

@@ -6,6 +6,7 @@
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
             <li class="headingText-w"> خدمه  السكن </li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px;cursor: pointer;" (click)="authSer.backFromEdit()">ربط السكن بالعهد</li>
             <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
           </ul>
         </div>
@@ -68,15 +69,14 @@
                           <div class="col-6"  *ngIf="categoryId == category_conv.category_id">
                               <div class=form-group>
                                 <div class="custom-control custom-checkbox centerIneerItem">
-                                  <input type="checkbox" class="custom-control-input checkboxx" id="{{category_conv.id}}" [(ngModel)]="category_conv.selected" [value]='category_conv.id' name="{{category_conv.id}}" style="cursor: pointer;" (input)="checked($event.target.value)">
+                                  <input type="checkbox" class="custom-control-input checkboxx" id="{{category_conv.id}}" [(ngModel)]="category_conv.selected" [value]='category_conv.id' name="{{category_conv.id}}" style="cursor: pointer;" (change)="checked($event.target.value)">
                                   <label class="custom-control-label disblayBlock-w" for="{{category_conv.id}}" style="color:#2a2a2a; cursor:pointer; padding: 0 20px; margin: -3px 5px">{{category_conv.name}}</label>
                                 </div>
                               </div>
                             </div> 
                             <div class="col-6"  *ngIf="categoryId == category_conv.category_id ">
                               <div class="form-group">
-                                <input type="number" class="form-control" placeholer="amount" min="1" max="{{category_conv.available_amount}}"  [(ngModel)]="category_conv.covenant_amount" [ngModelOptions]="{standalone: true}"/>
-                                <!-- <p style="color: red" *ngIf="over">تخطيت الحد المسموح</p> -->
+                                <input type="number" class="form-control" placeholer="amount" min="1" max="{{category_conv.available_amount}}"  [(ngModel)]="category_conv.covenant_amount"  [ngModelOptions]="{standalone: true}"  (input)="check_max(category_conv.covenant_amount, category_conv.available_amount, category_conv.name)" />
                               </div>
                             </div>
                       </div>

+ 20 - 6
src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-add/link-unit-to-covenants-add.component.ts

@@ -5,7 +5,7 @@ import { Location } from '@angular/common';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ToastrService } from 'ngx-toastr';
 import { DashboardService } from './../../../shared/dashboard.service';
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
 import { NgForm } from '@angular/forms';
 
 @Component({
@@ -48,6 +48,7 @@ export class LinkUnitToCovenantsAddComponent implements OnInit {
   ) { }
 
   @ViewChild('f') linkForm : NgForm;
+  @ViewChild('amountVal') amountVal: ElementRef;
 
   formData = {
     housing_complex_id:'',
@@ -148,6 +149,7 @@ export class LinkUnitToCovenantsAddComponent implements OnInit {
   }
 
   getBuildingType(event){
+    this.building_types = []
     console.log('sdsdsd',event);
     const id = event;
     this.isComplex = false;
@@ -167,6 +169,8 @@ export class LinkUnitToCovenantsAddComponent implements OnInit {
            this.isComplex = false;
            this.isBuildingType = false;
            this.isBuilding = false;
+           this.toastr.warning('لا يوجد انواع مباني لهذا المجمع')
+
         }
       },
       err => {
@@ -177,6 +181,7 @@ export class LinkUnitToCovenantsAddComponent implements OnInit {
   }
 
   getBuilding(event){
+    this.buildings = []
     this.http.get(this.authSer.pathApi + '/buildings_list_by_type_id/' + event ).subscribe(
       res => {
         console.log('res',res);
@@ -190,6 +195,8 @@ export class LinkUnitToCovenantsAddComponent implements OnInit {
         }else{
              this.isBuildingType = false;
              this.isBuilding = false;
+             this.isConvenat = false;
+           this.toastr.warning('لا يوجد بيانات لهذا النوع من المباني')
             
           }
           
@@ -203,7 +210,7 @@ export class LinkUnitToCovenantsAddComponent implements OnInit {
 
 getUnit(event){
   console.log('unit id >>' , this.unitId);
-  
+  this.units = []
   this.http.get(this.authSer.pathApi + '/units_list_by_building_id/' + event ).subscribe(
     res => {
       console.log(res);
@@ -215,6 +222,8 @@ getUnit(event){
 
       }else{
            this.isBuilding = false;
+           this.isConvenat = false;
+           this.toastr.warning('لا يوجد وحدات لهذا المبنى ')
         }
 
     },
@@ -240,7 +249,12 @@ getUnit(event){
       console.log(this.formData.covenants);
     } 
 
-
+    check_max(value, max, name){
+      console.log( 'ss',value, max, name);
+      if(value > max){
+        this.toastr.warning('عفوا لقد تجاوزت العدد المحدد لـ'+name)
+      }
+    } 
     showcovenant_categories(){
       this.isConvenat = true;
     }
@@ -254,11 +268,11 @@ getUnit(event){
           
               if(event == this.formData.covenants[i].covenants_data[j].id ){
 
-                this.formData.covenants[i].covenants_data[j].covenant_amount = 1
+                // this.formData.covenants[i].covenants_data[j].covenant_amount = 1
                   if(this.formData.covenants[i].covenants_data[j].selected == false){
-                    this.formData.covenants[i].covenants_data[j].covenant_amount = 1
+                    this.formData.covenants[i].covenants_data[j].covenant_amount = 0
                     }else{
-                      this.formData.covenants[i].covenants_data[j].covenant_amount = 0
+                      this.formData.covenants[i].covenants_data[j].covenant_amount = 1
                     }
                 
                               

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

@@ -36,15 +36,13 @@
                 </span>
               </div>
             </div>
-      </div>
-  
-      <div class="row">
+
        
           <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)">
+                  <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>
@@ -52,9 +50,9 @@
             </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)">
+                      نوع المبنى
+                    <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>
@@ -65,7 +63,7 @@
                   <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)">
+                      <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>
@@ -76,7 +74,7 @@
                     <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)" >
+                        <select [ngModel]="unitId" class="form-control selectButton-w" (input)="unitNum($event.target.value)" style="margin-right: 44px;padding-top: 10px;">
                          <option *ngFor="let unit of units" [value]="unit.id">{{unit.unit_number}}</option>
                         </select>
                       </span>

+ 3 - 2
src/app/dashboard/living-service/living-service-add/living-service-add.component.html

@@ -5,7 +5,8 @@
       <div class="row">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w"> خدمه البلاغات </li>
+            <li class="headingText-w"> خدمه السكن </li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px; cursor: pointer;" (click)="authSer.backFromEdit()">تعريف تصنيفات العهد</li>
             <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
           </ul>
         </div>
@@ -17,7 +18,7 @@
                 <div class="col-12 col-sm-12 col-md-4">
                     <div class="form-group">
                       <label for="name" style="float: right; margin-right: 5px">اسم التصنيف<span class="spanReqired-w">*</span></label>
-                      <input type="text" class="form-control" id="name" name="name" placeholder="اسم التصنيف" ngModel [ngModel]="formData.name" required/>
+                      <input type="text" class="form-control" id="name" name="name" placeholder="اسم التصنيف"   ngModel [ngModel]="formData.name"  maxlength="255" required/>
                     </div>
                   </div>
               

+ 3 - 2
src/app/dashboard/living-service/living-service-add/living-service-add.component.ts

@@ -5,7 +5,7 @@ import { Location } from '@angular/common';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ToastrService } from 'ngx-toastr';
 import { DashboardService } from './../../../shared/dashboard.service';
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
 import { NgForm } from '@angular/forms';
 
 @Component({
@@ -26,7 +26,6 @@ export class LivingServiceAddComponent implements OnInit {
   ) { }
 
   @ViewChild('f') definitionForm : NgForm;
-
   typePage: string = '';
   valueType: string = '';
   editPageId: number;
@@ -37,6 +36,7 @@ export class LivingServiceAddComponent implements OnInit {
   check : boolean = false;
   isEdit: boolean = false;
   disable: boolean = false;
+  max_size: boolean;
 
   formData = {
     name: '',
@@ -73,6 +73,7 @@ export class LivingServiceAddComponent implements OnInit {
     }
 
   }
+
   onSubmitted(){
     console.log('HERE',this.definitionForm.value);
     this.disable = true;

+ 9 - 1
src/app/dashboard/living-service/living-service-list/living-service-list.component.ts

@@ -146,6 +146,7 @@ filtterFunc(data) {
       this.perPagePagenation = res['per_page'];
       console.log('filtter count', this.count);
       console.log('filtter perPagePAgenation', this.perPagePagenation);
+      // alert(this.dataList.length);      
     },
     err => {
       console.log(err);
@@ -155,6 +156,7 @@ filtterFunc(data) {
 
 onPageChange(pagenationNumber) {
   this.spinner.show();
+  this.dataList = []
   this.currentPage = pagenationNumber;
   this.absorpationListIds = [];
   console.log(pagenationNumber);
@@ -167,6 +169,8 @@ onPageChange(pagenationNumber) {
       this.perPagePagenation = res['per_page'];
       console.log('FFFFFF', this.absorpationListIds);
       this.spinner.hide();
+      console.log(this.dataList.length);
+
     },
     err => {
       console.log(err);
@@ -261,8 +265,12 @@ onDelete() {
             );
           },
           (error) => {
-            console.log(error);
+            console.log(error.error.status);
+            if(error.error.status == 'covenant category id is already taken'){
+              this.toastr.warning('لا يمكنك حذف الصنف لانه جزء من النظام')
+            }
             this.spinner.hide();
+            
             },
           )
       );

+ 2 - 2
src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.css

@@ -179,7 +179,7 @@ select.ng-invalid{
     padding: 9px;
     border-radius: 5px 5px 0 0;
     margin-bottom: 0;
-    margin-right: -12px;
+    /* margin-right: -12px; */
     color: #fff;
 }
 .statusBtn-w {
@@ -346,7 +346,7 @@ select.ng-invalid{
  }
  .fit-filter-style{
     display: flex;
-    justify-content: center;
+    /* justify-content: center; */
     margin-top: 20px;
     text-align: center;
     margin-right: 2%;

+ 34 - 28
src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.html

@@ -9,44 +9,47 @@
           </div>
       </div>
       <div class="containerContent-w" id="print-section">
-          <div class="row printClass">
+          <!-- <div class="row printClass">
             <div class="col-12 col-md-4">
 
-                <div class="form-group">
-                    <span class="spanSelect-w" style="margin-right:10px;">
-                      <select [ngModel]="reportValue" class="form-control selectButton-w full"  (input)="getReport($event.target.value)">
-                        <option value="0"> رجاء الاختيار التقرير</option>
-                        <option value="1">تقارير عن الوحدات السكنية</option>
-                        <option value="2">تقارير عن السكان في مجمعات و المباني</option>
-                        <option value="3">تقارير عن ساكن</option>
-                        <option value="4">تقارير عن العهد الموجوده</option>
-                      </select>
-                    </span>
-                  </div>
+               
             </div>   
-           </div>
-           <div class="row fit-filter-style printClass" *ngIf="showFilters">
-              <div class="col-12 col-sm-3 col-md-3 col-lg-3">
-                <div class="form-group">
-                  <span class="spanSelect-w" style="margin-right:10px;">
+           </div> -->
+           <div class="row fit-filter-style printClass" >
+              <div class="col-12 col-sm-3 col-md-3 col-lg-2">
+                  <div class="form-group">
+                      <span class="spanSelect-w" style="margin-right:10px;">
+                        <select [ngModel]="reportValue" class="form-control selectButton-w full"  (input)="getReport($event.target.value)">
+                          <option value="0"> رجاء الاختيار التقرير</option>
+                          <option value="1">تقارير عن الوحدات السكنية</option>
+                          <option value="2">تقارير عن السكان في مجمعات و المباني</option>
+                          <option value="3">تقارير عن ساكن</option>
+                          <option value="4">تقارير عن العهد الموجوده</option>
+                        </select>
+                      </span>
+                    </div>
+              </div>
+              <div class="col-12 col-sm-3 col-md-3 col-lg-2">
+                <div class="form-group" *ngIf="showFilters">
+                  <span class="spanSelect-w" style="width: 100%;">
                     <select [ngModel]="housing_complex_id" class="form-control selectButton-w full" (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-3 col-md-3 col-lg-3" *ngIf="isComplex">
+              <div class="col-12 col-sm-3 col-md-3 col-lg-2" *ngIf="isComplex">
                 <div class="form-group">
-                  <span class="spanSelect-w" style="margin-right:10px;">
+                  <span class="spanSelect-w" style="width: 100%;">
                     <select [ngModel]="building_type_id" class="form-control selectButton-w full" (input)="getBuilding($event.target.value)">
                     <option *ngFor="let type of building_types" [value]="type.id">{{type.name}}</option>
                     </select>
                   </span>
                 </div>
               </div>
-              <div class="col-12 col-sm-3 col-md-3 col-lg-3" *ngIf="isBuildingType">
+              <div class="col-12 col-sm-3 col-md-3 col-lg-2" *ngIf="isBuildingType">
                 <div class="form-group">
-                  <span class="spanSelect-w" style="margin-right:10px;">
+                  <span class="spanSelect-w"style="width: 100%;">
                     <select [ngModel]="building_id" class="form-control selectButton-w full " (input)="getBuildingID($event.target.value)">
                       <option *ngFor="let building of buildings" [value]="building.id">{{building.building_name}}</option>
                     </select>
@@ -54,21 +57,24 @@
                 </div>
               </div>  
 
-              <div class="col-12 col-sm-12 col-md-12 col-lg-3" *ngIf="isUnit">
+              <div class="col-12 col-sm-12 col-md-12 col-lg-2" *ngIf="isUnit">
                 <div class="form-group">
-                  <span class="spanSelect-w" style="margin-right:10px;">
+                  <span class="spanSelect-w" style="width: 100%;">
                     <select [ngModel]="unitId" class="form-control selectButton-w full" (input)="unitNum($event.target.value)">
                      <option *ngFor="let unit of units" [value]="unit.id">{{unit.unit_number}}</option>
                     </select>
                   </span>
                 </div>
               </div>   
+              <div class="col-12 col-sm-12 col-md-12 col-lg-2">
+                <div class="row printClass" *ngIf="reportValue == 3 && showSearchBtn " style="justify-content: center;">
+                  <input type="text" placeholder="{{placeholder}}" class="form-control numberReport-s" [(ngModel)]="searchValue" style="width: 100%"/>
+                 </div>
+                </div>  
            </div>
-           <div class="row printClass" *ngIf="reportValue == 3 && showSearchBtn " style="justify-content: center; margin-top: 50px">
-            <input type="text" placeholder="{{placeholder}}" class="form-control numberReport-s" [(ngModel)]="searchValue" style="width: 25%"/>
-           </div>
-           <div class="row fit-filter-style printClass" *ngIf="showSearchBtn ">
-              <button class="btn btn-success buttonS" (click)="onSearch()" style="margin-left: 2%;">أبحث</button>            
+          
+           <div class="row fit-filter-style printClass" *ngIf="showSearchBtn " style="    padding: 25px;">
+              <button class="btn btn-success buttonS" (click)="onSearch()">أبحث</button>            
           </div>
 
           <div class="col-12" *ngIf="fristReport">

+ 6 - 14
src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.ts

@@ -154,9 +154,7 @@ getBuilding(event){
           this.isBuildingType= true;
 
           console.log(this.building_id , this.building_type_id , this.housing_complex_id);
-          if(this.fristReport || this.secondReport || this.thirdReport){
-            this.showSearchBtn = true;
-          }
+       
           
       },
       err =>{
@@ -180,13 +178,10 @@ getBuildingID(event){
         unit_number:'أختار رقم الوحدة',
       });
 
-             if(this.reportValue == 1){
-            this.showSearchBtn = true;
-
-          }else{
+   
             if(x > 1)
             this.isUnit = true;
-          }
+          
 
     },
 
@@ -199,19 +194,18 @@ getBuildingID(event){
 }
 unitNum(event){
  this.unitId = event;
- this.showSearchBtn = true;
+
 
   }
 
   getReport(event){
     this.reportValue = event
+    this.showSearchBtn= true;
     this.showFilters = true;
     this.housing_complex_id = 'all';
-
     this.isComplex = false;
     this.isBuildingType = false;
     this.isUnit = false;
-    this.showSearchBtn = false;
     this.building_types = [];
     this.buildings = [];
     this.assigned_units = [];
@@ -231,7 +225,7 @@ unitNum(event){
       this.fristReport = false;
       this.thirdReport = false;
       this.fourthReport = false;
-      this.showSearchBtn = true;
+
       
       this.reportName ='تقرير السكان في المحمع و المباني'
 
@@ -240,7 +234,6 @@ unitNum(event){
       this.fristReport = false;
       this.secondReport = false;
       this.fourthReport = false;
-      this.showSearchBtn = true;
       this.placeholder = 'ادخل رقم هوية الموظف'
       this.searchValue = '';
       this.reportName ='تقرير ساكن'
@@ -250,7 +243,6 @@ unitNum(event){
       this.fristReport = false;
       this.secondReport = false;
       this.thirdReport = false;
-      this.showSearchBtn = true;
       this.placeholder = 'ادخل رقم او كود الوحدة'
       this.searchValue = '';
       this.reportName ='تقرير العهد'

+ 6 - 5
src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.html

@@ -5,7 +5,8 @@
       <div class="row">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w"> خدمه البلاغات </li>
+            <li class="headingText-w"> خدمه السكن </li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px; cursor: pointer" (click)="authSer.backFromEdit()">تسجيل معلومات المجمعات السكنية</li>
             <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
           </ul>
         </div>
@@ -25,14 +26,14 @@
           <div class="col-12 col-sm-12 col-md-4">
             <div class="form-group">
               <label for="name" style="float: right; margin-right: 5px">اسم المجمع السكني<span class="spanReqired-w">*</span></label>
-              <input type="text" class="form-control" id="name" name="name" placeholder="اسم المجمع السكني" ngModel [(ngModel)]="formData.name" required/>
+              <input type="text" class="form-control" id="name" name="name" placeholder="اسم المجمع السكني" ngModel [(ngModel)]="formData.name" maxlength="255" required/>
             </div>
           </div>
 
           <div class="col-12 col-sm-12 col-md-4">
             <div class="form-group">
               <label for="land_area" style="float: right; margin-right: 5px">مساحة الأرض الإجمالية<span class="spanReqired-w">*</span></label>
-              <input type="text" class="form-control" id="land_area" name="land_area" placeholder="مساحة الأرض الإجمالية" ngModel [(ngModel)]="formData.land_area" required/>
+              <input type="text" class="form-control" id="land_area" name="land_area" placeholder="مساحة الأرض الإجمالية" ngModel [(ngModel)]="formData.land_area" maxlength="255" required/>
             </div>
           </div>
 
@@ -55,10 +56,10 @@
             <div class="col-12 col-sm-12 col-md-12" *ngFor="let building of formData.building_types; let i = index" style="padding: 20px;">
               <div class="form-group">
                 <div class="col-4">
-                <input type="text" class="form-control" id="building.name{{i}}" name="building.name{{i}}" placeholder="نوع " ngModel [(ngModel)]="building.name"  required/>
+                <input type="text" class="form-control" id="building.name{{i}}" name="building.name{{i}}" placeholder="نوع " maxlength="255"  ngModel [(ngModel)]="building.name"  />
               </div>
               <div class="col-4">
-                  <input type="number" class="form-control" id="building.value{{i}}" name="building.value{{i}}" min="1" placeholder="عدد {{building.name}}" ngModel [(ngModel)]="building.value" required/>
+                  <input type="number" class="form-control" id="building.value{{i}}" name="building.value{{i}}" min="1" placeholder="عدد {{building.name}}" ngModel [(ngModel)]="building.value" />
               </div>
               <div class="col-3">
                   <button type="button" class="btn btn-danger" (click)="onDeleteRow(i)" style="margin: 10px 15px;">حذف</button>

+ 11 - 3
src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.ts

@@ -115,9 +115,17 @@ export class RecordInfoBuildingAddComponent implements OnInit {
     onSubmitted(){
     console.log('HERE',this.definitionForm.value);
     console.log(this.formData);
+    for (let i = 0 , n = this.formData.building_types.length; i < n; i++) {
+      const value =this.formData.building_types[i].value;
+      const name = this.formData.building_types[i].name;
+      console.log(name , value)
+      if (value == '' || name == ''){
+         this.formData.building_types.splice(i , 1); 
+      }
+      }
     
+    this.disable = true;
     if(this.editPageId) {
-      this.disable = true;
       this.dashBoardSer.editItem(this.editPageId, this.formData, 'recordInfoBuilding').subscribe(
         res => {
           console.log(res);
@@ -130,7 +138,7 @@ export class RecordInfoBuildingAddComponent implements OnInit {
           console.log(err);
           if(err.error.error.complex_number[0] == 'The complex number has already been taken.'){
             this.toastr.warning('رقم المجمع موجود بالفعل')
-            this.disable = true;
+            this.disable = false;
             
           }else{
           this.disable = false;
@@ -154,7 +162,7 @@ export class RecordInfoBuildingAddComponent implements OnInit {
 
           if(err.error.error.complex_number[0] == 'The complex number has already been taken.'){
             this.toastr.warning('رقم المجمع موجود بالفعل')
-            this.disable = true;
+            this.disable = false;
             
           }else{
           this.disable = false;

+ 4 - 1
src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.ts

@@ -235,7 +235,7 @@ onDelete() {
       dialogRef.result
       .then( result =>
         this.dashboardSer.deleteItem(this.dataListIds , this.pageId).subscribe(
-          (responce) => {
+          (responce) => { 
             console.log(responce);
             this.toastr.success('تم الحذف');
             this.spinner.show();
@@ -258,6 +258,9 @@ onDelete() {
           (error) => {
             console.log(error);
             this.spinner.hide();
+            if(error.error.status == 'housing_complex already used'){
+              this.toastr.warning('لا يمكنك حذف المجمع السكني لانه جزء من النظام')
+            }
             },
           )
       );

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

@@ -6,6 +6,7 @@
           <div class="col-12">
             <ul class="list-unstyled titileLi-w">
               <li class="headingText-w"> خدمه  السكن </li>
+              <li class="headingText-w activeLi-w" style="margin-right:5px;cursor: pointer;" (click)="authSer.backFromEdit()">تسجيل معلومات المباني</li>
               <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
             </ul>
           </div>
@@ -50,13 +51,13 @@
                     <div class="col-12 col-sm-12 col-md-4">
                       <div class="form-group">
                         <label for="unit_code" style="float: right; margin-right: 5px">رمز الوحدة<span class="spanReqired-w">*</span></label>
-                        <input type="text" class="form-control" min="0" id="unit_code" name="unit_code" placeholder="" ngModel [ngModel]="formData.unit_code" required/>
+                        <input type="text" class="form-control" min="0" id="unit_code" maxlength="255" name="unit_code" placeholder="" ngModel [ngModel]="formData.unit_code" required/>
                       </div>
                     </div>
                     <div class="col-12 col-sm-12 col-md-4">
                       <div class="form-group">
                         <label for="unit_name" style="float: right; margin-right: 5px" >اسم الوحدة السكنية<span class="spanReqired-w">*</span></label>
-                        <input type="text" class="form-control" min="0" id="unit_name" name="unit_name" placeholder="" ngModel [ngModel]="formData.unit_name" required/>
+                        <input type="text" class="form-control" min="0" id="unit_name" maxlength="255" name="unit_name" placeholder="" maxlength="255" ngModel [ngModel]="formData.unit_name" />
                       </div>
                     </div>
                     <div class="col-12 col-sm-12 col-md-4">
@@ -99,7 +100,7 @@
                           <div class="col-12 col-sm-12 col-md-4">
                             <div class="form-group">
                               <label for="description" style="float: right; margin-right: 5px" > وصف للوحدة <span class="spanReqired-w">*</span></label>
-                              <input type="text" class="form-control" min="0" id="description" name="description" placeholder="" ngModel [ngModel]="formData.description" required/>
+                              <input type="text" class="form-control" min="0" id="description" name="description" placeholder="" maxlength="255" ngModel [ngModel]="formData.description" />
                             </div>
                           </div>      
                           <div class="col-12 col-sm-12 col-md-4">
@@ -113,7 +114,7 @@
                             </div>
                          </div>
                          <div class=" row col-6">
-                            <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid">حفظ</button>
+                            <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || disable">حفظ</button>
                             <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
                         </div>
                     </form>

+ 9 - 2
src/app/dashboard/unit-building-information/unit-building-information-add/unit-building-information-add.component.ts

@@ -118,7 +118,7 @@ export class UnitBuildingInformationAddComponent implements OnInit {
     this.show_amount = false;
  
   console.log(id);
-
+    this.building_types = []
     this.http.get(this.authSer.pathApi+ '/building_types_list/' + id ).subscribe(
       res => {
         console.log(res);
@@ -141,6 +141,7 @@ export class UnitBuildingInformationAddComponent implements OnInit {
   } 
   
   getBuilding(event){
+    this.buildings = []
       this.http.get(this.authSer.pathApi + '/buildings_list_by_type_id/' + event ).subscribe(
         res => {
           console.log(res);
@@ -152,6 +153,7 @@ export class UnitBuildingInformationAddComponent implements OnInit {
           }else{
                this.isBuildingType = false;
                this.show_amount = false;
+               this.toastr.warning('لا يوجد بيانات لهذا النوع من المباني')
             }
 
             if(this.editPageId) {
@@ -164,14 +166,19 @@ export class UnitBuildingInformationAddComponent implements OnInit {
       );
   }
   typeNumber(event){
-
+    this.amount =[]
     this.show_amount = true;
   const id = event;;
   for (let i = 0; i < this.buildings.length; i++) {
     if(id == this.buildings[i].id) {
         this.amount = this.buildings[i].empty_ids; 
         console.log('ammmmounnnt', this.amount);
+        if(this.amount.length == 0){
+          this.toastr.warning('لا يوجد وحدات فارغة')
+          this.show_amount = false;
+        }
         this.amount.push(this.formData.unit_number);
+
     }
   } 
 

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

@@ -27,13 +27,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>
                   من العناصر يتم عرضها
-                <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>

+ 3 - 0
src/app/dashboard/unit-building-information/unit-building-information-list/unit-building-information-list.component.ts

@@ -411,6 +411,9 @@ export class UnitBuildingInformationListComponent implements OnInit {
             (error) => {
               console.log(error);
               this.spinner.hide();
+              if(error.error.status == 'unit is already assigned'){
+                this.toastr.warning('لا يمكنك حذف الوحدة السكني لانه جزء من النظام')
+              }
               },
             )
         );

+ 4 - 3
src/app/dashboard/unit-information/unit-information-add/unit-information-add.component.html

@@ -5,7 +5,8 @@
       <div class="row">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w"> خدمه البلاغات </li>
+            <li class="headingText-w"> خدمه السكن </li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px ; cursor: pointer;" (click)="authSer.backFromEdit()">تسجيل معلومات المباني</li>
             <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
           </ul>
         </div>
@@ -44,7 +45,7 @@
                       <div class="col-12 col-sm-12 col-md-4">
                         <div class="form-group">
                           <label for="building_code" style="float: right; margin-right: 5px">رمز المبنى<span class="spanReqired-w">*</span></label>
-                          <input type="text" class="form-control" id="building_code" name="building_code"  ngModel [(ngModel)]="formData.building_code" required/>
+                          <input type="text" class="form-control" id="building_code" name="building_code" maxlength="255"  ngModel [(ngModel)]="formData.building_code" required/>
                         </div>
                       </div>
 
@@ -58,7 +59,7 @@
                 <div class="col-12 col-sm-12 col-md-4">
                     <div class="form-group">
                       <label for="building_name" style="float: right; margin-right: 5px">اسم المبنى<span class="spanReqired-w">*</span></label>
-                      <input type="text" class="form-control" id="building_name" name="building_name" ngModel [(ngModel)]="formData.building_name" required/>
+                      <input type="text" class="form-control" id="building_name" name="building_name" maxlength="255" ngModel [(ngModel)]="formData.building_name" required/>
                     </div>
                   </div>
               

+ 4 - 0
src/app/dashboard/unit-information/unit-information-list/unit-information-list.component.ts

@@ -255,12 +255,16 @@ onDelete() {
               (error) => {
                 console.log(error);
                 this.spinner.hide();
+               
               }
             );
           },
           (error) => {
             console.log(error);
             this.spinner.hide();
+            if(error.error.status == 'building is already used'){
+              this.toastr.warning('لا يمكنك حذف المبنى السكني لانه جزء من النظام')
+            }
             },
           )
       );

+ 5 - 4
src/app/dashboard/view_my_female_requests/view-my-female-requests-add/view-my-female-requests-add.component.html

@@ -5,14 +5,15 @@
         <div class="row">
           <div class="col-12">
             <ul class="list-unstyled titileLi-w">
-              <li class="headingText-w"> خدمه البلاغات </li>
-              <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
+              <li class="headingText-w"> خدمه السكن </li>
+              <li class="headingText-w activeLi-w" style="margin-right:5px; cursor: pointer;" (click)="authSer.backFromEdit()">{{page__title}}</li>
+              <li class="headingText-w activeLi-w" style="margin-right:5px">{{typePage}}</li>
             </ul>
           </div>
         </div>
   
       <div class="containerContent-w">
-        <h2 class="title"  style="margin: auto ;text-align:  center" [ngClass]="{'green': statusAccept, 'red' : statusrefu}">{{ statusAccept ? 'مقبول' : statusrefu  ? 'مرفوض' : ' جديد'}}</h2>
+        <h2 class="title"  style="margin: auto ;text-align:  center" [ngClass]="{'green': statusAccept, 'red' : statusrefu}">{{ comfoe }}</h2>
           <form (ngSubmit)="onSubmitted()" #f="ngForm" style="margin-top: 40px;">
               <div class="row">
                   <div class="col-12" >
@@ -101,7 +102,7 @@
                     </div> 
                   </div>
                 </div>   
-                <div class="col-12">
+                <div class="col-12" *ngIf="!addNew">
                     <h2 class="title">تفاصيل السكن</h2>
                     <div class="row">
                       <div class="col-12">

+ 57 - 17
src/app/dashboard/view_my_female_requests/view-my-female-requests-add/view-my-female-requests-add.component.ts

@@ -36,6 +36,7 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
   refusedCheak = false;
   statusAccept : boolean;
   statusrefu: boolean;
+  comfoe: string = 'جديد';
   toster: string;
   tookDes = false;
   employeeId: string;
@@ -46,6 +47,9 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
   isBuilding: boolean = false;
   isComplex: boolean = false;
   isBuildingType: boolean = false;
+  userInfo: any;
+  addNew: boolean = false;
+  page__title: string;
   constructor(
     private dashBoardSer: DashboardService,
     private toastr: ToastrService,
@@ -91,6 +95,7 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
   }
 
   ngOnInit() {
+    this.spinner.show()
      //init the values of permision boolean
   this.authSer.showAddBtn = false;
   this.authSer.showDeleteBtn = false;
@@ -113,13 +118,13 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
     (params: Params) => {
       this.editPageId = +params['editPageId'];
       this.whoIsComing = params['type'];
+      
       console.log(this.editPageId);
       
     }
   );
-    if(this.whoIsComing == 'AD74'){
-      this.isAdmin = true;
-    }
+
+
 
   console.log('current page',this.pageId)
   this.dashBoardSer.getRequestTypesList( 1 ,10000 , 'all', 'all', 'all').subscribe(
@@ -131,9 +136,13 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
   if (this.editPageId) {
     this.spinner.show();
     this.isEdit = true;
+    this.page__title = 'عرض طلباتي'
+
   this.typePage = 'تعديل';
   if(this.isAdmin){
     this.typePage = 'عرض تفاصيل الطلب'
+    this.page__title = 'عرض طلبات المستأجر للأدارة'
+
 
   }
     this.dashBoardSer.getItemData(this.editPageId, 'femalesRequest' ).subscribe(
@@ -146,16 +155,30 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
         if(this.isAdmin){
           this.adminForm.request_id = data.id;
         }
+        
         this.adminForm.status = data.status;
         if(this.adminForm.status != 'new'){
+          this.addNew = false;
           this.tookDes = true;
-          if(this.adminForm.status == 'accepted'){
+          if(this.adminForm.status == 'accepted' || this.adminForm.status == 'confirmed'){
             this.statusAccept = true;
+            if(this.adminForm.status == 'accepted'){
+              this.comfoe = 'مقبول'
+            }else{
+              this.comfoe = 'مؤكد'
+            }
           }else if(this.adminForm.status == 'refused'){
             this.adminForm.status_description = data.status_description;
             this.statusAccept = false;
             this.statusrefu = true;
             this.refusedCheak = true;
+            this.comfoe = 'مرفوض'
+          }
+        }else{
+          this.comfoe = 'جديد'
+          if(this.whoIsComing == 'AD74'){
+            this.isAdmin = true;
+            
           }
         }
         this.employeeId = data.employee_id;
@@ -167,7 +190,7 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
             this.userData.functional_number = res['user'].functional_number;
             this.userData.phone = res['user'].phone;
             this.userData.email = res['user'].email;
-
+            
           },
           err =>{
             console.log(err);
@@ -205,6 +228,18 @@ export class ViewMyFemaleRequestsAddComponent implements OnInit {
     );
   }else {
     this.typePage = 'اضافة';
+    this.page__title = 'عرض طلباتي'
+    this.addNew = true;
+    this.tookDes = false;    
+    this.userInfo= localStorage.getItem('userData')
+    this.userInfo = JSON.parse(this.userInfo);  
+    console.log('user  ',this.userInfo);
+    this.userData.name = this.userInfo.name;
+    this.userData.identity_number = this.userInfo.identity_number;
+    this.userData.functional_number = this.userInfo.functional_number;
+    this.userData.phone = this.userInfo.phone;
+    this.userData.email = this.userInfo.email;
+
   }
 
   this.spinner.hide();
@@ -390,17 +425,7 @@ getUnit(event){
     );
     
   }else{
-    if(this.files.length > 0){
-      this.formData.files = this.files
-    }
-    if(this.require_attachments == '1'){
-      if(this.formData.files.length <= 0){
-        this.toastr.warning('يجب اضافة مرفق')
-        this.disable = false;
-
-        return 0;
-      }
-    }
+   
     if(this.require_date == '1'){
       if(this.formData.return_date == null || this.formData.return_time == null){
        this.toastr.warning('يجب اضافة وقت و تاريخ العوده')
@@ -415,6 +440,17 @@ getUnit(event){
       }
     }
     if(this.editPageId) {
+      if(this.files.length > 0){
+        this.formData.files = this.files
+      }
+      if(this.require_attachments == '1'){
+        if(this.formData.files.length <= 0){
+          this.toastr.warning('يجب اضافة مرفق')
+          this.disable = false;
+  
+          return 0;
+        }
+      }
       this.dashBoardSer.editItem(this.editPageId, this.formData, 'editFemaleRequest').subscribe(
         (responce) => {
           this.disable = true;
@@ -429,6 +465,7 @@ getUnit(event){
         }
       )
     } else {
+
     this.dashBoardSer.addItem( this.formData , 'addFemaleRequest').subscribe(
       (responce) => {
         console.log('ADD',responce);
@@ -437,9 +474,12 @@ getUnit(event){
         this.location.back();
       },
       (error) => {
-        console.log(error);
+        
         this.checkSaveclick = false;
         this.disable = false;
+        if (true) {
+          
+        }
 
         this.toastr.error('خطأ في الخادم ، حاول لاحقا');
       }

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

@@ -4,7 +4,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w">خدمه السكن  </li>
-          <li class="headingText-w activeLi-w" style="margin-right:5px">عرض الطلبات </li>
+          <li class="headingText-w activeLi-w" style="margin-right:5px">عرض طلباتي </li>
         </ul>
       </div>
     </div>
@@ -24,20 +24,20 @@
       </div>
   
       <div class="row">
-          <div class="col-6 col-sm-12 col-md-12 col-lg-6">
+          <div class="col-6 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>
                   من العناصر يتم عرضها
-                <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="col-6 col-sm-12 col-md-12 col-lg-3">
               <div class="form-group">
                 <span class="spanSelect-w" style="margin-right:10px;">
                     الحالة
@@ -67,7 +67,7 @@
             <th *ngIf="accept">نوع الطلب</th>
             <th>الحاله</th>
             
-            <th *ngIf="authSer.showEditBtn">تعديل</th>
+            <th *ngIf="authSer.showEditBtn">التفاصيل</th>
           </tr>
         </thead>
         <tbody>

+ 3 - 3
src/app/dashboard/view_my_female_requests/view-my-female-requests-list/view-my-female-requests-list.component.ts

@@ -312,7 +312,7 @@ export class ViewMyFemaleRequestsListComponent implements OnInit {
               (error) => {
                 console.log(error.error.error);
                 this.spinner.hide();
-                if (error.error.error == 'Requests already uses this type can not delete it') {
+                if (error.error.error == 'Requests already uses this type can not delete it' ) {
                   this.toastr.warning('ليس هناك صلاحية لمسح هذا الطلب')
                 }
                 },
@@ -348,7 +348,7 @@ export class ViewMyFemaleRequestsListComponent implements OnInit {
     }
     
     onAdd() {
-      this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewMyFemaleRequestsAdd']);
+      this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewMyFemaleRequestsAdd' + '/' + this.codeForEdit]);
     }
     
     onEdit(editId: number) {
@@ -366,7 +366,7 @@ export class ViewMyFemaleRequestsListComponent implements OnInit {
           this.codeForEdit = 'EP73';
       }
       this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'viewMyFemaleRequests/edit/' + editId + '/' + this.codeForEdit]);
-      console.log('service/' + this.userLoginId + '/' + this.serviceId + '/' + 'femalesRequestTypes/edit/' + editId);
+      console.log('service/' + this.userLoginId + '/' + this.serviceId + '/' + 'femalesRequestTypes/edit/' + editId + '/' + this.codeForEdit);
       
     }
 

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

@@ -5,7 +5,8 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w" style="cursor: pointer;" (click)="authSer.perviousLocation()">خدمه السكن</li>
-          <li class="headingText-w activeLi-w" style="margin-right:5px">  طلب سكن</li>
+          <li class="headingText-w activeLi-w" style="margin-right:5px;cursor: pointer;" (click)="authSer.backFromEdit()">عرض الطلبات للإدارة</li>
+          <li class="headingText-w activeLi-w" style="margin-right:5px"> تفاصيل الطلب</li>
         </ul>
       </div>
     </div>
@@ -67,21 +68,21 @@
                       <thead class="headBackground-w">
                         <tr>
                           <th> إسم المرفق</th>
-                          <th>رفع الملف ( بصيغه pdf )</th>
-                          <!-- <th>عرض الملف</th> -->
+                          <!-- <th>رفع الملف</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}"/></td>
-                            <td style="position: relative;">
+                            <!-- <td style="position: relative;">
                                 <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"></i></label>
                                 <span class="fileName-w" *ngIf="file.nameFile" style="color:green"> <i class='fas fa-check'style=" float: left; padding-top: 4px; "></i>
                                 </span>
-                              </td>
-                              <!-- <td><a href="{{authSer.pathImg + file.nameFile}}" target="_blank"><i class="fas fa-download"></i></a></td> -->
+                              </td> -->
+                              <td><a 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>

+ 18 - 10
src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-details/view-requests-for-adminstration-details.component.ts

@@ -88,14 +88,14 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
     this.dashBoardSer.getItemData(this.detailsId, 'viewRequestsForAdminstrationDetails' ).subscribe(
       res => {
         console.log('ssss', res);
-       
+        
         this.employeeId = res['request'].employee_id;
-        this.files = res['request'].files;
+        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.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);
@@ -103,15 +103,19 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
           this.getBuilding(this.unitInformation.building_type_id);
           this.unitInformation.building_id = res['request'].unit_information.building_id;
           this.unitInformation.unit_id = res['request'].unit_id;
+          if(this.formData.status == 'accepted'){
            this.accept();
-        }else if(this.formData.status == 'confirmed'){
-          this.confirmed = false
-
+          }
+          if(this.formData.status == 'confirmed'){
+            this.confirmed = false
+           this.acceptCheak = true;
+          }
         }else if(this.formData.status == 'waiting'){
           this.waiting()
          }else if(this.formData.status == 'refused') {
           this.refuse()
          }
+
         this.http.get(this.authSer.pathApi + '/get_user/' + this.employeeId).subscribe(
           res =>{
             console.log('=>',res);
@@ -120,10 +124,11 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
             this.userData.functional_number = res['user'].functional_number;
             this.userData.phone = res['user'].phone;
             this.userData.email = res['user'].email;
-
+            this.spinner.hide()
           },
           err =>{
             console.log(err);
+            this.spinner.hide()
             
           }
         )
@@ -133,6 +138,8 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
     
       err => {
         console.log(err);
+        this.spinner.hide()
+
       }
     );
     this.spinner.hide();
@@ -249,7 +256,7 @@ export class ViewRequestsForAdminstrationDetailsComponent implements OnInit {
         }else{
              this.isBuildingType = false;
              this.isBuilding = false;
-            
+            this.toastr.warning('لا يوجد بيانات لهذا النوع من المباني')
           }
           
       },
@@ -271,6 +278,7 @@ getUnit(event , s){
 
       }else{
            this.isBuilding = false;
+           this.toastr.warning('لا يوجد وحدات لهذا المبنى')
         }
 
     },
@@ -296,12 +304,12 @@ onSubmitted(){
         console.log(res);
         this.toastr.success(this.status)
         this.location.back();
-        
+        this.confirmed = false
       },
       err => {
         console.log(err);
         this.toastr.error('هناك خطأ يرجى المحاولة لاحقا')
-        
+        this.confirmed = false        
         
       }
 

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

@@ -24,20 +24,20 @@
     </div>
 
     <div class="row">
-        <div class="col-6 col-sm-12 col-md-12 col-lg-6">
+        <div class="col-6 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>
                 من العناصر يتم عرضها
-              <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="col-6 col-sm-12 col-md-12 col-lg-3">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
                 الحالة

+ 11 - 1
src/app/dashboard/view_requests_for_adminstration/view-requests-for-adminstration-list/view-requests-for-adminstration-list.component.ts

@@ -149,6 +149,7 @@ export class ViewRequestsForAdminstrationListComponent implements OnInit {
         console.log(err);
       }
     );
+    this.spinner.hide();
   }
   onGetStatus(event){
     this.spinner.show();
@@ -183,9 +184,12 @@ export class ViewRequestsForAdminstrationListComponent implements OnInit {
         this.dataList = res['requests'];
         this.count = res['count'];
         this.perPagePagenation = res['per_page'];
+        this.spinner.hide();
+
       },
       err => {
         console.log(err);
+        this.spinner.hide();
         
       }
 
@@ -201,10 +205,13 @@ export class ViewRequestsForAdminstrationListComponent implements OnInit {
         this.dataList = res['requests'];
         this.count = res['count'];
         this.perPagePagenation = res['per_page'];
+        this.spinner.hide();
+
       },
       err => {
         console.log(err);
-        
+        this.spinner.hide();
+
       }
 
     );
@@ -223,9 +230,12 @@ export class ViewRequestsForAdminstrationListComponent implements OnInit {
         this.dataList = res['requests'];
         this.count = res['count'];
         this.perPagePagenation = res['per_page'];
+        this.spinner.hide();
+
       },
       err => {
         console.log(err);
+        this.spinner.hide();
         
       }
 

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

@@ -5,6 +5,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w" style="cursor: pointer;" (click)="authSer.perviousLocation()">خدمه السكن</li>
+          <li class="headingText-w activeLi-w" style="margin-right:5px; cursor: pointer;" (click)="authSer.backFromEdit()">عرض الطلبات </li>
           <li class="headingText-w activeLi-w" style="margin-right:5px">  طلب سكن</li>
         </ul>
       </div>
@@ -167,10 +168,12 @@
                           <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 class="col-12 col-sm-12 col-md-4"  *ngFor="let item of covenants">
+                                     <div class="form-group">
+                                        <label style="float: right; margin-right: 5px"> {{item.covenant_name}} </label>
+                                        <h3>{{item.covenant_amount}}</h3>
+                                      </div>
+                                    </div>  
                               </div>
                           </div>
                         </div>

+ 5 - 1
src/app/dashboard/view_requests_for_tenant/view-requests-for-tenant-details/view-requests-for-tenant-details.component.ts

@@ -275,7 +275,11 @@ onSubmitted(status) {
   this.http.post(this.authSer.pathApi + '/employee_handle_housing_request' , this.onSending).subscribe(
     res => {
       console.log(res);
-      this.toastr.success();
+      if(status == 'confirmed'){
+        this.toastr.success('تم تأكيد الطلب')
+      }else if (status == 'refused'){
+        this.toastr.error('تم رفض الطلب')
+      }
       this.location.back()
       
     },

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

@@ -17,27 +17,27 @@
       </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>
     </div>
 
     <div class="row">
-        <div class="col-6 col-sm-12 col-md-12 col-lg-6">
+        <div class="col-6 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>
                 من العناصر يتم عرضها
-              <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="col-6 col-sm-12 col-md-12 col-lg-3">
           <div class="form-group">
             <span class="spanSelect-w" style="margin-right:10px;">
                 الحالة