diff --git a/ng6-seed/src/app/app.component.ts b/ng6-seed/src/app/app.component.ts index bd80a9c51..dd3403763 100755 --- a/ng6-seed/src/app/app.component.ts +++ b/ng6-seed/src/app/app.component.ts @@ -2,6 +2,9 @@ import { Component } from '@angular/core'; import { MessagingService } from "./shared/messaging.service"; import { TranslateService} from '@ngx-translate/core'; import { AwsService } from './AwsService/aws.service'; +import { DashboardService } from './dashboard/dashboard.service'; +import 'rxjs/add/observable/interval'; +import { Observable,interval, Subscription } from 'rxjs'; @Component({ selector: 'app-root', @@ -9,11 +12,11 @@ import { AwsService } from './AwsService/aws.service'; }) export class AppComponent { message; - - +// alertTAT; +// public timer constructor(translate: TranslateService, private messagingService: MessagingService, - public aws: AwsService) { + public aws: AwsService,private dashBoardService:DashboardService) { translate.addLangs(['en', 'fr']); translate.setDefaultLang('en'); @@ -26,6 +29,15 @@ export class AppComponent { this.messagingService.requestPermission(userId) this.messagingService.receiveMessage() this.message = this.messagingService.currentMessage + // this.alertForTAT() } + // alertForTAT(){ + // this.alertTAT=Observable.interval(100000).subscribe(timer=>{ + // this.timer=timer + // this.dashBoardService.alertPDTAT().subscribe(res=>{ + + // }) + // }) + // } } diff --git a/ng6-seed/src/app/dashboard/dashboard.service.ts b/ng6-seed/src/app/dashboard/dashboard.service.ts index 3e2258180..0588da9c9 100755 --- a/ng6-seed/src/app/dashboard/dashboard.service.ts +++ b/ng6-seed/src/app/dashboard/dashboard.service.ts @@ -100,6 +100,9 @@ getLenderDetail(): Observable { ) } + alertPDTAT(){ + return this._http.get(this.apiUrl+'alertPDTAT').pipe(catchError(this.handleError('role',[]))); + } /** * TO Handle The Error diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.html b/ng6-seed/src/app/layouts/admin/admin-layout.component.html index f4e6346e7..07ea127b3 100755 --- a/ng6-seed/src/app/layouts/admin/admin-layout.component.html +++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.html @@ -311,6 +311,10 @@ notifications {{alertCount}} + diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts index d8c20a3d1..05883422f 100755 --- a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts +++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy, ViewChild, HostListener } from '@angular/ import { Router, NavigationEnd } from '@angular/router'; import { MenuItems } from '../../shared/menu-items/menu-items'; import { HorizontalMenuItems } from '../../shared/menu-items/horizontal-menu-items'; -import { Subscription } from 'rxjs'; +import { Subscription, Observable } from 'rxjs'; import { filter } from 'rxjs/operators'; import {TranslateService} from '@ngx-translate/core'; @@ -13,6 +13,9 @@ import { UserService } from '../../settings/service/user.service'; import { DashboardService } from '../../dashboard/dashboard.service'; import { AwsService } from '../../AwsService/aws.service'; import { RoleMenuItemsPipe } from './../role-menu-items.pipe'; +import 'rxjs/add/observable/interval'; + + @Component({ selector: 'app-layout', @@ -21,6 +24,7 @@ import { RoleMenuItemsPipe } from './../role-menu-items.pipe'; }) export class AdminLayoutComponent implements OnInit, OnDestroy { + profileurl: any; userDep: string; fullName: any; @@ -52,8 +56,11 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { alertCount: any; userRoleType: String; permissionDeined : boolean; + alertTAT: any; + countTAT: number; constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService) { + const browserLang: string = translate.getBrowserLang(); translate.use(browserLang.match(/en|fr/) ? browserLang : 'en'); this.users.getroles().subscribe(res=>{ @@ -103,7 +110,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { // console.log('Layout Alert Count',this.alertCount); }); - + // this.alertForTAT(); } ngOnInit(): void { @@ -130,6 +137,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { // Ps.update(elemContent); } }); + } @HostListener('click', ['$event']) @@ -149,6 +157,14 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { this._router.unsubscribe(); } + alertForTAT(){ + this.alertTAT=Observable.interval(10000).subscribe(timer=>{ + this.countTAT=timer + this._dashboardService.alertPDTAT().subscribe(res=>{ + + }) + }) + } isOver(): boolean { if (this.url === '/apps/messages' || this.url === '/apps/calendar' || this.url === '/apps/media' || this.url === '/maps/leaflet') { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 8cc24cb86..9556a591f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -14,7 +14,7 @@ - + Select @@ -52,7 +52,11 @@ - + + + Select + {{item.institute_name}} +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 346e4328d..9d262fa95 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -54,6 +54,7 @@ export class AddPdComponent implements OnInit, OnDestroy { isSubproductShown: boolean = true; sales_and_credit_person:any=[] sales_and_credit_enable:boolean=false; + finInstitutionList: any; constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, private titleCase : TitleCasePipe) { @@ -70,15 +71,34 @@ export class AddPdComponent implements OnInit, OnDestroy { this.cancelStatus = false; this.ListPdComponent.showListView(false); this.getLenderList(); - this.getProductsList(); - this.getCustomerSegmentList(); + // this.getProductsList(); + // this.getCustomerSegmentList(); this.getStateCityList(); - this.getPDTypeList(); + // this.getPDTypeList(); this.getRelationMaster(); this.getTitleMaster(); + // this.getProCusPDType() this.loadFormData(); } + getProCusPDType(entity_id){ + console.log(entity_id); + this._pd.getEntityPreferences(entity_id).subscribe(res=>{ + if(res['dataStatus']){ + this.productAllList=res['records'].products + this.pdTypeList=res['records'].pd_types + this.customerSegmentAllList=res['records'].customer_segments + this.finInstitutionList=res['records'].financial_institutions + let selectLender=this.lenderList.filter(val=>val.entity_id == entity_id)[0] + console.log(selectLender); + this.selectedLender(selectLender) + + } + else{ + this.notifier.notify("success","Something went wrong Reopen the window and Try again"); + } + }) + } // load form data loadFormData() { this._PDtriggerForm = this._fb.group({ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index 9e5d0c543..8493a0f2b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -21,7 +21,7 @@ --> - + Select @@ -64,7 +64,11 @@ - + + + Select + {{item.institute_name}} +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index 16f98c908..b4c553ac9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -62,6 +62,7 @@ export class EditPdMasterComponent implements OnInit { productShortName : any; sales_and_credit_enable: boolean=false; sales_and_credit_person: any=[]; + finInstitutionList: any; constructor(private _fb: FormBuilder, private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe) { @@ -76,14 +77,40 @@ export class EditPdMasterComponent implements OnInit { this.getLenderList(); // this.draftStatus="DRAFT"; // this.PDTriggerStatus="TRIGGERED"; - this.getCustomerSegmentList(); + // this.getCustomerSegmentList(); // this.getProductsList(); this.getStateCityList(); - this.getPDTypeList(); + // this.getPDTypeList(); // this.getAddresses(); - - this.applicantLength=this.data.applicantLength; + setTimeout(()=>{ + this.loadFormData(); + },500) + } + + getProCusPDType(entity_id,option?){ + console.log(entity_id); + this._pd.getEntityPreferences(entity_id).subscribe(res=>{ + if(res['dataStatus']){ + this.productAllList=res['records'].products + + this.pdTypeList=res['records'].pd_types + this.customerSegmentAllList=res['records'].customer_segments + this.finInstitutionList=res['records'].financial_institutions + + if(this.data.records.fk_product_id && option == 'start'){ + this.getSubproductList(this.data.records.fk_product_id,1); + } + + let selectLender=this.lenderList.filter(val=>val.entity_id == entity_id)[0] + console.log(selectLender); + this.selectedLender(selectLender,option) + + } + else{ + this.notifier.notify("success","Something went wrong Reopen the window and Try again"); + } + }) } @@ -100,7 +127,11 @@ export class EditPdMasterComponent implements OnInit { this.filterProductAbbr(x[0]['short_name'],1); } } - this.loadFormData(); + this.applicantLength=this.data.applicantLength; + if(this.data.records.fk_lender_id){ + this.getProCusPDType(this.data.records.fk_lender_id,'start') + } + } //, error => this.errorMessage = error); @@ -120,12 +151,14 @@ export class EditPdMasterComponent implements OnInit { // } /** FOR Dropdowns */ - selectedLender(lender) { + selectedLender(lender,option?) { // console.log('lender',lender); this.lenderBranchList = lender['branches']; this.lenderShortName = lender['short_name']; // console.log(this.lenderShortName); + if(!option){ this._EditPDtriggerForm.controls.pd_branch_id.setValue(null); + } if(this.lenderShortName == 'CLIX'){ @@ -146,13 +179,14 @@ export class EditPdMasterComponent implements OnInit { // console.log(this.productList); - +if(!option){ // console.log('this.productList',this.productList); this._EditPDtriggerForm.controls['fk_product_id'].setValue(''); this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(''); this._EditPDtriggerForm.controls['fk_pd_type'].setValue(''); this._EditPDtriggerForm.controls['fk_customer_segment'].setValue(''); this._EditPDtriggerForm.controls['loan_amount'].setValue(''); +} if(this.lenderShortName == "IIB"){ //FOR INDUSLAND BANK // console.log("entered"); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts index 5ea624e98..5b71db2d5 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts @@ -969,6 +969,7 @@ export class StockComponent implements OnInit { this.not_stock_of_sp[index] = value == "yes" ? 1 : 0; let SPOverallCount = this.ServiceCounterArray.reduce((sum, val) => sum + +val, 0); + console.log("flat 5",this.ServiceCounterArray,this.not_stock_of_sp,SPOverallCount,this.SPCommentCard) this.SPCommentCard = SPOverallCount > 0 ? true : false; let not_stock3 = this.not_stock_of_rm.reduce((sum, val) => sum + +val, 0); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 6b52b43df..44982299c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -138,6 +138,8 @@ export class ViewPdComponent implements OnInit, OnDestroy { this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2); this.CustomerSegmentAbbr = this.pdMasterData[0].customer_segment_abbr; this.pdDocumentsData = data.records.pd_documnets; + let parent_pd_id=masterData[0].parent_pd_id + localStorage.setItem('parent_pd_id_for_Genie',parent_pd_id); this.masterPdLogsData = Object.keys(data.records.pd_logs.master).map(function (key) { return data.records.pd_logs.master[key]; }); diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 2fdcf55ad..aeb31fec9 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -203,9 +203,12 @@ export class PdTrigerService { editData.pd_status = status; editData.fk_updatedby = this._aws.getlocale(); editData.random_string = randomString; + let parent_pd_id=localStorage.getItem('parent_pd_id_for_Genie') + editData.parent_pd_id=parent_pd_id; // editData.random_string = 'qRanHRk8mngFPRqU'; // editData.updatedon = currentdate; console.log('pd Trigger edit data',editData); + return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) .pipe( @@ -422,6 +425,8 @@ export class PdTrigerService { // pd review status update details pdReviewStatusUpdate(editData: any): Observable { editData.fk_updatedby = this._aws.getlocale(); + let parent_pd_id=localStorage.getItem('parent_pd_id_for_Genie') + editData.parent_pd_id=parent_pd_id; // editData.updatedon = currentdate; return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) @@ -759,5 +764,8 @@ export class PdTrigerService { return this._http.post(this.apiUrl+'getLenderContactPersons',{records:datas}) .pipe(catchError(this.handleError('role',[]))) } + getEntityPreferences(entity_id){ + return this._http.get(this.apiUrl+'getEntityPreferences/'+entity_id) + } } diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html index 4f5afabf4..1b52e86f4 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.html @@ -64,13 +64,12 @@
-
- + @@ -79,14 +78,14 @@ - + @@ -125,29 +124,60 @@ - {{pdReportRecords.pd_status}} -
- {{qcStatus}} -
- - -
- -
- - - -
- -
+ + + + PD Report + + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + +

+ +
+
+
+ +
+
+ +
-
-
-
+
+ +
diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts index 1e5d748cd..c09b18e1d 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts @@ -71,9 +71,9 @@ export class QcPdReportComponent implements OnInit { private dialog: MatDialog, private sanitizer: DomSanitizer) { this.startPD = this.route.snapshot.params['pdid']; let encryptReportRandomString = atob(this.route.snapshot.params['string']); - this.reportRandomString = this.apiUrl+'getPDReportHTML/'+encryptReportRandomString+'/'+this.startPD; + // this.reportRandomString = this.apiUrl+'getPDReportHTML/'+encryptReportRandomString+'/'+this.startPD; - console.log("report string",this.reportRandomString); + // console.log("report string",this.reportRandomString); this.notifier = notifier; // this.src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T073026Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=35aa183cbbfc835f96719a5e9aa552c79b3a1b7d8bca043f7d738d730755dcbb'; // this.src = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b"); @@ -84,16 +84,25 @@ export class QcPdReportComponent implements OnInit { // this.Url = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181207%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181207T122031Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=fac718f35d195ecb45d1dc7049fbaf0fa3158f237deeedac3bae60f8ec22e822"); } ngAfterViewInit(){ - let encryptReportRandomString = atob(this.route.snapshot.params['string']); - this.pdTrigerService.getPDReportHTML(encryptReportRandomString,this.startPD).subscribe(response=>{ - - this.dataContainer.nativeElement.innerHTML = response - console.log("data",this.dataContainer) - this.loadComponent=true - }) + } + + getHTMLPDReport(){ + let encryptReportRandomString = atob(this.route.snapshot.params['string']); + this.pdTrigerService.getPDReportHTML(encryptReportRandomString,this.startPD).subscribe(response=>{ + console.log("d",this.dataContainer) + this.dataContainer.nativeElement.innerHTML = response + console.log("data",this.dataContainer) + this.loadComponent=true + }) +} ngOnInit() { + // this.pdf_src="http://www.africau.edu/images/default/sample.pdf" + let encryptReportRandomString = atob(this.route.snapshot.params['string']); + // this.pdTrigerService.getPDReportPDFpreview(encryptReportRandomString,this.startPD,'').subscribe(response=>{ + + // }) this.listPDComponent.showListView(false); this.getPdReportDetails(); // this.getPdReportVersionList(); @@ -170,6 +179,7 @@ export class QcPdReportComponent implements OnInit { this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => { if (data.dataStatus) { this.notifier.notify('success', 'Done Successfully..!'); + this.ngOnInit(); // this.getPdReportVersionList(); } else { this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); @@ -191,6 +201,7 @@ export class QcPdReportComponent implements OnInit { // console.log(data.records); this.notifier.notify('success', 'Done Successfully..!'); this.getPdReportVersionList(); + this.ngOnInit(); } else { this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); } @@ -278,6 +289,7 @@ export class QcPdReportComponent implements OnInit { // console.log('else',this.generateBtn); this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); } + this.getHTMLPDReport() }, err => { this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); // alert(err.html_format); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts index 2d3d01302..d1b08741d 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-start/qc-start.component.ts @@ -145,7 +145,7 @@ export class QcStartComponent implements OnInit, OnDestroy { // load pd status change dialogue pdStatusDialogue(status: string): void { const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { - data: { pdid: this.startPD, pd_status: status }, + data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString }, disableClose: true, minWidth:'30%', maxWidth:'40%', diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts index 9290b41bd..0fd9ffcee 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts @@ -17,6 +17,7 @@ import { InitiateAdditionalPdComponent } from './../../../personal-discussion/ma import {QcStartComponent} from '../qc-start/qc-start.component' import {DatePipe } from '@angular/common'; + @Component({ selector: 'app-qc-view', templateUrl: './qc-view.component.html', @@ -79,6 +80,8 @@ export class QcViewComponent implements OnInit, OnDestroy { let masterData: any = data.records.pd_master_details; this.pdMasterData.push(masterData[0]); this.reportRandomString = btoa(masterData[0].random_string); + let parent_pd_id=masterData[0].parent_pd_id + localStorage.setItem('parent_pd_id_for_Genie',parent_pd_id); this.pd_QC_Rating = Number(this.pdMasterData.qc_rating); this.pdApplicantData= data.records.applicants_details; this.pdApplicantData = this.pdApplicantData.filter(appt => appt.applicant_type != 2); diff --git a/ng6-seed/src/app/quality-check/qc-service/qc.service.ts b/ng6-seed/src/app/quality-check/qc-service/qc.service.ts index 6ea301565..e213f132c 100755 --- a/ng6-seed/src/app/quality-check/qc-service/qc.service.ts +++ b/ng6-seed/src/app/quality-check/qc-service/qc.service.ts @@ -156,6 +156,8 @@ export class QcService { editData.pd_status = status; editData.fk_updatedby = this._aws.getlocale(); editData.random_string = randomString; + let parent_pd_id=localStorage.getItem('parent_pd_id_for_Genie') + editData.parent_pd_id=parent_pd_id; // editData.updatedon = currentdate; return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) @@ -374,6 +376,8 @@ export class QcService { // pd review status update details pdReviewStatusUpdate(editData: any): Observable { editData.fk_updatedby = this._aws.getlocale(); + let parent_pd_id=localStorage.getItem('parent_pd_id_for_Genie') + editData.parent_pd_id=parent_pd_id; // editData.updatedon = currentdate; return this._http.post(this.apiUrl + "updatePDMaster", { records: editData }) diff --git a/ng6-seed/src/app/session/login/login.component.ts b/ng6-seed/src/app/session/login/login.component.ts index 84d550792..8461ede20 100755 --- a/ng6-seed/src/app/session/login/login.component.ts +++ b/ng6-seed/src/app/session/login/login.component.ts @@ -137,10 +137,10 @@ const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword
- + - Passwords do not math. + Passwords do not match.
diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.html new file mode 100644 index 000000000..3c383a095 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.html @@ -0,0 +1,12 @@ +
+ + + + +
+ + +
+
+
diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.spec.ts new file mode 100644 index 000000000..c2a2367db --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityDescriptionComponent } from './entity-description.component'; + +describe('EntityDescriptionComponent', () => { + let component: EntityDescriptionComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityDescriptionComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityDescriptionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.ts new file mode 100644 index 000000000..3df7422e0 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-description/entity-description.component.ts @@ -0,0 +1,63 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { EntityService } from 'app/settings/service/entity/entity.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-entity-description', + templateUrl: './entity-description.component.html', + styleUrls: ['./entity-description.component.scss'] +}) +export class EntityDescriptionComponent implements OnInit { +@Input() entityId:number +private notifier: NotifierService; +entity_disclaimer:FormGroup; + constructor(notifier:NotifierService,private _fb:FormBuilder,private entityService:EntityService) { + this.notifier=notifier + + } + + ngOnInit() { + this.getDisclaimer() + this.entity_disclaimer=this._fb.group({ + disclaimer:[''], + entity_disclaimer_id:[''], + // fk_entity_id:[''], + fk_createdby:[''] + }) + console.log(this.entityId) + } + getDisclaimer(){ + this.entityService.getEntityDisclaimer(this.entityId).subscribe(response=>{ + // if(response['dataStatus']){ + let data=response['records'] + this.entity_disclaimer=this._fb.group({ + entity_disclaimer_id:[data ? data.entity_disclaimer_id : ''], + disclaimer:[data ? data.disclaimer : '',Validators.compose([Validators.required])], + // fk_entity_id:[this.entityId ], + fk_createdby:[data ? data.fk_createdby : ''], + + }) + // } + }) + } + onSubmit(){ + if(this.entity_disclaimer.invalid){ + this.notifier.notify('error',"Enter the Disclaimer"); + return; + } + let data=this.entity_disclaimer.value; + data.fk_entity_id=this.entityId; + this.entityService.saveEntityDisclaimer(data).subscribe(response=>{ + if(response['dataStatus']){ + this.getDisclaimer(); + this.notifier.notify('success','Disclaimer Saved Successfully..!'); + this.ngOnInit(); + } + else{ + this.notifier.notify("warning",response['msg']) + } + }) + } + +} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.html new file mode 100644 index 000000000..1b1eb11a2 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.html @@ -0,0 +1,38 @@ + +
+
+ + +
+
+ + + Institution Name is Required.! + + + + + Email is Required.! + Email must include '@' and '.' symbol + + +
+ + + +
+
+
+
+
+
+
+ + + + +
+
diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.spec.ts new file mode 100644 index 000000000..488259548 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityFinancialInstitutionComponent } from './entity-financial-institution.component'; + +describe('EntityFinancialInstitutionComponent', () => { + let component: EntityFinancialInstitutionComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityFinancialInstitutionComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityFinancialInstitutionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.ts new file mode 100644 index 000000000..b87657524 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-financial-institution/entity-financial-institution.component.ts @@ -0,0 +1,108 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { NotifierService } from 'angular-notifier'; +import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms'; +import { AwsService } from 'app/AwsService/aws.service'; +import { EntityService } from 'app/settings/service/entity/entity.service'; + +@Component({ + selector: 'app-entity-financial-institution', + templateUrl: './entity-financial-institution.component.html', + styleUrls: ['./entity-financial-institution.component.scss'] +}) +export class EntityFinancialInstitutionComponent implements OnInit { +@Input () public entityId:number +private notifier: NotifierService; +_addFinInstitution:FormGroup + user_id: any; + finInstitutionValue: any=[]; + + constructor(notifier:NotifierService,private _fb:FormBuilder,private awsService:AwsService, + private entityService:EntityService) { + this.notifier=notifier + this.user_id=this.awsService.getlocale() + } + get getinstitutionArray() { return this._addFinInstitution.controls['institution_array']; } + + ngOnInit() { + this._addFinInstitution=this._fb.group({ + institution_array:this._fb.array([]) + }) + this.getFinancialInstitution() + } + getFinancialInstitution(){ + this.entityService.getEntityFinInstitutions(this.entityId).subscribe(response=>{ + if(response['dataStatus']){ + this.finInstitutionValue=response['records'] + if(this.finInstitutionValue.length > 0){ + const control=this._addFinInstitution.controls['institution_array'] + this.finInstitutionValue.forEach(value=>{ + control.push(this.initInstitution(value)) + }) + } + } + }) + } + + initInstitution(data){ + if(data == null) + return this._fb.group({ + entity_fin_institution_id:[''], + institute_name:['',Validators.compose([Validators.required])], + institute_email:['',Validators.compose([Validators.required,Validators.email])], + fk_createdby:[this.user_id], + fk_updatedby:[this.user_id], + fk_entity_id:[this.entityId], + isactive:[1] + }) + else if(data != null) + return this._fb.group({ + entity_fin_institution_id:[data.entity_fin_institution_id], + institute_name:[data.institute_name,Validators.compose([Validators.required])], + institute_email:[data.institute_email,Validators.compose([Validators.required,Validators.email])], + fk_createdby:[data.fk_createdby], + fk_updatedby:[data.fk_updatedby], + fk_entity_id:[data.fk_entity_id], + isactive:[data.isactive] + }) + } + + addOneInstitution(){ + const control=this._addFinInstitution.controls['institution_array'] + control.push(this.initInstitution(null)) + } + + deleteOneInstitution(index){ + const control=this._addFinInstitution.controls['institution_array'] + if(control.controls[index].value['entity_fin_institution_id'] != null){ + this._addFinInstitution.controls['institution_array']['controls'][index].controls.isactive.setValue("0"); + } + else{ + control.removeAt(index); + } + + } + updateUser(control){ + control.controls.fk_updatedby.setValue(this.user_id); + + } + onSubmit(){ + if(this._addFinInstitution.invalid){ + this.notifier.notify("error","Please Fill all the Fields") + return + } + this.entityService.saveEntityFinInstitutions(this._addFinInstitution.value.institution_array).subscribe(res=>{ + if(res['dataStatus']){ + this.notifier.notify("success","Saved Successfully..!!") + } + else{ + this.notifier.notify("error","Something went wrong"); + } + }) + + } + reset(): void { + // this.listOfBranch = []; + this.ngOnInit(); +} + +} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.html new file mode 100644 index 000000000..f7cfadd1b --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.html @@ -0,0 +1,34 @@ +
+
+ + Products + + Select All + {{option.product_name}} + + + + + Customer Segments + + Select All + {{option.customer_segment}} + + + + + PD Types + + Select All + {{option.type_name}} + + + +
+
+ + + + +
+
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.spec.ts new file mode 100644 index 000000000..727c770a9 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityOtherPreferenceComponent } from './entity-other-preference.component'; + +describe('EntityOtherPreferenceComponent', () => { + let component: EntityOtherPreferenceComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityOtherPreferenceComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityOtherPreferenceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.ts new file mode 100644 index 000000000..d283c03f1 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-other-preference/entity-other-preference.component.ts @@ -0,0 +1,101 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { FormGroup, FormBuilder } from '@angular/forms'; +import { EntityService } from 'app/settings/service/entity/entity.service'; +import { NotifierService } from 'angular-notifier'; +import { AwsService } from 'app/AwsService/aws.service'; + +@Component({ + selector: 'app-entity-other-preference', + templateUrl: './entity-other-preference.component.html', + styleUrls: ['./entity-other-preference.component.scss'] +}) +export class EntityOtherPreferenceComponent implements OnInit { + @Input() public entityId:number + _otherPreferenceForm:FormGroup + notifier:NotifierService + productList: any=[]; + selectedAll:any={products:false,customer_segments:false,pd_types:false} + customerSegmentList: any=[]; + pdTypeList: any=[]; + users:string; + constructor(private entityService:EntityService,private _fb:FormBuilder,notifier:NotifierService,private awsService:AwsService) { + this.notifier=notifier + this.users=this.awsService.getlocale() + } + + ngOnInit() { + this.getDropdownValues() + this._otherPreferenceForm=this._fb.group({ + products:[''], + customer_segments:[''], + pd_types:[''], + fk_entity_id:[this.entityId], + fk_createdby:[this.users], + fk_updatedby:[this.users] + }) + this.getvalueFromApi() + } + getvalueFromApi(){ + this.entityService.getEntityOtherPreferences(this.entityId).subscribe(res=>{ + if(res['dataStatus']){ + this._otherPreferenceForm.patchValue(res['records']) + } + }) + } + getDropdownValues(){ + this.entityService.getListOfProducts().subscribe(res=>{ + if(res['dataStatus']){ + this.productList=res['records'] + } + }) + this.entityService.getListOfCustomerSegments().subscribe(res=>{ + if(res['dataStatus']){ + this.customerSegmentList=res['records'] + } + }) + this.entityService.getListOfPDAllocationTypes().subscribe(res=>{ + if(res['dataStatus']){ + this.pdTypeList=res['records'].pd_type + } + }) + + } + selectAll(option){ + console.log(this.selectedAll) + console.log(option) + if(this.selectedAll[option] == false){ + this.selectedAll[option] = true + if(option == 'products'){ + console.log(this.productList.map(item=>item.product_id)) + this._otherPreferenceForm.controls['products'].patchValue(this.productList.map(item=>item.product_id)) + } + if(option == "customer_segments"){ + this._otherPreferenceForm.controls['customer_segments'].patchValue(this.customerSegmentList.map(item=>item.customer_segment_id)) + } + if(option == "pd_types"){ + this._otherPreferenceForm.controls['pd_types'].patchValue(this.pdTypeList.map(item=>item.pd_type_id)) + } + } + else{ + this._otherPreferenceForm.controls[option].patchValue('') + this.selectedAll[option]=false + } + } + get getForm() { return this._otherPreferenceForm.controls; } + + onSubmit(){ + console.log(this._otherPreferenceForm.value) + let records=this._otherPreferenceForm.value + records.fk_updatedby=this.users + this.entityService.saveEntityOtherPreferences(records).subscribe(res=>{ + if(res['dataStatus']){ + this.notifier.notify("success","Saved Successfully..!"); + } + else{ + this.notifier.notify("error","Something went wron Try again"); + } + }) + + } + +} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html index 56af9ab52..ac8cd8dd3 100755 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html @@ -270,6 +270,24 @@ + + + + + + + + + + + + + + + + + +