Flyhi issue fix

This commit is contained in:
venbainfotech 2022-07-05 18:39:02 +05:30
parent 7bd177f374
commit a410cc9465
9 changed files with 323 additions and 23 deletions

View File

@ -19,8 +19,8 @@
<mat-tab>
<!-- <ng-template mat-tab-label>Fly Hi</ng-template> -->
<mat-card-content style="padding: 0px !important;">
<!-- <app-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)"
></app-advance-filter> -->
<app-flyhi-advance-filter (filteredlistData)="filteredDataSource($event)"
></app-flyhi-advance-filter>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<div class="example-container">
@ -29,7 +29,7 @@
<div fxFlex.xs="40" fxFlex.sm="40" class="webhide" style="text-align: left;" (click)="editForm(details)">
<small mat-line *ngIf="details.applicant_name == null">Name Not Given</small>
<small mat-line *ngIf="details.applicant_name != null">{{details.applicant_name}}</small><br/>
<small style="font-size: 10px;color:black" mat-line>{{details.sales_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</small>
<!-- <small style="font-size: 10px;color:black" mat-line>{{details.sales_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</small> -->
</div>
<div fxFlex.xs="50" fxFlex.sm="50" class="webhide" style="text-align: right;" (click)="editForm(details)" >
<!-- <div fxLayout="row wrap" style="margin-left: 6px;" fxLayoutAlign="end"> -->
@ -55,7 +55,7 @@
</div>
<div fxFlex.xs="14" fxFlex.sm="14" fxFlex.md="14" fxFlex.lg="14" fxFlex.xl="14" class="cell fontTitle" style="justify-content:flex-end" [ngStyle]="{'color':roleID == 20 ? '#0d93a9' :'#f44336'}">
<small mat-line>{{details.sales_pd_sno}}</small><br/>
<small style="color: black;text-align:center;font-weight: normal;font-size: 15px;">{{details.sales_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</small>
<!-- <small style="color: black;text-align:center;font-weight: normal;font-size: 15px;">{{details.sales_pd_type == '1' ? 'Physical PD' : 'Telephonic PD'}}</small> -->
</div>
<div fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="13" fxFlex.lg="13" fxFlex.xl="13" class="cell" style="justify-content:flex-end">
<span *ngIf="!details.applicant_name" mat-line>

View File

@ -13,7 +13,8 @@
// }
::ng-deep .mat-tab-group.mat-primary .mat-ink-bar, .mat-tab-nav-bar.mat-primary .mat-ink-bar {
background-color: #0d93a9;
// background-color: #0d93a9;
display: none;
}
.fontTitle{
font-weight:bold;

View File

@ -0,0 +1,114 @@
<!-- <p>
advance-filter works!
</p> -->
<mat-expansion-panel [(expanded)]="xpandStatus">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left">
<mat-toolbar-row>
<mat-icon>filter_list</mat-icon>
<span class="toolbar-space"></span>
<span>Advanced Filter</span>
</mat-toolbar-row>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-list class="m-gap p-gap" >
<div [formGroup]="searchForm">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
<mat-form-field class="web mobile">
<!-- <mat-select multiple formControlName="sales_pd_type" placeholder="PD Type">
<mat-option [value]="1">Physical PD</mat-option>
<mat-option [value]="2">Telephonic PD</mat-option>
</mat-select> -->
<mat-select multiple formControlName="sales_pd_type" placeholder="PD Type">
<mat-option *ngFor="let item of salesPdTypeList" [value]="item.id">{{item.pd_type_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
<!-- {{pdStatus | json}} -->
<mat-form-field class="web mobile">
<mat-select multiple formControlName="pd_status" placeholder="PD Status">
<mat-option *ngFor="let status of pdStatus" [value]="status.pd_status_name">{{status.pd_status_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
<mat-form-field class="web mobile">
<mat-select multiple formControlName="pd_products" placeholder="Products">
<mat-option *ngFor="let pro of PRODUCTS" [value]="pro.product_id">{{pro.abbr}}</mat-option>
</mat-select>
</mat-form-field>
</div> -->
</div>
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
<mat-form-field class="web mobile" >
<input matInput [matDatepicker]="picker" [max]="todaydate"
formControlName="pd_from_date" placeholder="Choose a From date" >
<mat-datepicker-toggle matSuffix [for]="picker" ></mat-datepicker-toggle>
<mat-datepicker touchUi=true #picker ></mat-datepicker>
</mat-form-field>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
<mat-form-field class="web mobile" >
<input matInput [matDatepicker]="picker1" [min]="searchForm.get('pd_from_date').value" [max]="todaydate"
formControlName="pd_to_date" placeholder="Choose a To date" >
<mat-datepicker-toggle matSuffix [for]="picker1" ></mat-datepicker-toggle>
<mat-datepicker touchUi=true #picker1 ></mat-datepicker>
</mat-form-field>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
<mat-form-field class="web mobile">
<input matInput type="text" formControlName="pd_applicant_name" placeholder="Applicant Name">
</mat-form-field>
</div>
</div>
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_city" placeholder="City">
<mat-option *ngFor="let city of CITY" [value]="city.city_id">{{city.name}}</mat-option>
</mat-select>
</mat-form-field> &nbsp; &nbsp; -->
<!-- <mat-form-field style="width:30%">
<mat-select multiple formControlName="pd_lender" placeholder="Lender Name">
<mat-option *ngFor="let ent of ENTITY" [value]="ent.entity_id">{{ent.full_name}}</mat-option>
</mat-select>
</mat-form-field> -->
<!-- <mat-form-field style="width: 30%">
<input matInput type="text" formControlName="pd_officer" placeholder="PD Officer Name">
</mat-form-field> -->
<!-- <div fxLayout="row wrap">
<div fxFlex.xs="80%" fxFlex.sm="80%" fxFlex="45%">
<mat-checkbox class="example-margin" color="primary" formControlName="is_include_archived">Include Archived</mat-checkbox>
</div>
</div> -->
</div>
</mat-list>
<div align="right" fxLayout="row" fxLayoutAlign="flex-end">
<button type="button" mat-raised-button mat-icon-button (click)="onReset()" matTooltip="Reset"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary">
<mat-icon>settings_backup_restore</mat-icon>
</button>
<button type="button" mat-raised-button mat-icon-button (click)="searchItem()" matTooltip="Search"
matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" type="button">
<mat-icon>search</mat-icon>
</button>
</div>
</mat-expansion-panel>

View File

@ -0,0 +1,10 @@
@media(min-width: 600px) {
.web{
width: 80% !important;
}
}
@media(max-width: 600px) {
.mobile{
width: 100% !important;
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FlyhiAdvanceFilterComponent } from './flyhi-advance-filter.component';
describe('FlyhiAdvanceFilterComponent', () => {
let component: FlyhiAdvanceFilterComponent;
let fixture: ComponentFixture<FlyhiAdvanceFilterComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FlyhiAdvanceFilterComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FlyhiAdvanceFilterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,153 @@
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { DatePipe } from '@angular/common';
import { FormGroup, FormBuilder } from '@angular/forms';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { SalesPdService } from 'app/sales-pd/services/sales-pd.service';
import { FlyhiService } from 'app/fly-hi/services/flyhi.service';
@Component({
selector: 'app-flyhi-advance-filter',
templateUrl: './flyhi-advance-filter.component.html',
styleUrls: ['./flyhi-advance-filter.component.scss']
})
export class FlyhiAdvanceFilterComponent implements OnInit {
searchForm:FormGroup;
todaydate: any;
pdStatus: any=[];
// pdStatus_all: any=[];
ENTITY: any =[];
is_sales_login: boolean = false;
@Input()drop_down_datas
@Output() filteredlistData = new EventEmitter();
@Output() resetFilter = new EventEmitter();
PRODUCTS: any =[];
xpandStatus:boolean=false;
pipe=new DatePipe('en-US');
salesPdTypeList = [
{
id:'4',
pd_type_name:"Residence"
},
{
id:'3',
pd_type_name:"Office"
}
]
constructor(private _fb:FormBuilder,private _pd:PdTrigerService,private _flyHi:FlyhiService) {
this.todaydate = new Date();
this.getDropdown();
let local:any = JSON.parse(localStorage.getItem('user_details'));
if(local.userid != ''){
this.is_sales_login = true
}
}
ngOnInit() {
let local:any = JSON.parse(localStorage.getItem('user_details'));
let entity_id=localStorage.getItem('LocalSetEntity');
// 'drop_down_datas':this.filter_drop_down_data,is_sales_login:this.is_sales_login
this.searchForm=this._fb.group({
pd_status:[''],
sales_pd_type:[''],
pd_from_date:[''],
pd_to_date:[''],
// pd_products:[''],
// pd_lender:[entity_id],
pd_applicant_name:[''],
// pd_officer:[''],
sales_pd_officer_id:[this.is_sales_login ? local.userid : '']
})
console.log('testing');
console.log(this.drop_down_datas)
}
getDropdown(){
this._pd.getAllMasterDatas('PDSTATUS').subscribe(res=>{
console.log(res)
if(res.dataStatus==true)
{
this.pdStatus = res.records.filter(status=>status.isactive==1 && status.hasOwnProperty('avail_pd_types') && (status.avail_pd_types == '2' || status.avail_pd_types == '3' ))
console.log(this.pdStatus)
}
});
this._pd.getAllMasterDatas('ENTITY').subscribe(res=>
{
if(res.dataStatus==true)
{
this.ENTITY = res.records.filter(ent=>ent.isactive==1 && ent.hasOwnProperty('avail_pd_types') && (ent.avail_pd_types == '2' || ent.avail_pd_types == '3' ));
}
});
this._pd.getAllMasterDatas('PRODUCTS').subscribe(res=>
{
if(res.dataStatus==true)
{
this.PRODUCTS = res.records.filter(pro=>pro.isactive==1 && pro.hasOwnProperty('avail_pd_types') && (pro.avail_pd_types == '2' || pro.avail_pd_types == '3' ));
}
});
}
setDropDownDatas(){
console.log(this.drop_down_datas)
if(this.drop_down_datas != undefined){
this.pdStatus=this.drop_down_datas.pd_status
console.log(this.pdStatus)
if(this.ENTITY.length != 0) {
this.entityCheck()
}
else{
setTimeout(()=>{this.entityCheck()},500)
}
if(this.PRODUCTS.length != 0) {
this.productCheck()
}
else{
setTimeout(()=>{this.productCheck()},500)
}
}
}
productCheck(){
this.PRODUCTS=this.PRODUCTS.filter(val=>{
if(this.drop_down_datas.product_ids.filter(dp=>dp == val.product_id).length > 0){
return val
}
})
}
entityCheck(){
this.ENTITY=this.ENTITY.filter(val=>{
if(this.drop_down_datas.lender_ids.filter(dp=>dp == val.entity_id).length > 0){
return val
}
})
}
searchItem(){
this.searchForm.value.pd_from_date = this.pipe.transform(this.searchForm.value.pd_from_date,'yyyy-MM-dd');
this.searchForm.value.pd_to_date = this.pipe.transform(this.searchForm.value.pd_to_date,'yyyy-MM-dd');
// console.log(this.searchForm.value);
//console.log('testing');
this.xpandStatus=true;
this._flyHi.advancedFilter(this.searchForm.value).subscribe(res=>{
if(res.dataStatus){
console.log(res);
this.filteredlistData.emit(res);
this.xpandStatus=false
}
else{
this.filteredlistData.emit(res)
}
})
}
onReset(){
this.searchForm.reset();
let local:any = JSON.parse(localStorage.getItem('user_details'));
// this.searchForm.controls['pd_lender'].setValue(local.fk_entity_id);
this.searchForm.controls['sales_pd_officer_id'].setValue(local.userid);
this.xpandStatus=false
this.resetFilter.emit(true);
}
}

View File

@ -227,7 +227,10 @@ loadTemplate(form_id,mapid,Formname) {
// getSalesPdpdf(pdfdetail){
// return this._http.get<any[]>(api_url + "downloadFlyhiPDReport/" + pdfdetail)
// }
// }
advancedFilter(params): Observable<any>{
return this._http.post(api_url+'filterFlyPDList',{"records":params})
}
}

View File

@ -23,6 +23,7 @@ import { CommonModule } from '@angular/common';
import { ReGenerateReportComponent } from './sales-pd-list/re-generate-report/re-generate-report.component';
import { FlyHiListComponent } from 'app/fly-hi/fly-hi-list/fly-hi-list.component';
import { ImageVideoComponent } from 'app/fly-hi/image-video/image-video.component';
import { FlyhiAdvanceFilterComponent } from 'app/fly-hi/fly-hi-list/flyhi-advance-filter/flyhi-advance-filter.component';
@NgModule({
imports: [
SalesPdRoutingModule,
@ -35,7 +36,7 @@ import { ImageVideoComponent } from 'app/fly-hi/image-video/image-video.componen
MatDialogModule,
MatTooltipModule
],
declarations: [ImageVideoComponent,AlertDialogComponent,FlyHiListComponent,SalesPdComponent,AdvanceFilterComponent, ReGenerateReportComponent],
declarations: [FlyhiAdvanceFilterComponent,ImageVideoComponent,AlertDialogComponent,FlyHiListComponent,SalesPdComponent,AdvanceFilterComponent, ReGenerateReportComponent],
entryComponents:[ImageVideoComponent,AlertDialogComponent,SalesPdComponent,ReGenerateReportComponent],
providers:[ConstantsProvider,{ provide: MAT_DATE_LOCALE, useValue: 'en-GB' },{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS},{ provide: MatDialogRef, useValue: {} },{ provide: MAT_DIALOG_DATA, useValue: [] }],

View File

@ -977,7 +977,7 @@
]
},
{
"question":"Constitution Of Employer /Business Applicant",
"question":"Constitution of Employer /Business Applicant",
"question_key":"constitution_of_employer_business_applicant",
"type":"2",
"field_width":"66",
@ -1048,7 +1048,7 @@
"onchange_properties":null
},
{
"question":"Occupation Of The Loan Applicant",
"question":"Occupation of The Loan Applicant",
"question_key":"occupation_of_the_loan_applicant",
"field_width":"33",
"type":"2",
@ -1247,7 +1247,7 @@
]
},
{
"question":"Name Of Student",
"question":"Name of Student",
"sub_title":"Additional Question",
"question_key":"name_of_student",
"field_width":"100",
@ -1365,7 +1365,7 @@
"answers":null,
"api_properties":null,
"is_repeatable":null,
"field_type":"string",
"field_type":"str&num",
"validations":[
{
"name":"required",
@ -1373,13 +1373,6 @@
"validator":"Validators.required",
"message":"Class /Section/ Course Name Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[A-Za-z ]*",
"message":"alphabets only ",
"value":null
}
],
"onchange_properties":null
@ -1406,7 +1399,7 @@
]
},
{
"question":"Duration Of The Course",
"question":"Duration of The Course",
"question_key":"duration_of_the_course",
"place_holder":"Enter text",
"field_width":"33",
@ -1415,7 +1408,7 @@
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"numtoword",
"field_type":"str&num",
"validations":[
{
"name":"required",
@ -1448,7 +1441,7 @@
]
},
{
"question":"Loan Tenor",
"question":"Loan Tenure",
"question_key":"loan_tenor",
"place_holder":"Enter text",
"field_width":"33",
@ -1457,13 +1450,13 @@
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"numtoword",
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Loan amount Required",
"message":"Loan Tenure Required",
"value":null
}
]