Geo Location and Sub product changes done

This commit is contained in:
sriram-at-840620226347 2020-01-24 16:33:06 +05:30
parent 9c615081d9
commit fa62a8449b
5 changed files with 62 additions and 8 deletions

View File

@ -265,36 +265,36 @@ export class AddPdComponent implements OnInit, OnDestroy {
//get sub product list based on prokduct id
getSubproductList(productID: string) {
// console.log(productID)
let productabbr : any;
let prod_catagory : any;
// console.log('productID',productID);
if(productID !== undefined && productID !== null && productID !== '' && this.productList.length > 0) {
this.subProductList = this.productList.filter(item => item.product_id == productID);
console.log('sub products',this.subProductList,this.productList,productID)
this.subProductList = this.subProductList[0].subproducts;
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{
productabbr = ''
prod_catagory = ''
this.subProductList = [];
this._PDtriggerForm.controls['fk_subproduct_id'].setValue('');
this._PDtriggerForm.controls['fk_pd_type'].setValue('');
this._PDtriggerForm.controls['fk_customer_segment'].setValue('');
this._PDtriggerForm.controls['loan_amount'].setValue('');
}
// console.log('productID',productID,productabbr);
// console.log('productID',productID,prod_catagory);
/**customer segment */
switch(productabbr){
switch(prod_catagory){
case 'BL' :
// 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.isSubproductShown = false;
break;
case 'LAEP':
// 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.isSubproductShown = false;
break;

View File

@ -48,8 +48,9 @@
<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="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 Pictures" matTooltipPosition="above" (click)="archivePDImages()"><mat-icon>save_alt</mat-icon></button>
<button *ngIf="!spinner_access" mat-raised-button mat-icon-button class="mr-1 ml-1 hover-icon" type="button" matTooltip="Download PD Pictures (PDF)" matTooltipPosition="above" (click)="downloadPDImagesPDF()"><mat-icon>picture_as_pdf</mat-icon></button>

View File

@ -27,6 +27,25 @@
<button mat-button mat-dialog-close>Cancel</button>
</mat-dialog-actions>
</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'">
<h2 mat-dialog-title>QC Notes</h2>

View File

@ -102,6 +102,12 @@ export class QcReviewComponent implements OnInit {
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', []))
)
}
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> {
return this._http.post<any>(this.apiUrl + "getListOfPDReportVersions", { "records": { "pd_id": pdId } })