amr 5 роки тому
батько
коміт
519e698da0
15 змінених файлів з 92 додано та 23 видалено
  1. 1 1
      src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.html
  2. 12 2
      src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.ts
  3. 1 1
      src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.html
  4. 4 0
      src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-add/link-unit-to-covenants-add.component.ts
  5. 1 1
      src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-list/link-unit-to-covenants-list.component.html
  6. 1 1
      src/app/dashboard/living-service/living-service-add/living-service-add.component.html
  7. 10 2
      src/app/dashboard/living-service/living-service-add/living-service-add.component.ts
  8. 10 8
      src/app/dashboard/living-service/living-service-list/living-service-list.component.ts
  9. 8 0
      src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.ts
  10. 1 1
      src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.html
  11. 25 2
      src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.ts
  12. 1 1
      src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.html
  13. 14 0
      src/app/dashboard/unit-building-information/unit-building-information-add/unit-building-information-add.component.ts
  14. 1 1
      src/app/dashboard/unit-building-information/unit-building-information-list/unit-building-information-list.component.html
  15. 2 2
      src/app/dashboard/unit-building-information/unit-building-information-list/unit-building-information-list.component.ts

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

@@ -50,7 +50,7 @@
               
               
           </div>
           </div>
           <div class=" row col-6">
           <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>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
           </div>
           </div>
         </form>
         </form>

+ 12 - 2
src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.ts

@@ -28,13 +28,16 @@ export class DefinitionOfCovenantsAddComponent implements OnInit {
   @ViewChild('f') definitionForm : NgForm;
   @ViewChild('f') definitionForm : NgForm;
 
 
   typePage: string = '';
   typePage: string = '';
+  valueType: string = '';
+  editPageId: number;
+
   locations =[];
   locations =[];
   categories = [];
   categories = [];
-  valueType: string = '';
+  
   checkSaveclick:boolean = false;
   checkSaveclick:boolean = false;
   check : boolean = false;
   check : boolean = false;
   isEdit: boolean = false;
   isEdit: boolean = false;
-  editPageId: number;
+  disable: boolean = false;
 
 
   formData = {
   formData = {
     name: '',
     name: '',
@@ -91,13 +94,17 @@ export class DefinitionOfCovenantsAddComponent implements OnInit {
 
 
 
 
   onSubmitted(){
   onSubmitted(){
+    this.disable = true;
     console.log('HERE',this.definitionForm.value);
     console.log('HERE',this.definitionForm.value);
     if(this.editPageId) {
     if(this.editPageId) {
       this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'definitionOfCovenant').subscribe(
       this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'definitionOfCovenant').subscribe(
         res => {
         res => {
           console.log(res);
           console.log(res);
+          this.disable = false;
           this.toastr.success('تم التعديل بنجاح');
           this.toastr.success('تم التعديل بنجاح');
           this.location.back();
           this.location.back();
+          this.disable = false;
+
         },
         },
         err => {
         err => {
           console.log(err);
           console.log(err);
@@ -108,6 +115,7 @@ export class DefinitionOfCovenantsAddComponent implements OnInit {
       this.dashBoardSer.addItem( this.definitionForm.value , 'definitionOfCovenant').subscribe(
       this.dashBoardSer.addItem( this.definitionForm.value , 'definitionOfCovenant').subscribe(
         res => {
         res => {
           console.log('ADD',res);
           console.log('ADD',res);
+          this.disable = false;
           this.toastr.success('تم الإضافه بنجاح');
           this.toastr.success('تم الإضافه بنجاح');
           this.checkSaveclick = false;
           this.checkSaveclick = false;
           this.location.back();
           this.location.back();
@@ -116,6 +124,8 @@ export class DefinitionOfCovenantsAddComponent implements OnInit {
           console.log(err);
           console.log(err);
           this.checkSaveclick = false;
           this.checkSaveclick = false;
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
+          this.disable = false;
+
         }
         }
       );
       );
       }
       }

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

@@ -4,7 +4,7 @@
     <div class="col-12">
     <div class="col-12">
       <ul class="list-unstyled titileLi-w">
       <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">تعريف تصنيفات العهد</li>
+        <li class="headingText-w activeLi-w" style="margin-right:5px">تعريف  العهد</li>
       </ul>
       </ul>
     </div>
     </div>
   </div>
   </div>

+ 4 - 0
src/app/dashboard/link_unit_to_covenants/link-unit-to-covenants-add/link-unit-to-covenants-add.component.ts

@@ -149,6 +149,10 @@ export class LinkUnitToCovenantsAddComponent implements OnInit {
   getBuildingType(event){
   getBuildingType(event){
     console.log('sdsdsd',event);
     console.log('sdsdsd',event);
     const id = event;
     const id = event;
+    this.isComplex = false;
+    this.isBuildingType = false;
+    this.show_amount = false;
+    this.isBuilding = false;
  
  
   console.log(id);
   console.log(id);
 
 

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

@@ -4,7 +4,7 @@
       <div class="col-12">
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
         <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">تسجيل معلومات المباني</li>
+          <li class="headingText-w activeLi-w" style="margin-right:5px">ربط السكن بالعهد</li>
         </ul>
         </ul>
       </div>
       </div>
     </div>
     </div>

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

@@ -33,7 +33,7 @@
               
               
           </div>
           </div>
           <div class=" row col-6">
           <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>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
           </div>
           </div>
         </form>
         </form>

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

@@ -28,12 +28,15 @@ export class LivingServiceAddComponent implements OnInit {
   @ViewChild('f') definitionForm : NgForm;
   @ViewChild('f') definitionForm : NgForm;
 
 
   typePage: string = '';
   typePage: string = '';
-  locations =[];
   valueType: string = '';
   valueType: string = '';
+  editPageId: number;
+
+  locations =[];
+
   checkSaveclick:boolean = false;
   checkSaveclick:boolean = false;
   check : boolean = false;
   check : boolean = false;
   isEdit: boolean = false;
   isEdit: boolean = false;
-  editPageId: number;
+  disable: boolean = false;
 
 
   formData = {
   formData = {
     name: '',
     name: '',
@@ -72,16 +75,19 @@ export class LivingServiceAddComponent implements OnInit {
   }
   }
   onSubmitted(){
   onSubmitted(){
     console.log('HERE',this.definitionForm.value);
     console.log('HERE',this.definitionForm.value);
+    this.disable = true;
     if(this.editPageId) {
     if(this.editPageId) {
       this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'livingService').subscribe(
       this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'livingService').subscribe(
         res => {
         res => {
           console.log(res);
           console.log(res);
           this.toastr.success('تم التعديل بنجاح');
           this.toastr.success('تم التعديل بنجاح');
           this.location.back();
           this.location.back();
+          this.disable = false;
         },
         },
         err => {
         err => {
           console.log(err);
           console.log(err);
           this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
           this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
+          this.disable = false;
         }
         }
       )
       )
     } else {
     } else {
@@ -90,11 +96,13 @@ export class LivingServiceAddComponent implements OnInit {
           console.log('ADD',res);
           console.log('ADD',res);
           this.toastr.success('تم الإضافه بنجاح');
           this.toastr.success('تم الإضافه بنجاح');
           this.checkSaveclick = false;
           this.checkSaveclick = false;
+          this.disable = false;
           this.location.back();
           this.location.back();
         },
         },
         err => {
         err => {
           console.log(err);
           console.log(err);
           this.checkSaveclick = false;
           this.checkSaveclick = false;
+          this.disable = false;
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
         }
         }
       );
       );

+ 10 - 8
src/app/dashboard/living-service/living-service-list/living-service-list.component.ts

@@ -96,6 +96,7 @@ export class LivingServiceListComponent implements OnInit {
               );
               );
             }
             }
           );
           );
+          this.spinner.show();
           console.log('current page',this.pageId)
           console.log('current page',this.pageId)
           this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
           this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
             res => {
             res => {
@@ -103,15 +104,16 @@ export class LivingServiceListComponent implements OnInit {
               this.dataList = res['covenant_categories'];
               this.dataList = res['covenant_categories'];
             this.count = res['count'];
             this.count = res['count'];
             this.perPagePagenation = res['per_page'];
             this.perPagePagenation = res['per_page'];
-            },
-            err => {
-              console.log(err);
-              
-            }
-
+            this.spinner.hide();
+          },
+          err => {
+            console.log(err);
+            
+          }
+          
           );
           );
-  
-  
+          
+          
   }
   }
   //make all checkbox of user checked 
   //make all checkbox of user checked 
   //make all checkbox of user checked 
   //make all checkbox of user checked 

+ 8 - 0
src/app/dashboard/living_system_reports/living-system-reports/living-system-reports.component.ts

@@ -67,6 +67,14 @@ export class LivingSystemReportsComponent implements OnInit {
 
 
   ngOnInit() {
   ngOnInit() {
 
 
+    this.authSer.notificationLogin = true;
+    this.authSer.showSearchHeader = false;
+    this.authSer.showHeaderLogin = false;
+    this.authSer.showHeaderDashBoard = true;
+    this.authSer.showDashboardHeader = true;
+    this.authSer.internalHeader = false;
+    // localStorage.setItem('pageIdActive', '62');
+
 
 
     this.http.get(this.authSer.pathApi + '/housing_complexes_list').subscribe(
     this.http.get(this.authSer.pathApi + '/housing_complexes_list').subscribe(
       res => {
       res => {

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

@@ -68,7 +68,7 @@
             <button type="button" class="btn btn-success rightW"  (click)="plusBuilding()">اضافة نوع جديد</button>
             <button type="button" class="btn btn-success rightW"  (click)="plusBuilding()">اضافة نوع جديد</button>
           </div>
           </div>
           <div class=" row col-6">
           <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>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
           </div>
           </div>
         </form>
         </form>

+ 25 - 2
src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.ts

@@ -34,6 +34,7 @@ export class RecordInfoBuildingAddComponent implements OnInit {
   checkSaveclick:boolean = false;
   checkSaveclick:boolean = false;
   check : boolean = false;
   check : boolean = false;
   isEdit: boolean = false;
   isEdit: boolean = false;
+  disable: boolean = false;
   editPageId: number;
   editPageId: number;
 
 
   formData = {
   formData = {
@@ -116,15 +117,26 @@ export class RecordInfoBuildingAddComponent implements OnInit {
     console.log(this.formData);
     console.log(this.formData);
     
     
     if(this.editPageId) {
     if(this.editPageId) {
+      this.disable = true;
       this.dashBoardSer.editItem(this.editPageId, this.formData, 'recordInfoBuilding').subscribe(
       this.dashBoardSer.editItem(this.editPageId, this.formData, 'recordInfoBuilding').subscribe(
         res => {
         res => {
           console.log(res);
           console.log(res);
           this.toastr.success('تم التعديل بنجاح');
           this.toastr.success('تم التعديل بنجاح');
           this.location.back();
           this.location.back();
+          this.disable = false;
+
         },
         },
         err => {
         err => {
           console.log(err);
           console.log(err);
-          this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
+          if(err.error.error.complex_number[0] == 'The complex number has already been taken.'){
+            this.toastr.warning('رقم المجمع موجود بالفعل')
+            this.disable = true;
+            
+          }else{
+          this.disable = false;
+
+          this.toastr.error('خطأ في الخادم ، حاول لاحقا');
+          }
         }
         }
       )
       )
     } else {
     } else {
@@ -133,12 +145,23 @@ export class RecordInfoBuildingAddComponent implements OnInit {
           console.log('ADD',res);
           console.log('ADD',res);
           this.toastr.success('تم الإضافه بنجاح');
           this.toastr.success('تم الإضافه بنجاح');
           this.checkSaveclick = false;
           this.checkSaveclick = false;
+          this.disable = false;
           this.location.back();
           this.location.back();
         },
         },
         err => {
         err => {
-          console.log(err);
+          console.log(err.error.error.complex_number[0]);
           this.checkSaveclick = false;
           this.checkSaveclick = false;
+
+          if(err.error.error.complex_number[0] == 'The complex number has already been taken.'){
+            this.toastr.warning('رقم المجمع موجود بالفعل')
+            this.disable = true;
+            
+          }else{
+          this.disable = false;
+
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
+          }
+
         }
         }
       );
       );
       }
       }

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

@@ -4,7 +4,7 @@
     <div class="col-12">
     <div class="col-12">
       <ul class="list-unstyled titileLi-w">
       <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">تعريف تصنيفات العهد</li>
+        <li class="headingText-w activeLi-w" style="margin-right:5px">تسجيل معلومات المجمعات السكنية</li>
       </ul>
       </ul>
     </div>
     </div>
   </div>
   </div>

+ 14 - 0
src/app/dashboard/unit-building-information/unit-building-information-add/unit-building-information-add.component.ts

@@ -29,6 +29,7 @@ export class UnitBuildingInformationAddComponent implements OnInit {
   check : boolean = false;
   check : boolean = false;
   isEdit: boolean = false;
   isEdit: boolean = false;
   editPageId: number;
   editPageId: number;
+  disable: boolean =  false;
 
 
   constructor(
   constructor(
     private dashBoardSer: DashboardService,
     private dashBoardSer: DashboardService,
@@ -112,6 +113,9 @@ export class UnitBuildingInformationAddComponent implements OnInit {
   getBuildingsType(event){
   getBuildingsType(event){
     console.log('sdsdsd',event);
     console.log('sdsdsd',event);
     const id = event;
     const id = event;
+    this.isComplex = false;
+    this.isBuildingType = false;
+    this.show_amount = false;
  
  
   console.log(id);
   console.log(id);
 
 
@@ -125,6 +129,9 @@ export class UnitBuildingInformationAddComponent implements OnInit {
            this.isComplex = false;
            this.isComplex = false;
            this.isBuildingType = false;
            this.isBuildingType = false;
         }
         }
+          if(this.editPageId){
+            this.getBuilding(this.formData.building_type_id);
+          }
       },
       },
       err => {
       err => {
         console.log(err);
         console.log(err);
@@ -171,16 +178,20 @@ export class UnitBuildingInformationAddComponent implements OnInit {
   }
   }
   onSubmitted(){
   onSubmitted(){
     console.log('HERE',this.unitInfoForm.value);
     console.log('HERE',this.unitInfoForm.value);
+    this.disable = true;
     if(this.editPageId) {
     if(this.editPageId) {
       this.dashBoardSer.editItem(this.editPageId, this.unitInfoForm.value, 'unitsBuildingInformation').subscribe(
       this.dashBoardSer.editItem(this.editPageId, this.unitInfoForm.value, 'unitsBuildingInformation').subscribe(
         res => {
         res => {
           console.log(res);
           console.log(res);
           this.toastr.success('تم التعديل بنجاح');
           this.toastr.success('تم التعديل بنجاح');
           this.location.back();
           this.location.back();
+          this.disable = false;
         },
         },
         err => {
         err => {
           console.log(err);
           console.log(err);
           this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
           this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
+          this.disable = false;
+
         }
         }
       )
       )
     } else {
     } else {
@@ -190,10 +201,13 @@ export class UnitBuildingInformationAddComponent implements OnInit {
           this.toastr.success('تم الإضافه بنجاح');
           this.toastr.success('تم الإضافه بنجاح');
           this.checkSaveclick = false;
           this.checkSaveclick = false;
           this.location.back();
           this.location.back();
+          this.disable = false;
+
         },
         },
         err => {
         err => {
           console.log(err);
           console.log(err);
           this.checkSaveclick = false;
           this.checkSaveclick = false;
+          this.disable = false;
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
           this.toastr.error('خطأ في الخادم ، حاول لاحقا');
         }
         }
       );
       );

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

@@ -17,7 +17,7 @@
         </div>
         </div>
         <div class="col-12 col-sm-12 col-md-6 col-lg-6">
         <div class="col-12 col-sm-12 col-md-6 col-lg-6">
           <div class="form-group">
           <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>
             <hr>
           </div>
           </div>
         </div>
         </div>

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

@@ -145,7 +145,7 @@ export class UnitBuildingInformationListComponent implements OnInit {
     this.building_type_id = event;
     this.building_type_id = event;
     this.building = [];
     this.building = [];
     this.building_id = 'all'
     this.building_id = 'all'
-
+    this.isBuildingType = false;
     if(event != 'all'){
     if(event != 'all'){
       this.selectedType = false;
       this.selectedType = false;
       this.http.get(this.authSer.pathApi + '/buildings_list_by_type_id/' + event ).subscribe(
       this.http.get(this.authSer.pathApi + '/buildings_list_by_type_id/' + event ).subscribe(
@@ -158,7 +158,7 @@ export class UnitBuildingInformationListComponent implements OnInit {
             building_name:'الكل'
             building_name:'الكل'
           },
           },
             );
             );
-            if(x > 0)
+            if(x > 1)
             this.isBuildingType= true;
             this.isBuildingType= true;
             
             
         },
         },