mis report add remarks
This commit is contained in:
parent
44297ad628
commit
16252bcaaf
@ -1034,4 +1034,9 @@ export class PdTrigerService {
|
||||
// let headers = this.createAuthorizationHeader()
|
||||
return this._http.post(this.apiUrl+'getPDImgDetails',params);
|
||||
}
|
||||
updateMISReportRemarks(params):Observable<any> {
|
||||
// let headers = this.createAuthorizationHeader()
|
||||
console.log(params);
|
||||
return this._http.post(this.apiUrl+'updateMISReportRemarks',params);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
||||
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
|
||||
import { MatInputModule } from '@angular/material';
|
||||
import { MatInputModule, MatDialogModule } from '@angular/material';
|
||||
import { MatCardModule,
|
||||
MatIconModule,MatButtonModule,MatSelectModule,
|
||||
MatProgressBarModule,MatProgressSpinnerModule,
|
||||
@ -28,6 +28,7 @@ import { PdMisComponent } from './pd-mis/pd-mis.component';
|
||||
import {NotifierModule,NotifierOptions} from 'angular-notifier'
|
||||
import { MatTableExporterModule } from 'mat-table-exporter';
|
||||
import { SmcCreditComponent } from './smc-credit/smc-credit.component';
|
||||
import { SmcRemarksComponent } from './smc-remarks/smc-remarks.component';
|
||||
|
||||
|
||||
const pdCustomNotifierOptions: NotifierOptions = {
|
||||
@ -95,12 +96,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
||||
MatTooltipModule,
|
||||
MatListModule,
|
||||
MatDatepickerModule,
|
||||
MatTableExporterModule
|
||||
MatTableExporterModule,MatDialogModule
|
||||
],
|
||||
exports: [MatExpansionModule],
|
||||
declarations: [PdMisComponent, SmcCreditComponent],
|
||||
exports: [MatExpansionModule,SmcRemarksComponent],
|
||||
declarations: [PdMisComponent, SmcCreditComponent, SmcRemarksComponent],
|
||||
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},]
|
||||
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS},],
|
||||
entryComponents:[SmcRemarksComponent]
|
||||
})
|
||||
|
||||
export class ReportsModule { }
|
||||
|
||||
@ -100,8 +100,10 @@
|
||||
<ng-container matColumnDef="credit_pd_sno">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Reference Number</th>
|
||||
<td mat-cell *matCellDef="let row">
|
||||
<span *ngIf="row.pd_sno" mat-line>{{row.pd_sno}}</span> </td>
|
||||
</ng-container>
|
||||
<span *ngIf="row.pd_sno" mat-line>{{row.pd_sno}}
|
||||
|
||||
</span> </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="applicant_name" sticky>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Main Loan Applicant </th>
|
||||
@ -139,6 +141,13 @@
|
||||
<td mat-cell *matCellDef="let row">
|
||||
<span *ngIf="row.updatedon" mat-line> {{row.updatedon | date: 'dd-MM-yyyy hh:mm a'}}</span> </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="remarks">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Remarks</th>
|
||||
<td mat-cell *matCellDef="let row">
|
||||
<span *ngIf="row.updatedon" mat-line>
|
||||
<span ><button mat-fab (click)="addRemark(row.pd_id)" class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Add Remarks" matTooltipPosition="above" >
|
||||
<mat-icon>add</mat-icon></button></span></span> </td>
|
||||
</ng-container>
|
||||
<!-- <ng-container matColumnDef="mail_status">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Mail Status</th>
|
||||
<td mat-cell *matCellDef="let row">
|
||||
|
||||
@ -2,14 +2,16 @@ import { DatePipe } from '@angular/common';
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormGroup, FormBuilder } from '@angular/forms';
|
||||
import { PageEvent, MatTableDataSource, MatPaginator, MatSort } from '@angular/material';
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { SalesPdService } from 'app/sales-pd/services/sales-pd.service';
|
||||
import { ReportsService } from '../reports.service';
|
||||
|
||||
@Component({
|
||||
import {SmcRemarksComponent}from '../smc-remarks/smc-remarks.component';
|
||||
import { NgModule } from '@angular/core';
|
||||
@Component({
|
||||
selector: 'app-smc-credit',
|
||||
templateUrl: './smc-credit.component.html',
|
||||
templateUrl: './smc-credit.component.html',
|
||||
styleUrls: ['./smc-credit.component.scss']
|
||||
})
|
||||
export class SmcCreditComponent implements OnInit {
|
||||
@ -39,17 +41,18 @@ export class SmcCreditComponent implements OnInit {
|
||||
'credit_pd_sno',
|
||||
'applicant_name',
|
||||
'credit_pd_type',
|
||||
'product_abbr',
|
||||
'product_abbr',
|
||||
'officer_name',
|
||||
'status',
|
||||
'createdon',
|
||||
'remarks',
|
||||
// 'mail_status'
|
||||
];
|
||||
expandStatus: boolean=true;
|
||||
|
||||
|
||||
|
||||
constructor(private reportService:ReportsService,private router:Router,private form_builder:FormBuilder,private notifier:NotifierService) {
|
||||
constructor(private reportService:ReportsService,private dialog: MatDialog,private router:Router,private route: ActivatedRoute,private form_builder:FormBuilder,private notifier:NotifierService) {
|
||||
this.reportform = this.form_builder.group({
|
||||
from_date:[null],to_date:[null],officer_name:[null],lender_id:[null]});
|
||||
|
||||
@ -269,6 +272,20 @@ export class SmcCreditComponent implements OnInit {
|
||||
let selected_date = this.pipe.transform(values, 'yyyy/MM/dd');
|
||||
this.minDate = new Date(selected_date);
|
||||
}
|
||||
addRemark(pd_id)
|
||||
{
|
||||
|
||||
const dialogRef = this.dialog.open(SmcRemarksComponent, {
|
||||
data: { pdid:pd_id},
|
||||
disableClose: true,
|
||||
minWidth: '30%',
|
||||
maxWidth: '40%',
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
//this.viewPdDetails(1,2)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
|
||||
<h2 mat-dialog-title>Add Remarks PD-ID: {{this.pdid}}</h2>
|
||||
<mat-dialog-content>
|
||||
<div fxFlex="100">
|
||||
<p align="center">
|
||||
|
||||
</p>
|
||||
<span >
|
||||
|
||||
<span *ngIf="Loading">
|
||||
<div fxLayoutAlign="center">
|
||||
<mat-progress-spinner mode="indeterminate"></mat-progress-spinner>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
<div align="center">
|
||||
<mat-form-field appearance="outline" style="width: 100%;">
|
||||
<mat-label>Remarks</mat-label>
|
||||
<textarea matInput autocomplete="off" placeholder="Add Your Remarks" type="text" [formControl] = "remarks"></textarea>
|
||||
<mat-error align="end" *ngIf="remarks.hasError('required')">Remarks required</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end" >
|
||||
|
||||
<button mat-raised-button color="primary" (click)="AddPDRemarks(this.pdid)"><strong>Add Remarks</strong></button>
|
||||
<button mat-raised-button mat-dialog-close><strong>Cancel</strong></button>
|
||||
</mat-dialog-actions>
|
||||
<notifier-container></notifier-container>
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SmcRemarksComponent } from './smc-remarks.component';
|
||||
|
||||
describe('SmcRemarksComponent', () => {
|
||||
let component: SmcRemarksComponent;
|
||||
let fixture: ComponentFixture<SmcRemarksComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SmcRemarksComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SmcRemarksComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,80 @@
|
||||
import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core';
|
||||
import { NotifierService } from "angular-notifier";
|
||||
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material';
|
||||
//import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||
import{PdTrigerService} from './../../personal-discussion/pd-service/pd-triger.service'
|
||||
import { FormControl, Validators } from '@angular/forms';
|
||||
@Component({
|
||||
selector: 'app-smc-remarks',
|
||||
templateUrl: './smc-remarks.component.html',
|
||||
styleUrls: ['./smc-remarks.component.scss']
|
||||
})
|
||||
export class SmcRemarksComponent implements OnInit {
|
||||
private notifier: NotifierService;
|
||||
|
||||
pdid: any;
|
||||
|
||||
remarks:FormControl = new FormControl('',Validators.compose([Validators.required]))
|
||||
constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef<SmcRemarksComponent>,@Inject(MAT_DIALOG_DATA) public data: any)
|
||||
{
|
||||
this.notifier = notifier;
|
||||
this.pdid=this.data.pdid;
|
||||
//this.notifier = notifier;
|
||||
//this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' :this.data.pd_status=='CANCELLED' ? 'PD Cancel': 'Change Discussion';
|
||||
//this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion and forwarding for Quality Check ?' : this.data.pd_status=='CANCELLED' ? 'Are you going to cancel this PD' : 'Change Discussion';
|
||||
//this.enableAddonPD = false;
|
||||
//this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true;
|
||||
//this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false;
|
||||
// this.masterRandomString = this.data.random_string;
|
||||
// this.fk_pd_type = this.data.pd_type
|
||||
//console.log("sdf@@@@@@@@@@2",this.fk_pd_type)
|
||||
//this.is_remarks_enabled = this.data.pd_status == 'CANCELLED'
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
AddPDRemarks(pdid)
|
||||
{
|
||||
|
||||
if(this.remarks.invalid) {
|
||||
this.notifier.notify("warning","Remarks is Required");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
let params: any={};
|
||||
params.pd_id =pdid;
|
||||
params.remarks=this.remarks.value;
|
||||
this.pd.updateMISReportRemarks(params).subscribe(result => {
|
||||
console.log(result);
|
||||
|
||||
if (result['status'] == 200) {
|
||||
|
||||
this.notifier.notify('success','Remarks Added Successfully');
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
}, 3000);
|
||||
}
|
||||
else {
|
||||
|
||||
this.notifier.notify('warning', 'Something Went Wrong Try Again.!');
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
}, 3000);
|
||||
}
|
||||
}, error => {
|
||||
|
||||
this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!');
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user