Fairoj : Tele PD and General Feedback and video call auto disconnection features are added

This commit is contained in:
venbatechnologies@gmail.com 2020-08-31 20:16:55 +05:30
parent 0d6abee45b
commit 195faa6958
19 changed files with 622 additions and 80 deletions

View File

@ -16,8 +16,13 @@
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson(1);getProCusPDType($event.value)"> <mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson(1);getProCusPDType($event.value)">
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" --> <!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
<mat-option>
<ngx-mat-select-search [formControl]="lenderFilterCtrl"
[placeholderLabel]="'Search Lender...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option> Select </mat-option> <mat-option> Select </mat-option>
<mat-option (click)="selectedLender(LL)" *ngFor="let LL of lenderList" [value]="LL.entity_id" > <mat-option (click)="selectedLender(LL)" *ngFor="let LL of filteredLenderList | async" [value]="LL.entity_id" >
{{LL.full_name}} {{LL.full_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>

View File

@ -10,7 +10,7 @@ import { TitleCasePipe } from '@angular/common';
/**sweet alert */ /**sweet alert */
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs'; import { Subject, ReplaySubject } from 'rxjs';
@Component({ @Component({
selector: 'app-add-pd', selector: 'app-add-pd',
templateUrl: './add-pd.component.html', templateUrl: './add-pd.component.html',
@ -65,6 +65,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
stateData: any=[]; stateData: any=[];
billingtolist: any; billingtolist: any;
removedControl: any = []; removedControl: any = [];
public lenderFilterCtrl:FormControl = new FormControl();
public filteredLenderList:ReplaySubject<any> = new ReplaySubject<any>(1);
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
private titleCase : TitleCasePipe) { private titleCase : TitleCasePipe) {
@ -90,7 +95,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.getTitleMaster(); this.getTitleMaster();
// this.getProCusPDType() // this.getProCusPDType()
this.loadFormData(); this.loadFormData();
this.filterList()
} }
getProCusPDType(entity_id){ getProCusPDType(entity_id){
console.log(entity_id); console.log(entity_id);
@ -251,6 +256,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.lenderList = data.records this.lenderList = data.records
this.filteredLenderList.next(this.lenderList.slice());
} }
}, error => this.errorMessage = <any>error); }, error => this.errorMessage = <any>error);
} }
@ -1102,5 +1108,28 @@ searchFun(control:any,i:number,option){
// this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1) // this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1)
// ) // )
} }
filterList() {
this.lenderFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.lenderFilterCtrl.value,this.filteredLenderList,this.lenderList,'full_name')
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
}
} }

View File

@ -22,11 +22,16 @@
<mat-card-content> <mat-card-content>
<mat-form-field style="width: 29%"> <mat-form-field style="width: 29%">
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson(1);getProCusPDType($event.value)"> <mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getContactPerson(1);getProCusPDType($event.value)">
<mat-option>
<ngx-mat-select-search [formControl]="lenderFilterCtrl"
[placeholderLabel]="'Search Lender...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option> <mat-option>
Select Select
</mat-option> </mat-option>
<!-- <mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" > --> <!-- <mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" > -->
<mat-option (click)="selectedLender(LL)" *ngFor="let LL of lenderList" <mat-option (click)="selectedLender(LL)" *ngFor="let LL of filteredLenderList | async"
[value]="LL.entity_id"> [value]="LL.entity_id">
{{LL.full_name}} {{LL.full_name}}
</mat-option> </mat-option>

View File

@ -8,7 +8,7 @@ import { TitleCasePipe } from '@angular/common';
import { getRandomString } from 'selenium-webdriver/safari'; import { getRandomString } from 'selenium-webdriver/safari';
import Swal from 'sweetalert2' import Swal from 'sweetalert2'
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs'; import { Subject, ReplaySubject } from 'rxjs';
@Component({ @Component({
selector: 'app-edit-pd-master', selector: 'app-edit-pd-master',
@ -74,6 +74,11 @@ export class EditPdMasterComponent implements OnInit {
finInstitutionList: any; finInstitutionList: any;
billingtolist: any; billingtolist: any;
removedControl: any = []; removedControl: any = [];
public lenderFilterCtrl:FormControl = new FormControl();
public filteredLenderList:ReplaySubject<any> = new ReplaySubject<any>(1);
constructor(private _fb: FormBuilder, constructor(private _fb: FormBuilder,
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>, private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) { @Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) {
@ -97,6 +102,7 @@ export class EditPdMasterComponent implements OnInit {
setTimeout(()=>{ setTimeout(()=>{
this.loadFormData(); this.loadFormData();
},500) },500)
this.filterList()
} }
getProCusPDType(entity_id,option?){ getProCusPDType(entity_id,option?){
@ -163,6 +169,7 @@ export class EditPdMasterComponent implements OnInit {
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.lenderList=data.records; this.lenderList=data.records;
this.filteredLenderList.next(this.lenderList.slice())
if(this.data.records.fk_lender_id != null){ if(this.data.records.fk_lender_id != null){
if(this.data.records.fk_lender_id){ if(this.data.records.fk_lender_id){
this.getProCusPDType(this.data.records.fk_lender_id,'start') this.getProCusPDType(this.data.records.fk_lender_id,'start')
@ -992,4 +999,27 @@ searchFun(control:any,i:number,option){
// this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1) // this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1)
// ) // )
} }
filterList() {
this.lenderFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.lenderFilterCtrl.value,this.filteredLenderList,this.lenderList,'full_name')
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
}
} }

View File

@ -216,6 +216,14 @@
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<mat-form-field style="width:25%;" *ngIf="fk_pd_type == '3'">
<mat-select placeholder="Address proof provided ?" name="address_proof_provided" formControlName="address_proof_provided" required>
<mat-option>Select</mat-option>
<mat-option value ="yes">Yes</mat-option>
<mat-option value ="no">No</mat-option>
</mat-select>
<mat-error align="end" style="font-size:13px" *ngIf="addressForm.controls['address_proof_provided'].errors?.required || addressForm.controls['address_proof_provided'].touched">Address Proof is Required</mat-error>
</mat-form-field>
<mat-form-field style="width: 46%;"> <mat-form-field style="width: 46%;">
<mat-select placeholder="Address Type" formControlName="address_type" <mat-select placeholder="Address Type" formControlName="address_type"
(selectionChange)="setOthers($event.value,'',3);selectedAddressType($event.source.triggerValue)"> (selectionChange)="setOthers($event.value,'',3);selectedAddressType($event.source.triggerValue)">

View File

@ -191,6 +191,7 @@ export class AddressComponent implements OnInit {
if(datas.comment_locality) { if(datas.comment_locality) {
this.addressForm.controls.comment_locality.setValue(datas.comment_locality); this.addressForm.controls.comment_locality.setValue(datas.comment_locality);
} }
this.addressForm.controls.locality.setValue(datas.locality ? datas.locality : ''); this.addressForm.controls.locality.setValue(datas.locality ? datas.locality : '');
if (datas.locality) { if (datas.locality) {
@ -235,6 +236,7 @@ export class AddressComponent implements OnInit {
this.addressForm = this.fb.group({ this.addressForm = this.fb.group({
addresses: this.fb.array([]), addresses: this.fb.array([]),
is_pd_done_on_initiated_address: [true], is_pd_done_on_initiated_address: [true],
address_proof_provided: [''],
address_type: ['', Validators.compose([Validators.required])], address_type: ['', Validators.compose([Validators.required])],
locality: ['', Validators.compose([Validators.required])], locality: ['', Validators.compose([Validators.required])],
locality_mixuse: [''], locality_mixuse: [''],
@ -543,6 +545,7 @@ export class AddressComponent implements OnInit {
records.pdid = this.pdid; records.pdid = this.pdid;
records.parent_pdid = this.parent_pdid; records.parent_pdid = this.parent_pdid;
records.formid = '5'; records.formid = '5';
records.address_proof_provided = this.addressForm.controls.address_proof_provided.value;
// records.fk_createdby = '250'; // records.fk_createdby = '250';
// console.log(JSON.stringify(records)); // console.log(JSON.stringify(records));
@ -652,6 +655,8 @@ export class AddressComponent implements OnInit {
records.pdid = this.pdid; records.pdid = this.pdid;
records.parent_pdid = this.parent_pdid; records.parent_pdid = this.parent_pdid;
records.formid = '5'; records.formid = '5';
records.address_proof_provided = this.addressForm.controls.address_proof_provided.value;
console.log(this.addressForm.controls.address_proof_provided.value,records);
// console.log('Final records', records); // console.log('Final records', records);
@ -909,6 +914,9 @@ export class AddressComponent implements OnInit {
} }
// this.addressForm.controls.was_the_company_name_board_sighted.setValue(data.records.hasOwnProperty('was_the_company_name_board_sighted') ? data.records.was_the_company_name_board_sighted : ''); // this.addressForm.controls.was_the_company_name_board_sighted.setValue(data.records.hasOwnProperty('was_the_company_name_board_sighted') ? data.records.was_the_company_name_board_sighted : '');
this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark); this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark);
// if(datas.address_proof_provided) {
this.addressForm.controls.address_proof_provided.patchValue(data.records.address_proof_provided)
// }
} }
else { else {
this.loadPDAddressesDetails(); this.loadPDAddressesDetails();

View File

@ -72,7 +72,12 @@
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''"> <mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != ''">
<input matInput placeholder="Address of the Property" formControlName="address_of_the_property" <input matInput placeholder="Address of the Property" formControlName="address_of_the_property"
autocomplete="off"> autocomplete="off" [matAutocomplete]="auto">
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let address of addressList" [value]="address.value">
<span>{{address.value}}</span>
</mat-option>
</mat-autocomplete>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != '' && (lender_short_name != 'CLIX' && lender_short_name != 'MWISE')"> <mat-form-field style="width:45%" *ngIf="detail.get('property_type').value != '' && (lender_short_name != 'CLIX' && lender_short_name != 'MWISE')">
<input matInput placeholder="Description of the Property" formControlName="describe_of_the_property_asset" <input matInput placeholder="Description of the Property" formControlName="describe_of_the_property_asset"

View File

@ -75,6 +75,7 @@ export class AssetsInfoComponent implements OnInit {
form_id: string; form_id: string;
product_abbr: any; product_abbr: any;
prod_catagory: any; prod_catagory: any;
addressList: any = [];
constructor( constructor(
notifier: NotifierService, notifier: NotifierService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
@ -158,6 +159,7 @@ export class AssetsInfoComponent implements OnInit {
//this.getM_InsuranceType(); //this.getM_InsuranceType();
this.getM_Vehicle_Type(); this.getM_Vehicle_Type();
this.getM_UOM_Type(); this.getM_UOM_Type();
this.addressSuggestion()
//this.retriveFile(); //this.retriveFile();
} }
@ -1125,6 +1127,25 @@ else{
control.removeAt(0) control.removeAt(0)
} }
} }
addressSuggestion() {
let params: any = {};
params.parent_pdid = this.parent_pdid;
params.pd_id = this.pdid;
params.pd_form_id = '5';
this.pdTrigerService.getAddressSuggestion(params).subscribe(data => {
console.log('Address Check',data);
let initiated_address_check = data.records.hasOwnProperty('is_pd_done_on_initiated_address') ? data.records.is_pd_done_on_initiated_address : true;
this.addressList.push({ key_name: 'initiate_address', value: data.records.addresses[0].address, description: 'Initiated Address' });
if (initiated_address_check == false ) {
this.addressList.push({ key_name: 'alternative_addresses', value: data.records.alternative_addresses[0].alternative_address, description: 'Alternative Address' });
}
console.log(this.addressList);
// debugger;
})
}
} }

View File

@ -124,8 +124,13 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name"> <mat-select placeholder="Bank Name" formControlName="bank_name">
<mat-option>
<ngx-mat-select-search [formControl]="bankFilterCtrl"
[placeholderLabel]="'Search Bank...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ <mat-option *ngFor="let btLen of filtered_m_btLenderList | async" [value]="btLen.bt_lender_list_id">{{
btLen.lender_name }}</mat-option> btLen.lender_name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>

View File

@ -23,6 +23,7 @@ import {
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
import { ReplaySubject } from 'rxjs';
@Component({ @Component({
selector: 'app-banking-details', selector: 'app-banking-details',
templateUrl: './banking-details.component.html', templateUrl: './banking-details.component.html',
@ -53,6 +54,10 @@ export class BankingDetailsComponent implements OnInit {
documentsAndFilesList: any = []; documentsAndFilesList: any = [];
image_doc_params: { pdid: number; form_id: any; company_id: string; }; image_doc_params: { pdid: number; form_id: any; company_id: string; };
form_id: string; form_id: string;
public bankFilterCtrl:FormControl = new FormControl();
public filtered_m_btLenderList:ReplaySubject<any> = new ReplaySubject<any>(1);
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService, private _pd: PdTrigerService,
@ -171,9 +176,31 @@ export class BankingDetailsComponent implements OnInit {
}); });
// this.retriveFile(); // this.retriveFile();
this.filterList();
} }
filterList() {
this.bankFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.bankFilterCtrl.value,this.filtered_m_btLenderList,this.m_btLenderList,'lender_name')
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
}
// ====================== // ======================
getM_AccountType() { getM_AccountType() {
@ -192,6 +219,7 @@ export class BankingDetailsComponent implements OnInit {
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe( this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => { data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1); this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1);
this.filtered_m_btLenderList.next(this.m_btLenderList.slice());
}) })
} }

View File

@ -57,8 +57,13 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name"> <mat-select placeholder="Bank Name" formControlName="bank_name">
<mat-option>
<ngx-mat-select-search [formControl]="bankFilterCtrl"
[placeholderLabel]="'Search Bank...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ <mat-option *ngFor="let btLen of filtered_m_btLenderList | async" [value]="btLen.bt_lender_list_id">{{
btLen.lender_name }}</mat-option> btLen.lender_name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>

View File

@ -23,6 +23,7 @@ import {
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
import { ReplaySubject } from 'rxjs';
@Component({ @Component({
selector: 'app-business-banking-details', selector: 'app-business-banking-details',
@ -59,6 +60,9 @@ export class BusinessBankingDetailsComponent implements OnInit {
image_doc_params: { pdid: number; form_id: any; company_id: String; }; image_doc_params: { pdid: number; form_id: any; company_id: String; };
form_id: string; form_id: string;
public bankFilterCtrl:FormControl = new FormControl();
public filtered_m_btLenderList:ReplaySubject<any> = new ReplaySubject<any>(1);
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService, private _pd: PdTrigerService,
@ -171,8 +175,31 @@ export class BusinessBankingDetailsComponent implements OnInit {
} }
}); });
//this.retriveFile(); //this.retriveFile();
this.filterList()
} }
filterList() {
this.bankFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.bankFilterCtrl.value,this.filtered_m_btLenderList,this.m_btLenderList,'lender_name')
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
}
// ====================== // ======================
getM_AccountType() { getM_AccountType() {
@ -191,6 +218,7 @@ export class BusinessBankingDetailsComponent implements OnInit {
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe( this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => { data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1); this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1);
this.filtered_m_btLenderList.next(this.m_btLenderList.slice())
}) })
} }

View File

@ -290,7 +290,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" <mat-select placeholder="State" formControlName="state_name"
required> required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -298,8 +303,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error> <mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error>
@ -332,8 +342,13 @@
<mat-form-field style="width:84%;"> <mat-form-field style="width:84%;">
<mat-label>States Where Max Sales Done for <mat-label>States Where Max Sales Done for
{{manufacturing.value.main_products}}</mat-label> {{manufacturing.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of manufacturing.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,manufacturing.value.india_where_sale_done)" <mat-option *ngIf="manufacturing.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of manufacturing.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,manufacturing.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -342,8 +357,13 @@
<mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'"> <mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-label>Cities Where Max Sales Done for <mat-label>Cities Where Max Sales Done for
{{manufacturing.value.main_products}}</mat-label> {{manufacturing.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -420,7 +440,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" <mat-select placeholder="State" formControlName="state_name"
required> required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -428,8 +453,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error> <mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error>
@ -458,8 +488,13 @@
<mat-form-field style="width:84%;"> <mat-form-field style="width:84%;">
<mat-label>States Where Max Sales Done for <mat-label>States Where Max Sales Done for
{{manufacturing.value.main_products}}</mat-label> {{manufacturing.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of manufacturing.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,manufacturing.value.india_where_sale_done)" <mat-option *ngIf="manufacturing.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of manufacturing.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,manufacturing.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -468,8 +503,13 @@
<mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'"> <mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-label>Cities Where Max Sales Done for <mat-label>Cities Where Max Sales Done for
{{manufacturing.value.main_products}}</mat-label> {{manufacturing.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -485,6 +525,11 @@
<mat-label>Countries Where The Export Is Being Done for <mat-label>Countries Where The Export Is Being Done for
{{manufacturing.value.main_products}}</mat-label> {{manufacturing.value.main_products}}</mat-label>
<mat-select placeholder="Countries" formControlName="country_name"> <mat-select placeholder="Countries" formControlName="country_name">
<mat-option>
<ngx-mat-select-search formControlName="countrySearch" (keyup)="searchFun(countryList,i,'country')"
[placeholderLabel]="'Search Countries...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id"> <mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}} {{CL.country_name}}
</mat-option> </mat-option>
@ -582,7 +627,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" <mat-select placeholder="State" formControlName="state_name"
required> required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -590,8 +640,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
@ -623,8 +678,13 @@
<mat-label>States Where Max Sales Done for <mat-label>States Where Max Sales Done for
{{retail.value.main_products}}</mat-label> {{retail.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of retail.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,retail.value.india_where_sale_done)" <mat-option *ngIf="retail.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of retail.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,retail.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -634,8 +694,13 @@
<mat-label>Cities Where Max Sales Done for <mat-label>Cities Where Max Sales Done for
{{retail.value.main_products}}</mat-label> {{retail.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,retail.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,retail.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,retail.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -713,7 +778,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" <mat-select placeholder="State" formControlName="state_name"
required> required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -721,8 +791,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
@ -752,8 +827,13 @@
<mat-form-field style="width:84%;"> <mat-form-field style="width:84%;">
<mat-label>States Where Max Sales Done for <mat-label>States Where Max Sales Done for
{{retail.value.main_products}}</mat-label> {{retail.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of retail.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,retail.value.india_where_sale_done)" <mat-option *ngIf="retail.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of retail.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,retail.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -763,8 +843,13 @@
<mat-label>Cities Where Max Sales Done for <mat-label>Cities Where Max Sales Done for
{{retail.value.main_products}}</mat-label> {{retail.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,retail.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,retail.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,retail.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -782,6 +867,11 @@
<mat-select placeholder="Countries Where The Export Is Being Done" <mat-select placeholder="Countries Where The Export Is Being Done"
formControlName="country_name"> formControlName="country_name">
<mat-option>
<ngx-mat-select-search formControlName="countrySearch" (keyup)="searchFun(countryList,i,'country')"
[placeholderLabel]="'Search Countries...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id"> <mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}} {{CL.country_name}}
</mat-option> </mat-option>
@ -882,7 +972,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" <mat-select placeholder="State" formControlName="state_name"
required> required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -890,8 +985,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error> <mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error>
@ -922,8 +1022,13 @@
<mat-label>States Where Max Sales Done for <mat-label>States Where Max Sales Done for
{{wholesale.value.main_products}}</mat-label> {{wholesale.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of wholesale.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,wholesale.value.india_where_sale_done)" <mat-option *ngIf="wholesale.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of wholesale.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,wholesale.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -933,8 +1038,13 @@
<mat-label>Cities Where Max Sales Done for <mat-label>Cities Where Max Sales Done for
{{wholesale.value.main_products}}</mat-label> {{wholesale.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,wholesale.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,wholesale.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,wholesale.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -1007,7 +1117,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" <mat-select placeholder="State" formControlName="state_name"
required> required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -1015,8 +1130,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error> <mat-error *ngIf="saleList.controls['city_name'].hasError('required')">City Required</mat-error>
@ -1047,8 +1167,13 @@
<mat-label>States Where Max Sales Done for <mat-label>States Where Max Sales Done for
{{wholesale.value.main_products}}</mat-label> {{wholesale.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of wholesale.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,wholesale.value.india_where_sale_done)" <mat-option *ngIf="wholesale.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of wholesale.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,wholesale.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -1058,8 +1183,13 @@
<mat-label>Cities Where Max Sales Done for <mat-label>Cities Where Max Sales Done for
{{wholesale.value.main_products}}</mat-label> {{wholesale.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,wholesale.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,wholesale.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,wholesale.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -1078,6 +1208,11 @@
<mat-label>Countries Where The Export Is Being Done for <mat-label>Countries Where The Export Is Being Done for
{{wholesale.value.main_products}}</mat-label> {{wholesale.value.main_products}}</mat-label>
<mat-select placeholder="Countries" formControlName="country_name"> <mat-select placeholder="Countries" formControlName="country_name">
<mat-option>
<ngx-mat-select-search formControlName="countrySearch" (keyup)="searchFun(countryList,i,'country')"
[placeholderLabel]="'Search Countries...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id"> <mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}} {{CL.country_name}}
</mat-option> </mat-option>
@ -1177,7 +1312,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="Where, In India, Is The Service Provided" <mat-select placeholder="Where, In India, Is The Service Provided"
formControlName="state_name" required> formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -1185,8 +1325,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
@ -1216,8 +1361,13 @@
<mat-label>States Where Max Revenue From Services for <mat-label>States Where Max Revenue From Services for
{{serviceprovider.value.main_products}}</mat-label> {{serviceprovider.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of serviceprovider.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,serviceprovider.value.india_where_sale_done)" <mat-option *ngIf="serviceprovider.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of serviceprovider.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,serviceprovider.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -1227,8 +1377,13 @@
<mat-label>Cities Where Max Revenue From Services for <mat-label>Cities Where Max Revenue From Services for
{{serviceprovider.value.main_products}}</mat-label> {{serviceprovider.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,serviceprovider.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,serviceprovider.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,serviceprovider.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -1301,7 +1456,12 @@
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="Where, In India, Is The Service Provided" <mat-select placeholder="Where, In India, Is The Service Provided"
formControlName="state_name" required> formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredStateList | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -1309,8 +1469,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" <mat-select multiple formControlName="city_name"
placeholder="City" required> placeholder="City" required (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterCity(stateList,saleList.value.state_name,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityFilterCtrl.value ? (filteredCityList | async) : filterCity(stateList,saleList.value.state_name)"
[value]="CL.city_id">{{CL.city_name}}</mat-option> [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
@ -1341,8 +1506,13 @@
<mat-label>States Where Max Revenue From Services for <mat-label>States Where Max Revenue From Services for
{{serviceprovider.value.main_products}}</mat-label> {{serviceprovider.value.main_products}}</mat-label>
<mat-select multiple placeholder="States" formControlName="state_name"> <mat-select multiple placeholder="States" formControlName="state_name" (selectionChange)="stateFilterCtrl.setValue('')">
<mat-option *ngFor="let MSL of serviceprovider.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,serviceprovider.value.india_where_sale_done)" <mat-option *ngIf="serviceprovider.value.pan_india_options=='Yes'">
<ngx-mat-select-search [formControl]="stateFilterCtrl"
[placeholderLabel]="'Search State...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MSL of serviceprovider.value.pan_india_options=='Yes' ? (filteredStateList | async) : filterMaxSaleState(stateList,serviceprovider.value.india_where_sale_done)"
[value]="MSL.state_id"> [value]="MSL.state_id">
{{MSL.state_name}} {{MSL.state_name}}
</mat-option> </mat-option>
@ -1352,8 +1522,13 @@
<mat-label>Cities Where Max Revenue From Services for <mat-label>Cities Where Max Revenue From Services for
{{serviceprovider.value.main_products}}</mat-label> {{serviceprovider.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name"> <mat-select multiple placeholder="Cities" formControlName="city_name" (selectionChange) = "cityFilterCtrl.setValue('')">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,serviceprovider.get('india_where_sale_done').value)" <mat-option>
<ngx-mat-select-search [formControl]="cityFilterCtrl" (keyup) = "filterMaxSaleCities(stateList,maxStateList.value.state_name,serviceprovider.get('india_where_sale_done').value,cityFilterCtrl.value)"
[placeholderLabel]="'Search City...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let MCL of cityFilterCtrl.value ? (filteredCityList | async) : filterMaxSaleCities(stateList,maxStateList.value.state_name,serviceprovider.get('india_where_sale_done').value)"
[value]="MCL.city_id"> [value]="MCL.city_id">
{{MCL.city_name}} {{MCL.city_name}}
</mat-option> </mat-option>
@ -1369,6 +1544,11 @@
<mat-label>Countries Where The Export Is Being Done for <mat-label>Countries Where The Export Is Being Done for
{{serviceprovider.value.main_products}}</mat-label> {{serviceprovider.value.main_products}}</mat-label>
<mat-select placeholder="Countries" formControlName="country_name"> <mat-select placeholder="Countries" formControlName="country_name">
<mat-option>
<ngx-mat-select-search formControlName="countrySearch" (keyup)="searchFun(countryList,i,'country')"
[placeholderLabel]="'Search Countries...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id"> <mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}} {{CL.country_name}}
</mat-option> </mat-option>

View File

@ -29,7 +29,7 @@ import { DatePipe } from '@angular/common';
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs'; import { Subject, ReplaySubject } from 'rxjs';
@Component({ @Component({
selector: 'app-business-info', selector: 'app-business-info',
templateUrl: './business-info.component.html', templateUrl: './business-info.component.html',
@ -106,6 +106,11 @@ export class BusinessInfoComponent implements OnInit {
prod_catagory: any; prod_catagory: any;
fk_pd_type: any; fk_pd_type: any;
vendor_data_answers: any = {documents_info:{}}; vendor_data_answers: any = {documents_info:{}};
public stateFilterCtrl:FormControl = new FormControl();
public cityFilterCtrl:FormControl = new FormControl();
public filteredStateList:ReplaySubject<any>=new ReplaySubject<any>(1)
public filteredCityList:ReplaySubject<any>=new ReplaySubject<any>(1)
constructor(notifier: NotifierService, constructor(notifier: NotifierService,
@ -686,7 +691,8 @@ export class BusinessInfoComponent implements OnInit {
val.toUpperCase() == 'YES' ? this.businessForm.addControl('month_of_business_run', new FormControl('', Validators.required)) : this.businessForm.removeControl('month_of_business_run'); val.toUpperCase() == 'YES' ? this.businessForm.addControl('month_of_business_run', new FormControl('', Validators.required)) : this.businessForm.removeControl('month_of_business_run');
}); });
// this.retriveFile(); // this.retriveFile();
this.filterDropDownDatas()
} }
@ -739,7 +745,11 @@ export class BusinessInfoComponent implements OnInit {
} }
/************************* END OF VENDOR FORM DATAS *********************************/ /************************* END OF VENDOR FORM DATAS *********************************/
filterDropDownDatas() {
this.stateFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.stateFilterCtrl.value,this.filteredStateList,this.stateList,'state_name')
})
}
public initBusinessForm(): void { public initBusinessForm(): void {
this.businessForm = this.fb.group({ this.businessForm = this.fb.group({
@ -1375,6 +1385,7 @@ export class BusinessInfoComponent implements OnInit {
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.stateList = data.records this.stateList = data.records
this.filteredStateList.next(this.stateList.slice())
} }
}); });
} }
@ -1811,10 +1822,20 @@ export class BusinessInfoComponent implements OnInit {
// filter cities for other than pan india // filter cities for other than pan india
filterCity(datasource: any, filterid: number) { filterCity(datasource: any, filterid: number,searchText?:String) {
if (filterid) { if (filterid) {
let filter = datasource.filter(x => x.state_id == filterid); let filter = datasource.filter(x => x.state_id == filterid);
let filter_output =[]
if(filter.length > 0){
filter_output = filter[0].cities
}
if(searchText) {
searchText =searchText.toLowerCase();
this.filteredCityList.next( filter_output.filter(vv => vv['city_name'].toLowerCase().indexOf(searchText) > -1))
return
}
return filter.length > 0 ? filter[0].cities : []; return filter.length > 0 ? filter[0].cities : [];
} }
} }
@ -1833,7 +1854,7 @@ export class BusinessInfoComponent implements OnInit {
} }
} }
filterMaxSaleCities(datasource: any, filterValues: any, selectedCites: any) { filterMaxSaleCities(datasource: any, filterValues: any, selectedCites: any,searchText?:String) {
if (filterValues) { if (filterValues) {
let setCityValues: any=[]; let setCityValues: any=[];
let getOriginalStateList = datasource.map(dval => dval.state_id); let getOriginalStateList = datasource.map(dval => dval.state_id);
@ -1861,6 +1882,12 @@ export class BusinessInfoComponent implements OnInit {
}); });
}); });
if(searchText && setCityValues.length>0) {
setCityValues = setCityValues.filter(fVal=>fVal.city_id!="1")
searchText =searchText.toLowerCase();
this.filteredCityList.next( setCityValues.filter(vv => vv['city_name'].toLowerCase().indexOf(searchText) > -1))
return
}
return setCityValues.length>0 ? setCityValues.filter(fVal=>fVal.city_id!="1") : []; return setCityValues.length>0 ? setCityValues.filter(fVal=>fVal.city_id!="1") : [];
} }
@ -2155,8 +2182,34 @@ export class BusinessInfoComponent implements OnInit {
this.searchcountry(control.controls['countrySearch'].value) this.searchcountry(control.controls['countrySearch'].value)
}) })
} }
else if( option == 'state') {
// this.filteredStateList = this.applyFilter(control,this.filteredStateList,this.stateList,'state_name')
// takeUntil(this._onDestroy)
// console.log(this.filteredStateList)
}
} }
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
// return raw_list.slice()
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
// return raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
}
searchcountry(val: any) { searchcountry(val: any) {
console.log("countryData") console.log("countryData")

View File

@ -78,8 +78,13 @@
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select placeholder="Lender" formControlName="lender" <mat-select placeholder="Lender" formControlName="lender"
(selectionChange)="setRequiredValidation($event.value,details,2)"> (selectionChange)="setRequiredValidation($event.value,details,2)">
<mat-option>
<ngx-mat-select-search [formControl]="bankFilterCtrl"
[placeholderLabel]="'Search Lender...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{ <mat-option *ngFor="let btLen of filteredLenderData | async" [value]="btLen.bt_lender_list_id">{{
btLen.lender_name }}</mat-option> btLen.lender_name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>

View File

@ -11,6 +11,7 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import { ActivatedRoute, Router } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
import { ReplaySubject } from 'rxjs';
@Component({ @Component({
selector: 'app-current-loan', selector: 'app-current-loan',
@ -48,6 +49,9 @@ export class CurrentLoanComponent implements OnInit {
product_abbr: any; product_abbr: any;
prod_catagory: any; prod_catagory: any;
public bankFilterCtrl:FormControl = new FormControl();
public filteredLenderData:ReplaySubject<any> = new ReplaySubject<any>(1)
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private _pd: PdTrigerService, private _pd: PdTrigerService,
@ -401,7 +405,35 @@ export class CurrentLoanComponent implements OnInit {
} }
}) })
//this.retriveFile(); //this.retriveFile();
this.filterList()
} }
// filter changes for dropdown datas.
filterList() {
this.bankFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.bankFilterCtrl.value,this.filteredLenderData,this.lenderData,'lender_name')
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
}
checkTenure(details) { checkTenure(details) {
let originalTenure = details.value.original_tenure; let originalTenure = details.value.original_tenure;
// alert(originalTenure); // alert(originalTenure);
@ -623,6 +655,9 @@ export class CurrentLoanComponent implements OnInit {
this.addressTypeData.push(val); this.addressTypeData.push(val);
} }
}) })
if(type == 1) {
this.filteredLenderData.next(this.lenderData.slice())
}
}); });
} }

View File

@ -204,9 +204,14 @@
<mat-select formControlName="business_entity_type" <mat-select formControlName="business_entity_type"
(selectionChange)="checkEntityType(com.value.business_entity_type,c)" (selectionChange)="checkEntityType(com.value.business_entity_type,c)"
required> required>
<mat-option>
<ngx-mat-select-search [formControl]="entityFilterCtrl"
[placeholderLabel]="'Search Entity...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option [value]="entity.business_entity_type_id" <mat-option [value]="entity.business_entity_type_id"
*ngFor="let entity of businessEntityTypeList"> *ngFor="let entity of filteredBusinessEntityTypeList | async">
{{entity.business_entity_type_name}}</mat-option> {{entity.business_entity_type_name}}</mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="com.controls['business_entity_type'].invalid">Business <mat-error *ngIf="com.controls['business_entity_type'].invalid">Business
@ -293,9 +298,14 @@
<mat-form-field class="table-field" floatLabel="never" style="width: 75%;" > <mat-form-field class="table-field" floatLabel="never" style="width: 75%;" >
<mat-select placeholder="Relation" formControlName="relationship" <mat-select placeholder="Relation" formControlName="relationship"
(selectionChange)="updatePersonalRelation(i)"> (selectionChange)="updatePersonalRelation(i)">
<mat-option>
<ngx-mat-select-search [formControl]="relationFilterCtrl"
[placeholderLabel]="'Search Relation...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option [value]="member.relationship_id" <mat-option [value]="member.relationship_id"
*ngFor="let member of relationShipList">{{member.name *ngFor="let member of filteredRelationShipList | async">{{member.name
+ ' of' | titlecase}}</mat-option> + ' of' | titlecase}}</mat-option>
<mat-option value="0"> Not Related </mat-option> <mat-option value="0"> Not Related </mat-option>
</mat-select> </mat-select>
@ -364,8 +374,13 @@
<mat-form-field class="table-field" floatLabel="never" style="width: 75%"> <mat-form-field class="table-field" floatLabel="never" style="width: 75%">
<mat-select placeholder="Relation" formControlName="company_relationship" <mat-select placeholder="Relation" formControlName="company_relationship"
(selectionChange)="updateCompanyRelation(i)"> (selectionChange)="updateCompanyRelation(i)">
<mat-option>
<ngx-mat-select-search [formControl]="companyRelationFilterCtrl"
[placeholderLabel]="'Search Relation...'"
[noEntriesFoundLabel]="'no matching records found'"></ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" <mat-option *ngFor="let comrelShip of filteredCompanyRelationShipList | async"
[value]="comrelShip.company_relationship_id"> [value]="comrelShip.company_relationship_id">
{{comrelShip.name | titlecase}} {{comrelShip.name | titlecase}}
</mat-option> </mat-option>

View File

@ -10,6 +10,8 @@ import { DatePipe, TitleCasePipe } from '@angular/common';
import { SearchRelationPipe } from './../../../../../pd-pipes/search-relation.pipe'; import { SearchRelationPipe } from './../../../../../pd-pipes/search-relation.pipe';
import { Options } from 'selenium-webdriver/edge'; import { Options } from 'selenium-webdriver/edge';
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
import { ReplaySubject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
// import { ImageCropperComponent } from '../dialogue/image-cropper/image-cropper.component'; // import { ImageCropperComponent } from '../dialogue/image-cropper/image-cropper.component';
@Component({ @Component({
@ -89,6 +91,15 @@ export class GeneralInfoComponent implements OnInit {
checksalaried: boolean = false; checksalaried: boolean = false;
split_customer_abbr: any; split_customer_abbr: any;
fk_pd_type: any; fk_pd_type: any;
/** control for the MatSelect filter keyword */
public entityFilterCtrl: FormControl = new FormControl();
public relationFilterCtrl: FormControl = new FormControl();
public companyRelationFilterCtrl:FormControl = new FormControl();
/** list filtered by search keyword */
public filteredBusinessEntityTypeList: ReplaySubject<any> = new ReplaySubject<any>(1);
public filteredRelationShipList: ReplaySubject<any> = new ReplaySubject<any>(1);
public filteredCompanyRelationShipList: ReplaySubject<any> = new ReplaySubject<any>(1);
/********************** Declaration Section Ends Here *****************/ /********************** Declaration Section Ends Here *****************/
@ -153,6 +164,38 @@ export class GeneralInfoComponent implements OnInit {
}); });
//this.retriveFile(); //this.retriveFile();
// FILTER THE CHANGES DETECTION
this.filterList()
}
filterList() {
this.entityFilterCtrl.valueChanges.pipe().subscribe(()=>{
console.log("value changes",this.entityFilterCtrl,this._generalForm.value);
this.applyFilter(this.entityFilterCtrl.value,this.filteredBusinessEntityTypeList,this.businessEntityTypeList,'business_entity_type_name')
})
this.relationFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.relationFilterCtrl.value,this.filteredRelationShipList,this.relationShipList,'name')
})
this.companyRelationFilterCtrl.valueChanges.pipe().subscribe(()=>{
this.applyFilter(this.companyRelationFilterCtrl.value,this.filteredCompanyRelationShipList,this.companyRelationShipList,'name')
})
}
applyFilter(filtered_text,filter_list,raw_list,obj_name) {
if (!raw_list) {
return;
}
// get the search keyword
let search = filtered_text;
if (!search) {
filter_list.next(raw_list.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
filter_list.next(
raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
);
} }
/***************************** ng Oninit Section Ends Here **********************************/ /***************************** ng Oninit Section Ends Here **********************************/
@ -185,17 +228,20 @@ export class GeneralInfoComponent implements OnInit {
if (data.status == 200) { if (data.status == 200) {
if (type == 1) { if (type == 1) {
this.relationShipList = data.records.filter(item => item.isactive == 1); this.relationShipList = data.records.filter(item => item.isactive == 1);
this.filteredRelationShipList.next(this.relationShipList.slice())
//this.relationShipList.push({'relationship_id':"0",'name':'Not Applicable'}); //this.relationShipList.push({'relationship_id':"0",'name':'Not Applicable'});
} }
if (type == 2) { if (type == 2) {
this.companyRelationShipList = data.records.filter(item => item.isactive == 1); this.companyRelationShipList = data.records.filter(item => item.isactive == 1);
this.companyRelationShipList = data.records.filter(item => item.name != 'Others'); this.companyRelationShipList = data.records.filter(item => item.name != 'Others');
this.filteredCompanyRelationShipList.next(this.companyRelationShipList.slice())
} }
if (type == 3) { if (type == 3) {
this.qualificationList = data.records; this.qualificationList = data.records;
} }
if (type == 4) { if (type == 4) {
this.businessEntityTypeList = data.records.filter(val=>val.isactive != '0'); this.businessEntityTypeList = data.records.filter(val=>val.isactive != '0');
this.filteredBusinessEntityTypeList.next(this.businessEntityTypeList.slice());
} }
} }

View File

@ -33,6 +33,9 @@ export class VideoChatComponent implements OnInit {
start_btn_enable:boolean = true start_btn_enable:boolean = true
displayMsg:string = "Note : Make sure the Reciever is waiting for your call before start Calling" displayMsg:string = "Note : Make sure the Reciever is waiting for your call before start Calling"
arr_of_blobs: any = []; arr_of_blobs: any = [];
unique_video_key: string = '';
callDisconnectTimer:any
constructor(private _notificationService:PushNotifyService, constructor(private _notificationService:PushNotifyService,
private cdRef: ChangeDetectorRef,private socket: Socket, private cdRef: ChangeDetectorRef,private socket: Socket,
private dialogRef: MatDialogRef<VideoChatComponent>, private dialogRef: MatDialogRef<VideoChatComponent>,
@ -120,6 +123,7 @@ export class VideoChatComponent implements OnInit {
if( supports['facingMode'] === true ) { if( supports['facingMode'] === true ) {
// switchCameraBtn.disabled = false; // switchCameraBtn.disabled = false;
} }
console.log("entered",stream); console.log("entered",stream);
peerx = new SimplePeer ({ peerx = new SimplePeer ({
initiator: option === 'init', initiator: option === 'init',
@ -150,6 +154,10 @@ export class VideoChatComponent implements OnInit {
if(data.hasOwnProperty('type') && data.type == 'offer'){ if(data.hasOwnProperty('type') && data.type == 'offer'){
console.log("entered!!!!!!!!!!!!!!!!1"); console.log("entered!!!!!!!!!!!!!!!!1");
this.user_msg = "Calling..." this.user_msg = "Calling..."
this.callDisconnectTimer = setTimeout(()=>{
this.notify("User is Busy !!.", "Try calling again later")
this.disconnect()
},15000);
let event_data = {JSON_to_connect:data,type:'offer',random_string:this.chat_info.random_string,user_type:"officer"} let event_data = {JSON_to_connect:data,type:'offer',random_string:this.chat_info.random_string,user_type:"officer"}
this.socket.emit('Offer', event_data) this.socket.emit('Offer', event_data)
} }
@ -224,6 +232,9 @@ export class VideoChatComponent implements OnInit {
// //wait for 1 sec // //wait for 1 sec
// } // }
function connectPeer(answer) { function connectPeer(answer) {
if(this.callDisconnectTimer) {
clearTimeout(this.callDisconnectTimer)
}
console.log("$$$$$$$$$$$$$$44"); console.log("$$$$$$$$$$$$$$44");
console.log(answer); console.log(answer);
setTimeout(()=>{ setTimeout(()=>{
@ -278,7 +289,7 @@ export class VideoChatComponent implements OnInit {
} }
updateTheMsg(msg_obj) { updateTheMsg(msg_obj) {
console.log("CallstatusMsg",msg_obj) console.log("CallstatusMsg",msg_obj)
if(msg_obj && msg_obj.status_code == 2){ if(msg_obj && (msg_obj.status_code == 2) || (msg_obj.status_code == 3) && msg_obj.random_string == this.chat_info.random_string){
console.log("entered"); console.log("entered");
this.start_btn_enable = false this.start_btn_enable = false
this.displayMsg = msg_obj.msg this.displayMsg = msg_obj.msg
@ -307,6 +318,7 @@ export class VideoChatComponent implements OnInit {
// this.camereSwitchBtn.nativeElement.disabled = true; // this.camereSwitchBtn.nativeElement.disabled = true;
console.log("peervideo check",this.peerVideoEnable,this.peervideo.nativeElement.videoWidth,this.peervideo.nativeElement.videoHeight); console.log("peervideo check",this.peerVideoEnable,this.peervideo.nativeElement.videoWidth,this.peervideo.nativeElement.videoHeight);
this.cdRef.detectChanges(); this.cdRef.detectChanges();
this.unique_video_key =this.randomStringGenerator(8)
this.startRecording(stream) this.startRecording(stream)
// this.addVideoToRecorder(stream) // this.addVideoToRecorder(stream)
// this.addVideoToRecorder(this.MediaStream) // this.addVideoToRecorder(this.MediaStream)
@ -407,7 +419,7 @@ this.stopRecording(true);
console.log("----------------------------") console.log("----------------------------")
console.log("video "+this.arr_of_blobs.length, fileURL) console.log("video "+this.arr_of_blobs.length, fileURL)
console.log("----------------------------") console.log("----------------------------")
this.sendVideoToServer(seekableBlob) this.sendVideoToServer(seekableBlob,autostarRec)
}) })
// var file = new File([blob], 'video.mp4', { // var file = new File([blob], 'video.mp4', {
@ -438,11 +450,13 @@ this.stopRecording(true);
// }) // })
} }
sendVideoToServer(blob) { sendVideoToServer(blob,is_auto_start) {
let formData = new FormData(); let formData = new FormData();
formData.append('video_file', blob); formData.append('video_file', blob);
let params = { let params = {
filename:'video'+this.arr_of_blobs.length+'.mp4', filename:'video'+this.arr_of_blobs.length+'-'+this.unique_video_key,
is_call_ended:is_auto_start ? '0' : '1',
video_key:this.unique_video_key,
random_string:this.chat_info.random_string, random_string:this.chat_info.random_string,
pd_id:this.chat_info.pd_id pd_id:this.chat_info.pd_id
} }
@ -474,6 +488,9 @@ sendVideoToServer(blob) {
this.stopRecording().then(res=>{ this.stopRecording().then(res=>{
}) })
if(this.callDisconnectTimer) {
clearTimeout(this.callDisconnectTimer)
}
this.peer.destroy(); this.peer.destroy();
this.peerVideoEnable = false this.peerVideoEnable = false
this.targetpeer = '' this.targetpeer = ''
@ -566,6 +583,20 @@ sendVideoToServer(blob) {
this.socket.emit('callStatus',{random_string:this.chat_info.random_string,status:'disconnected',status_code:0}) this.socket.emit('callStatus',{random_string:this.chat_info.random_string,status:'disconnected',status_code:0})
} }
} }
randomStringGenerator(length: number): string {
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
const values = new Uint32Array(length);
window.crypto.getRandomValues(values);
let i;
let result = "";
for (i = 0; i < length; i++) {
// console.log(values[i], charset.length);
result += charset[values[i] % charset.length];
}
return result;
}
@HostListener('window:beforeunload', ['$event']) @HostListener('window:beforeunload', ['$event'])
unloadHandler(event) { unloadHandler(event) {