issues fixes : ps
This commit is contained in:
parent
dd1cb76487
commit
bf52ff64b1
@ -29,10 +29,11 @@ import {MatToolbarModule} from '@angular/material/toolbar';
|
|||||||
import {MatTabsModule} from '@angular/material/tabs';
|
import {MatTabsModule} from '@angular/material/tabs';
|
||||||
import {MatCheckboxModule} from '@angular/material/checkbox';
|
import {MatCheckboxModule} from '@angular/material/checkbox';
|
||||||
import {MatProgressBarModule} from '@angular/material/progress-bar';
|
import {MatProgressBarModule} from '@angular/material/progress-bar';
|
||||||
|
// import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
||||||
import {MatSelectModule} from '@angular/material/select';
|
import {MatSelectModule} from '@angular/material/select';
|
||||||
import {MatCardModule} from '@angular/material/card';
|
import {MatCardModule} from '@angular/material/card';
|
||||||
import {ChangePasswordDialog} from './settings/users/user-profile/user-profile.component';
|
import {ChangePasswordDialog} from './settings/users/user-profile/user-profile.component';
|
||||||
import { MatFormFieldModule } from '@angular/material';
|
import { MatFormFieldModule,MatProgressSpinnerModule } from '@angular/material';
|
||||||
import { AppRoutes } from './app.routing';
|
import { AppRoutes } from './app.routing';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
|
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
|
||||||
@ -77,7 +78,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
|
|||||||
MatToolbarModule,
|
MatToolbarModule,
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatCheckboxModule,
|
MatCheckboxModule,
|
||||||
MatProgressBarModule,
|
MatProgressBarModule,MatProgressSpinnerModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
DemoMaterialModule,
|
DemoMaterialModule,
|
||||||
|
|||||||
@ -84,8 +84,8 @@
|
|||||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||||
<!-- <mat-option value= 0 >Others</mat-option> ->
|
<!-- <mat-option value= 0 >Others</mat-option> ->
|
||||||
</mat-select> -->
|
</mat-select> -->
|
||||||
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by"
|
<mat-select multiple placeholder="Loan Taken By" formControlName="loan_taken_by"
|
||||||
[compareWith]="compareObjects" (selectionChange)="setRequiredValidation($event.value.id,details,3)">
|
[compareWith]="compareObjects" (selectionChange)="setOtherLoanTakenBy($event.value,i)">
|
||||||
<mat-optgroup *ngFor="let group of mergeCompanyApplicant"
|
<mat-optgroup *ngFor="let group of mergeCompanyApplicant"
|
||||||
[label]="group.groupName">
|
[label]="group.groupName">
|
||||||
<mat-option *ngFor="let val of group.groupValues"
|
<mat-option *ngFor="let val of group.groupValues"
|
||||||
@ -97,7 +97,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<!-- {{details.get('loan_taken_by').value}} -->
|
<!-- {{details.get('loan_taken_by').value}} -->
|
||||||
<!-- <mat-form-field *ngIf="details.get('loan_taken_by').value == 0"> -->
|
<!-- <mat-form-field *ngIf="details.get('loan_taken_by').value == 0"> -->
|
||||||
<mat-form-field style="width:45%;" *ngIf="checkOthers(details.get('loan_taken_by').value)===true">
|
<mat-form-field *ngIf="isOtherLoanTakenBy[i]">
|
||||||
<input matInput autocomplete="off" placeholder="Specify Borrower"
|
<input matInput autocomplete="off" placeholder="Specify Borrower"
|
||||||
formControlName="others_loan_taken">
|
formControlName="others_loan_taken">
|
||||||
<mat-error *ngIf="details.controls['others_loan_taken'].hasError('required')">Borrower Required</mat-error>
|
<mat-error *ngIf="details.controls['others_loan_taken'].hasError('required')">Borrower Required</mat-error>
|
||||||
|
|||||||
@ -42,6 +42,7 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
dataFromAssets: any = [];
|
dataFromAssets: any = [];
|
||||||
existCompanyList: any = [];
|
existCompanyList: any = [];
|
||||||
mergeCompanyApplicant: any = [];
|
mergeCompanyApplicant: any = [];
|
||||||
|
isOtherLoanTakenBy:any = [];
|
||||||
|
|
||||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@ -140,6 +141,8 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
result.forEach((val, index) => {
|
result.forEach((val, index) => {
|
||||||
this.selectedfrequency(val.frequency, index);
|
this.selectedfrequency(val.frequency, index);
|
||||||
|
|
||||||
|
|
||||||
//this.selectedLoanTakenBy(val.loan_taken_by,index);
|
//this.selectedLoanTakenBy(val.loan_taken_by,index);
|
||||||
|
|
||||||
let objs = {
|
let objs = {
|
||||||
@ -150,7 +153,7 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
'emi': val.emi,
|
'emi': val.emi,
|
||||||
'loan_type': val.loan_type,
|
'loan_type': val.loan_type,
|
||||||
'others_loan_type': val.others_loan_type,
|
'others_loan_type': val.others_loan_type,
|
||||||
'loan_taken_by': val.loan_taken_by,
|
'loan_taken_by': val.loan_taken_by || null,
|
||||||
'others_loan_taken': val.others_loan_taken,
|
'others_loan_taken': val.others_loan_taken,
|
||||||
'lender': val.lender,
|
'lender': val.lender,
|
||||||
'others_lender': val.others_lender,
|
'others_lender': val.others_lender,
|
||||||
@ -159,7 +162,7 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
'elapsed_tenure': val.elapsed_tenure
|
'elapsed_tenure': val.elapsed_tenure
|
||||||
}
|
}
|
||||||
control.push(this.createLoanDetail(objs));
|
control.push(this.createLoanDetail(objs));
|
||||||
|
this.setOtherLoanTakenBy(val.loan_taken_by,index);
|
||||||
});
|
});
|
||||||
|
|
||||||
// this.currentLoanForm.controls['loan_details'].setValue(result_data);
|
// this.currentLoanForm.controls['loan_details'].setValue(result_data);
|
||||||
@ -603,6 +606,43 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setOtherLoanTakenBy(value, ParInx) {
|
||||||
|
|
||||||
|
let ParCtrls = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||||
|
|
||||||
|
let ChdCtrls: any = <FormArray>ParCtrls.controls[ParInx];
|
||||||
|
|
||||||
|
let Avaliablity = 1;
|
||||||
|
|
||||||
|
if (value !== null ) {
|
||||||
|
if (value.length > 0) {
|
||||||
|
|
||||||
|
value.forEach(option => {
|
||||||
|
if (option.id == 0 && option.group_id == 2) {
|
||||||
|
Avaliablity = option.id;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Avaliablity == 0) {
|
||||||
|
|
||||||
|
ChdCtrls.controls.others_loan_taken.setValidators([Validators.required]);
|
||||||
|
this.isOtherLoanTakenBy[ParInx] = true;
|
||||||
|
|
||||||
|
} else if (Avaliablity == 1) {
|
||||||
|
|
||||||
|
ChdCtrls.controls.others_loan_taken.setValue('');
|
||||||
|
ChdCtrls.controls.others_loan_taken.clearValidators();
|
||||||
|
this.isOtherLoanTakenBy[ParInx] = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ChdCtrls.controls.others_loan_taken.updateValueAndValidity();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
setRequiredValidation(value, item, flag) {
|
setRequiredValidation(value, item, flag) {
|
||||||
|
|
||||||
if (flag == 1) {
|
if (flag == 1) {
|
||||||
@ -619,13 +659,13 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
item.controls.others_lender.setValue('');}
|
item.controls.others_lender.setValue('');}
|
||||||
item.controls.others_lender.updateValueAndValidity();
|
item.controls.others_lender.updateValueAndValidity();
|
||||||
}
|
}
|
||||||
else if(flag == 3) {
|
// else if(flag == 3) {
|
||||||
if(value == 0){
|
// if(value == 0){
|
||||||
item.controls.others_loan_taken.setValidators([Validators.required]);}
|
// item.controls.others_loan_taken.setValidators([Validators.required]);}
|
||||||
else{ item.controls.others_loan_taken.clearValidators();
|
// else{ item.controls.others_loan_taken.clearValidators();
|
||||||
item.controls.others_loan_taken.setvalue(''); }
|
// item.controls.others_loan_taken.setvalue(''); }
|
||||||
item.controls.others_loan_taken.updateValueAndValidity();
|
// item.controls.others_loan_taken.updateValueAndValidity();
|
||||||
}
|
// }
|
||||||
else if(flag == 4) {
|
else if(flag == 4) {
|
||||||
if(value == 1){
|
if(value == 1){
|
||||||
item.controls.other_frequency.setValidators([Validators.required]);}
|
item.controls.other_frequency.setValidators([Validators.required]);}
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
<!-- <mat-card-title></mat-card-title> -->
|
<!-- <mat-card-title></mat-card-title> -->
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<mat-form-field style="width:45% !important;">
|
<mat-form-field style="width:45% !important;">
|
||||||
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Other Income"
|
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Other Income of Loan Applicants"
|
||||||
formControlName="other_income">
|
formControlName="other_income">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option value="Yes">Yes</mat-option>
|
<mat-option value="Yes">Yes</mat-option>
|
||||||
|
|||||||
@ -37,7 +37,7 @@ export class OtherIncomeComponent implements OnInit {
|
|||||||
subproduct_abbr: any;
|
subproduct_abbr: any;
|
||||||
lender_applicant_id: any;
|
lender_applicant_id: any;
|
||||||
main_applicant: any;
|
main_applicant: any;
|
||||||
pageTitle: string = "Other Income of Loan Applicants";
|
pageTitle: string = "Other Income Details";
|
||||||
loadDataStatus: boolean = true;
|
loadDataStatus: boolean = true;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,16 +3,17 @@
|
|||||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-1">
|
<div fxLayout="row" fxLayoutAlign="start center" class="mb-1">
|
||||||
<div class="ml-xs mr-xs" style="width: 100%;">
|
<div class="ml-xs mr-xs" style="width: 100%;">
|
||||||
<mat-card-title><span> PD MIS Report </span>
|
<mat-card-title><span> PD MIS Report </span>
|
||||||
<button class="btn_export" mat-raised-button color="primary" (click)="ExportTOExcel()" >Export CSV</button>
|
<button class="btn_export" mat-raised-button color="primary" (click)="exportAsExcel()" [disabled]="dataLength == 0 ? true : false" >Export CSV</button>
|
||||||
|
<!-- (click)="ExportTOExcel()" -->
|
||||||
</mat-card-title>
|
</mat-card-title>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
|
|
||||||
<div class="filter-container mat-elevation-z8">
|
<div *ngIf="!Loading" class="report-card-container mat-elevation-z8">
|
||||||
|
<br/>
|
||||||
<div fxLayout="row" fxLayoutAlign="start center" class="filter-header">
|
<div fxLayout="row" fxLayoutAlign="start center" class="filter-header">
|
||||||
<div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 100%;">
|
<div class="ml-xs mr-xs" style="width: 100%;">
|
||||||
<form [formGroup]="reportform">
|
<form [formGroup]="reportform">
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
@ -27,18 +28,15 @@
|
|||||||
<input matInput type="text" placeholder="Application ID" formControlName="applicant_id">
|
<input matInput type="text" placeholder="Application ID" formControlName="applicant_id">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field color="accent" class="date1 ml-xs mr-xs" style="width: 30%;">
|
<mat-form-field class="ml-xs mr-xs" style="width:30%">
|
||||||
<mat-label>From Date</mat-label>
|
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="from_date" placeholder="From Date" (dateChange)="getDateObjects($event.target.value)">
|
||||||
<input matInput [max]="maxDate" [matDatepicker]="picker1" formControlName="from_date" (dateChange)="getDateObjects($event.target.value)">
|
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||||
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
|
<mat-datepicker #picker></mat-datepicker>
|
||||||
<mat-datepicker #picker1 color="primary"></mat-datepicker>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<mat-form-field class="ml-xs mr-xs" style="width:30%">
|
||||||
<mat-form-field color="accent" class="date2 ml-xs mr-xs" style="width: 30%;">
|
<input matInput [matDatepicker]="picker1" [min]="minDate" [max]="maxDate" formControlName="to_date" placeholder="To Date">
|
||||||
<mat-label>To Date</mat-label>
|
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||||
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="picker2" formControlName="to_date" >
|
<mat-datepicker #picker1></mat-datepicker>
|
||||||
<mat-datepicker-toggle matSuffix [for]="picker2"></mat-datepicker-toggle>
|
|
||||||
<mat-datepicker #picker2 color="primary"></mat-datepicker>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||||
@ -60,11 +58,10 @@
|
|||||||
</form>
|
</form>
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="noRecordFound" class="nocontent ml-xs mr-xs" style="width: 80%;">No records found</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="report-table-container mat-elevation-z8 " #TABLE>
|
||||||
<div class="example-container mat-elevation-z8 " #TABLE>
|
<div *ngIf="dataLength != 0">
|
||||||
<table mat-table #table *ngIf="!noRecordFound" [dataSource]="dataSource" matSort>
|
<table mat-table #table [dataSource]="dataSource" matSort>
|
||||||
|
|
||||||
<ng-container matColumnDef="serialno" sticky>
|
<ng-container matColumnDef="serialno" sticky>
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Sl </th>
|
<th mat-header-cell *matHeaderCellDef mat-sort-header>Sl </th>
|
||||||
@ -207,7 +204,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<mat-paginator *ngIf="!noRecordFound" [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
<div *ngIf="dataLength == 0" class="nocontent ml-xs mr-xs" style="padding: 1rem !important;">No records found</div>
|
||||||
|
</div>
|
||||||
|
<mat-paginator [length]="pageSize" [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100,dataLength]" showFirstLastButtons></mat-paginator>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="Loading">
|
||||||
|
<div fxLayoutAlign="center">
|
||||||
|
<mat-progress-spinner mode="indeterminate" class="primary"></mat-progress-spinner>
|
||||||
|
</div>
|
||||||
|
<p class="nocontent">Loading....</p>
|
||||||
</div>
|
</div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|||||||
@ -3,57 +3,60 @@
|
|||||||
font-size: 25px !important;
|
font-size: 25px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Table CSS -nocontent */
|
/** CSS for "No record Found Text " and "Loading Text" */
|
||||||
.nocontent {
|
.nocontent {
|
||||||
color: red;
|
color: red;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-container {
|
/** Filter Header Css (Overall) */
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-width: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-header {
|
.filter-header {
|
||||||
min-height: 64px;
|
min-height: 64px;
|
||||||
padding: 8px 24px 0;
|
padding: 8px 24px 0;
|
||||||
}
|
}
|
||||||
.date1{
|
|
||||||
width: 30%;
|
|
||||||
}
|
|
||||||
.date2{
|
|
||||||
width: 30%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/** Export Button CSS */
|
||||||
.btn_export
|
.btn_export
|
||||||
{
|
{
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.example-container {
|
/** Report Card Common Css (Overall) */
|
||||||
|
.report-card-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Report Table Common Css (Overall)*/
|
||||||
|
.report-table-container {
|
||||||
max-height: 600px;
|
max-height: 600px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: 2%;
|
margin-top: 2%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Table Header Cell Css*/
|
||||||
.mat-header-cell {
|
.mat-header-cell {
|
||||||
padding: 0 10px 0 10px;
|
padding: 0 10px 0 10px;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
font-size: 1rem !important;
|
font-size: 1rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Table Body Cell Css*/
|
||||||
.mat-cell {
|
.mat-cell {
|
||||||
padding: 0 10px 0 10px;
|
padding: 0 10px 0 10px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Table Static Columns Css*/
|
||||||
.mat-table-sticky {
|
.mat-table-sticky {
|
||||||
border-right: 1px solid #e0e0e0;
|
border-right: 1px solid #e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Table Footer Cell Css - not In use*/
|
||||||
.mat-footer-cell {
|
.mat-footer-cell {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 1.2rem !important;
|
font-size: 1.2rem !important;
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import { DatePipe } from '@angular/common';
|
|||||||
import { FormGroup, FormControl,FormBuilder } from '@angular/forms';
|
import { FormGroup, FormControl,FormBuilder } from '@angular/forms';
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
import { MatSort,MatPaginator, MatTableDataSource } from '@angular/material';
|
import { MatSort,MatPaginator, MatTableDataSource } from '@angular/material';
|
||||||
import Swal from 'sweetalert2';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pd-mis',
|
selector: 'app-pd-mis',
|
||||||
@ -15,16 +14,18 @@ import Swal from 'sweetalert2';
|
|||||||
export class PdMisComponent implements OnInit {
|
export class PdMisComponent implements OnInit {
|
||||||
|
|
||||||
pipe = new DatePipe('en-US');
|
pipe = new DatePipe('en-US');
|
||||||
color = 'primary';
|
|
||||||
pageSize = 10;
|
|
||||||
userData = null;
|
|
||||||
noRecordFound: boolean = false;
|
|
||||||
maxDate: any;
|
maxDate: any;
|
||||||
minDate: any;
|
minDate: any;
|
||||||
array_value:any=[];
|
|
||||||
|
api_data:any=[];
|
||||||
|
filtered_data:any=[];
|
||||||
|
|
||||||
|
public Loading: boolean = true;
|
||||||
|
|
||||||
public reportform: FormGroup;
|
public reportform: FormGroup;
|
||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
|
public pageSize : number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
|
|
||||||
displayedColumns = ['serialno',
|
displayedColumns = ['serialno',
|
||||||
@ -46,9 +47,7 @@ export class PdMisComponent implements OnInit {
|
|||||||
'officer_name',
|
'officer_name',
|
||||||
'pd_status'];
|
'pd_status'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
|
||||||
@ViewChild('TABLE') table: ElementRef;
|
|
||||||
|
|
||||||
constructor(private reportsService:ReportsService,private route:ActivatedRoute,private router:Router,private form_builder:FormBuilder) {
|
constructor(private reportsService:ReportsService,private route:ActivatedRoute,private router:Router,private form_builder:FormBuilder) {
|
||||||
this.reportform = this.form_builder.group({ from_date:[null],to_date:[null],city:[null],branch:[null],applicant_id:[null] });
|
this.reportform = this.form_builder.group({ from_date:[null],to_date:[null],city:[null],branch:[null],applicant_id:[null] });
|
||||||
@ -56,42 +55,46 @@ export class PdMisComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit(){
|
ngOnInit(){
|
||||||
this.maxDate = new Date();
|
this.maxDate = new Date();
|
||||||
this.getPDMISDailyReportContent();
|
this.getMISDailyReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
getPDMISDailyReportContent() {
|
getMISDailyReport() {
|
||||||
|
|
||||||
this.reportsService.getPDMISDailyReport().subscribe(
|
this.reportsService.retirveDataForMISDailyReport().subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
|
||||||
if(data.dataStatus == true){
|
if(data.dataStatus == true){
|
||||||
|
this.api_data = data.records;
|
||||||
this.noRecordFound = false;
|
|
||||||
this.userData = data.records;
|
|
||||||
this.dataLength = data.records.length;
|
this.dataLength = data.records.length;
|
||||||
|
this.pageSize = data.records.length;
|
||||||
if(data.records.length >= 1){
|
if(data.records.length >= 1){
|
||||||
this.userData = this.userData.map((val, i)=>{
|
this.api_data = this.api_data.map((val, i)=>{
|
||||||
val['serialno'] = i + 1;
|
val['serialno'] = i + 1;
|
||||||
return val;
|
return val;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.dataSource.data = this.userData;
|
this.dataSource.data = this.api_data;
|
||||||
|
this.Loading = false;
|
||||||
}else{
|
}else{
|
||||||
this.noRecordFound = true;
|
this.dataLength = 0;
|
||||||
this.dataLength = 0
|
// this.Loading = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
ExportTOExcel()
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
{
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
|
// @ViewChild('TABLE') table: ElementRef;
|
||||||
|
@ViewChild('TABLE',{ read: ElementRef }) table: ElementRef;
|
||||||
|
|
||||||
|
exportAsExcel():void {
|
||||||
|
|
||||||
const ws: XLSX.WorkSheet=XLSX.utils.table_to_sheet(this.table.nativeElement);
|
const ws: XLSX.WorkSheet=XLSX.utils.table_to_sheet(this.table.nativeElement);
|
||||||
const wb: XLSX.WorkBook = XLSX.utils.book_new();
|
const wb: XLSX.WorkBook = XLSX.utils.book_new();
|
||||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
||||||
|
|
||||||
/* save to file */
|
/* save to file */
|
||||||
XLSX.writeFile(wb, 'Daily MIS Report.xlsx');
|
XLSX.writeFile(wb, 'Daily MIS Report.xlsx');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
@ -109,23 +112,23 @@ export class PdMisComponent implements OnInit {
|
|||||||
|
|
||||||
searchform(value:any){
|
searchform(value:any){
|
||||||
|
|
||||||
this.reportsService.getPDMISDailyReport().subscribe(
|
this.reportsService.retirveDataForMISDailyReport().subscribe(
|
||||||
data => {
|
data => {
|
||||||
if(data['dataStatus']==true)
|
if(data['dataStatus']==true)
|
||||||
{
|
{
|
||||||
this.array_value = data.records;
|
this.filtered_data = data.records;
|
||||||
|
|
||||||
if(value.applicant_id !== null && value.applicant_id != ''){
|
if(value.applicant_id !== null && value.applicant_id != ''){
|
||||||
this.array_value = this.filterForApplicantID(this.array_value,value.applicant_id);
|
this.filtered_data = this.filterForApplicantID(this.filtered_data,value.applicant_id);
|
||||||
}
|
}
|
||||||
if(value.city !== null && value.city != ''){
|
if(value.city !== null && value.city != ''){
|
||||||
this.array_value = this.filterForCity(this.array_value,value.city);
|
this.filtered_data = this.filterForCity(this.filtered_data,value.city);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(value.branch !== null && value.branch != ''){
|
if(value.branch !== null && value.branch != ''){
|
||||||
// this.array_value = this.array_value.filter(val => val.branch == value.branch );
|
// this.filtered_data = this.filtered_data.filter(val => val.branch == value.branch );
|
||||||
// this.array_value = this.array_value.filter(val => this.customFilter(val,value.brach,3));
|
// this.filtered_data = this.filtered_data.filter(val => this.customFilter(val,value.brach,3));
|
||||||
this.array_value = this.filterForBranch(this.array_value,value.branch);
|
this.filtered_data = this.filterForBranch(this.filtered_data,value.branch);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(value.from_date !== null && value.to_date !== null){
|
if(value.from_date !== null && value.to_date !== null){
|
||||||
@ -133,24 +136,23 @@ export class PdMisComponent implements OnInit {
|
|||||||
// console.log('value',value.to_date);
|
// console.log('value',value.to_date);
|
||||||
let from_Date = this.pipe.transform(value.from_date,'yyyy-MM-dd HH:mm:ss');
|
let from_Date = this.pipe.transform(value.from_date,'yyyy-MM-dd HH:mm:ss');
|
||||||
let to_Date = this.pipe.transform(value.to_date,'yyyy-MM-dd HH:mm:ss');
|
let to_Date = this.pipe.transform(value.to_date,'yyyy-MM-dd HH:mm:ss');
|
||||||
this.array_value = this.array_value.filter(val => val.created_on >= from_Date && val.created_on <= to_Date );
|
this.filtered_data = this.filtered_data.filter(val => val.created_on >= from_Date && val.created_on <= to_Date );
|
||||||
// console.log('this.array_value',this.array_value);
|
// console.log('this.filtered_data',this.filtered_data);
|
||||||
}
|
}
|
||||||
|
this.Loading = false;
|
||||||
console.log(this.array_value);
|
this.dataLength = this.filtered_data.length;
|
||||||
|
this.pageSize = this.filtered_data.length;
|
||||||
this.noRecordFound = false;
|
if(this.filtered_data.length >= 1){
|
||||||
this.dataLength = this.array_value.length;
|
this.api_data = this.filtered_data.map((val, i)=>{
|
||||||
if(this.array_value.length >= 1){
|
|
||||||
this.userData = this.array_value.map((val, i)=>{
|
|
||||||
val['serialno'] = i + 1;
|
val['serialno'] = i + 1;
|
||||||
return val;
|
return val;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.dataSource.data = this.array_value;
|
this.dataSource.data = this.filtered_data;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.dataSource.data = this.array_value;
|
this.dataSource.data = this.filtered_data;
|
||||||
|
this.dataLength = this.filtered_data.length;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,71 +1,31 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
|
|
||||||
import { MatInputModule } from '@angular/material';
|
import { MatInputModule } from '@angular/material';
|
||||||
|
import { MatCardModule,
|
||||||
|
MatIconModule,MatButtonModule,MatSelectModule,
|
||||||
|
MatProgressBarModule,MatProgressSpinnerModule,
|
||||||
|
MatTableModule,MatPaginatorModule,MatSortModule } from '@angular/material';
|
||||||
|
|
||||||
|
import { MatListModule } from '@angular/material/list';
|
||||||
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||||
|
import { MatFormFieldModule } from '@angular/material/form-field'
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
import { MatExpansionModule } from '@angular/material/expansion';
|
||||||
|
|
||||||
|
import { MatDatepickerModule} from '@angular/material/datepicker';
|
||||||
|
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||||
|
import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||||
|
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
|
||||||
|
|
||||||
|
import { ReportsService } from '../reports/reports.service';
|
||||||
import { ReportsRoutingModule } from './reports-routing.module';
|
import { ReportsRoutingModule } from './reports-routing.module';
|
||||||
import { PdMisComponent } from './pd-mis/pd-mis.component';
|
import { PdMisComponent } from './pd-mis/pd-mis.component';
|
||||||
import {MatDatepickerModule} from '@angular/material/datepicker';
|
|
||||||
|
|
||||||
import {
|
|
||||||
MatCardModule,
|
|
||||||
MatIconModule,
|
|
||||||
MatRadioModule,
|
|
||||||
MatButtonModule,
|
|
||||||
MatSelectModule,
|
|
||||||
MatDialogModule,
|
|
||||||
MatProgressBarModule,MatToolbarModule,MatCheckboxModule,
|
|
||||||
MatTableModule,MatPaginatorModule,MatSortModule} from '@angular/material';
|
|
||||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
|
||||||
import {MatFormFieldModule} from '@angular/material/form-field'
|
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
||||||
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
|
|
||||||
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
|
|
||||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
|
||||||
import { DragulaModule } from 'ng2-dragula';
|
|
||||||
import {MatListModule} from '@angular/material/list';
|
|
||||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
||||||
import { ReportsService } from '../reports/reports.service';
|
|
||||||
import {MatExpansionModule} from '@angular/material/expansion';
|
|
||||||
const customNotifierOptions: NotifierOptions = {
|
|
||||||
position: {
|
|
||||||
horizontal: {
|
|
||||||
position: 'right',
|
|
||||||
distance: 12
|
|
||||||
},
|
|
||||||
vertical: {
|
|
||||||
position: 'top',
|
|
||||||
distance: 32,
|
|
||||||
gap: 10
|
|
||||||
}
|
|
||||||
},
|
|
||||||
theme: 'material',
|
|
||||||
behaviour: {
|
|
||||||
autoHide: 5000,
|
|
||||||
onClick: 'hide',
|
|
||||||
onMouseover: 'pauseAutoHide',
|
|
||||||
showDismissButton: true,
|
|
||||||
stacking: 4
|
|
||||||
},
|
|
||||||
animations: {
|
|
||||||
enabled: true,
|
|
||||||
show: {
|
|
||||||
preset: 'slide',
|
|
||||||
speed: 300,
|
|
||||||
easing: 'ease'
|
|
||||||
},
|
|
||||||
hide: {
|
|
||||||
preset: 'fade',
|
|
||||||
speed: 300,
|
|
||||||
easing: 'ease',
|
|
||||||
offset: 50
|
|
||||||
},
|
|
||||||
shift: {
|
|
||||||
speed: 300,
|
|
||||||
easing: 'ease'
|
|
||||||
},
|
|
||||||
overlap: 150
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@ -78,25 +38,23 @@ const customNotifierOptions: NotifierOptions = {
|
|||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatInputModule,
|
MatInputModule,
|
||||||
MatRadioModule,
|
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatTableModule,
|
MatTableModule,
|
||||||
MatPaginatorModule,
|
MatPaginatorModule,
|
||||||
MatProgressBarModule,
|
MatProgressBarModule,MatProgressSpinnerModule,
|
||||||
MatDialogModule,
|
|
||||||
MatSortModule,
|
MatSortModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
FlexLayoutModule,
|
FlexLayoutModule,
|
||||||
NgxMatSelectSearchModule,
|
|
||||||
NgxDatatableModule,
|
NgxDatatableModule,
|
||||||
MatSlideToggleModule,
|
MatSlideToggleModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
MatListModule,DragulaModule,
|
MatListModule,
|
||||||
MatDatepickerModule,
|
MatDatepickerModule,
|
||||||
NotifierModule.withConfig(customNotifierOptions),
|
|
||||||
],
|
],
|
||||||
exports: [MatExpansionModule],
|
exports: [MatExpansionModule],
|
||||||
declarations: [PdMisComponent],
|
declarations: [PdMisComponent],
|
||||||
providers:[ReportsService]
|
providers:[ReportsService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
||||||
|
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS},]
|
||||||
})
|
})
|
||||||
|
|
||||||
export class ReportsModule { }
|
export class ReportsModule { }
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export class ReportsService {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// get Details
|
// get Details
|
||||||
getPDMISDailyReport(): Observable<any> {
|
retirveDataForMISDailyReport(): Observable<any> {
|
||||||
return this._http.get(this.apiUrl + 'PD_MIS_report');
|
return this._http.get(this.apiUrl + 'PD_MIS_report');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user