This commit is contained in:
venbatechnologies@gmail.com 2020-01-28 16:43:15 +05:30
commit 355efe361e
6 changed files with 82 additions and 18 deletions

View File

@ -102,10 +102,12 @@ export class AddPdComponent implements OnInit, OnDestroy {
console.log(selectLender); console.log(selectLender);
this.selectedLender(selectLender) this.selectedLender(selectLender)
this.getSubproductList(res['records'].default_product)
this._PDtriggerForm.controls['fk_product_id'].setValue(res['records'].default_product); this._PDtriggerForm.controls['fk_product_id'].setValue(res['records'].default_product);
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(res['records'].default_sub_product);
this._PDtriggerForm.controls['fk_customer_segment'].setValue(res['records'].default_customer_segment); this._PDtriggerForm.controls['fk_customer_segment'].setValue(res['records'].default_customer_segment);
this._PDtriggerForm.controls['fk_pd_type'].setValue(res['records'].default_pd_type); this._PDtriggerForm.controls['fk_pd_type'].setValue(res['records'].default_pd_type);
this.getSubproductList(res['records'].default_product)
} }
else{ else{
@ -263,36 +265,36 @@ export class AddPdComponent implements OnInit, OnDestroy {
//get sub product list based on prokduct id //get sub product list based on prokduct id
getSubproductList(productID: string) { getSubproductList(productID: string) {
// console.log(productID) // console.log(productID)
let productabbr : any; let prod_catagory : any;
// console.log('productID',productID); // console.log('productID',productID);
if(productID !== undefined && productID !== null && productID !== '' && this.productList.length > 0) { if(productID !== undefined && productID !== null && productID !== '' && this.productList.length > 0) {
this.subProductList = this.productList.filter(item => item.product_id == productID); this.subProductList = this.productList.filter(item => item.product_id == productID);
console.log('sub products',this.subProductList,this.productList,productID) console.log('sub products',this.subProductList,this.productList,productID)
this.subProductList = this.subProductList[0].subproducts; this.subProductList = this.subProductList[0].subproducts;
this.subProductList = this.subProductList.filter(item => item.is_others == 0); this.subProductList = this.subProductList.filter(item => item.is_others == 0);
productabbr = this.productAllList.filter(item => item.product_id == productID)[0].product_abbr; prod_catagory = this.productAllList.filter(item => item.product_id == productID)[0].prod_catagory;
} }
else{ else{
productabbr = '' prod_catagory = ''
this.subProductList = []; this.subProductList = [];
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(''); this._PDtriggerForm.controls['fk_subproduct_id'].setValue('');
this._PDtriggerForm.controls['fk_pd_type'].setValue(''); this._PDtriggerForm.controls['fk_pd_type'].setValue('');
this._PDtriggerForm.controls['fk_customer_segment'].setValue(''); this._PDtriggerForm.controls['fk_customer_segment'].setValue('');
this._PDtriggerForm.controls['loan_amount'].setValue(''); this._PDtriggerForm.controls['loan_amount'].setValue('');
} }
// console.log('productID',productID,productabbr); // console.log('productID',productID,prod_catagory);
/**customer segment */ /**customer segment */
switch(productabbr){ switch(prod_catagory){
case 'BL' : case 'BL' :
// console.log(1); // console.log(1);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); this.customerSegmentList = this.customerSegmentAllList;
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(null); this._PDtriggerForm.controls['fk_subproduct_id'].setValue(null);
this.isSubproductShown = false; this.isSubproductShown = false;
break; break;
case 'LAEP': case 'LAEP':
// console.log(2); // console.log(2);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); this.customerSegmentList = this.customerSegmentAllList;
this._PDtriggerForm.controls['fk_subproduct_id'].setValue(null); this._PDtriggerForm.controls['fk_subproduct_id'].setValue(null);
this.isSubproductShown = false; this.isSubproductShown = false;
break; break;

View File

@ -68,7 +68,7 @@ export class EditPdMasterComponent implements OnInit {
}; };
lenderShortName: any; lenderShortName: any;
isSubproductShown: boolean = true; isSubproductShown: boolean = true;
productShortName : any; prod_catagory : any;
sales_and_credit_enable: boolean=false; sales_and_credit_enable: boolean=false;
sales_and_credit_person: any=[]; sales_and_credit_person: any=[];
finInstitutionList: any; finInstitutionList: any;
@ -118,6 +118,14 @@ export class EditPdMasterComponent implements OnInit {
let selectLender=this.lenderList.filter(val=>val.entity_id == entity_id)[0] let selectLender=this.lenderList.filter(val=>val.entity_id == entity_id)[0]
console.log(selectLender); console.log(selectLender);
this.selectedLender(selectLender,option) this.selectedLender(selectLender,option)
if(option != 'start'){
this.getSubproductList(res['records'].default_product,1);
this._EditPDtriggerForm.controls['fk_product_id'].setValue(res['records'].default_product);
this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(res['records'].default_sub_product);
this._EditPDtriggerForm.controls['fk_customer_segment'].setValue(res['records'].default_customer_segment);
this._EditPDtriggerForm.controls['fk_pd_type'].setValue(res['records'].default_pd_type);
}
} }
else{ else{
@ -202,8 +210,8 @@ if(!option){
if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK
// console.log("entered"); // console.log("entered");
this._EditPDtriggerForm.controls['fk_product_id'].setValue("3") // this._EditPDtriggerForm.controls['fk_product_id'].setValue("3")
this._EditPDtriggerForm.controls['fk_pd_type'].setValue("1"); // this._EditPDtriggerForm.controls['fk_pd_type'].setValue("1");
this.getSubproductList("3",2) this.getSubproductList("3",2)
} }
// console.log("len",lender) // console.log("len",lender)
@ -385,20 +393,20 @@ if(!option){
if (productID !== undefined && productID !== null && productID !== '') { if (productID !== undefined && productID !== null && productID !== '') {
this.productShortName = this.productAllList.filter(item => item.product_id == productID)[0].product_abbr; this.prod_catagory = this.productAllList.filter(item => item.product_id == productID)[0].prod_catagory;
this.subProductList=this.productAllList.filter(item => item.product_id == productID); this.subProductList=this.productAllList.filter(item => item.product_id == productID);
this.subProductList=this.subProductList[0].subproducts; this.subProductList=this.subProductList[0].subproducts;
console.log("dd sub",this.subProductList) console.log("dd sub",this.subProductList)
} }
else { else {
this.productShortName = ''; this.prod_catagory = '';
this.subProductList=[]; this.subProductList=[];
} }
// console.log('this.productAbbr',this.productShortName); // console.log('this.productAbbr',this.prod_catagory);
switch (this.productShortName) { switch (this.prod_catagory) {
case 'BL': case 'BL':
// console.log(1); // console.log(1);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); this.customerSegmentList = this.customerSegmentAllList;
if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); } if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); }
// this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(this.subProductList[0].subproduct_id); // this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(this.subProductList[0].subproduct_id);
this.subProductList=[]; this.subProductList=[];
@ -406,7 +414,7 @@ if(!option){
break; break;
case 'LAEP': case 'LAEP':
// console.log(2); // console.log(2);
this.customerSegmentList = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); this.customerSegmentList = this.customerSegmentAllList;
// this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(this.subProductList[0].subproduct_id); // this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(this.subProductList[0].subproduct_id);
if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); } if(this.lenderShortName == 'CLIX' && flag==2 ){ this._EditPDtriggerForm.controls['fk_customer_segment'].setValue('5'); }
this.subProductList=[]; this.subProductList=[];

View File

@ -48,6 +48,7 @@
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Notes" matTooltipPosition="above" (click)="reportReview('REMARKS')" style="margin-right: 2px;"><mat-icon>notes</mat-icon></button> <button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Notes" matTooltipPosition="above" (click)="reportReview('REMARKS')" style="margin-right: 2px;"><mat-icon>notes</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="PD Officer Notes" matTooltipPosition="above" (click)="reportReview('pd_officer_notes')" style="margin-right: 2px;"><mat-icon>bookmarks</mat-icon></button> <button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="PD Officer Notes" matTooltipPosition="above" (click)="reportReview('pd_officer_notes')" style="margin-right: 2px;"><mat-icon>bookmarks</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Complete" matTooltipPosition="above" (click)="reportReview('COMPLETE')" style="margin-right: 2px;"><mat-icon>done_all</mat-icon></button> <button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="QC Complete" matTooltipPosition="above" (click)="reportReview('COMPLETE')" style="margin-right: 2px;"><mat-icon>done_all</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Map" matTooltipPosition="above" (click)="reportReview('GEOLOCATION')" style="margin-right: 2px;"><mat-icon>map</mat-icon></button>
<button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Report" matTooltipPosition="above" (click)="reGeneratePFReport()"><mat-icon>autorenew</mat-icon></button> <button *ngIf="pdReportRecords.pd_status!='QC_COMPLETED'" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Re-generate Report" matTooltipPosition="above" (click)="reGeneratePFReport()"><mat-icon>autorenew</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Report" matTooltipPosition="above" (click)="downloadPDReport()"><mat-icon>get_app</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Report" matTooltipPosition="above" (click)="downloadPDReport()"><mat-icon>get_app</mat-icon></button>

View File

@ -27,6 +27,25 @@
<button mat-button mat-dialog-close>Cancel</button> <button mat-button mat-dialog-close>Cancel</button>
</mat-dialog-actions> </mat-dialog-actions>
</div> </div>
<div *ngIf="showStatus == 'GEOLOCATION'">
<h2 mat-dialog-title>Geo-Location</h2>
<mat-dialog-content class="mat-typography">
<div style="margin: 12px; width: 340px;">
<form role="form" *ngIf="showForm" [formGroup]="ngForm" accept-charset="UTF-8" novalidate>
<div>
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Geo Location</mat-label>
<textarea matInput placeholder="Enter Geo Location" formControlName="qc_geo_location"></textarea>
</mat-form-field>
</div>
</form>
</div>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button class="btn btn-primary" (click)="geoLocationClick()">Save</button>
<button mat-button mat-dialog-close>Cancel</button>
</mat-dialog-actions>
</div>
<div *ngIf="showStatus == 'REMARKS'"> <div *ngIf="showStatus == 'REMARKS'">
<h2 mat-dialog-title>QC Notes</h2> <h2 mat-dialog-title>QC Notes</h2>

View File

@ -102,6 +102,12 @@ export class QcReviewComponent implements OnInit {
this.showForm = true; this.showForm = true;
} }
else if(this.showStatus == 'GEOLOCATION'){
this.ngForm = this._formBuilder.group({
qc_geo_location: ['']
})
this.showForm = true;
}
} }
@ -147,6 +153,27 @@ export class QcReviewComponent implements OnInit {
}) })
} }
geoLocationClick(): void {
let geo = this.ngForm.value;
let records = {
'pd_id':this.data.startId,
'geo_location':geo.qc_geo_location,
'comment':""
}
this.pdTrigerService.updateGeoLocation(records).subscribe(data=>{
this.notifier.notify('success', 'Your Changes Updated.!');
this.dialogRef.close({
status:true,
dialog_close:true
});
}, 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.!');
// alert(err.html_format);
});
}
// ============================= // =============================

View File

@ -342,6 +342,13 @@ export class QcService {
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
updateGeoLocation(records: any): Observable<any> {
records.fk_updatedby=this._aws.getlocale();
return this._http.post<any>(this.apiUrl + "renewSatellite", { "records": records })
.pipe(
catchError(this.handleError('operation', []))
)
}
getPdDocVersionList(pdId: number): Observable<any> { getPdDocVersionList(pdId: number): Observable<any> {
return this._http.post<any>(this.apiUrl + "getListOfPDReportVersions", { "records": { "pd_id": pdId } }) return this._http.post<any>(this.apiUrl + "getListOfPDReportVersions", { "records": { "pd_id": pdId } })