From 0391c87659cc747db7d949b4bb76a2d413885c0b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 15 Mar 2019 19:37:44 +0530 Subject: [PATCH 1/2] QC Functionality changes --- .../model-edit-pd-report.component.html | 40 ++-- .../model-edit-pd-report.component.scss | 8 + .../model-edit-pd-report.component.ts | 7 +- .../pd-report/pd-report.component.html | 195 +++++++++--------- .../pd-report/pd-report.component.scss | 13 +- .../list-pd/pd-report/pd-report.component.ts | 12 +- .../qc-review/qc-review.component.ts | 6 +- .../model-edit-pd-report.component.html | 25 ++- .../model-edit-pd-report.component.scss | 8 + .../model-edit-pd-report.component.ts | 22 +- .../qc-pd-report/qc-pd-report.component.html | 99 +++++---- .../qc-pd-report/qc-pd-report.component.scss | 13 +- .../qc-pd-report/qc-pd-report.component.ts | 18 +- .../qc-review/qc-review.component.ts | 6 +- .../qc-list/qc-view/qc-view.component.html | 2 +- .../quality-check/qc-service/qc.service.ts | 2 + 16 files changed, 286 insertions(+), 190 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html index 0c978aba3..8379ac773 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.html @@ -1,19 +1,23 @@ -

Edit PD Report Details

- - -
-
-
- - - + +

+
+ Edit PD Report Details
- - -

- - - - - - \ No newline at end of file + + + +
+
+ + +
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.scss index e69de29bb..21a517b38 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.scss @@ -0,0 +1,8 @@ +::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; + overflow: hidden; +} +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts index 0b50cbef4..874d745c9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/model-edit-pd-report/model-edit-pd-report.component.ts @@ -23,7 +23,7 @@ export class ModelEditPdReportComponent implements OnInit { ckeConfig: any; recordData: any; log = ''; - showEditor= false; + showEditor: boolean= false; @ViewChild('myckeditor') ckeditor: any; /** * Notifier service @@ -85,7 +85,10 @@ export class ModelEditPdReportComponent implements OnInit { this.pdTrigerService.updatePDReportDetails(data).subscribe(data=>{ this.notifier.notify('success', 'Your Changes Updated.!'); - this.dialogRef.close(); + this.dialogRef.close({ + status: true + } + ); }, err => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); 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 170ed331f..4564cf0b2 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 @@ -1,96 +1,107 @@ - - - + +
+ - - - - - - - -
- -
- -
-
-
- - -
-
- - - -
- -
-
- -
-
-
- - -
-
-
-
{{message}}
-
- -
-
-
-
- -
- - - - - - - - - - -
- -
- -
-
- -
- - - -
+ + + -
-
- -
-
-
- - - - -
+ + +

{{ pd.doc_name }}

+ +

{{pd.createdby}} ({{pd.createdon}})

+
+ + +
+ + + + + + + View More + + + + +
+ +
+ +
+
+ +
+ + +
+
+ + + +
+ +
+
+ +
+
+ + + +
+
+
+
+
+
{{message}}
+
+ + + +
+
+
+
+ +
+ +
+ + + +
+ +
+ + +
+ +
+ + + +
+ +
+
+ +
+
+ + +
\ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss index b8d8535d4..ce799dd58 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.scss @@ -7,7 +7,9 @@ } :host /deep/ { mat-sidenav { - max-width: 300px; + max-width: 400px; + max-height: 500px; + overflow-y: auto; } .mat-sidenav-content { padding: 0; @@ -115,5 +117,12 @@ $product-bg-color-hover: rgba(103, 58, 183, 0.7); } } - +.custm-list-item { + cursor: pointer; + } + .footer { + position: fixed; + bottom: 2%; + right: 2%; +} \ No newline at end of file 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 9a8658e4e..1972b05d7 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 @@ -39,6 +39,7 @@ export class PdReportComponent implements OnInit { pdReportRecords: any; latestPDDetails: any; message: any; + selectedIndex: Number; private notifier: NotifierService; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, public pdTrigerService: PdTrigerService, private listPDComponent: ListPdComponent, @@ -129,6 +130,7 @@ export class PdReportComponent implements OnInit { this.pdReportVersionList = [...data.records.reports_urls].reverse(); let datas = this.pdReportVersionList.filter((a) => { return a.is_latest == 1; }) this.latestPDDetails = datas[0]; + this.selectedIndex = 0; this.qcStatus = data.records.pdstatus; // alert(JSON.stringify(this.latestPDDetails)); this.reGenerateBtn = true; @@ -169,6 +171,9 @@ export class PdReportComponent implements OnInit { }); dialogRef.afterClosed() .subscribe(dataresult => { + if(dataresult.status==true){ + this.getPdReportVersionList(); + } // this.getPdReportFinalTemplateDetails(); // this.getQuestionsMasters(); // this.getBranch(); @@ -176,9 +181,9 @@ export class PdReportComponent implements OnInit { }); } - changeVersion(pd: any): void { + changeVersion(pd: any,selIndex:Number): void { this.latestPDDetails = pd; - console.log(this.latestPDDetails); + this.selectedIndex = selIndex; } @@ -190,6 +195,9 @@ export class PdReportComponent implements OnInit { }); dialogRef.afterClosed() .subscribe(dataresult => { + if(dataresult.status==true){ + this.getPdReportVersionList(); + } // this.getPdReportFinalTemplateDetails(); // this.getQuestionsMasters(); // this.getBranch(); 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 index c054a5d7c..7fa06f1f4 100755 --- 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 @@ -78,17 +78,17 @@ export class QcReviewComponent implements OnInit { } 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(); + this.dialogRef.close({ + status: true + }); }, err => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html index 0c978aba3..e7b33e507 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.html @@ -1,19 +1,22 @@ -

Edit PD Report Details

- - +
+

+
+ Edit PD Report Details +
+ +

+
-
-
- - +
-
- - - \ No newline at end of file + + + + + diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.scss index e69de29bb..21a517b38 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.scss +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.scss @@ -0,0 +1,8 @@ +::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; + overflow: hidden; +} +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts index 4a76ad601..c1fc032ca 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component.ts @@ -13,7 +13,7 @@ import { @Component({ selector: 'app-model-edit-pd-report', templateUrl: './model-edit-pd-report.component.html', - styleUrls: ['./model-edit-pd-report.component.scss'] + styleUrls: ['./model-edit-pd-report.component.scss'], }) export class ModelEditPdReportComponent implements OnInit { @@ -23,7 +23,7 @@ export class ModelEditPdReportComponent implements OnInit { ckeConfig: any; recordData: any; log = ''; - showEditor= false; + showEditor: boolean= false; @ViewChild('myckeditor') ckeditor: any; /** * Notifier service @@ -51,7 +51,7 @@ export class ModelEditPdReportComponent implements OnInit { if(data['dataStatus']){ this.recordData = data.records[0]; this.ngForm = this._formBuilder.group({ - content: [this.recordData.pd_report_latest_version_blob, Validators.compose([Validators.required])], + content: [this.recordData.content, Validators.compose([Validators.required])], isactive:[this.recordData.isactive] }); this.showEditor = true; @@ -59,11 +59,12 @@ export class ModelEditPdReportComponent implements OnInit { },err => { }); - // this.ckeConfig = { - // allowedContent: false, - // extraPlugins: 'divarea', - // forcePasteAsPlainText: true - // }; + this.ckeConfig = { + // allowedContent: false, + // extraPlugins: 'divarea', + // forcePasteAsPlainText: true, + height:250, + }; } onChange($event: any): void { @@ -85,7 +86,10 @@ export class ModelEditPdReportComponent implements OnInit { this.pdTrigerService.updatePDReportDetails(data).subscribe(data=>{ this.notifier.notify('success', 'Your Changes Updated.!'); - this.dialogRef.close(); + this.dialogRef.close({ + status: true + } + ); }, err => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); 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 3b00ea5cd..548a0c955 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 @@ -1,31 +1,42 @@ - - + +
- - + - - - - - -
+ + + + + +

{{ pd.doc_name }}

+ +

{{pd.createdby}} ({{pd.createdon}})

+
+ + +
+ + + + + + + View More + + + + +
-
+
+
@@ -42,39 +53,40 @@
+ + - - +
+
{{message}}
- + + +
- - - - - - - +
+ + - - + -
+
-
-
+ +
@@ -83,14 +95,13 @@
-
+
- - - - + - + \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss index ded3d2c82..cb94a35c0 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss @@ -7,7 +7,9 @@ } :host /deep/ { mat-sidenav { - max-width: 300px; + max-width: 400px; + max-height: 500px; + overflow-y: auto; } .mat-sidenav-content { padding: 0; @@ -114,4 +116,13 @@ $product-bg-color-hover: rgba(103, 58, 183, 0.7); } } +} + +.custm-list-item { + cursor: pointer; + } + .footer { + position: fixed; + bottom: 2%; + right: 2%; } \ No newline at end of file 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 d2aa1e577..8775e7f43 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 @@ -37,6 +37,7 @@ export class QcPdReportComponent implements OnInit { pdReportRecords: any; latestPDDetails: any; message: any; + selectedIndex: Number; private notifier: NotifierService; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, @@ -128,8 +129,11 @@ export class QcPdReportComponent implements OnInit { this.pdReportVersionList = [...data.records.reports_urls].reverse(); let datas = this.pdReportVersionList.filter((a) => { return a.is_latest == 1; }) this.latestPDDetails = datas[0]; + this.selectedIndex = 0; + this.qcStatus = data.records.pdstatus; // alert(JSON.stringify(this.latestPDDetails)); + this.generateBtn=false; this.reGenerateBtn = true; } else { // this.reGenerateBtn = true; @@ -164,10 +168,17 @@ export class QcPdReportComponent implements OnInit { addNewQuestion() { const dialogRef = this.dialog.open(ModelEditPdReportComponent, { data: { startId: this.startPD, version_id: this.latestPDDetails.doc_name }, + maxWidth: '100vw', + maxHeight: '100vh', + height: '100%', + width: '100%', disableClose: true }); dialogRef.afterClosed() .subscribe(dataresult => { + if(dataresult.status==true){ + this.getPdReportVersionList(); + } // this.getPdReportFinalTemplateDetails(); // this.getQuestionsMasters(); // this.getBranch(); @@ -175,9 +186,9 @@ export class QcPdReportComponent implements OnInit { }); } - changeVersion(pd: any): void { + changeVersion(pd: any,selIndex: Number): void { this.latestPDDetails = pd; - console.log(this.latestPDDetails); + this.selectedIndex = selIndex; } @@ -189,6 +200,9 @@ export class QcPdReportComponent implements OnInit { }); dialogRef.afterClosed() .subscribe(dataresult => { + if(dataresult.status==true){ + this.getPdReportVersionList(); + } // this.getPdReportFinalTemplateDetails(); // this.getQuestionsMasters(); // this.getBranch(); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts index c5c4df00f..77f1818f4 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-review/qc-review.component.ts @@ -78,17 +78,17 @@ export class QcReviewComponent implements OnInit { } 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(); + this.dialogRef.close({ + status:true + }); }, err => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html index 5e61a209e..29dffd228 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html @@ -48,7 +48,7 @@ - + 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 c57621a8a..add487f9e 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 @@ -316,6 +316,7 @@ export class QcService { } updatePDReportDetails(records: any): Observable { + records.fk_updatedby=this._aws.getlocale(); return this._http.post(this.apiUrl + "saveNewVersionOfPDReport ", { "records": records }) .pipe( catchError(this.handleError('operation', [])) @@ -331,6 +332,7 @@ export class QcService { swapOlderPDReportToLatest(pdId: any): Observable { pdId.fk_createdby = this._aws.getlocale(); + pdId.fk_updatedby = this._aws.getlocale(); return this._http.post(this.apiUrl + "swapOlderPDReportToLatest", { "records": pdId }) .pipe( catchError(this.handleError('operation', [])) From 1a91f0c7188e245c72d0f4f6297e856118e2cb1d Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 15 Mar 2019 19:38:26 +0530 Subject: [PATCH 2/2] merge : kms --- .../current-loan/current-loan.component.html | 2 +- .../current-loan/current-loan.component.ts | 7 +- .../family-details.component.ts | 95 ++++++++++++++++++- .../neighbour-hood.component.ts | 5 +- 4 files changed, 99 insertions(+), 10 deletions(-) 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 30b45776e..17b672ebe 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 @@ -136,7 +136,7 @@ -
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index 70ea3f909..2c8b310a0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -225,13 +225,8 @@ export class CurrentLoanComponent implements OnInit { this.dataFromAssets.forEach((val, index) => { if (val.mode == 0) { - let owner = val.owner_name.map((e => { - console.log(e.name.split(',')); - console.log(e.name); - + let owner = val.owner_name.map((e => { return (e.name == 'Others' ? val.other_owner : e.name).split(','); - - })); // labelarray[index] = ' : '+owner +' - '+ val.mode_name.split("/")[0] + ' ( ' + val.mode_name.split("/")[1] + ' )'; labelarray[index] = ' : ' + owner + ' - ' + val.mode_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 fa0c9aae3..295b4eafe 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 @@ -518,10 +518,101 @@ export class FamilyDetailsComponent implements OnInit { } submitFamily() { - if (!this.familyForm.valid) { + + const familyFormArray : FormArray = this.familyForm.controls['family_details'] as FormArray; + + let FDArrayLength: any = familyFormArray.controls.length; + + if (FDArrayLength > 0) { + let cnt1 = 0; + while(cnt1 < FDArrayLength){ + + let familyDetailsFormGrp : FormGroup = familyFormArray.controls[cnt1] as FormGroup; + let familyMembersFormArr : FormArray = familyDetailsFormGrp.controls.family_members_details as FormArray; + + familyDetailsFormGrp.controls.residence_ownership.value == 1 + ? familyDetailsFormGrp.controls.ownershipOther.setValidators([Validators.required]) + : familyDetailsFormGrp.controls.ownershipOther.setValue(''); + familyDetailsFormGrp.controls.ownershipOther.updateValueAndValidity(); + + familyDetailsFormGrp.controls.residence_ownership.value == 3 + ? familyDetailsFormGrp.controls.rent.setValidators([Validators.required]) + : familyDetailsFormGrp.controls.rent.setValue(''); + familyDetailsFormGrp.controls.rent.updateValueAndValidity(); + + familyDetailsFormGrp.controls.residence_pin.value == 1 + ? familyDetailsFormGrp.controls.residence_other_pincode.setValidators([Validators.required]) + : familyDetailsFormGrp.controls.residence_other_pincode.setValue(''); + familyDetailsFormGrp.controls.residence_other_pincode.updateValueAndValidity(); + + let FMArrayLength: any = familyMembersFormArr.controls.length; + + if (FMArrayLength > 0) { + let cnt2 = 0; + while(cnt2 < FMArrayLength){ + let Ctrls : FormArray = familyMembersFormArr.controls[cnt2] as FormArray; + if(Ctrls.controls['family_member_earning_status'].value == 1){ + + Ctrls.controls['non_earning_occupation'].setValue(''); + Ctrls.controls['non_earning_occupation'].clearValidators(); + Ctrls.controls['non_earning_occupation'].updateValueAndValidity(); + + if(Ctrls.controls['earning_segment'].value == 1){ + Ctrls.controls['earning_if_others_segment'].setValidators([Validators.required]); + } + + Ctrls.controls['non_earning_if_others'].setValue(''); + Ctrls.controls['non_earning_if_schoolorcollege'].setValue(''); + Ctrls.controls['non_earning_if_retired_from'].setValue(''); + + } + if(Ctrls.controls['family_member_earning_status'].value == 2){ + + Ctrls.controls['earning_if_others_segment'].setValue(''); + + Ctrls.controls['earning_gross_income_per_month'].setValue(''); + + Ctrls.controls['earning_segment'].setValue(''); + Ctrls.controls['earning_segment'].clearValidators(); + + Ctrls.controls['earning_name_of_the_employer_or_business'].setValue(''); + Ctrls.controls['earning_name_of_the_employer_or_business'].clearValidators(); + + Ctrls.controls['earning_number_of_years_in_employment_or_business'].setValue(''); + Ctrls.controls['earning_number_of_years_in_employment_or_business'].clearValidators(); + + + if(Ctrls.controls['non_earning_occupation'].value==1){ + Ctrls.controls['non_earning_if_others'].setValidators([Validators.required]); + } + if(Ctrls.controls['non_earning_occupation'].value==2){ + Ctrls.controls['non_earning_if_schoolorcollege'].setValidators([Validators.required]); + } + if(Ctrls.controls['non_earning_occupation'].value==3){ + Ctrls.controls['non_earning_if_retired_from'].setValidators([Validators.required]); + } + } + + Ctrls.controls['earning_if_others_segment'].updateValueAndValidity(); + Ctrls.controls['earning_segment'].updateValueAndValidity(); + Ctrls.controls['earning_name_of_the_employer_or_business'].updateValueAndValidity(); + Ctrls.controls['earning_number_of_years_in_employment_or_business'].updateValueAndValidity(); + Ctrls.controls['non_earning_if_others'].updateValueAndValidity(); + Ctrls.controls['non_earning_if_schoolorcollege'].updateValueAndValidity(); + Ctrls.controls['non_earning_if_retired_from'].updateValueAndValidity(); + Ctrls.controls['earning_gross_income_per_month'].updateValueAndValidity(); + cnt2++; + } + } + cnt1++; + } + } + + if (!this.familyForm.valid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); return; - } + } + var records = this.familyForm.value; //To Remove The "Null" With Key also Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index c0d355453..73fcba573 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts @@ -265,7 +265,6 @@ export class NeighbourHoodComponent implements OnInit { // let RefCtrlLength : any = referencecheckControl.controls.length; const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup; let NbhdCtrlLength: any = neighbourhoodControl.controls.length; - if (NbhdCtrlLength > 0) { let Ncnt = 0; while(Ncnt < NbhdCtrlLength){ @@ -307,6 +306,10 @@ export class NeighbourHoodComponent implements OnInit { Ncnt++; } } + + this._neighbourhoodForm.controls.neighbourhood_status.setValidators([Validators.required]); + this._neighbourhoodForm.controls.neighbourhood_status.updateValueAndValidity(); + // } // if(formData.check_type==1){