Fiyat Kodu

Fiyat Kodu Script

console.log('that',this);

let useDailyRatesControl = this.allFormControls['USEDAILYRATES'];

 const c1 = this.allFormControls['DAILYRATEMARKUPPERCENT'];
 const c2= this.allFormControls['DAILYRATEMARKUPAMOUNT'];

useDailyRatesControl.valueChanges.pipe(rxjs.startWith(useDailyRatesControl.value)).subscribe(v=>{
  
 if(v === 2){ 
     c1.enable(),c2.disable();
      this.recordService.children.P2.component.tabGroupService.children[0].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[4].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[5].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[6].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[7].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[8].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[9].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[11].componentRef.instance.hide=true;
      this.recordService.children.P2.component.updateTabs();
      document.querySelector('.ang-record-hotel_ratecode .ang-tab-groupP2 .mat-tab-label-active')?.click();
 }
 else if(v == 1){c1.disable(),c2.enable();
      this.recordService.children.P2.component.tabGroupService.children[0].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[4].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[5].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[6].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[7].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[8].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[9].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[11].componentRef.instance.hide=true;
      this.recordService.children.P2.component.updateTabs();
      document.querySelector('.ang-record-hotel_ratecode .ang-tab-groupP2 .mat-tab-label-active')?.click();
 }
 else if(v == 0){c1.disable(),c2.disable();
 
      this.recordService.children.P2.component.tabGroupService.children[0].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[11].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[4].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[5].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[6].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[7].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[8].componentRef.instance.hide=true;
      this.recordService.children.P2.component.tabGroupService.children[9].componentRef.instance.hide=true;
      this.recordService.children.P2.component.updateTabs();
      document.querySelector('.ang-record-hotel_ratecode .ang-tab-groupP2 .mat-tab-label-active')?.click();
  }
  else if (v != 2){
    
   c1.disable(),c2.disable();
      this.recordService.children.P2.component.tabGroupService.children[4].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[5].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[6].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[7].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[8].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[9].componentRef.instance.hide=false;
      this.recordService.children.P2.component.tabGroupService.children[11].componentRef.instance.hide=true;
      this.recordService.children.P2.component.updateTabs();
      document.querySelector('.ang-record-hotel_ratecode .ang-tab-groupP2 .mat-tab-label-active')?.click();
  }
});

Last updated