Skip to content

Commit

Permalink
transfer drop down issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Parth Kothari committed Dec 4, 2023
1 parent 2ab2507 commit 27e35a1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/closure/closure.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h4 class="f-s-b m-t-10 m-b-10">{{currentLanguageSet?.closure}}</h4>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 p-b-1-5" *ngIf="validTrans">
<md-select [disabled]="disableTransfer" placeholder="{{currentLanguageSet?.transferCall}}" name="transferCall" [(ngModel)]="transferCall" (change)="chooseService(transferCall)" [style.width]="'100%'" [disabled]="current_campaign=='OUTBOUND'">
<md-option [value]="">Select none</md-option>
<md-option *ngFor="let availableService of services" [value]="availableService.subServiceName">{{availableService.subServiceName}}</md-option>
<md-option *ngFor="let availableService of transferCallArr" [value]="availableService.subServiceName">{{availableService.subServiceName}}</md-option>
</md-select>
</div>

Expand Down
55 changes: 55 additions & 0 deletions src/app/closure/closure.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export class ClosureComponent implements OnInit {
enableInstitute: boolean = false;
varRefral : any;
appointmnetSuccessFlag : boolean;
benDetailsSelectedData: any;
transferCallArr: Array<any> = [];

constructor(
public dialog: MdDialog,
Expand Down Expand Up @@ -205,6 +207,14 @@ export class ClosureComponent implements OnInit {
(err) => {}
);

this._availableServices.getServices(requestObject).subscribe(
(response) => {
// this.callTypeObj = response;
this.populateTransferDropDown(response);
},
(err) => { }
);

this.saved_data.serviceAvailed.subscribe((data) => {
this.serviceAvailed = true;
});
Expand Down Expand Up @@ -1516,4 +1526,49 @@ export class ClosureComponent implements OnInit {
}
})
}

populateTransferDropDown(response: any) {
// this.benDetailsSelectedData = this.saved_data.benDetailsSelected;
this.saved_data.isBenDetails$.subscribe((value) => {
this.benDetailsSelectedData = value;

if ((this.current_role.toUpperCase() === "RO") && (this.benDetailsSelectedData === null || this.benDetailsSelectedData === undefined || this.benDetailsSelectedData === "")) {
if (response !== null || response !== undefined || response.length > 0) {
this.transferCallArr = response.filter(function (item) {
return item.subServiceName === 'Health Advisory Service';
});
}

}

else {
if (response !== null || response !== undefined || response.length > 0) {
this.transferCallArr = response;
// transferCallArr = response;
}
}
// transferDropdown();

});

// let transferCallArr : Array<any> = [];

// if ((this.current_role.toUpperCase() === "RO") && (this.benDetailsSelectedData === null || this.benDetailsSelectedData === undefined || this.benDetailsSelectedData === "")) {
// if (response !== null || response !== undefined || response.length > 0) {
// this.transferCallArr = response.filter(function (item) {
// return item.subServiceName === 'Health Advisory Service';
// });
// }

// }

// else {
// if (response !== null || response !== undefined || response.length > 0) {
// this.transferCallArr = response;
// // transferCallArr = response;
// }
// }

}

}
2 changes: 2 additions & 0 deletions src/app/innerpage/innerpage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ export class InnerpageComponent implements OnInit, OnDestroy {
this.selectedBenData.caste = res[0].i_bendemographics.communityName
? res[0].i_bendemographics.communityName
: undefined;

this.getCommonData.getBenDetailsOfCall(this.selectedBenData);
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/app/services/dataService/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import { Injectable } from '@angular/core';

import { Http, Response } from '@angular/http';
import { BehaviorSubject } from 'rxjs';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import 'rxjs/add/operator/catch';
Expand Down Expand Up @@ -69,6 +70,9 @@ export class dataService {
outboundBloodReqtID: any;
avoidingEvent: boolean = false;
transactionId:any;
isBenDetails: any="";
isBenDetailsData = new BehaviorSubject(this.isBenDetails);
isBenDetails$ = this.isBenDetailsData.asObservable();

// bpQuestionTypeId = 18;
// diabeticQuestionTypeId = 19;
Expand Down Expand Up @@ -116,5 +120,10 @@ export class dataService {
benDataInRO: any;
apiCalledForInbound=false;
appLanguage:any="English";

getBenDetailsOfCall(value : any){
this.isBenDetails = value;
this.isBenDetailsData.next(this.isBenDetails);
}

};

0 comments on commit 27e35a1

Please sign in to comment.