From 0068b7bd0f16b1c42eb3feb393d520f29f952d80 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Mon, 24 Dec 2018 19:33:59 +0530 Subject: [PATCH 1/4] pd , QC complete report ratings get : kdk --- .../pd-report/pd-report.component.html | 13 +-- .../list-pd/pd-report/pd-report.component.ts | 23 ++++- .../qc-review/qc-review.component.html | 23 +++++ .../qc-review/qc-review.component.scss | 0 .../qc-review/qc-review.component.spec.ts | 25 ++++++ .../qc-review/qc-review.component.ts | 87 +++++++++++++++++++ .../manage-pd/manage-pd.module.ts | 7 +- .../pd-service/pd-triger.service.ts | 17 ++++ .../app/shared/rating/rating.component.html | 16 ++++ .../app/shared/rating/rating.component.scss | 42 +++++++++ .../shared/rating/rating.component.spec.ts | 25 ++++++ .../src/app/shared/rating/rating.component.ts | 25 ++++++ ng6-seed/src/app/shared/shared.module.ts | 7 +- 13 files changed, 297 insertions(+), 13 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts create mode 100644 ng6-seed/src/app/shared/rating/rating.component.html create mode 100644 ng6-seed/src/app/shared/rating/rating.component.scss create mode 100644 ng6-seed/src/app/shared/rating/rating.component.spec.ts create mode 100644 ng6-seed/src/app/shared/rating/rating.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html index 946913656..12865496c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html @@ -56,7 +56,7 @@ short_text - + - +
- -
+ {{qcStatus}} +
- + *ngIf="latestPDDetails.is_latest == 1 && qcStatus !== 'QC_COMPLETED'" (click)="addNewQuestion()">edit +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts index 83f222a13..d7ad19799 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts @@ -10,6 +10,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material"; import { ModelEditPdReportComponent} from './model-edit-pd-report/model-edit-pd-report.component'; +import { QcReviewComponent } from './qc-review/qc-review.component'; /**sweet alert */ // import Swal from 'sweetalert2'; @@ -117,12 +118,14 @@ export class PdReportComponent implements OnInit { }) } + public qcStatus: string = ''; getPdReportVersionList(){ this.pdTrigerService.getPdDocVersionList(this.startPD).subscribe(data => { if(data.status == 200 && data.dataStatus){ - this.pdReportVersionList = [...data.records].reverse(); + this.pdReportVersionList = [...data.records.reports_urls].reverse(); let datas = this.pdReportVersionList.filter((a)=>{return a.is_latest == 1;}) this.latestPDDetails = datas[0]; + this.qcStatus = data.records.pdstatus; // alert(JSON.stringify(this.latestPDDetails)); this.reGenerateBtn = true; } else { @@ -174,6 +177,22 @@ export class PdReportComponent implements OnInit { console.log(this.latestPDDetails); } + + + reportReview(): void { + const dialogRef = this.dialog.open(QcReviewComponent, { + data: { startId : this.startPD }, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.getPdReportFinalTemplateDetails(); + // this.getQuestionsMasters(); + // this.getBranch(); + // this.isPopupOpened = false; + }); + } + changeDocumentEdit() : void{ @@ -200,8 +219,6 @@ export class PdReportComponent implements OnInit { } else { } }); - - // Swal('User Created'); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html new file mode 100644 index 000000000..c67d819ea --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html @@ -0,0 +1,23 @@ +

QC Completed Review

+ + +
+
+
+ + Remarks + + +
+
+ +
+
+
+
+ + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts new file mode 100644 index 000000000..0d0b84d1e --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { QcReviewComponent } from './qc-review.component'; + +describe('QcReviewComponent', () => { + let component: QcReviewComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ QcReviewComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QcReviewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts new file mode 100644 index 000000000..e87e9c5a0 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts @@ -0,0 +1,87 @@ +import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { PdTrigerService } from '../../../../pd-service/pd-triger.service'; +import { NotifierService } from "angular-notifier"; + + +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material'; + +@Component({ + selector: 'app-qc-review', + templateUrl: './qc-review.component.html', + styleUrls: ['./qc-review.component.scss'] +}) +export class QcReviewComponent implements OnInit { + + @Input() questionId: number; + ngForm: FormGroup; + recordData: any; + showForm: Boolean; +/** + * Notifier service + */ + private notifier: NotifierService; + constructor( private _formBuilder: FormBuilder, + private pdTrigerService: PdTrigerService, + notifier: NotifierService , + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier = notifier; + + // this.mycontent = `

My html content

`; + } + + ngOnInit() { + this.getQcCompleteReviewStatus(); + } + + getQcCompleteReviewStatus() { + this.pdTrigerService.getQCReportFinalReviewDetails(this.data.startId, "QC").subscribe(data => { + if(data['dataStatus']){ + this.recordData = data.records[0]; + this.ngForm = this._formBuilder.group({ + qc_remarks: [this.recordData.qc_remarks], + qc_rating: [Number(this.recordData.qc_rating)], + pd_status: [this.recordData.pd_status], + }) + this.showForm = true; + } + },err => { + + }); + } + + onChange($event: any): void { + console.log('onChange'); + // this.log += new Date() + "
"; + } + + myClick(): void { + let template = this.ngForm.value; + template.pd_id = this.data.startId; + console.log(JSON.stringify(template)); + this.pdTrigerService.pdReviewStatusUpdate(template).subscribe(data=>{ + this.notifier.notify('success', 'Your Changes Updated.!'); + this.dialogRef.close(); + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + }) + } + + + + // ============================= + + ratingClicked: number; + itemIdRatingClicked: string; + rating : number = 1; + + ratingComponentClick(e){ + this.ngForm.controls.qc_rating.setValue(e.rating); + } +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 12285e2ba..64756a67c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -87,6 +87,8 @@ import { NgxViewerModule } from 'ngx-viewer'; import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/final-remarks.component'; import { BusinessOtherFamilyMemberComponent } from './list-pd/start-pd/forms/dialogue/business-other-family-member/business-other-family-member.component'; +import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.component'; +import { SharedModule } from "app/shared/shared.module"; /** * Custom angular notifier options @@ -264,7 +266,7 @@ const pdCustomNotifierOptions: NotifierOptions = { // AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule, // OwlNativeDateTimeModule, // ], - declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent], + declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent], // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], // providers: [PdTrigerService, GetGeometricLocationService], @@ -273,6 +275,7 @@ const pdCustomNotifierOptions: NotifierOptions = { CommonModule, ManagePdRoutingModule, NgxViewerModule, + SharedModule, NotifierModule.withConfig(pdCustomNotifierOptions), CKEditorModule, PdfViewerModule, @@ -307,7 +310,7 @@ const pdCustomNotifierOptions: NotifierOptions = { {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent, - ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent], + ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent], }) export class ManagePdModule { 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 0cec83e9f..89b00f4b7 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 @@ -331,6 +331,23 @@ getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable{ ) } + getQCReportFinalReviewDetails(pd_id: any, flag : string ): Observable{ + return this._http.post(this.apiUrl+"getQCLenderRemarks", {"records": { "pd_id" : pd_id, "flag" :flag }}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // pd review status update details + pdReviewStatusUpdate(editData: any): Observable { + editData.fk_updatedby = this._aws.getlocale(); + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl + "updatePDMaster", {records: editData}) + + .pipe( + catchError(this.handleError('operation', [])) + ) + } // inWords(num) { diff --git a/ng6-seed/src/app/shared/rating/rating.component.html b/ng6-seed/src/app/shared/rating/rating.component.html new file mode 100644 index 000000000..06bae631d --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.html @@ -0,0 +1,16 @@ +
+ + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/shared/rating/rating.component.scss b/ng6-seed/src/app/shared/rating/rating.component.scss new file mode 100644 index 000000000..64db81cb4 --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.scss @@ -0,0 +1,42 @@ + +.rating { + float:left; +} + +.rating:not(:checked) > input { + position:absolute; + top:-9999px; + clip:rect(0,0,0,0); +} + +.rating:not(:checked) > label { + float:right; + width:1em; + padding:0.1em; + overflow:hidden; + white-space:nowrap; + cursor:pointer; + font-size:200%; + line-height:1.2; + color:#ddd; +} + +.rating:not(:checked) > label:before { + content: '★ '; +} + +.rating > input:checked ~ label { + color: #f70; +} + +.rating:not(:checked) > label:hover, +.rating:not(:checked) > label:hover ~ label { + color: gold; +} + + +.rating > input:checked ~ label:hover, +.rating > input:checked ~ label:hover ~ label, +.rating > label:hover ~ input:checked ~ label { + color: #ea0; +} \ No newline at end of file diff --git a/ng6-seed/src/app/shared/rating/rating.component.spec.ts b/ng6-seed/src/app/shared/rating/rating.component.spec.ts new file mode 100644 index 000000000..1460c9ec6 --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RatingComponent } from './rating.component'; + +describe('RatingComponent', () => { + let component: RatingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RatingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RatingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/shared/rating/rating.component.ts b/ng6-seed/src/app/shared/rating/rating.component.ts new file mode 100644 index 000000000..5c6eed26a --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.ts @@ -0,0 +1,25 @@ +import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-rating', + templateUrl: './rating.component.html', + styleUrls: ['./rating.component.scss'] +}) +export class RatingComponent implements OnInit { + @Input() rating: number; + @Input() itemId: number; + @Output() ratingClick: EventEmitter = new EventEmitter(); + + inputName: string; + ngOnInit() { + this.inputName = this.itemId + '_rating'; + } + onClick(rating: number): void { + this.rating = rating; + this.ratingClick.emit({ + itemId: this.itemId, + rating: rating + }); + } + +} diff --git a/ng6-seed/src/app/shared/shared.module.ts b/ng6-seed/src/app/shared/shared.module.ts index 9dbf91116..cc6a4cb68 100755 --- a/ng6-seed/src/app/shared/shared.module.ts +++ b/ng6-seed/src/app/shared/shared.module.ts @@ -4,19 +4,22 @@ import { MenuItems } from './menu-items/menu-items'; import { HorizontalMenuItems } from './menu-items/horizontal-menu-items'; import { AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective } from './accordion'; import { ToggleFullscreenDirective } from './fullscreen/toggle-fullscreen.directive'; +import { RatingComponent} from './rating/rating.component'; @NgModule({ declarations: [ AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective, - ToggleFullscreenDirective + ToggleFullscreenDirective, + RatingComponent ], exports: [ AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective, - ToggleFullscreenDirective + ToggleFullscreenDirective, + RatingComponent ], providers: [ MenuItems, HorizontalMenuItems ] }) From 62f354fd4aff1127e00d628c9aea54323a818c18 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 24 Dec 2018 19:45:30 +0530 Subject: [PATCH 2/4] business form changes --- .../business-info.component.html | 234 +++++++++++++++++- .../business-info.component.scss | 3 + .../business-info/business-info.component.ts | 85 ++++++- 3 files changed, 309 insertions(+), 13 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html index f25950d8d..2c8b9bc4f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html @@ -249,10 +249,10 @@ Within India Export - + Both - +
@@ -283,7 +283,7 @@
- +
@@ -305,6 +305,58 @@
+ + + + + +
+ + + + {{SL.state_name}} + + + + + + {{CL.city_name}} + + + + + + +
+
+ +
+ + + + + + + + + +
+
+
+ +
@@ -337,10 +389,10 @@ Within India Export - + Both - +
@@ -371,7 +423,7 @@
- +
@@ -394,6 +446,59 @@
+ + + + + +
+ + + + {{SL.state_name}} + + + + + + {{CL.city_name}} + + + + + + +
+
+ +
+ + + + + + + + + +
+
+
+ +
+ @@ -425,10 +530,10 @@ Within India Export - + Both - +
@@ -459,7 +564,7 @@
- +
@@ -481,6 +586,58 @@
+ + + + + +
+ + + + {{SL.state_name}} + + + + + + {{CL.city_name}} + + + + + + +
+
+ +
+ + + + + + + + + +
+
+
+ +
@@ -513,10 +670,10 @@ Within India Export - + Both - +
@@ -547,7 +704,7 @@
- +
@@ -569,6 +726,59 @@
+ + + + + +
+ + + + {{SL.state_name}} + + + + + + {{CL.city_name}} + + + + + + + +
+
+ +
+ + + + + + + + + +
+
+
+ +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.scss index 647e45ba4..a656a6bd9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.scss @@ -132,4 +132,7 @@ mat-header-cell mat-cell { .example-margin { margin: 0 10px; } + .tab_class { + margin-top: 3%; + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index 19d62f38a..520dec67e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -247,6 +247,19 @@ export class BusinessInfoComponent implements OnInit { innercontrol.push(this.createCountrySale()) }); } + else if(element.area_of_sale=='Both'){ + manufacturingControl.controls[index].addControl('india_where_sale_done', this.fb.array([])); + element.india_where_sale_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = manufacturingControl.controls[index].get('india_where_sale_done') as FormArray; + innercontrol.push(this.createStateSale()) + }); + manufacturingControl.controls[index].addControl('countries_where_export_done', this.fb.array([])); + element.countries_where_export_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = manufacturingControl.controls[index].get('countries_where_export_done') as FormArray; + innercontrol.push(this.createCountrySale()) + }); + + } }); businessVal.manufacturing_activity_details=selectedManufacturing; } @@ -280,6 +293,18 @@ export class BusinessInfoComponent implements OnInit { innercontrol.push(this.createCountrySale()) }); } + else if(element.area_of_sale=='Both'){ + retailControl.controls[index].addControl('india_where_sale_done', this.fb.array([])); + element.india_where_sale_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray; + innercontrol.push(this.createStateSale()) + }); + retailControl.controls[index].addControl('countries_where_export_done', this.fb.array([])); + element.countries_where_export_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = retailControl.controls[index].get('countries_where_export_done') as FormArray; + innercontrol.push(this.createCountrySale()) + }); + } }); businessVal.retail_trading_activity_details=selectedRetail; } @@ -314,6 +339,19 @@ export class BusinessInfoComponent implements OnInit { innercontrol.push(this.createCountrySale()) }); } + else if(element.area_of_sale=='Both'){ + wholesaleControl.controls[index].addControl('india_where_sale_done', this.fb.array([])); + element.india_where_sale_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray; + innercontrol.push(this.createStateSale()) + }); + wholesaleControl.controls[index].addControl('countries_where_export_done', this.fb.array([])); + element.countries_where_export_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = wholesaleControl.controls[index].get('countries_where_export_done') as FormArray; + innercontrol.push(this.createCountrySale()) + }); + } + }); businessVal.wholesale_trading_activity_details=selectedWholesale; } @@ -348,6 +386,18 @@ export class BusinessInfoComponent implements OnInit { innercontrol.push(this.createCountrySale()) }); } + else if(element.area_of_sale=='Both'){ + serviceProviderControl.controls[index].addControl('india_where_sale_done', this.fb.array([])); + element.india_where_sale_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray; + innercontrol.push(this.createStateSale()) + }); + serviceProviderControl.controls[index].addControl('countries_where_export_done', this.fb.array([])); + element.countries_where_export_done.forEach((innerElement,innerIndex) => { + let innercontrol:any = serviceProviderControl.controls[index].get('countries_where_export_done') as FormArray; + innercontrol.push(this.createCountrySale()) + }); + } }); businessVal.service_provider_activity_details=selectedService; } @@ -566,12 +616,20 @@ export class BusinessInfoComponent implements OnInit { if(getDetails.value.area_of_sale=="Within India"){ control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); } else if(getDetails.value.area_of_sale=="Export"){ + control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); } + else if(getDetails.value.area_of_sale=="Both") { + control.controls[getIndex].removeControl('india_where_sale_done'); + control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); + control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); + } } // change retail options @@ -580,10 +638,18 @@ export class BusinessInfoComponent implements OnInit { if(getDetails.value.area_of_sale=="Within India"){ control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); } else if(getDetails.value.area_of_sale=="Export"){ + control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].removeControl('india_where_sale_done'); + control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); + } + else if(getDetails.value.area_of_sale=="Both"){ + control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('india_where_sale_done'); + control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); } } @@ -594,12 +660,20 @@ export class BusinessInfoComponent implements OnInit { if(getDetails.value.area_of_sale=="Within India"){ control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); } else if(getDetails.value.area_of_sale=="Export"){ + control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); } + else if(getDetails.value.area_of_sale=="Both"){ + control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].removeControl('india_where_sale_done'); + control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); + control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); + } } // change service provider changeServiceArea(getDetails: any, getIndex) { @@ -607,11 +681,19 @@ export class BusinessInfoComponent implements OnInit { if(getDetails.value.area_of_sale=="Within India"){ control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); } else if(getDetails.value.area_of_sale=="Export"){ + control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('india_where_sale_done'); - control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createCountrySale()])); + control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); + } + else if(getDetails.value.area_of_sale=="Both"){ + control.controls[getIndex].removeControl('countries_where_export_done'); + control.controls[getIndex].removeControl('india_where_sale_done'); + control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()])); + control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); } } @@ -715,6 +797,7 @@ export class BusinessInfoComponent implements OnInit { control = control.controls[windex].get('countries_where_export_done') as FormArray; control.push(this.createCountrySale()) } + } // remove for whole sale removeWholesaleState(mindex,sindex,type) { From 9df9e3d2a5d5a6e3b044cf4d4562d5e359c7fb67 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 24 Dec 2018 19:46:19 +0530 Subject: [PATCH 3/4] merge : kms --- .../pd-report/pd-report.component.html | 13 ++- .../list-pd/pd-report/pd-report.component.ts | 23 +++- .../qc-review/qc-review.component.html | 23 ++++ .../qc-review/qc-review.component.scss | 0 .../qc-review/qc-review.component.spec.ts | 25 ++++ .../qc-review/qc-review.component.ts | 87 ++++++++++++++ .../forms/address/address.component.html | 24 ++-- .../forms/address/address.component.ts | 13 +++ .../assets-info/assets-info.component.html | 76 ++++++------ .../assets-info/assets-info.component.ts | 98 ++++++++-------- .../current-loan/current-loan.component.html | 64 ++++++----- .../current-loan/current-loan.component.ts | 33 ++++-- .../family-details.component.html | 12 +- .../family-details.component.ts | 10 +- .../financial-info.component.html | 91 ++++++++------- .../financial-info.component.ts | 48 ++++---- .../other-income/other-income.component.ts | 2 +- .../start-pd/forms/stock/stock.component.html | 108 +++++++++--------- .../list-pd/start-pd/start-pd.component.html | 13 ++- .../list-pd/start-pd/start-pd.component.scss | 9 ++ .../manage-pd/manage-pd.module.ts | 7 +- .../pd-service/pd-triger.service.ts | 17 +++ .../app/shared/rating/rating.component.html | 16 +++ .../app/shared/rating/rating.component.scss | 42 +++++++ .../shared/rating/rating.component.spec.ts | 25 ++++ .../src/app/shared/rating/rating.component.ts | 25 ++++ ng6-seed/src/app/shared/shared.module.ts | 7 +- 27 files changed, 617 insertions(+), 294 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts create mode 100644 ng6-seed/src/app/shared/rating/rating.component.html create mode 100644 ng6-seed/src/app/shared/rating/rating.component.scss create mode 100644 ng6-seed/src/app/shared/rating/rating.component.spec.ts create mode 100644 ng6-seed/src/app/shared/rating/rating.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html index 946913656..12865496c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html @@ -56,7 +56,7 @@ short_text - + - +
- -
+ {{qcStatus}} +
- + *ngIf="latestPDDetails.is_latest == 1 && qcStatus !== 'QC_COMPLETED'" (click)="addNewQuestion()">edit +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts index 83f222a13..d7ad19799 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts @@ -10,6 +10,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material"; import { ModelEditPdReportComponent} from './model-edit-pd-report/model-edit-pd-report.component'; +import { QcReviewComponent } from './qc-review/qc-review.component'; /**sweet alert */ // import Swal from 'sweetalert2'; @@ -117,12 +118,14 @@ export class PdReportComponent implements OnInit { }) } + public qcStatus: string = ''; getPdReportVersionList(){ this.pdTrigerService.getPdDocVersionList(this.startPD).subscribe(data => { if(data.status == 200 && data.dataStatus){ - this.pdReportVersionList = [...data.records].reverse(); + this.pdReportVersionList = [...data.records.reports_urls].reverse(); let datas = this.pdReportVersionList.filter((a)=>{return a.is_latest == 1;}) this.latestPDDetails = datas[0]; + this.qcStatus = data.records.pdstatus; // alert(JSON.stringify(this.latestPDDetails)); this.reGenerateBtn = true; } else { @@ -174,6 +177,22 @@ export class PdReportComponent implements OnInit { console.log(this.latestPDDetails); } + + + reportReview(): void { + const dialogRef = this.dialog.open(QcReviewComponent, { + data: { startId : this.startPD }, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.getPdReportFinalTemplateDetails(); + // this.getQuestionsMasters(); + // this.getBranch(); + // this.isPopupOpened = false; + }); + } + changeDocumentEdit() : void{ @@ -200,8 +219,6 @@ export class PdReportComponent implements OnInit { } else { } }); - - // Swal('User Created'); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html new file mode 100644 index 000000000..c67d819ea --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html @@ -0,0 +1,23 @@ +

QC Completed Review

+ + +
+
+
+ + Remarks + + +
+
+ +
+
+
+
+ + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts new file mode 100644 index 000000000..0d0b84d1e --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { QcReviewComponent } from './qc-review.component'; + +describe('QcReviewComponent', () => { + let component: QcReviewComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ QcReviewComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QcReviewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts new file mode 100644 index 000000000..e87e9c5a0 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts @@ -0,0 +1,87 @@ +import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { PdTrigerService } from '../../../../pd-service/pd-triger.service'; +import { NotifierService } from "angular-notifier"; + + +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material'; + +@Component({ + selector: 'app-qc-review', + templateUrl: './qc-review.component.html', + styleUrls: ['./qc-review.component.scss'] +}) +export class QcReviewComponent implements OnInit { + + @Input() questionId: number; + ngForm: FormGroup; + recordData: any; + showForm: Boolean; +/** + * Notifier service + */ + private notifier: NotifierService; + constructor( private _formBuilder: FormBuilder, + private pdTrigerService: PdTrigerService, + notifier: NotifierService , + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier = notifier; + + // this.mycontent = `

My html content

`; + } + + ngOnInit() { + this.getQcCompleteReviewStatus(); + } + + getQcCompleteReviewStatus() { + this.pdTrigerService.getQCReportFinalReviewDetails(this.data.startId, "QC").subscribe(data => { + if(data['dataStatus']){ + this.recordData = data.records[0]; + this.ngForm = this._formBuilder.group({ + qc_remarks: [this.recordData.qc_remarks], + qc_rating: [Number(this.recordData.qc_rating)], + pd_status: [this.recordData.pd_status], + }) + this.showForm = true; + } + },err => { + + }); + } + + onChange($event: any): void { + console.log('onChange'); + // this.log += new Date() + "
"; + } + + myClick(): void { + let template = this.ngForm.value; + template.pd_id = this.data.startId; + console.log(JSON.stringify(template)); + this.pdTrigerService.pdReviewStatusUpdate(template).subscribe(data=>{ + this.notifier.notify('success', 'Your Changes Updated.!'); + this.dialogRef.close(); + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + }) + } + + + + // ============================= + + ratingClicked: number; + itemIdRatingClicked: string; + rating : number = 1; + + ratingComponentClick(e){ + this.ngForm.controls.qc_rating.setValue(e.rating); + } +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index f4a58047d..13cd38df4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -97,27 +97,29 @@
-
- +
+ Yes No - -
+
+
+
+
- - + + - - + + -
+
+
-
-
+ - + - + Yes No NA @@ -215,7 +215,7 @@
- +
@@ -223,7 +223,7 @@ + formControlName="business_name_of_the_owner" > {{owner.applicant_name}} @@ -238,7 +238,7 @@
- + {{relations.name}} @@ -343,7 +343,7 @@
- + {{ prop.name }} @@ -364,7 +364,7 @@
- +
@@ -378,7 +378,7 @@
- +
@@ -406,7 +406,7 @@
- +
@@ -421,33 +421,33 @@
- +
- + {{ freqn.name }}
- +
- +
@@ -463,7 +463,7 @@
- + {{ ins_type.name }} @@ -477,14 +477,14 @@
- +
- +
@@ -499,14 +499,14 @@
- + - + + formControlName="name_of_the_owner" > {{owner.applicant_name}} @@ -520,7 +520,7 @@
- + {{relations.name}} @@ -529,10 +529,10 @@
- + - + Yes No NA @@ -569,7 +569,7 @@
+ formControlName="name_of_the_owner" > {{owner.applicant_name}} @@ -584,7 +584,7 @@
- + {{relations.name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts index b4d11a7e7..90c350611 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts @@ -345,14 +345,14 @@ public m_investmentType = []; // Dynamic Form field creation Functionality : START ===> initDetails() { return this._formBuilder.group({ - assets_mode: ['', Validators.compose([Validators.required])], + assets_mode: [''], details: this._formBuilder.array([]), - approximate_market_value: ['', Validators.compose([])], - name_of_the_owner: ['', Validators.compose([])], + approximate_market_value: [''], + name_of_the_owner: [''], other_owner:[''], relation: [''], - // purchase_year: ['', Validators.compose([])], - //purchase_month: ['', Validators.compose([])], + // purchase_year: [''], + //purchase_month: [''], emi: [''], emi_paid: [''], original_loan_tenure: [''], @@ -363,14 +363,14 @@ public m_investmentType = []; initBusinessDetails(data) { return this._formBuilder.group({ - business_assets_mode: ['', Validators.compose([Validators.required])], + business_assets_mode: [''], business_details: this._formBuilder.array([]), - business_approximate_market_value: ['', Validators.compose([])], + business_approximate_market_value: [''], business_name_of_the_owner: [data], // other_owner:[''], // relation:[''], - // purchase_year: ['', Validators.compose([])], - //purchase_month: ['', Validators.compose([])], + // purchase_year: [''], + //purchase_month: [''], business_emi: [''], business_emi_paid: [''], business_original_loan_tenure: [''], @@ -458,26 +458,26 @@ public m_investmentType = []; loadProperty() { return this._formBuilder.group({ - property_type: ['', Validators.compose([Validators.required])], + property_type: [''], other_property_type: [''] }); } loadJwellDescription() { return this._formBuilder.group({ - jwell_description: ['', Validators.compose([])] + jwell_description: [''] }); } loadConsumerDurableDescription() { return this._formBuilder.group({ - consumer_durable_description: ['', Validators.compose([Validators.required])] + consumer_durable_description: [''] }); } otherAssetsDescription() { return this._formBuilder.group({ - any_other_assets: ['', Validators.compose([Validators.required])], + any_other_assets: [''], name_of_the_owner:[''], other_owner:[''], relation:[''], @@ -490,7 +490,7 @@ public m_investmentType = []; otherBusinessAssetsDescription() { return this._formBuilder.group({ - any_other_assets: ['', Validators.compose([Validators.required])], + any_other_assets: [''], any_other_asset_value : [''], any_other_asset_loan : [''], other_asset_emi_amt : [''] @@ -500,32 +500,32 @@ public m_investmentType = []; loadInsuranceDescription() { return this._formBuilder.group({ - //insurance_type: ['', Validators.compose([Validators.required])], - premium_paid: ['', Validators.compose([])], - frequency_mode: ['', Validators.compose([])], - sum_assured: ['', Validators.compose([])], - members_coverd: ['', Validators.compose([])] + //insurance_type: [''], + premium_paid: [''], + frequency_mode: [''], + sum_assured: [''], + members_coverd: [''] }); } loadInvestDescription() { return this._formBuilder.group({ - investments_type: ['', Validators.compose([])], + investments_type: [''], other_investments_type:[''], - amount_of_invest: ['', Validators.compose([])], - bank_name: ['', Validators.compose([])] + amount_of_invest: [''], + bank_name: [''] }); } load_Four_Weeler() { return this._formBuilder.group({ - manufacturer_model_four_weeler: ['', Validators.compose([])] + manufacturer_model_four_weeler: [''] }); } load_Two_Weeler() { return this._formBuilder.group({ - manufacturer_model_two_weeler: ['', Validators.compose([Validators.required])] + manufacturer_model_two_weeler: [''] }); } @@ -533,26 +533,26 @@ public m_investmentType = []; loadPropertyWithData(data) { return this._formBuilder.group({ - property_type: [data.property_type, Validators.compose([Validators.required])] + property_type: [data.property_type] //property_type:[''] }); } loadJwellDescriptionWithData(data) { return this._formBuilder.group({ - jwell_description: [data.jwell_description, Validators.compose([Validators.required])] + jwell_description: [data.jwell_description] }); } loadConsumerDurableDescriptionWithData(data) { return this._formBuilder.group({ - consumer_durable_description: [data.consumer_durable_description, Validators.compose([Validators.required])] + consumer_durable_description: [data.consumer_durable_description] }); } otherAssetsDescriptionWithData(data) { return this._formBuilder.group({ - any_other_assets: [data.any_other_assets, Validators.compose([Validators.required])], + any_other_assets: [data.any_other_assets], name_of_the_owner:[data.name_of_the_owner], other_owner:[data.other_owner], relation:[data.relation], @@ -564,7 +564,7 @@ public m_investmentType = []; otherBusinessAssetsDescriptionWithData(data) { return this._formBuilder.group({ - any_other_assets: [data.any_other_assets, Validators.compose([Validators.required])], + any_other_assets: [data.any_other_assets], any_other_asset_value : [data.any_other_asset_value], any_other_asset_loan : [data.any_other_asset_loan], other_asset_emi_amt : [data.other_asset_emi_amt] @@ -575,32 +575,32 @@ public m_investmentType = []; loadInsuranceDescriptionWithData(data) { return this._formBuilder.group({ - //insurance_type: [data.insurance_type, Validators.compose([Validators.required])], - premium_paid: [data.premium_paid, Validators.compose([Validators.required])], - frequency_mode: [data.frequency_mode, Validators.compose([Validators.required])], - sum_assured: [data.sum_assured, Validators.compose([Validators.required])], - members_coverd: [data.members_coverd, Validators.compose([Validators.required])] + //insurance_type: [data.insurance_type], + premium_paid: [data.premium_paid], + frequency_mode: [data.frequency_mode], + sum_assured: [data.sum_assured], + members_coverd: [data.members_coverd] }); } loadInvestDescriptionWithData(data) { return this._formBuilder.group({ - investments_type: [data.investments_type, Validators.compose([Validators.required])], + investments_type: [data.investments_type], other_investments_type : [data.other_investments_type], - amount_of_invest: [data.amount_of_invest, Validators.compose([Validators.required])], - bank_name: [data.bank_name, Validators.compose([Validators.required])] + amount_of_invest: [data.amount_of_invest], + bank_name: [data.bank_name] }); } load_Four_WeelerWithData(data) { return this._formBuilder.group({ - manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler, Validators.compose([Validators.required])] + manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler] }); } load_Two_WeelerWithData(data) { return this._formBuilder.group({ - manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler, Validators.compose([Validators.required])] + manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler] }); } @@ -608,14 +608,14 @@ public m_investmentType = []; initDetailsWithdata(data) { return this._formBuilder.group({ - assets_mode: [data.assets_mode, Validators.compose([Validators.required])], + assets_mode: [data.assets_mode], details: this._formBuilder.array([]), - approximate_market_value: [data.approximate_market_value, Validators.compose([])], - name_of_the_owner: [data.name_of_the_owner, Validators.compose([])], + approximate_market_value: [data.approximate_market_value], + name_of_the_owner: [data.name_of_the_owner], other_owner:[data.other_owner || ''], relation: [data.relation || ''], - // purchase_year: [data.purchase_year, Validators.compose([])], - // purchase_month: [data.purchase_month, Validators.compose([])], + // purchase_year: [data.purchase_year], + // purchase_month: [data.purchase_month], emi: [data.emi || 0], emi_paid: [data.emi_paid || ''], original_loan_tenure: [data.original_loan_tenure || ''], @@ -625,14 +625,14 @@ public m_investmentType = []; } initBusinessDetailsWithdata(data) { return this._formBuilder.group({ - business_assets_mode: [data.business_assets_mode, Validators.compose([Validators.required])], + business_assets_mode: [data.business_assets_mode], business_details: this._formBuilder.array([]), - business_approximate_market_value: [data.business_approximate_market_value, Validators.compose([])], - business_name_of_the_owner: [data.business_name_of_the_owner, Validators.compose([])], + business_approximate_market_value: [data.business_approximate_market_value], + business_name_of_the_owner: [data.business_name_of_the_owner], // other_owner:[data.other_owner || ''], // relation: [data.relation || ''], - // purchase_year: [data.purchase_year, Validators.compose([])], - // purchase_month: [data.purchase_month, Validators.compose([])], + // purchase_year: [data.purchase_year], + // purchase_month: [data.purchase_month], business_emi: [data.business_emi || 0], business_emi_paid: [data.business_emi_paid || ''], business_original_loan_tenure: [data.business_original_loan_tenure || ''], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index b4154fdeb..cd2bf8ef3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -22,7 +22,7 @@ + formControlName="existing_loan" > Yes No @@ -38,45 +38,51 @@ - + + formControlName="frequency" > {{freq.name}} - + - + + {{types.loan_type_name}} + + + + + - + {{owner.applicant_name}} - Others + - - + + - + {{ btLen.lender_name }} - + - + - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts index 5f32b8ba6..a90c465d5 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts @@ -577,11 +577,11 @@ export class FamilyDetailsComponent implements OnInit { // records.formid = '6'; // // records.fk_createdby = '251'; // console.log(JSON.stringify(records)); -// this._pd.saveForm(records).subscribe(data => { -// this.notifier.notify('success', 'Saved Successfully.'); -// }, error => { -// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); -// }); +// // this._pd.saveForm(records).subscribe(data => { +// // this.notifier.notify('success', 'Saved Successfully.'); +// // }, error => { +// // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); +// // }); // } // // validateAllFormFields(formGroup: FormGroup) { // // Object.keys(formGroup.controls).forEach(field => { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 0b90adbee..4385d2676 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -23,11 +23,12 @@

Data as Per Financial Statements

- + + Please provide Correct Year Format. Format Should Be (YYYY) - +

@@ -35,45 +36,53 @@ [formGroupName]="i"> - - + + - - + + - - + + Net Profit Net Loss - - + + - + - + - + - + + + + {{details.get('variation').value <= 0 ? 'Decreases ' : 'Increases '}} in Sales in FY Over Sales in FY is % + + + + + - - + + - + + - + - - + + Net Profit Net Loss - + - + - + - + - + {{details.controls['estimate_variation'].value}} {{details.controls['estimate_year'].value}} - + + Yes No Please comment on the Traded Goods stock level observed? - + @@ -191,35 +191,35 @@

{{d+1}} Finished Goods

- + - + Yes No - + - + {{"₹"}} {{R_goodsValueInWords}} Only - + - + Yes No Please comment on the finished goods stock level observed? - + @@ -240,35 +240,35 @@

{{e+1}} Traded Goods

- + - + Yes No - + - + {{"₹"}} {{R_tradedGoodsValueInWords}} Only - + - + Yes No Please comment on the Traded Goods stock level observed? - + @@ -301,35 +301,35 @@

{{f+1}} Finished Goods

- + - + Yes No - + - + {{"₹"}} {{T_goodsValueInWords}} Only - + - + Yes No Please comment on the finished goods stock level observed? - + @@ -351,35 +351,35 @@

{{g+1}} Traded Goods

- + - + Yes No - + - + {{"₹"}} {{T_tradedGoodsValueInWords}} Only - + - - + + Yes No Please comment on the Traded Goods stock level observed? - + @@ -516,7 +516,7 @@
Remarks - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index a79735f1e..17292f75b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -16,14 +16,15 @@
- - -
- {{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }} + + + {{quesIndex+1}} +
+ {{ formButton.form_name }}
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss index ce04f2137..bd80283eb 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.scss @@ -1,6 +1,12 @@ // .child_mat_card mat-card { // margin: 2 0%; // } + ::ng-deep .mat-card-header-text{ + margin:0px !important; + } + .mat-purple{ + background-color: gray !important; + } mat-card.parent_mat_card > { mat-card-header { display: flex; @@ -11,6 +17,8 @@ mat-card.parent_mat_card > { max-height:52vh; overflow:auto; } + + .user-thumb { position: absolute; bottom: -35%; @@ -66,3 +74,4 @@ mat-card .child_mat_card > mat-card { } } + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 12285e2ba..64756a67c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -87,6 +87,8 @@ import { NgxViewerModule } from 'ngx-viewer'; import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/final-remarks.component'; import { BusinessOtherFamilyMemberComponent } from './list-pd/start-pd/forms/dialogue/business-other-family-member/business-other-family-member.component'; +import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.component'; +import { SharedModule } from "app/shared/shared.module"; /** * Custom angular notifier options @@ -264,7 +266,7 @@ const pdCustomNotifierOptions: NotifierOptions = { // AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule, // OwlNativeDateTimeModule, // ], - declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent], + declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent], // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], // providers: [PdTrigerService, GetGeometricLocationService], @@ -273,6 +275,7 @@ const pdCustomNotifierOptions: NotifierOptions = { CommonModule, ManagePdRoutingModule, NgxViewerModule, + SharedModule, NotifierModule.withConfig(pdCustomNotifierOptions), CKEditorModule, PdfViewerModule, @@ -307,7 +310,7 @@ const pdCustomNotifierOptions: NotifierOptions = { {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent, - ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent], + ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent], }) export class ManagePdModule { 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 0cec83e9f..89b00f4b7 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 @@ -331,6 +331,23 @@ getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable{ ) } + getQCReportFinalReviewDetails(pd_id: any, flag : string ): Observable{ + return this._http.post(this.apiUrl+"getQCLenderRemarks", {"records": { "pd_id" : pd_id, "flag" :flag }}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + + // pd review status update details + pdReviewStatusUpdate(editData: any): Observable { + editData.fk_updatedby = this._aws.getlocale(); + // editData.updatedon = currentdate; + return this._http.post(this.apiUrl + "updatePDMaster", {records: editData}) + + .pipe( + catchError(this.handleError('operation', [])) + ) + } // inWords(num) { diff --git a/ng6-seed/src/app/shared/rating/rating.component.html b/ng6-seed/src/app/shared/rating/rating.component.html new file mode 100644 index 000000000..06bae631d --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.html @@ -0,0 +1,16 @@ +
+ + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/shared/rating/rating.component.scss b/ng6-seed/src/app/shared/rating/rating.component.scss new file mode 100644 index 000000000..64db81cb4 --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.scss @@ -0,0 +1,42 @@ + +.rating { + float:left; +} + +.rating:not(:checked) > input { + position:absolute; + top:-9999px; + clip:rect(0,0,0,0); +} + +.rating:not(:checked) > label { + float:right; + width:1em; + padding:0.1em; + overflow:hidden; + white-space:nowrap; + cursor:pointer; + font-size:200%; + line-height:1.2; + color:#ddd; +} + +.rating:not(:checked) > label:before { + content: '★ '; +} + +.rating > input:checked ~ label { + color: #f70; +} + +.rating:not(:checked) > label:hover, +.rating:not(:checked) > label:hover ~ label { + color: gold; +} + + +.rating > input:checked ~ label:hover, +.rating > input:checked ~ label:hover ~ label, +.rating > label:hover ~ input:checked ~ label { + color: #ea0; +} \ No newline at end of file diff --git a/ng6-seed/src/app/shared/rating/rating.component.spec.ts b/ng6-seed/src/app/shared/rating/rating.component.spec.ts new file mode 100644 index 000000000..1460c9ec6 --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RatingComponent } from './rating.component'; + +describe('RatingComponent', () => { + let component: RatingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RatingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RatingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/shared/rating/rating.component.ts b/ng6-seed/src/app/shared/rating/rating.component.ts new file mode 100644 index 000000000..5c6eed26a --- /dev/null +++ b/ng6-seed/src/app/shared/rating/rating.component.ts @@ -0,0 +1,25 @@ +import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-rating', + templateUrl: './rating.component.html', + styleUrls: ['./rating.component.scss'] +}) +export class RatingComponent implements OnInit { + @Input() rating: number; + @Input() itemId: number; + @Output() ratingClick: EventEmitter = new EventEmitter(); + + inputName: string; + ngOnInit() { + this.inputName = this.itemId + '_rating'; + } + onClick(rating: number): void { + this.rating = rating; + this.ratingClick.emit({ + itemId: this.itemId, + rating: rating + }); + } + +} diff --git a/ng6-seed/src/app/shared/shared.module.ts b/ng6-seed/src/app/shared/shared.module.ts index 9dbf91116..cc6a4cb68 100755 --- a/ng6-seed/src/app/shared/shared.module.ts +++ b/ng6-seed/src/app/shared/shared.module.ts @@ -4,19 +4,22 @@ import { MenuItems } from './menu-items/menu-items'; import { HorizontalMenuItems } from './menu-items/horizontal-menu-items'; import { AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective } from './accordion'; import { ToggleFullscreenDirective } from './fullscreen/toggle-fullscreen.directive'; +import { RatingComponent} from './rating/rating.component'; @NgModule({ declarations: [ AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective, - ToggleFullscreenDirective + ToggleFullscreenDirective, + RatingComponent ], exports: [ AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective, - ToggleFullscreenDirective + ToggleFullscreenDirective, + RatingComponent ], providers: [ MenuItems, HorizontalMenuItems ] }) From 6365d43aa25a14a95ebd3dd6f232556b5ead1be0 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 26 Dec 2018 12:20:05 +0530 Subject: [PATCH 4/4] general form path changes --- .../other-applicant-details.component.html | 4 +- .../other-applicant-details.component.scss | 0 .../other-applicant-details.component.spec.ts | 0 .../other-applicant-details.component.ts | 0 .../general-info/general-info.component.html | 6 ++- .../general-info/general-info.component.ts | 54 +++++++++---------- .../manage-pd/manage-pd.module.ts | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) rename ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/{ => dialogue}/other-applicant-details/other-applicant-details.component.html (80%) rename ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/{ => dialogue}/other-applicant-details/other-applicant-details.component.scss (100%) rename ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/{ => dialogue}/other-applicant-details/other-applicant-details.component.spec.ts (100%) rename ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/{ => dialogue}/other-applicant-details/other-applicant-details.component.ts (100%) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html similarity index 80% rename from ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.html rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html index 6433832c0..ff4bce671 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html @@ -20,7 +20,7 @@ - - + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.scss similarity index 100% rename from ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.scss rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.scss diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.spec.ts similarity index 100% rename from ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.spec.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.spec.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts similarity index 100% rename from ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component.ts rename to ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index 25f21ceb7..866e9d4c6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -15,12 +15,14 @@
-
+
{{applicant.controls.applicant_name.value}} -
+ + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index 7f18d0981..4981b675a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -3,7 +3,7 @@ import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@ang import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; -import {OtherApplicantDetailsComponent} from './../other-applicant-details/other-applicant-details.component'; +import {OtherApplicantDetailsComponent} from './../dialogue/other-applicant-details/other-applicant-details.component'; @Component({ selector: 'app-general-info', templateUrl: './general-info.component.html', @@ -27,7 +27,7 @@ export class GeneralInfoComponent implements OnInit { this.form_id = 18; this.pd_applicants_details = this.pd_all_details.pdapplicants_detials; // push Other options to applicant details - this.pd_applicants_details.push({'pd_co_applicant_id':"0",'applicant_name':'Others', }); + // this.pd_applicants_details.push({'pd_co_applicant_id':"0",'applicant_name':'Others', }); } ngOnInit() { @@ -147,37 +147,11 @@ export class GeneralInfoComponent implements OnInit { // checkand un check function checkboxChange(event, index, item) { if(item.exist_status.value){ - if(item.pd_co_applicant_id.value==0){ - const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, { - data: '', - width:'40%', - disableClose: true - }); - dialogRef.afterClosed() - .subscribe(dataresult => { - if(dataresult.data.length>0){ - let relationControl = this._generalForm.controls['applicant_relation']; - dataresult.data.forEach(element => { - let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','company_name':element.company_name,'company_relation':''}; - relationControl.push(this.createApplicantRelation(applicant_details)); - // push related to details - this.fetch_related_details.push(element.applicant_name); - }); - - } - - - // exist_status - }); - - } - else{ let relationControl = this._generalForm.controls['applicant_relation']; let applicant_details: any= {'pd_co_applicant_id':item.pd_co_applicant_id.value,'applicant_name':item.applicant_name.value,'applicant_relation_to':'','relation':'','company_name':item.company_name.value,'company_relation':''}; relationControl.push(this.createApplicantRelation(applicant_details)); // push related to details this.fetch_related_details.push(item.applicant_name.value); - } } else { @@ -192,6 +166,30 @@ export class GeneralInfoComponent implements OnInit { } } + // add more applicant details + addOtherApplicant() { + const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, { + data: '', + width:'40%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.data.length>0){ + let relationControl = this._generalForm.controls['applicant_relation']; + dataresult.data.forEach(element => { + let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','company_name':element.company_name,'company_relation':''}; + relationControl.push(this.createApplicantRelation(applicant_details)); + // push related to details + this.fetch_related_details.push(element.applicant_name); + }); + + } + }); + + } + + // remove other details removeOthers(index, item: any){ console.log(item) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index 64756a67c..90d398715 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -79,7 +79,7 @@ import { AllocationViewMoreComponent } from './list-pd/allocation-view-more/allo import { PdRequirementComponent } from './list-pd/pd-requirement/pd-requirement.component'; import { GeneralInfoComponent } from './list-pd/start-pd/forms/general-info/general-info.component'; import { ModelEditPdReportComponent } from './list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component'; -import { OtherApplicantDetailsComponent } from './list-pd/start-pd/forms/other-applicant-details/other-applicant-details.component'; +import { OtherApplicantDetailsComponent } from './list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component'; import { NeighbourHoodComponent } from './list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component'; // import ngx-viewer module