Advance Filter for credit PD
This commit is contained in:
parent
cd3816c8d0
commit
0d80696b74
@ -15,6 +15,7 @@ import {AppVersion} from '@ionic-native/app-version'
|
|||||||
import { SalesPDlistPage } from '../pages/sales_pd/pages/sales-p-dlist/sales-p-dlist';
|
import { SalesPDlistPage } from '../pages/sales_pd/pages/sales-p-dlist/sales-p-dlist';
|
||||||
import { ConstantsProvider } from '../providers/constants/constants';
|
import { ConstantsProvider } from '../providers/constants/constants';
|
||||||
import { SalesPdProvider } from '../pages/sales_pd/providers/sales-pd/sales-pd';
|
import { SalesPdProvider } from '../pages/sales_pd/providers/sales-pd/sales-pd';
|
||||||
|
import { PdtriggerProvider } from '../providers/pdtrigger/pdtrigger';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'app.html'
|
templateUrl: 'app.html'
|
||||||
@ -29,8 +30,9 @@ export class MyApp {
|
|||||||
|
|
||||||
pages: Array<{title: string,icon:any, method: any}>;
|
pages: Array<{title: string,icon:any, method: any}>;
|
||||||
protected app_version: string;
|
protected app_version: string;
|
||||||
|
commonDetails: any;
|
||||||
|
|
||||||
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen,public aws:AwsServiceProvider,public shared:CognitoServiceProvider,public AWS:AwsServiceProvider,public alertCtrl:AlertController,private appVersionProvide:AppVersion,private events:Events,private constant:ConstantsProvider,private salesPDService:SalesPdProvider) {
|
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen,public aws:AwsServiceProvider,public shared:CognitoServiceProvider,public AWS:AwsServiceProvider,public alertCtrl:AlertController,private appVersionProvide:AppVersion,private events:Events,private constant:ConstantsProvider,private salesPDService:SalesPdProvider,private pdtrigger:PdtriggerProvider) {
|
||||||
this.initializeApp();
|
this.initializeApp();
|
||||||
this.changeDecision();
|
this.changeDecision();
|
||||||
|
|
||||||
@ -62,12 +64,14 @@ export class MyApp {
|
|||||||
|
|
||||||
this.shared.getAccessToken().then(()=>{
|
this.shared.getAccessToken().then(()=>{
|
||||||
this.getuserDetails();
|
this.getuserDetails();
|
||||||
|
|
||||||
this.rootPage = AuthPage
|
this.rootPage = AuthPage
|
||||||
}).catch(()=>{
|
}).catch(()=>{
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.rootPage = LoginPage;
|
this.rootPage = LoginPage;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
this.getCommonSettings()
|
||||||
})
|
})
|
||||||
|
|
||||||
this.platform.registerBackButtonAction(()=>{
|
this.platform.registerBackButtonAction(()=>{
|
||||||
@ -104,6 +108,17 @@ export class MyApp {
|
|||||||
this.nav.pop()
|
this.nav.pop()
|
||||||
}
|
}
|
||||||
}); }
|
}); }
|
||||||
|
|
||||||
|
getCommonSettings(){
|
||||||
|
// getCommonConfig
|
||||||
|
this.pdtrigger.getCommonSettingsConfig().subscribe(res=>{
|
||||||
|
this.commonDetails = res;
|
||||||
|
if(this.commonDetails.dataStatus == true){
|
||||||
|
localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
getuserDetails()
|
getuserDetails()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -86,6 +86,7 @@ import { BrowserModule, HAMMER_GESTURE_CONFIG, HammerGestureConfig } from '@angu
|
|||||||
import { ReportViewer } from '../pages/sales_pd/pages/report-pdf-viewer/pdf-modal';
|
import { ReportViewer } from '../pages/sales_pd/pages/report-pdf-viewer/pdf-modal';
|
||||||
import { AndroidPermissions } from '@ionic-native/android-permissions';
|
import { AndroidPermissions } from '@ionic-native/android-permissions';
|
||||||
import { AdvanceFilterPage } from '../pages/sales_pd/pages/advance-filter/advance-filter';
|
import { AdvanceFilterPage } from '../pages/sales_pd/pages/advance-filter/advance-filter';
|
||||||
|
import { PdAdvanceFilterPage } from '../pages/pd-list/pd-advance-filter/pd-advance-filter';
|
||||||
// need the hammerConnfig
|
// need the hammerConnfig
|
||||||
export class HammerConfig extends HammerGestureConfig {
|
export class HammerConfig extends HammerGestureConfig {
|
||||||
overrides = {
|
overrides = {
|
||||||
@ -114,7 +115,8 @@ export class HammerConfig extends HammerGestureConfig {
|
|||||||
InputPage,
|
InputPage,
|
||||||
SalesPDlistPage,
|
SalesPDlistPage,
|
||||||
ReportViewer,
|
ReportViewer,
|
||||||
AdvanceFilterPage
|
AdvanceFilterPage,
|
||||||
|
PdAdvanceFilterPage
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,ReactiveFormsModule,FormsModule,
|
BrowserModule,ReactiveFormsModule,FormsModule,
|
||||||
@ -170,7 +172,8 @@ export class HammerConfig extends HammerGestureConfig {
|
|||||||
InputPage,
|
InputPage,
|
||||||
SalesPDlistPage,
|
SalesPDlistPage,
|
||||||
ReportViewer,
|
ReportViewer,
|
||||||
AdvanceFilterPage
|
AdvanceFilterPage,
|
||||||
|
PdAdvanceFilterPage
|
||||||
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
|||||||
82
src/pages/pd-list/pd-advance-filter/pd-advance-filter.html
Normal file
82
src/pages/pd-list/pd-advance-filter/pd-advance-filter.html
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
<!--
|
||||||
|
Generated template for the AdvanceFilterPage page.
|
||||||
|
|
||||||
|
See http://ionicframework.com/docs/components/#navigation for more info on
|
||||||
|
Ionic pages and navigation.
|
||||||
|
-->
|
||||||
|
<ion-header>
|
||||||
|
|
||||||
|
<ion-navbar>
|
||||||
|
<ion-title ><ion-icon style="font-size: 18px;" ios="ios-options" md="md-options"></ion-icon> Advanced Filter</ion-title>
|
||||||
|
<ion-buttons end>
|
||||||
|
<button ion-button clear (click)="closeModal()"><ion-icon name="close" style="font-size: 20px;"></ion-icon></button>
|
||||||
|
</ion-buttons>
|
||||||
|
</ion-navbar>
|
||||||
|
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<mat-list class="m-gap p-gap" >
|
||||||
|
<div [formGroup]="searchForm" fxLayout="row wrap" fxFlex="100%" fxLayoutGap="35px" fxLayoutAlign="flex-start stretch">
|
||||||
|
<mat-form-field style="width: 100%" *ngIf="from_page != 'complete_list'">
|
||||||
|
<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>
|
||||||
|
<mat-form-field style="width:100%">
|
||||||
|
<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 #picker></mat-datepicker>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width:100%">
|
||||||
|
<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 #picker1></mat-datepicker>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width:100%">
|
||||||
|
<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>
|
||||||
|
<!-- <mat-form-field style="width:100%">
|
||||||
|
<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> -->
|
||||||
|
<!-- <mat-form-field style="width:100%">
|
||||||
|
<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:100%">
|
||||||
|
<input matInput type="text" formControlName="pd_applicant_name" placeholder="Applicant Name">
|
||||||
|
</mat-form-field>
|
||||||
|
<!-- <mat-form-field style="width: 100%">
|
||||||
|
<input matInput type="text" formControlName="pd_officer" placeholder="PD Officer Name">
|
||||||
|
</mat-form-field> -->
|
||||||
|
<!-- <div fxLayout="row wrap">
|
||||||
|
<div fxFlex.xs="100%" fxFlex.sm="100%" fxFlex="45%">
|
||||||
|
<mat-checkbox class="example-margin" color="primary" formControlName="is_include_archived">Include Archived</mat-checkbox>
|
||||||
|
</div>
|
||||||
|
</div> --> </div>
|
||||||
|
</mat-list>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
|
<ion-footer>
|
||||||
|
<div align="right" fxLayout="row" fxLayoutAlign="flex-end" style="margin-top: 10px;margin-right: 10px;">
|
||||||
|
|
||||||
|
<button style="background-color: #e2412f;" mat-raised-button mat-icon-button (click)="onReset()" class="mr-1 mt-1 hover-icon" >
|
||||||
|
<ion-icon style="font-size: 18px;color: #fff;" ios="ios-refresh" md="md-refresh"></ion-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button style="background-color: #e2412f;" mat-raised-button mat-icon-button (click)="searchItem()" class="mr-1 mt-1 hover-icon">
|
||||||
|
<ion-icon style="font-size: 18px;color: #fff;" ios="ios-search" md="md-search"></ion-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-footer>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
page-pd-advance-filter {
|
||||||
|
.scroll-content {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.mat-raised-button{
|
||||||
|
background-color: #e2412f;
|
||||||
|
}
|
||||||
|
}
|
||||||
164
src/pages/pd-list/pd-advance-filter/pd-advance-filter.ts
Normal file
164
src/pages/pd-list/pd-advance-filter/pd-advance-filter.ts
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
import { Component, Input, EventEmitter, Output } from '@angular/core';
|
||||||
|
import { FormGroup, FormBuilder } from '@angular/forms';
|
||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { ToastProvider } from '../../../providers/common-provider/toast';
|
||||||
|
import { LoadingProvider } from '../../../providers/common-provider/loading';
|
||||||
|
import { PdtriggerProvider } from '../../../providers/pdtrigger/pdtrigger';
|
||||||
|
import { NavController, NavParams, ActionSheetController, ViewController } from 'ionic-angular';
|
||||||
|
// import { SalesPdProvider } from '../../providers/sales-pd/sales-pd';
|
||||||
|
// import { ToastProvider } from '../../../../services/common-provider/toast
|
||||||
|
// import { LoadingProvider } from '../../../../providers/common-provider/loading';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generated class for the AdvanceFilterPage page.
|
||||||
|
*
|
||||||
|
* See https://ionicframework.com/docs/components/#navigation for more info on
|
||||||
|
* Ionic pages and navigation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// @IonicPage()
|
||||||
|
@Component({
|
||||||
|
selector: 'page-pd-advance-filter',
|
||||||
|
templateUrl: 'pd-advance-filter.html'
|
||||||
|
})
|
||||||
|
export class PdAdvanceFilterPage {
|
||||||
|
searchForm:FormGroup;
|
||||||
|
todaydate: any;
|
||||||
|
pdStatus: any=[];
|
||||||
|
// pdStatus_all: any=[];
|
||||||
|
@Input()drop_down_datas
|
||||||
|
@Output() filteredlistData = new EventEmitter();
|
||||||
|
@Output() resetFilter = new EventEmitter();
|
||||||
|
ENTITY: any =[];
|
||||||
|
PRODUCTS: any =[];
|
||||||
|
xpandStatus:boolean=false;
|
||||||
|
pipe=new DatePipe('en-US');
|
||||||
|
from_page: any;
|
||||||
|
constructor(private _fb:FormBuilder,public navCtrl: NavController, public navParams: NavParams,public actionSheetCtrl: ActionSheetController,private pdTriggerProvider:PdtriggerProvider,private toastProvider:ToastProvider,private loaderProvider:LoadingProvider,private viewCtrl:ViewController ) {
|
||||||
|
this.todaydate = new Date();
|
||||||
|
this.getDropdown();
|
||||||
|
this.from_page=this.navParams.get('FormDet');
|
||||||
|
console.log(this.from_page);
|
||||||
|
if(this.from_page){
|
||||||
|
this.from_page =this.from_page.from_page
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ionViewDidLoad() {
|
||||||
|
console.log('ionViewDidLoad AdvanceFilterPage');
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
let local:any = JSON.parse(localStorage.getItem('user_details'));
|
||||||
|
console.log('local****',local);
|
||||||
|
this.drop_down_datas = this.navParams.get('drop_down_datas');
|
||||||
|
this.setDropDownDatas()
|
||||||
|
console.log(this.drop_down_datas);
|
||||||
|
this.searchForm=this._fb.group({
|
||||||
|
pd_status:[''],
|
||||||
|
pd_from_date:[''],
|
||||||
|
pd_to_date:[''],
|
||||||
|
pd_products:[''],
|
||||||
|
pd_lender:[local.fk_entity_id],
|
||||||
|
pd_applicant_name:[''],
|
||||||
|
// pd_officer:[''],
|
||||||
|
// pd_officer_id:[''],
|
||||||
|
// pd_type:[''],
|
||||||
|
// pd_name:[null],
|
||||||
|
// pd_applicant_id:[null],
|
||||||
|
})
|
||||||
|
console.log(this.drop_down_datas)
|
||||||
|
}
|
||||||
|
getDropdown(){
|
||||||
|
// this.pdTriggerProvider.getAllMasterDatas('PDSTATUS').subscribe(res=>
|
||||||
|
// {
|
||||||
|
// if(res.dataStatus==true)
|
||||||
|
// {
|
||||||
|
// this.pdStatus_all = res.records.filter(status=>status.isactive==1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// this.pdTriggerProvider.getAllMasterDatas('ENTITY').subscribe(res=>
|
||||||
|
// {
|
||||||
|
// if(res.dataStatus==true)
|
||||||
|
// {
|
||||||
|
// this.ENTITY = res.records.filter(ent=>ent.isactive==1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
this.pdTriggerProvider.getAllMasterDatas('PRODUCTS').subscribe(res=>
|
||||||
|
{
|
||||||
|
if(res.dataStatus==true)
|
||||||
|
{
|
||||||
|
this.PRODUCTS = res.records.filter(pro=>pro.isactive==1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.pdTriggerProvider.getAllMasterDatas("PDSTATUS").subscribe(res=>
|
||||||
|
{
|
||||||
|
if(res.dataStatus==true)
|
||||||
|
{
|
||||||
|
this.pdStatus = res.records.filter(pro=>(pro.isactive==1));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
setDropDownDatas(){
|
||||||
|
console.log(this.drop_down_datas)
|
||||||
|
if(this.drop_down_datas != undefined){
|
||||||
|
this.pdStatus=this.drop_down_datas.pd_status
|
||||||
|
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.loaderProvider.pdloader('fetching data')
|
||||||
|
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(JSON.stringifythis.searchForm.value);
|
||||||
|
this.xpandStatus=true;
|
||||||
|
this.pdTriggerProvider.advancedFilter(this.searchForm.value).subscribe(res=>{
|
||||||
|
if(res.dataStatus){
|
||||||
|
console.log(res);
|
||||||
|
// this.filteredlistData.emit(res);
|
||||||
|
// this.xpandStatus=false
|
||||||
|
this.loaderProvider.dismissLoader()
|
||||||
|
this.viewCtrl.dismiss(res['records'])
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// this.filteredlistData.emit(res)
|
||||||
|
this.loaderProvider.dismissLoader()
|
||||||
|
this.toastProvider.lenderappmessage('No Records Found...!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onReset(){
|
||||||
|
this.searchForm.reset();
|
||||||
|
let local:any = JSON.parse(localStorage.getItem('user_details'));
|
||||||
|
local=local.fk_entity_id
|
||||||
|
this.searchForm.controls['pd_lender'].setValue(local);
|
||||||
|
}
|
||||||
|
closeModal() {
|
||||||
|
this.viewCtrl.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,6 +14,9 @@
|
|||||||
style="margin-top:-1px">
|
style="margin-top:-1px">
|
||||||
</ion-searchbar></ion-title>
|
</ion-searchbar></ion-title>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
|
<a clear (click)="openFilterModal()" *ngIf="!viewchange">
|
||||||
|
<ion-icon name="options" style="color:white;font-size:25px;"></ion-icon>
|
||||||
|
</a>
|
||||||
<a (click)="filter(viewchange)" *ngIf="!viewchange">
|
<a (click)="filter(viewchange)" *ngIf="!viewchange">
|
||||||
<ion-icon style="color:white;font-size:25px;"name="search"></ion-icon>
|
<ion-icon style="color:white;font-size:25px;"name="search"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
@ -175,13 +178,17 @@
|
|||||||
|
|
||||||
</ion-list>
|
</ion-list>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</ion-grid>
|
</ion-grid>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p *ngIf="pdlistaccess && filterMsg" class="note">Showing data for last {{common}}. To see older records, please use <ion-icon name="options" style="color: black;font-size:15px;"></ion-icon> advanced filter</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!pdlistaccess && !loader_access" text-center>
|
<div *ngIf="!pdlistaccess && !loader_access" text-center>
|
||||||
|
|
||||||
<h2>{{pdlistdetails}}</h2>
|
<h2>{{pdlistdetails}}</h2>
|
||||||
|
|||||||
@ -3,6 +3,16 @@ page-pd-list{
|
|||||||
mat-grid-tile {
|
mat-grid-tile {
|
||||||
background: white!important;
|
background: white!important;
|
||||||
}
|
}
|
||||||
|
p.note{
|
||||||
|
color: gray;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
float: center;
|
||||||
|
|
||||||
|
}
|
||||||
.grid{
|
.grid{
|
||||||
padding:0px;
|
padding:0px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { IonicPage, NavController, NavParams, Events } from 'ionic-angular';
|
import { IonicPage, NavController, NavParams, Events, ModalOptions, ModalController } from 'ionic-angular';
|
||||||
import { InputPage } from '../input/input';
|
import { InputPage } from '../input/input';
|
||||||
import { AwsServiceProvider } from '../../providers/aws-service/aws-service';
|
import { AwsServiceProvider } from '../../providers/aws-service/aws-service';
|
||||||
import { PdtriggerProvider } from '../../providers/pdtrigger/pdtrigger';
|
import { PdtriggerProvider } from '../../providers/pdtrigger/pdtrigger';
|
||||||
import { CognitoServiceProvider } from '../../providers/aws-service/cognito.service';
|
import { CognitoServiceProvider } from '../../providers/aws-service/cognito.service';
|
||||||
import { parseDate } from 'ionic-angular/util/datetime-util';
|
import { parseDate } from 'ionic-angular/util/datetime-util';
|
||||||
import { PdAllocationPage } from '../pd-allocation/pd-allocation';
|
import { PdAllocationPage } from '../pd-allocation/pd-allocation';
|
||||||
|
import { PdAdvanceFilterPage } from './pd-advance-filter/pd-advance-filter';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,10 +39,14 @@ export class PdListPage {
|
|||||||
status:any;
|
status:any;
|
||||||
searchitem:any;
|
searchitem:any;
|
||||||
loader_access:boolean=true
|
loader_access:boolean=true
|
||||||
|
filter_drop_down_data: { product_ids: any[]; lender_ids: any[]; pd_status: any[]; };
|
||||||
|
filterMsg: boolean = false;
|
||||||
|
common: any;
|
||||||
// public category:string="inpro"
|
// public category:string="inpro"
|
||||||
// public categories:Array<string>=['inpro','past']
|
// public categories:Array<string>=['inpro','past']
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public pdofficer:PdtriggerProvider,public shared:CognitoServiceProvider,private events:Events) {
|
constructor(public navCtrl: NavController,private modalCtrl:ModalController, public navParams: NavParams,public aws:AwsServiceProvider,public pdofficer:PdtriggerProvider,public shared:CognitoServiceProvider,private events:Events) {
|
||||||
|
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||||
|
this.common = this.common.count+' '+this.common.factor
|
||||||
}
|
}
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
@ -84,6 +89,7 @@ export class PdListPage {
|
|||||||
if(this.pdlistdetails.dataStatus == true)
|
if(this.pdlistdetails.dataStatus == true)
|
||||||
{
|
{
|
||||||
this.loader_access=false
|
this.loader_access=false
|
||||||
|
this.filterMsg=true
|
||||||
this.pdlistaccess = true;
|
this.pdlistaccess = true;
|
||||||
this.pdinprogress = this.pdlistdetails.records.filter(past=>past.pd_status !="QC_COMPLETED");
|
this.pdinprogress = this.pdlistdetails.records.filter(past=>past.pd_status !="QC_COMPLETED");
|
||||||
this.searchinprogress = this.pdinprogress;
|
this.searchinprogress = this.pdinprogress;
|
||||||
@ -133,7 +139,54 @@ export class PdListPage {
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
openFilterModal(){
|
||||||
|
const modalOption:ModalOptions={
|
||||||
|
cssClass:'filterModal'
|
||||||
|
}
|
||||||
|
const modalCtrl=this.modalCtrl.create(PdAdvanceFilterPage,{'drop_down_datas':this.filter_drop_down_data},modalOption)
|
||||||
|
modalCtrl.present();
|
||||||
|
modalCtrl.onDidDismiss((data)=>{
|
||||||
|
console.log(data)
|
||||||
|
if(data){
|
||||||
|
// this.sales_displayValue = data;
|
||||||
|
this.filterMsg=false
|
||||||
|
this.loader_access=false
|
||||||
|
this.pdlistaccess = true;
|
||||||
|
this.pdinprogress = data.filter(past=>past.pd_status !="QC_COMPLETED");
|
||||||
|
this.searchinprogress = this.pdinprogress;
|
||||||
|
this.pdlistdetails = data.filter(past=>past.pd_status =="QC_COMPLETED");
|
||||||
|
this.searchpast = this.pdlistdetails;
|
||||||
|
|
||||||
|
//FOR SPLITTING THE VALUE OF pd_sno
|
||||||
|
this.pdinprogress.length >0 ?
|
||||||
|
this.pdinprogress.forEach(value=>{
|
||||||
|
let original=value.pd_sno
|
||||||
|
if(original != null){
|
||||||
|
value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
value.pd_sno_split={lender_name:'',serial_no:''}
|
||||||
|
}
|
||||||
|
}) : this.pdinprogress
|
||||||
|
|
||||||
|
this.pdlistdetails.length >0 ?
|
||||||
|
this.pdlistdetails.forEach(value=>{
|
||||||
|
let original=value.pd_sno
|
||||||
|
if(original != null){
|
||||||
|
value.pd_sno_split={lender_name:original.replace(/[^a-z]/gi, ''),serial_no:original.match(/(\d+)/)[0]}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
value.pd_sno_split={lender_name:'',serial_no:''}
|
||||||
|
}
|
||||||
|
}) : this.pdlistdetails
|
||||||
|
|
||||||
|
console.log("ingp",this.pdinprogress);
|
||||||
|
this.random_bg_color();
|
||||||
|
this.random_ng_past();
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
pdlistsearch(searchbar) {
|
pdlistsearch(searchbar) {
|
||||||
this.pdlistdetails = this.searchpast;
|
this.pdlistdetails = this.searchpast;
|
||||||
this.pdinprogress = this.searchinprogress;
|
this.pdinprogress = this.searchinprogress;
|
||||||
|
|||||||
@ -25,7 +25,15 @@ export class PdtriggerProvider {
|
|||||||
|
|
||||||
|
|
||||||
/**get dropdonw list */
|
/**get dropdonw list */
|
||||||
|
getAllMasterDatas(TableName: string): Observable<any> {
|
||||||
|
return this.http.post(this.apiurl + 'getListOfMaster', { "master_name": TableName })
|
||||||
|
.pipe(
|
||||||
|
// catchError(this.handleError('role', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
advancedFilter(params): Observable<any>{
|
||||||
|
return this.http.post(this.apiurl+'filterPDList',{"records":params})
|
||||||
|
}
|
||||||
getproductandsubpro()
|
getproductandsubpro()
|
||||||
{
|
{
|
||||||
return this.http.get(this.apiurl+'getListOfProducts');
|
return this.http.get(this.apiurl+'getListOfProducts');
|
||||||
@ -154,6 +162,9 @@ getLenderContactPersons(datas){
|
|||||||
handleError(arg0: string, arg1: undefined[]): any {
|
handleError(arg0: string, arg1: undefined[]): any {
|
||||||
console.log("error",arg1)
|
console.log("error",arg1)
|
||||||
}
|
}
|
||||||
|
getCommonSettingsConfig()
|
||||||
|
{
|
||||||
|
return this.http.post(this.apiurl+'getCommonConfig','');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user