This commit is contained in:
saravanakumarkandasami 2018-11-17 18:38:34 +05:30
commit 629bb2b72c
9 changed files with 48 additions and 22 deletions

View File

@ -20,15 +20,12 @@
<mat-card>
<mat-card-title>
<div fxFlex.gt-sm="25" fxFlex="100">
<div fxFlex.gt-sm="75" fxFlex="100">
{{dashboardTitle}}
</div>
<div fxFlex.gt-sm="25" fxFlex="100">
<ngx-mat-drp (selectedDateRangeChanged)="updateRange($event)" (change)="onChange($event,'One')" [options]="options" #dateRangePicker></ngx-mat-drp>
</div>
</div>
<div fxFlex.gt-sm="25" fxFlex="100">
<ngx-mat-drp (selectedDateRangeChanged)="updateRange($event)" (change)="onChange($event,'One')" [options]="options" #dateRangePicker></ngx-mat-drp>
</div>
<div fxFlex.gt-sm="25" fxFlex="100">
<!-- <mat-form-field >

View File

@ -126,15 +126,20 @@ export class DashboardComponent {
const toMin = new Date(today.getFullYear(), today.getMonth()-1, 1);
const toMax = new Date(today.getFullYear(), today.getMonth()+2, 0);
const resetRange = {fromDate: today, toDate: today};
this.dateRangePicker.resetDates(resetRange); // will trigger selectedDateRangeChanged
const thismonth = new Date(today.getFullYear(), today.getMonth(), 0);
console.log(fromMin);
console.log(fromMax);
console.log(toMin);
console.log(toMax);
//const resetRange = {fromDate: today, toDate: today};
//this.dateRangePicker.resetDates(resetRange); // will trigger selectedDateRangeChanged
this.setupPresets();
this.options = {
presets: this.presets,
format: 'mediumDate',
range: {fromDate:today, toDate: today},
range: {fromDate:toMin, toDate: fromMax},
applyLabel: "Submit",
calendarOverlayConfig: {
shouldCloseOnBackdropClick: false,
@ -142,7 +147,7 @@ export class DashboardComponent {
},
placeholder: "Date",
cancelLabel: "Cancel",
excludeWeekends:true,
excludeWeekends:false,
fromMinMax: {fromDate:fromMin, toDate:fromMax},
toMinMax: {fromDate:toMin, toDate:toMax}
};

View File

@ -53,7 +53,12 @@ export class DashboardService {
// }
getPDDetailForDoughnut(fromdate,todate,cityarr,lenderarr): Observable<any> {
console.log(')))))');
console.log(fromdate);
console.log(todate);
console.log(cityarr);
console.log(lenderarr);
console.log('(((');
return this._http.post(this.apiUrl+'getDashBoardMaster', {
"fromdate":fromdate,
"todate": todate,

View File

@ -50,7 +50,7 @@
<div>
<mat-form-field>
<mat-select (selectionChange)="selectedFreqPurchase($event)" placeholder="Select Frequency of Purchase" formControlName="frequency_of_purchase">
<mat-option *ngFor="let feq of m_freqOfPurchase" [value]="feq.id">{{ feq.name }}</mat-option>
<mat-option *ngFor="let feq of m_freqOfPurchase" [value]="feq.frequency_id">{{ feq.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>

View File

@ -63,7 +63,7 @@ export class CurrentLoanComponent implements OnInit {
});
this.currentLoanForm.controls['loan_details'].setValue(result);
} else {
control.push(this.createLoanDetail());
// control.push(this.createLoanDetail());
}
}
} else {

View File

@ -21,7 +21,7 @@
<p>Other Income Details</p>
<form [formGroup]="otherIncomeForm" class="address">
<mat-form-field>
<mat-select placeholder="Other Income"
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Other Income"
formControlName="other_income">
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>

View File

@ -50,18 +50,22 @@ export class OtherIncomeComponent implements OnInit {
console.log('value', value);
const control = <FormArray>this.otherIncomeForm.controls['income_details'];
if (value.status == 200) {
this.otherIncomeForm.controls['other_income'].setValue(value.records.other_income);
this.otherIncomeForm.controls['otherincome_remarks'].setValue(value.records.otherincome_remarks);
if (value.records.other_income == 'Yes') {
var result = Object.keys(value.records.income_details).map(function(key) {
return value.records.income_details[key];
});
this.otherIncomeForm.controls['other_income'].setValue(value.records.other_income);
this.otherIncomeForm.controls['otherincome_remarks'].setValue(value.records.otherincome_remarks);
if (result.length > 0) {
result.forEach(val => {
control.push(this.createDetail());
});
this.otherIncomeForm.controls['income_details'].setValue(result);
} else {
control.push(this.createDetail());
// control.push(this.createDetail());
}
}
} else {
control.push(this.createDetail());
@ -75,6 +79,16 @@ export class OtherIncomeComponent implements OnInit {
income_details: this.fb.array([])
});
}
selectedLoanChanges(e): void {
if (e.value == 'Yes') {
const control = <FormArray>this.otherIncomeForm.controls['income_details'];
control.push(this.createDetail());
} else if (e.value == 'No') {
const arr = <FormArray>this.otherIncomeForm.controls.income_details;
arr.removeAt(0);
}
}
createDetail() {
return this.fb.group({
source: ['', Validators.compose([Validators.required])],
@ -111,7 +125,11 @@ export class OtherIncomeComponent implements OnInit {
records.fk_createdby = this.pdid;
records.other_income = this.otherIncomeForm.controls['other_income'].value;
records.otherincome_remarks = this.otherIncomeForm.controls['otherincome_remarks'].value;
if (this.otherIncomeForm.controls['other_income'].value == 'Yes') {
records.income_details = this.otherIncomeForm.controls['income_details'].value;
}
console.log('data', records);
this._pd.saveForm(records).subscribe(data => {
console.log('data', data);

View File

@ -6,7 +6,7 @@
</div>
<mat-sidenav-container class="app-inner background-none shadow-none mail-db">
<mat-sidenav #mailnav [mode]="isOver() ? 'over' : 'side'" [opened]="!isOver()" class="mail-sidebar pl-xs pr-xs">
<button _ngcontent-c21="" [disabled]="currentPDStatus !=pdStatusCheck.INPROGRESS || actualQuestions!=answeredQuestions" class="compose-btn mat-warn mat-raised-button mb-1" (click)="changePDStatus(pdStatusCheck.COMPLETED);"><span>{{currentPDStatus==pdStatusCheck.INPROGRESS ? 'COMPLETE':(currentPDStatus==pdStatusCheck.QC_COMPLETED ? 'QC COMPLETED' : currentPDStatus ) }}</span></button>
<button _ngcontent-c21="" [disabled]="actualQuestions!=answeredQuestions" class="compose-btn mat-warn mat-raised-button mb-1" (click)="changePDStatus(pdStatusCheck.COMPLETED);"><span>{{currentPDStatus==pdStatusCheck.INPROGRESS ? 'COMPLETE':(currentPDStatus==pdStatusCheck.QC_COMPLETED ? 'QC COMPLETED' : currentPDStatus ) }}</span></button>
<!--{{ (currentPDStatus==pdStatusCheck.INPROGRESS)? 'COMPLETE':(currentPDStatus) }} -->
<div *ngIf="categoryList != ''">

View File

@ -99,7 +99,8 @@
</mat-expansion-panel-header>
<mat-list *ngFor="let documents of pdDocumentsData">
<mat-list-item>
<p><span><i class="fa-1x fa fa-file"></i> {{documents.pd_document_title}} </span></p>
<!--<p><span><i class="fa-1x fa fa-file"></i> {{documents.pd_document_title}} </span></p> -->
<a href="{{documents.doc_url}}" target="_blank"><i class="fa-1x fa fa-file"></i> {{documents.pd_document_title}}</a>
<!---- <span class="mb-2 text-center hover-icon"> &nbsp;{{documents.pd_document_name}} </span> -->
</mat-list-item>
</mat-list>