From 963a91113f0f9f991bc2cfcea517af6b931ca38c Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Mon, 5 Nov 2018 12:05:41 +0530 Subject: [PATCH 01/14] supplier pd-form details added : kdk --- .../supplier-info.component.html | 92 ++++++++- .../supplier-info.component.scss | 3 + .../supplier-info/supplier-info.component.ts | 195 +++++++++++++++++- .../list-pd/start-pd/start-pd.component.html | 5 +- .../pd-service/pd-triger.service.ts | 8 + 5 files changed, 295 insertions(+), 8 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 7fbdf4049..952ecbda0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -1,3 +1,89 @@ -

- supplier-info works! -

+ + +
+
+
+ + + You must Include Raw Material Details. + +
+
+
+
+
+
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + + {{ pm.name }} + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + + {{ feq.name }} + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss index e69de29bb..890847551 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss @@ -0,0 +1,3 @@ +.example-full-width{ + width : 100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 8f91281d8..9f52ed182 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -1,15 +1,206 @@ -import { Component, OnInit } from '@angular/core'; +/** Common Imports */ +import { + Component, + OnInit, + Inject, + Input +} from '@angular/core'; +import { + FormBuilder, + FormGroup, + Validators, + FormArray, +} from '@angular/forms'; + +import { NotifierService } from 'angular-notifier'; + +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material'; +/** Service */ +import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; @Component({ selector: 'app-supplier-info', templateUrl: './supplier-info.component.html', styleUrls: ['./supplier-info.component.scss'] }) export class SupplierInfoComponent implements OnInit { + + @Input() pdid: number; - constructor() { } + public _supplierQuesFrom: FormGroup; + public submitted = false; + public m_paymentModeType= [ + { + 'id': 1, + 'name': 'Immediate Or Advanced Payment' + }, + { + 'id': 2, + 'name': 'Credit' + }, + { + 'id': 3, + 'name': 'Combination of Both' + }, + ]; + + public m_freqOfPurchase= [ + { + 'id': 1, + 'name': 'Daily' + }, + { + 'id': 2, + 'name': 'Weekly' + }, + { + 'id': 3, + 'name': 'Monthly' + }, + { + 'id': 4, + 'name': 'Every 3 months' + }, + { + 'id': 5, + 'name': 'Half yearly' + }, + { + 'id': 6, + 'name': 'Yearly' + }, + { + 'id': 7, + 'name': 'As and when required' + }, + { + 'id': 8, + 'name': 'Others' + } + ] + + constructor( + private _formBuilder: FormBuilder, + private pdTrigerService: PdTrigerService) { } ngOnInit() { + this._supplierQuesFrom = this._formBuilder.group({ + main_raw_materials: [null, Validators.compose([Validators.required])], + supplier_details: this._formBuilder.array([ + this.initDetails(), + ]) + }); + this.getPdSupplierFormDetails(); } + getPdSupplierFormDetails() { + this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe( + data => { + if (data) { + if (data.records) { + // this.noRecordFound = false; + // this.entityBillingInfoRecord = data.records; + } else { + // this.noRecordFound = true; + } + } else { + // this.noRecordFound = true; + } + } + ); + } + + // convenience getter for easy access to form fields + get f() { return this._supplierQuesFrom.controls; } + + // Dynamic Form field creation Functionality : START ===> + initDetails() { + return this._formBuilder.group({ + supplier_name: ['', Validators.compose([Validators.required])], + contact_person: ['', Validators.compose([Validators.required])], + mobile_number: ['', Validators.compose([Validators.required])], + payment_mode: ['', Validators.compose([Validators.required])], + per_of_immediate_advance_payment:[''], + credit_period:[''], + frequency_of_purchase: ['', Validators.compose([Validators.required])], + freq_purchase_others_text_value: [''] + }); + } + + addSupplierDetails(e) { + const control = this._supplierQuesFrom.controls['supplier_details']; + control.push(this.initDetails()); + } + removeLanguage(i: number) { + const control = this._supplierQuesFrom.controls['supplier_details']; + control.removeAt(i); + } + + public paymentModeTextBox: number; + selectedPM(e) { + this.paymentModeTextBox = e.value; + // this.f.supplier_details.controls.get('payment_mode_value'); + } + + public freqPurchaseTextBox: number; + selectedFreqPurchase(e){ + this.freqPurchaseTextBox = e.value; + } + + + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + // stop here if form is invalid + if (this._supplierQuesFrom.invalid) { + return; + } else { + var answerFormValues = this._supplierQuesFrom.value; + + //To Remove The "Null" With Key also + Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); + alert(JSON.stringify(answerFormValues)); + // //Add BRANCH data with help Service File + // this.questionsService.addQuestionMasterDetails(answerFormValues).subscribe( + // dataresult => { + // if (dataresult.status == 200) { + // console.log(dataresult); + // this.notifier.notify('success', 'Record Saved Successfully.!'); + // this.dialogRef.close(); + // // alert("sample alert for Saving"); + // } + // else { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Some Thing Wents Wrong Try Again !"; + // } + // }, error => { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Something Wents Wrong Try Again !"; + // this.dialogRef.close(); + // }); + // //After Saving the BRANCH data then popup close + // // this.dialogRef.close(); + } + } + + /** To Reset Popup Data */ + onReset() { + // this._addQuesFrom.reset(); + } + + // { + // 'main_raw_materials': 'sdkjfal', + // 'supplier_details' ; [ + // { + // 'supplier_name':'ldskjfalks', + // 'payment_mode': '1', + // 'payment_mode_value':'' + // } + // ] + // } + } 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 1d7761abf..16fcc96b5 100644 --- 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 @@ -377,7 +377,7 @@ -

supplier

+
@@ -388,8 +388,7 @@ - -

Personal

+
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 33b989c0c..a9e41f2d6 100644 --- 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 @@ -189,6 +189,14 @@ export class PdTrigerService { ) } +// common Pd form details get for the Pd Process +getPDFormDetailsWithID(pdID, formID ):Observable { + return this._http.post(this.apiUrl+"getPDFormDetails",{"pdid":pdID,"pd_form_id" : formID}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // save pd answers savePDQuestions(saveData: any): Observable { saveData.createdby = this._aws.getlocale(); From 719477d9d47f075407d996e7df96e7abb0ece69c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 5 Nov 2018 12:08:39 +0530 Subject: [PATCH 02/14] personal info changes --- .../personal-info.component.html | 128 +++++++++++++++++- .../personal-info.component.scss | 6 + .../personal-info/personal-info.component.ts | 95 ++++++++++++- 3 files changed, 224 insertions(+), 5 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html index 3527ddf35..270154728 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html @@ -1,3 +1,125 @@ -

- personal-info works! -

+
+ + + +
+ +
+ + + Main Applicant + +
+
+ + + + + + + + + + + + + + + + + + + + + {{education}} + + + + + + + + + {{earning}} + + + +
+
+ +
+
+ + +
+ + + + + +
+ + + Co Applicant + +
+
+ + + + + + + + + + + + + + + + + + + + {{education}} + + + + + + + + + {{earning}} + + + + + + + + {{rel.name}} + + + +
+
+ + +
+ + + + +
+ + +
+ + +
+ + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss index e69de29bb..776d000ca 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.scss @@ -0,0 +1,6 @@ +.mat-card-content { + background-color: white; + } + .mat-card-actions { + background-color: white; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts index 75070f4db..296611de6 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts @@ -1,4 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit , Input, Output } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; +import { Key } from 'protractor'; @Component({ selector: 'app-personal-info', @@ -7,9 +11,96 @@ import { Component, OnInit } from '@angular/core'; }) export class PersonalInfoComponent implements OnInit { - constructor() { } + qualifications:any=["Graduate","Under Graduate","Post Graduate","Professional"]; + earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"]; + relationShipList:any=[]; + @Input() pdid : string; + form_id:number; + private notifier: NotifierService; + public _personalForm: FormGroup; + + public mainApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status"]; + public coApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status","Relationship"]; + errorMessage:any; + //coItem:any; + //mainItem:any; + + repeat:number=3; + + constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService) { + this.notifier = notifier; + this.form_id = 3; + } ngOnInit() { + + this.loadPDDetails(this.pdid,this.form_id); + this.loadFormData(); + this.getRelationMaster(); } + // load form pd details + loadPDDetails(pd:string,form:number){ + + // this._pd.getAllMasterDatas(pdid,form_id).subscribe( + // data => { + // if (data.status == 200) { + // this.relationShipList=data.records; + + // } + // }, error => this.errorMessage = error); + } + + loadFormData(){ + // main applicant + let mainApplicantGroup = new FormArray(this.mainApplicantQuestions.map((item,key) => new FormGroup({ + fk_pd_id:new FormControl(null), + pd_question:new FormControl(this.mainApplicantQuestions[key]), + pd_question_type:new FormControl(key), + pd_detail_answer_id: new FormControl(null), + pd_answer_id: new FormControl(null,), + pd_answer: new FormControl(null,Validators.required), + pd_answer_weightage:new FormControl(null), + }))); + // co applicant + let coApplicantGroup = new FormArray(this.coApplicantQuestions.map((item,key) => new FormGroup({ + fk_pd_id:new FormControl(null), + pd_question:new FormControl(this.coApplicantQuestions[key]), + pd_question_type:new FormControl(key), + pd_detail_answer_id: new FormControl(null), + pd_answer_id: new FormControl(null), + pd_answer: new FormControl(null, Validators.required), + pd_answer_weightage:new FormControl(null), + }))); + + + this._personalForm = this._fb.group({ + pdid:null, + form_id:null, + mainItem: mainApplicantGroup, + coItem: coApplicantGroup, + }); + + console.log(this._personalForm.controls.coItem) + } + + //get pd main applicant array values + get pdMainapplicant() { return this._personalForm.get('mainItem') as FormArray; } + + // get pd co applicant array values + get pdCoapplicant() {return this._personalForm.get('coItem') as FormArray;} + + // get relation master details + getRelationMaster(){ + let relation ="RELATIONSHIPS"; + this._pd.getAllMasterDatas(relation).subscribe( + data => { + if (data.status == 200) { + this.relationShipList=data.records; + + } +}, error => this.errorMessage = error); +} +// + } From 0480d6163c36c2a8ff45e5c1f801540716bde404 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 5 Nov 2018 12:09:11 +0530 Subject: [PATCH 03/14] merge : kms --- .../supplier-info.component.html | 92 ++++++++- .../supplier-info.component.scss | 3 + .../supplier-info/supplier-info.component.ts | 195 +++++++++++++++++- .../list-pd/start-pd/start-pd.component.html | 5 +- .../pd-service/pd-triger.service.ts | 8 + 5 files changed, 295 insertions(+), 8 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 7fbdf4049..952ecbda0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -1,3 +1,89 @@ -

- supplier-info works! -

+ + +
+
+
+ + + You must Include Raw Material Details. + +
+
+
+
+
+
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + + {{ pm.name }} + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + + {{ feq.name }} + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss index e69de29bb..890847551 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.scss @@ -0,0 +1,3 @@ +.example-full-width{ + width : 100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 8f91281d8..9f52ed182 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -1,15 +1,206 @@ -import { Component, OnInit } from '@angular/core'; +/** Common Imports */ +import { + Component, + OnInit, + Inject, + Input +} from '@angular/core'; +import { + FormBuilder, + FormGroup, + Validators, + FormArray, +} from '@angular/forms'; + +import { NotifierService } from 'angular-notifier'; + +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material'; +/** Service */ +import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; @Component({ selector: 'app-supplier-info', templateUrl: './supplier-info.component.html', styleUrls: ['./supplier-info.component.scss'] }) export class SupplierInfoComponent implements OnInit { + + @Input() pdid: number; - constructor() { } + public _supplierQuesFrom: FormGroup; + public submitted = false; + public m_paymentModeType= [ + { + 'id': 1, + 'name': 'Immediate Or Advanced Payment' + }, + { + 'id': 2, + 'name': 'Credit' + }, + { + 'id': 3, + 'name': 'Combination of Both' + }, + ]; + + public m_freqOfPurchase= [ + { + 'id': 1, + 'name': 'Daily' + }, + { + 'id': 2, + 'name': 'Weekly' + }, + { + 'id': 3, + 'name': 'Monthly' + }, + { + 'id': 4, + 'name': 'Every 3 months' + }, + { + 'id': 5, + 'name': 'Half yearly' + }, + { + 'id': 6, + 'name': 'Yearly' + }, + { + 'id': 7, + 'name': 'As and when required' + }, + { + 'id': 8, + 'name': 'Others' + } + ] + + constructor( + private _formBuilder: FormBuilder, + private pdTrigerService: PdTrigerService) { } ngOnInit() { + this._supplierQuesFrom = this._formBuilder.group({ + main_raw_materials: [null, Validators.compose([Validators.required])], + supplier_details: this._formBuilder.array([ + this.initDetails(), + ]) + }); + this.getPdSupplierFormDetails(); } + getPdSupplierFormDetails() { + this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe( + data => { + if (data) { + if (data.records) { + // this.noRecordFound = false; + // this.entityBillingInfoRecord = data.records; + } else { + // this.noRecordFound = true; + } + } else { + // this.noRecordFound = true; + } + } + ); + } + + // convenience getter for easy access to form fields + get f() { return this._supplierQuesFrom.controls; } + + // Dynamic Form field creation Functionality : START ===> + initDetails() { + return this._formBuilder.group({ + supplier_name: ['', Validators.compose([Validators.required])], + contact_person: ['', Validators.compose([Validators.required])], + mobile_number: ['', Validators.compose([Validators.required])], + payment_mode: ['', Validators.compose([Validators.required])], + per_of_immediate_advance_payment:[''], + credit_period:[''], + frequency_of_purchase: ['', Validators.compose([Validators.required])], + freq_purchase_others_text_value: [''] + }); + } + + addSupplierDetails(e) { + const control = this._supplierQuesFrom.controls['supplier_details']; + control.push(this.initDetails()); + } + removeLanguage(i: number) { + const control = this._supplierQuesFrom.controls['supplier_details']; + control.removeAt(i); + } + + public paymentModeTextBox: number; + selectedPM(e) { + this.paymentModeTextBox = e.value; + // this.f.supplier_details.controls.get('payment_mode_value'); + } + + public freqPurchaseTextBox: number; + selectedFreqPurchase(e){ + this.freqPurchaseTextBox = e.value; + } + + + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + // stop here if form is invalid + if (this._supplierQuesFrom.invalid) { + return; + } else { + var answerFormValues = this._supplierQuesFrom.value; + + //To Remove The "Null" With Key also + Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); + alert(JSON.stringify(answerFormValues)); + // //Add BRANCH data with help Service File + // this.questionsService.addQuestionMasterDetails(answerFormValues).subscribe( + // dataresult => { + // if (dataresult.status == 200) { + // console.log(dataresult); + // this.notifier.notify('success', 'Record Saved Successfully.!'); + // this.dialogRef.close(); + // // alert("sample alert for Saving"); + // } + // else { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Some Thing Wents Wrong Try Again !"; + // } + // }, error => { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Something Wents Wrong Try Again !"; + // this.dialogRef.close(); + // }); + // //After Saving the BRANCH data then popup close + // // this.dialogRef.close(); + } + } + + /** To Reset Popup Data */ + onReset() { + // this._addQuesFrom.reset(); + } + + // { + // 'main_raw_materials': 'sdkjfal', + // 'supplier_details' ; [ + // { + // 'supplier_name':'ldskjfalks', + // 'payment_mode': '1', + // 'payment_mode_value':'' + // } + // ] + // } + } 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 1d7761abf..16fcc96b5 100644 --- 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 @@ -377,7 +377,7 @@ -

supplier

+
@@ -388,8 +388,7 @@ - -

Personal

+
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 33b989c0c..a9e41f2d6 100644 --- 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 @@ -189,6 +189,14 @@ export class PdTrigerService { ) } +// common Pd form details get for the Pd Process +getPDFormDetailsWithID(pdID, formID ):Observable { + return this._http.post(this.apiUrl+"getPDFormDetails",{"pdid":pdID,"pd_form_id" : formID}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // save pd answers savePDQuestions(saveData: any): Observable { saveData.createdby = this._aws.getlocale(); From 5425dc72de81a54ff37a0efe052bb3d54af40e79 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 5 Nov 2018 12:10:52 +0530 Subject: [PATCH 04/14] personal info changes --- .../start-pd/forms/personal-info/personal-info.component.ts | 2 +- .../manage-pd/list-pd/start-pd/start-pd.component.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts index 296611de6..267301dbc 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts @@ -101,6 +101,6 @@ export class PersonalInfoComponent implements OnInit { } }, error => this.errorMessage = error); } -// + } 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 16fcc96b5..7a6677638 100644 --- 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 @@ -389,6 +389,7 @@ +
From 215de92b412eee6f0a0f82dccfd20a0d5a1c1b1a Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Mon, 5 Nov 2018 12:19:23 +0530 Subject: [PATCH 05/14] save pd form service details check : kdk --- .../pd-service/pd-triger.service.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 a9e41f2d6..213e638bd 100644 --- 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 @@ -197,6 +197,19 @@ getPDFormDetailsWithID(pdID, formID ):Observable { ) } + // save Pd form details + savePDFormDetailsWithID(saveData: any): Observable { + saveData.fk_createdby = this._aws.getlocale(); + saveData.fk_createdon = currentdate; + // saveData[0].fk_updatedby = this._aws.getlocale(); + // saveData[0].updatedon = currentdate; + + return this._http.post(this.apiUrl+"savePDFormDetails",{"records":saveData}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // save pd answers savePDQuestions(saveData: any): Observable { saveData.createdby = this._aws.getlocale(); From 73da3b4efd46686e1a1e5203294e1c91d09bcd92 Mon Sep 17 00:00:00 2001 From: saravanakumarkandasami Date: Mon, 5 Nov 2018 15:46:31 +0530 Subject: [PATCH 06/14] Templates UI --- .../questions/list/list.component.html | 7 ++- .../templates.list.component.html | 48 ++++++------------- .../templates.list.component.scss | 4 +- .../templates.list.component.ts | 12 ++++- 4 files changed, 29 insertions(+), 42 deletions(-) diff --git a/ng6-seed/src/app/template/questions/list/list.component.html b/ng6-seed/src/app/template/questions/list/list.component.html index fd7fe1a92..ac0ed4c45 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.html +++ b/ng6-seed/src/app/template/questions/list/list.component.html @@ -47,11 +47,10 @@
-
- - -
+ - -
- + + + @@ -33,7 +33,7 @@
- {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} ,
+ {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} ,

@@ -45,38 +45,18 @@
- - -
-
- + + + + +
No Record Found ...
-
-
- - -
+ +
+ diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss index a0999becd..00579aa03 100644 --- a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss +++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss @@ -25,8 +25,8 @@ overflow: hidden; // white-space: nowrap; display: -webkit-box; - line-height: 16px; /* fallback */ - max-height: 32px; /* fallback */ + line-height: 15px; /* fallback */ + max-height: 44px; /* fallback */ -webkit-line-clamp: 2; /* number of lines to show */ -webkit-box-orient: vertical; diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts index c72aaf2e2..34122c711 100644 --- a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts +++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts @@ -20,12 +20,13 @@ import { TemplatesAddComponent } from './templates-add/templates-add.component'; }) export class TemplateListComponent implements OnInit, OnDestroy { - public templateList = []; + public templateList: any[] = []; public listView: boolean; public names: string; public noTemplMasterRecrdFound: boolean = false; public search_cid : any; + // pagination variable details length = 50; pageIndex = 0; @@ -55,6 +56,10 @@ export class TemplateListComponent implements OnInit, OnDestroy { this.getTemplateMastersListDetails(); } + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } // get question master list details getTemplateMastersListDetails() { @@ -123,7 +128,10 @@ export class TemplateListComponent implements OnInit, OnDestroy { //Called once, before the instance is destroyed. //Add 'implements OnDestroy' to the class. } - + // padination page event call + pageChange(e) { + console.log(e); + } public m_templateList = { "dataStatus": true, From 53c5f08cd82adb78debaf93133272149df589925 Mon Sep 17 00:00:00 2001 From: saravanakumarkandasami Date: Mon, 5 Nov 2018 16:15:41 +0530 Subject: [PATCH 07/14] entity UI --- .../entity-list/entity.list.component.html | 45 +++---------------- .../entity-list/entity.list.component.ts | 4 +- 2 files changed, 9 insertions(+), 40 deletions(-) diff --git a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html index c6ce4f330..d1e73369d 100644 --- a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html +++ b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html @@ -34,54 +34,23 @@ - - + - - +
No Record Found ...
-
- - -
+ diff --git a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts index 5a2243c77..6e3aa81c9 100644 --- a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts @@ -36,14 +36,14 @@ export class EntityListComponent implements OnInit { // pagination variable details length = 50; pageIndex = 0; - pageSize = 10; + pageSize = 10; pageEvent: PageEvent; // data source variable details questionListData = null; public dataLength: number; public dataSource = new MatTableDataSource(); - displayedColumns = ['categroy_name', 'question', 'actions']; + displayedColumns = ['entity_name', 'name','contact', 'actions']; @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; From bf2ed84d309b493b38629fea578c4c4c851fdc2b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 5 Nov 2018 16:37:10 +0530 Subject: [PATCH 08/14] personal discussion changes --- .../personal-info.component.html | 101 ++++++------ .../personal-info/personal-info.component.ts | 152 ++++++++++++++---- .../list-pd/start-pd/start-pd.component.html | 2 +- .../list-pd/start-pd/start-pd.component.ts | 3 + 4 files changed, 175 insertions(+), 83 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html index 270154728..7f2b3e5f5 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html @@ -1,4 +1,4 @@ -
+ @@ -12,38 +12,33 @@
- - - - - - - - - - - - - - - - - - - - {{education}} - - - - - - - - - {{earning}} - - - + + + + + + + + + + + + + + + + {{education}} + + + + + + + + {{earning}} + + +
@@ -57,48 +52,48 @@ -
+
Co Applicant -
+
- + - + - + - + - + - + - + - + {{education}} - + - + {{earning}} - + - + {{rel.name}} @@ -109,17 +104,17 @@ - - - - +
- - +
+ + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts index 267301dbc..e683072c6 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts @@ -15,12 +15,17 @@ export class PersonalInfoComponent implements OnInit { earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"]; relationShipList:any=[]; @Input() pdid : string; + @Input() pd_all_details:any; form_id:number; private notifier: NotifierService; public _personalForm: FormGroup; public mainApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status"]; public coApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status","Relationship"]; + + public mainApplicantDetails :any=[]; + public coApplicantDetails :any=[]; + errorMessage:any; //coItem:any; //mainItem:any; @@ -35,53 +40,106 @@ export class PersonalInfoComponent implements OnInit { ngOnInit() { this.loadPDDetails(this.pdid,this.form_id); - this.loadFormData(); this.getRelationMaster(); - } + this.mainApplicantDetails = this.pd_all_details.pdapplicants_detials.filter(item => item.applicant_type == 1); + // console.log(this.mainApplicantDetails) + this.coApplicantDetails = this.pd_all_details.pdapplicants_detials.filter(item => item.applicant_type == 0); + } // load form pd details loadPDDetails(pd:string,form:number){ - // this._pd.getAllMasterDatas(pdid,form_id).subscribe( - // data => { - // if (data.status == 200) { - // this.relationShipList=data.records; - - // } - // }, error => this.errorMessage = error); + this._pd.getPDFormDetailsWithID(this.pdid,this.form_id).subscribe( + data => { + if (data.status == 200) { + + + } + else if(data.status == 204){ + let defaultMainApp=[]; + let defaultCoApp=[]; + // generate default main applicant form details + if(this.mainApplicantDetails.length>0){ + for(let j=0;j this.errorMessage = error); } - loadFormData(){ + loadFormData(mainApp,coApp){ // main applicant - let mainApplicantGroup = new FormArray(this.mainApplicantQuestions.map((item,key) => new FormGroup({ - fk_pd_id:new FormControl(null), - pd_question:new FormControl(this.mainApplicantQuestions[key]), - pd_question_type:new FormControl(key), - pd_detail_answer_id: new FormControl(null), - pd_answer_id: new FormControl(null,), - pd_answer: new FormControl(null,Validators.required), - pd_answer_weightage:new FormControl(null), + let mainApplicantGroup = new FormArray(this.mainApplicantDetails.map((item,key) => new FormGroup({ + name_ques:new FormControl(this.mainApplicantQuestions[0]), + name_ans:new FormControl(item.applicant_name, Validators.required), + name_id:new FormControl(0), + age_ques:new FormControl(this.mainApplicantQuestions[1]), + age_id:new FormControl(1), + age_ans:new FormControl(null, Validators.required), + entity_ques: new FormControl(this.mainApplicantQuestions[2]), + entity_id: new FormControl(2), + entity_ans:new FormControl(null, Validators.required), + qualification_ques: new FormControl(this.mainApplicantQuestions[3]), + qualification_id: new FormControl(3), + qualification_ans:new FormControl(null, Validators.required), + earningStatus_ques:new FormControl(this.mainApplicantQuestions[4]), + earning_id: new FormControl(4), + earning_ans:new FormControl(null, Validators.required), + }))); // co applicant - let coApplicantGroup = new FormArray(this.coApplicantQuestions.map((item,key) => new FormGroup({ - fk_pd_id:new FormControl(null), - pd_question:new FormControl(this.coApplicantQuestions[key]), - pd_question_type:new FormControl(key), - pd_detail_answer_id: new FormControl(null), - pd_answer_id: new FormControl(null), - pd_answer: new FormControl(null, Validators.required), - pd_answer_weightage:new FormControl(null), - }))); - + let iterateCoApp=[]; + + let coApplicantGroup = new FormArray(this.coApplicantDetails.map((item,key) => new FormGroup({ + name_ques:new FormControl(this.coApplicantQuestions[0]), + name_ans:new FormControl(item.applicant_name, Validators.required), + name_id:new FormControl(0), + age_ques:new FormControl(this.coApplicantQuestions[1]), + age_id:new FormControl(1), + age_ans:new FormControl(null, Validators.required), + entity_ques: new FormControl(this.coApplicantQuestions[2]), + entity_id: new FormControl(2), + entity_ans:new FormControl(null, Validators.required), + qualification_ques: new FormControl(this.coApplicantQuestions[3]), + qualification_id: new FormControl(3), + qualification_ans:new FormControl(null, Validators.required), + earningStatus_ques:new FormControl(this.coApplicantQuestions[4]), + earning_id: new FormControl(4), + earning_ans:new FormControl(null, Validators.required), + relationShip_ques:new FormControl(this.coApplicantQuestions[5]), + relation_id:new FormControl(5), + relation_ans:new FormControl(null, Validators.required), + }))); + this._personalForm = this._fb.group({ pdid:null, form_id:null, mainItem: mainApplicantGroup, coItem: coApplicantGroup, }); + //console.log(this._personalForm); - console.log(this._personalForm.controls.coItem) } //get pd main applicant array values @@ -102,5 +160,41 @@ export class PersonalInfoComponent implements OnInit { }, error => this.errorMessage = error); } +// submit forms details +submitPersonalForm(formData:any) { + if(this._personalForm.valid){ + let applicantDetails:any=[]; + + formData.mainItem.forEach((element,key) => { + if(key==0){ + applicantDetails.push(element) + } + console.log(element); + console.log(key); + + }); + formData.coItem.forEach((Coelement,Cokey) => { + applicantDetails.push(Coelement) + + }); + + let save_details:any={ + "pdid": this.pdid, + "formid": this.form_id, + "applicant_details":applicantDetails + }; + this._pd.savePDQuestions(save_details).subscribe(result => { + if (result.status == 200) { + this.notifier.notify('success', 'Success.'); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + } +} + } 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 7a6677638..6651573d6 100644 --- 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 @@ -389,7 +389,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts index 1bedab318..5673a92b3 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -29,6 +29,7 @@ selectedQuestionIndex:number; getQuestionsLength:number; answerList:any=[]; ansPDList:any=[]; +pdFullDetails:any=[]; // category static form buttons categoryFormButtons : any=[ @@ -107,6 +108,8 @@ loadTemplates(startID:string){ this.actualQuestions = data.records.counts.overall_question_count; this.answeredQuestions = data.records.counts.overall_answered_count; + this.pdFullDetails = data.records + } else{ this.pdMasterList=""; From 99896dcb8eb8b1adabc89abb75d74d580945f061 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 5 Nov 2018 16:37:52 +0530 Subject: [PATCH 09/14] merge : kms --- .../pd-service/pd-triger.service.ts | 13 +++++ .../entity-list/entity.list.component.html | 45 +++-------------- .../entity-list/entity.list.component.ts | 4 +- .../questions/list/list.component.html | 7 ++- .../templates.list.component.html | 48 ++++++------------- .../templates.list.component.scss | 4 +- .../templates.list.component.ts | 12 ++++- 7 files changed, 51 insertions(+), 82 deletions(-) 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 a9e41f2d6..213e638bd 100644 --- 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 @@ -197,6 +197,19 @@ getPDFormDetailsWithID(pdID, formID ):Observable { ) } + // save Pd form details + savePDFormDetailsWithID(saveData: any): Observable { + saveData.fk_createdby = this._aws.getlocale(); + saveData.fk_createdon = currentdate; + // saveData[0].fk_updatedby = this._aws.getlocale(); + // saveData[0].updatedon = currentdate; + + return this._http.post(this.apiUrl+"savePDFormDetails",{"records":saveData}) + .pipe( + catchError(this.handleError('operation', [])) + ) + } + // save pd answers savePDQuestions(saveData: any): Observable { saveData.createdby = this._aws.getlocale(); diff --git a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html index c6ce4f330..d1e73369d 100644 --- a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html +++ b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html @@ -34,54 +34,23 @@ - - + - - +
No Record Found ...
-
- - -
+
diff --git a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts index 5a2243c77..6e3aa81c9 100644 --- a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts @@ -36,14 +36,14 @@ export class EntityListComponent implements OnInit { // pagination variable details length = 50; pageIndex = 0; - pageSize = 10; + pageSize = 10; pageEvent: PageEvent; // data source variable details questionListData = null; public dataLength: number; public dataSource = new MatTableDataSource(); - displayedColumns = ['categroy_name', 'question', 'actions']; + displayedColumns = ['entity_name', 'name','contact', 'actions']; @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; diff --git a/ng6-seed/src/app/template/questions/list/list.component.html b/ng6-seed/src/app/template/questions/list/list.component.html index fd7fe1a92..ac0ed4c45 100644 --- a/ng6-seed/src/app/template/questions/list/list.component.html +++ b/ng6-seed/src/app/template/questions/list/list.component.html @@ -47,11 +47,10 @@ -
- - -
+
- -
- + + + @@ -33,7 +33,7 @@
- {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} ,
+ {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} ,

@@ -45,38 +45,18 @@
- - -
-
- + + + + +
No Record Found ...
-
-
- - -
+ +
+ diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss index a0999becd..00579aa03 100644 --- a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss +++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.scss @@ -25,8 +25,8 @@ overflow: hidden; // white-space: nowrap; display: -webkit-box; - line-height: 16px; /* fallback */ - max-height: 32px; /* fallback */ + line-height: 15px; /* fallback */ + max-height: 44px; /* fallback */ -webkit-line-clamp: 2; /* number of lines to show */ -webkit-box-orient: vertical; diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts index c72aaf2e2..34122c711 100644 --- a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts +++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts @@ -20,12 +20,13 @@ import { TemplatesAddComponent } from './templates-add/templates-add.component'; }) export class TemplateListComponent implements OnInit, OnDestroy { - public templateList = []; + public templateList: any[] = []; public listView: boolean; public names: string; public noTemplMasterRecrdFound: boolean = false; public search_cid : any; + // pagination variable details length = 50; pageIndex = 0; @@ -55,6 +56,10 @@ export class TemplateListComponent implements OnInit, OnDestroy { this.getTemplateMastersListDetails(); } + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } // get question master list details getTemplateMastersListDetails() { @@ -123,7 +128,10 @@ export class TemplateListComponent implements OnInit, OnDestroy { //Called once, before the instance is destroyed. //Add 'implements OnDestroy' to the class. } - + // padination page event call + pageChange(e) { + console.log(e); + } public m_templateList = { "dataStatus": true, From 1d4615b1e543434606759aa3613dbb25f18327d7 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 5 Nov 2018 17:11:12 +0530 Subject: [PATCH 10/14] personal info changes --- .../personal-info/personal-info.component.ts | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts index e683072c6..25dc2bec0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts @@ -167,14 +167,26 @@ submitPersonalForm(formData:any) { formData.mainItem.forEach((element,key) => { if(key==0){ - applicantDetails.push(element) + applicantDetails.push({ + "name_ans":element.name_ans, + "age_ans":element.age_ans, + "entity_ans":element.entity_ans, + "qualification_ans":element.qualification_ans, + "earning_ans":element.earning_ans, + }) } - console.log(element); - console.log(key); }); formData.coItem.forEach((Coelement,Cokey) => { - applicantDetails.push(Coelement) + applicantDetails.push({ + + "name_ans":Coelement.name_ans, + "age_ans":Coelement.age_ans, + "qualification_ans":Coelement.qualification_ans, + "entity_ans":Coelement.entity_ans, + "earning_ans":Coelement.earning_ans, + "relation_ans":Coelement.relation_ans, + }) }); @@ -183,7 +195,7 @@ submitPersonalForm(formData:any) { "formid": this.form_id, "applicant_details":applicantDetails }; - this._pd.savePDQuestions(save_details).subscribe(result => { + this._pd.savePDFormDetailsWithID(save_details).subscribe(result => { if (result.status == 200) { this.notifier.notify('success', 'Success.'); } From 1db3a58fa820526a9982f99cc8626b36ea0fb12f Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Mon, 5 Nov 2018 17:54:44 +0530 Subject: [PATCH 11/14] supplier changes details : kdk --- .../client-info/client-info.component.html | 84 +++++- .../client-info/client-info.component.ts | 250 +++++++++++++++++- .../supplier-info.component.html | 2 +- .../supplier-info/supplier-info.component.ts | 143 +++++++--- .../list-pd/start-pd/start-pd.component.html | 2 +- .../pd-service/pd-triger.service.ts | 3 +- 6 files changed, 431 insertions(+), 53 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index 0c0a40381..2582904d1 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -1,3 +1,81 @@ -

- client-info works! -

+ + +
+
+
+
+
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + + {{ pm.name }} + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ + + {{ feq.name }} + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts index 80ae7153a..5e373360f 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts @@ -1,5 +1,27 @@ -import { Component, OnInit } from '@angular/core'; +/** Common Imports */ +import { + Component, + OnInit, + Inject, + Input +} from '@angular/core'; +import { + FormBuilder, + FormGroup, + Validators, + FormArray, +} from '@angular/forms'; + +import { NotifierService } from 'angular-notifier'; + +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material'; +/** Service */ +import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; @Component({ selector: 'app-client-info', templateUrl: './client-info.component.html', @@ -7,9 +29,233 @@ import { Component, OnInit } from '@angular/core'; }) export class ClientInfoComponent implements OnInit { - constructor() { } + @Input() pdid: number; + + public _supplierQuesFrom: FormGroup; + public submitted = false; + public m_paymentModeType= [ + { + 'id': "1", + 'name': 'Immediate Or Advanced Payment' + }, + { + 'id': "2", + 'name': 'Credit' + }, + { + 'id': "3", + 'name': 'Combination of Both' + }, + ]; + + public m_freqOfPurchase= [ + { + 'id': "1", + 'name': 'Daily' + }, + { + 'id': "2", + 'name': 'Weekly' + }, + { + 'id': "3", + 'name': 'Monthly' + }, + { + 'id': "4", + 'name': 'Every 3 months' + }, + { + 'id': "5", + 'name': 'Half yearly' + }, + { + 'id': "6", + 'name': 'Yearly' + }, + { + 'id': "7", + 'name': 'As and when required' + }, + { + 'id': "8", + 'name': 'Others' + } + ] + + constructor( + private _formBuilder: FormBuilder, + private pdTrigerService: PdTrigerService) { } ngOnInit() { + + this.getPdSupplierFormDetails(); + } +apiLoadFinish: boolean = false; + getPdSupplierFormDetails() { + this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe( + data => { + if (data) { + if(data.dataStatus){ + this.formLoadData(data.records) + } else { + this.formLoadData(null) + } + this.apiLoadFinish = true; + } else { + // this.noRecordFound = true; + } + } + ); } + formLoadData(val) { + if(val !== null) { + let value = val; + this._supplierQuesFrom = this._formBuilder.group({ + pdid: [this.pdid], + formid: ['1'], + main_raw_materials: [value.main_raw_materials, Validators.compose([Validators.required])], + supplier_details: this._formBuilder.array([ + // this.initDetails(), + ]) + }); + this.addSupplierDetailsWithData(value.supplier_details); + } else { + this._supplierQuesFrom = this._formBuilder.group({ + pdid: [this.pdid], + formid: ['1'], + main_raw_materials: [null, Validators.compose([Validators.required])], + supplier_details: this._formBuilder.array([ + this.initDetails(), + ]) + }); + } + } + + // convenience getter for easy access to form fields + get f() { return this._supplierQuesFrom.controls; } + + // Dynamic Form field creation Functionality : START ===> + initDetails() { + return this._formBuilder.group({ + supplier_name: ['', Validators.compose([Validators.required])], + contact_person: ['', Validators.compose([Validators.required])], + mobile_number: ['', Validators.compose([Validators.required])], + payment_mode: ['', Validators.compose([Validators.required])], + per_of_immediate_advance_payment:[''], + credit_period:[''], + frequency_of_purchase: ['', Validators.compose([Validators.required])], + freq_purchase_others_text_value: [''] + }); + } + + initDetailsWithdata(data) { + return this._formBuilder.group({ + supplier_name: [data.supplier_name, Validators.compose([Validators.required])], + contact_person: [data.contact_person, Validators.compose([Validators.required])], + mobile_number: [data.mobile_number, Validators.compose([Validators.required])], + payment_mode: [data.payment_mode, Validators.compose([Validators.required])], + per_of_immediate_advance_payment:[data.per_of_immediate_advance_payment || ''], + credit_period:[data.credit_period || ''], + frequency_of_purchase: [data.frequency_of_purchase, Validators.compose([Validators.required])], + freq_purchase_others_text_value: [data.freq_purchase_others_text_value || ''] + }); + } + + addSupplierDetailsWithData(supp_data) { + +var result = Object.keys(supp_data).map(function(key) { + return supp_data[key]; +}); + if (result.length > 0) { + for (let val of result) { + let vals = { + supplier_name: val.supplier_name, + contact_person: val.contact_person, + mobile_number: val.mobile_number, + payment_mode: val.payment_mode, + per_of_immediate_advance_payment: val.per_of_immediate_advance_payment, + credit_period: val.credit_period, + frequency_of_purchase: val.frequency_of_purchase, + freq_purchase_others_text_value: val.freq_purchase_others_text_value + }; + const control = this._supplierQuesFrom.controls['supplier_details']; + control.push(this.initDetailsWithdata(vals)); + } + } + } + + addSupplierDetails(e) { + const control = this._supplierQuesFrom.controls['supplier_details']; + control.push(this.initDetails()); + } + removeLanguage(i: number) { + const control = this._supplierQuesFrom.controls['supplier_details']; + control.removeAt(i); + } + + public paymentModeTextBox: number; + selectedPM(e) { + this.paymentModeTextBox = e.value; + // this.f.supplier_details.controls.get('payment_mode_value'); + } + + public freqPurchaseTextBox: number; + selectedFreqPurchase(e){ + this.freqPurchaseTextBox = e.value; + } + + + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + // stop here if form is invalid + if (this._supplierQuesFrom.invalid) { + return; + } else { + var answerFormValues = this._supplierQuesFrom.value; + + //To Remove The "Null" With Key also + Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); + alert(JSON.stringify(answerFormValues)); + //Add BRANCH data with help Service File + this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( + dataresult => { + if (dataresult.status == 200) { + // console.log(dataresult); + // this.notifier.notify('success', 'Record Saved Successfully.!'); + // this.dialogRef.close(); + // alert("sample alert for Saving"); + } + else { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Some Thing Wents Wrong Try Again !"; + } + }, error => { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Something Wents Wrong Try Again !"; + // this.dialogRef.close(); + }); + //After Saving the BRANCH data then popup close + // this.dialogRef.close(); + } + } + + /** To Reset Popup Data */ + onReset() { + // this._addQuesFrom.reset(); + } + + // { + // 'main_raw_materials': 'sdkjfal', + // 'supplier_details' ; [ + // { + // 'supplier_name':'ldskjfalks', + // 'payment_mode': '1', + // 'payment_mode_value':'' + // } + // ] + // } + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 952ecbda0..152e6d3a5 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -1,6 +1,6 @@ -
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 9f52ed182..3a2f64e99 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -35,50 +35,50 @@ export class SupplierInfoComponent implements OnInit { public submitted = false; public m_paymentModeType= [ { - 'id': 1, + 'id': "1", 'name': 'Immediate Or Advanced Payment' }, { - 'id': 2, + 'id': "2", 'name': 'Credit' }, { - 'id': 3, + 'id': "3", 'name': 'Combination of Both' }, ]; public m_freqOfPurchase= [ { - 'id': 1, + 'id': "1", 'name': 'Daily' }, { - 'id': 2, + 'id': "2", 'name': 'Weekly' }, { - 'id': 3, + 'id': "3", 'name': 'Monthly' }, { - 'id': 4, + 'id': "4", 'name': 'Every 3 months' }, { - 'id': 5, + 'id': "5", 'name': 'Half yearly' }, { - 'id': 6, + 'id': "6", 'name': 'Yearly' }, { - 'id': 7, + 'id': "7", 'name': 'As and when required' }, { - 'id': 8, + 'id': "8", 'name': 'Others' } ] @@ -88,25 +88,20 @@ export class SupplierInfoComponent implements OnInit { private pdTrigerService: PdTrigerService) { } ngOnInit() { - this._supplierQuesFrom = this._formBuilder.group({ - main_raw_materials: [null, Validators.compose([Validators.required])], - supplier_details: this._formBuilder.array([ - this.initDetails(), - ]) - }); + this.getPdSupplierFormDetails(); } - +apiLoadFinish: boolean = false; getPdSupplierFormDetails() { this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe( data => { if (data) { - if (data.records) { - // this.noRecordFound = false; - // this.entityBillingInfoRecord = data.records; - } else { - // this.noRecordFound = true; - } + if(data.dataStatus){ + this.formLoadData(data.records) + } else { + this.formLoadData(null) + } + this.apiLoadFinish = true; } else { // this.noRecordFound = true; } @@ -114,6 +109,30 @@ export class SupplierInfoComponent implements OnInit { ); } + formLoadData(val) { + if(val !== null) { + let value = val; + this._supplierQuesFrom = this._formBuilder.group({ + pdid: [this.pdid], + formid: ['1'], + main_raw_materials: [value.main_raw_materials, Validators.compose([Validators.required])], + supplier_details: this._formBuilder.array([ + // this.initDetails(), + ]) + }); + this.addSupplierDetailsWithData(value.supplier_details); + } else { + this._supplierQuesFrom = this._formBuilder.group({ + pdid: [this.pdid], + formid: ['1'], + main_raw_materials: [null, Validators.compose([Validators.required])], + supplier_details: this._formBuilder.array([ + this.initDetails(), + ]) + }); + } + } + // convenience getter for easy access to form fields get f() { return this._supplierQuesFrom.controls; } @@ -131,6 +150,42 @@ export class SupplierInfoComponent implements OnInit { }); } + initDetailsWithdata(data) { + return this._formBuilder.group({ + supplier_name: [data.supplier_name, Validators.compose([Validators.required])], + contact_person: [data.contact_person, Validators.compose([Validators.required])], + mobile_number: [data.mobile_number, Validators.compose([Validators.required])], + payment_mode: [data.payment_mode, Validators.compose([Validators.required])], + per_of_immediate_advance_payment:[data.per_of_immediate_advance_payment || ''], + credit_period:[data.credit_period || ''], + frequency_of_purchase: [data.frequency_of_purchase, Validators.compose([Validators.required])], + freq_purchase_others_text_value: [data.freq_purchase_others_text_value || ''] + }); + } + + addSupplierDetailsWithData(supp_data) { + +var result = Object.keys(supp_data).map(function(key) { + return supp_data[key]; +}); + if (result.length > 0) { + for (let val of result) { + let vals = { + supplier_name: val.supplier_name, + contact_person: val.contact_person, + mobile_number: val.mobile_number, + payment_mode: val.payment_mode, + per_of_immediate_advance_payment: val.per_of_immediate_advance_payment, + credit_period: val.credit_period, + frequency_of_purchase: val.frequency_of_purchase, + freq_purchase_others_text_value: val.freq_purchase_others_text_value + }; + const control = this._supplierQuesFrom.controls['supplier_details']; + control.push(this.initDetailsWithdata(vals)); + } + } + } + addSupplierDetails(e) { const control = this._supplierQuesFrom.controls['supplier_details']; control.push(this.initDetails()); @@ -164,26 +219,26 @@ export class SupplierInfoComponent implements OnInit { //To Remove The "Null" With Key also Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); alert(JSON.stringify(answerFormValues)); - // //Add BRANCH data with help Service File - // this.questionsService.addQuestionMasterDetails(answerFormValues).subscribe( - // dataresult => { - // if (dataresult.status == 200) { - // console.log(dataresult); - // this.notifier.notify('success', 'Record Saved Successfully.!'); - // this.dialogRef.close(); - // // alert("sample alert for Saving"); - // } - // else { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // this.errorMessage = "Some Thing Wents Wrong Try Again !"; - // } - // }, error => { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // this.errorMessage = "Something Wents Wrong Try Again !"; - // this.dialogRef.close(); - // }); - // //After Saving the BRANCH data then popup close - // // this.dialogRef.close(); + //Add BRANCH data with help Service File + this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( + dataresult => { + if (dataresult.status == 200) { + // console.log(dataresult); + // this.notifier.notify('success', 'Record Saved Successfully.!'); + // this.dialogRef.close(); + // alert("sample alert for Saving"); + } + else { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Some Thing Wents Wrong Try Again !"; + } + }, error => { + // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // this.errorMessage = "Something Wents Wrong Try Again !"; + // this.dialogRef.close(); + }); + //After Saving the BRANCH data then popup close + // this.dialogRef.close(); } } 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 7a6677638..bc826bf96 100644 --- 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 @@ -383,7 +383,7 @@ -

client

+
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 213e638bd..06398801e 100644 --- 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 @@ -191,7 +191,7 @@ export class PdTrigerService { // common Pd form details get for the Pd Process getPDFormDetailsWithID(pdID, formID ):Observable { - return this._http.post(this.apiUrl+"getPDFormDetails",{"pdid":pdID,"pd_form_id" : formID}) + return this._http.post(this.apiUrl+"getPDFormDetails",{"pd_id":pdID,"pd_form_id" : formID}) .pipe( catchError(this.handleError('operation', [])) ) @@ -200,7 +200,6 @@ getPDFormDetailsWithID(pdID, formID ):Observable { // save Pd form details savePDFormDetailsWithID(saveData: any): Observable { saveData.fk_createdby = this._aws.getlocale(); - saveData.fk_createdon = currentdate; // saveData[0].fk_updatedby = this._aws.getlocale(); // saveData[0].updatedon = currentdate; From 22dbdf39af457eec49e4e169a2282610511c77f6 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Mon, 5 Nov 2018 19:39:02 +0530 Subject: [PATCH 12/14] personal info form changes : kdk --- .../personal-info.component.html | 24 ++++---- .../personal-info/personal-info.component.ts | 57 ++++++++++++++++--- 2 files changed, 62 insertions(+), 19 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html index 7f2b3e5f5..f8a09f739 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html @@ -1,4 +1,4 @@ - + @@ -13,19 +13,19 @@
- + - + - + - + {{education}} @@ -33,7 +33,7 @@ - + {{earning}} @@ -61,22 +61,22 @@
- + - + - + - + {{education}} @@ -85,7 +85,7 @@ - + {{earning}} @@ -93,7 +93,7 @@ - + {{rel.name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts index 25dc2bec0..9dad2e46c 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.ts @@ -52,7 +52,7 @@ export class PersonalInfoComponent implements OnInit { this._pd.getPDFormDetailsWithID(this.pdid,this.form_id).subscribe( data => { if (data.status == 200) { - + this.loadFormWithIDData(data.records); } else if(data.status == 204){ @@ -85,7 +85,48 @@ export class PersonalInfoComponent implements OnInit { } }, error => this.errorMessage = error); - } +} + +loadDataStatus: boolean; + +loadFormWithIDData(data) { + var main_result = Object.keys(data.main_applicant_details).map(function(key) { + return data.main_applicant_details[key]; +}); +var co_result = Object.keys(data.co_applicant_details).map(function(key) { + return data.co_applicant_details[key]; +}); + + // main applicant + let mainApplicantGroup = new FormArray(main_result.map((item,key) => new FormGroup({ + name_ans:new FormControl(item.name_ans, Validators.required), + age_ans:new FormControl(item.age_ans, Validators.required), + entity_ans:new FormControl(item.entity_ans, Validators.required), + qualification_ans:new FormControl(item.qualification_ans, Validators.required), + earning_ans:new FormControl(item.earning_ans, Validators.required), + }))); + // co applicant + let iterateCoApp=[]; + + let coApplicantGroup = new FormArray(co_result.map((item,key) => new FormGroup({ + name_ans:new FormControl(item.name_ans, Validators.required), + age_ans:new FormControl(item.age_ans, Validators.required), + entity_ans:new FormControl(item.entity_ans, Validators.required), + qualification_ans:new FormControl(item.qualification_ans, Validators.required), + earning_ans:new FormControl(item.earning_ans, Validators.required), + relation_ans:new FormControl(item.relation_ans, Validators.required), + + }))); + + this._personalForm = this._fb.group({ + pdid:null, + form_id:null, + mainItem: mainApplicantGroup, + coItem: coApplicantGroup, + }); + //console.log(this._personalForm); + this.loadDataStatus = true; +} loadFormData(mainApp,coApp){ // main applicant @@ -139,7 +180,7 @@ export class PersonalInfoComponent implements OnInit { coItem: coApplicantGroup, }); //console.log(this._personalForm); - +this.loadDataStatus = true; } //get pd main applicant array values @@ -163,11 +204,12 @@ export class PersonalInfoComponent implements OnInit { // submit forms details submitPersonalForm(formData:any) { if(this._personalForm.valid){ - let applicantDetails:any=[]; + let main_applicantDetails:any=[]; + let co_applicantDetails:any=[]; formData.mainItem.forEach((element,key) => { if(key==0){ - applicantDetails.push({ + main_applicantDetails.push({ "name_ans":element.name_ans, "age_ans":element.age_ans, "entity_ans":element.entity_ans, @@ -178,7 +220,7 @@ submitPersonalForm(formData:any) { }); formData.coItem.forEach((Coelement,Cokey) => { - applicantDetails.push({ + co_applicantDetails.push({ "name_ans":Coelement.name_ans, "age_ans":Coelement.age_ans, @@ -193,7 +235,8 @@ submitPersonalForm(formData:any) { let save_details:any={ "pdid": this.pdid, "formid": this.form_id, - "applicant_details":applicantDetails + "main_applicant_details":main_applicantDetails, + "co_applicant_details":co_applicantDetails }; this._pd.savePDFormDetailsWithID(save_details).subscribe(result => { if (result.status == 200) { From 84668c77e5b7483449358db354e4dfb60b0f8ca4 Mon Sep 17 00:00:00 2001 From: saravanakumarkandasami Date: Wed, 7 Nov 2018 15:02:42 +0530 Subject: [PATCH 13/14] UI in PD and QC forms --- .../supplier-info.component.html | 141 +++++++++--------- .../list-pd/start-pd/start-pd.component.html | 21 ++- .../list-pd/view-pd/view-pd.component.html | 6 +- .../qc-list/qc-view/qc-view.component.html | 6 +- ng6-seed/src/index.html | 2 +- 5 files changed, 95 insertions(+), 81 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 152e6d3a5..b244be4e3 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -1,5 +1,6 @@ +

Supplier Details

@@ -11,73 +12,79 @@
-
-
-
-
- - - - -
-
- - - - -
-
- - - - -
-
-
-
- - - {{ pm.name }} - - -
-
- - - - -
-
- - - - -
-
-
-
- - - {{ feq.name }} - - -
-
- - - - -
- -
- - - -
-
-
-
- + +
+
+
+ + +
+
+
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 8653773ec..7788df8b8 100644 --- 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 @@ -23,8 +23,8 @@ - - {{ (formButton.form_name.length>15)? (formButton.form_name | slice:0:15)+'..':(formButton.form_name) }} + + {{ (formButton.form_name.length>17)? (formButton.form_name | slice:0:17)+'..':(formButton.form_name) }} @@ -58,9 +58,8 @@
- - -

No Records Found..

+ +

No Records Found..

@@ -69,8 +68,8 @@ - - + + {{optionsForm.controls.pd_question.value}} @@ -134,7 +133,7 @@
-
+
skip_previous chevron_left @@ -148,7 +147,7 @@ - + {{selectedCategory.question}} @@ -237,7 +236,7 @@
-
+
skip_previous chevron_left @@ -333,7 +332,7 @@
-
+
skip_previous chevron_left diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index 00b3d4d69..a0dfcc36d 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -45,9 +45,13 @@ + +

{{master.pd_contact_person}}   {{master.pd_contact_mobileno}} (Lender Contact Details)

+

{{master.product_name}} / {{master.subproduct_name}}

{{master.pd_type_name}} /  {{master.loan_amount}}

-

{{master.addressline1}} , {{master.addressline2}} , {{master.addressline3}}

+

{{master.addressline1}} , {{master.addressline2}} , {{master.addressline3}}

+

Remarks : {{master.remarks}}

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 943abcf9c..350c34216 100644 --- 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 @@ -40,10 +40,14 @@ +

{{master.pd_contact_person}}   {{master.pd_contact_mobileno}} (Lender Contact Details)

+

{{master.product_name}} / {{master.subproduct_name}}

{{master.pd_type_name}} /  {{master.loan_amount}}

{{master.addressline1}},{{master.addressline2}} ,{{master.addressline3}}

-
+

Remarks : {{master.remarks}}

+ + diff --git a/ng6-seed/src/index.html b/ng6-seed/src/index.html index 84a9194ad..1703d3bd1 100644 --- a/ng6-seed/src/index.html +++ b/ng6-seed/src/index.html @@ -135,7 +135,7 @@ .swal2-title, .swal2-header { text-align:left !important; } - .mat-card-subtitle{ + .mat-card, .mat-card-content, .mat-card-subtitle{ color:#000 !important; } From 723a7f6a410c22850a189e8164dec31c51e60a83 Mon Sep 17 00:00:00 2001 From: saravanakumarkandasami Date: Wed, 7 Nov 2018 15:55:52 +0530 Subject: [PATCH 14/14] Personal Info UI --- .../personal-info.component.html | 222 +++++++++--------- 1 file changed, 113 insertions(+), 109 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html index f8a09f739..36b5e52f7 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/personal-info/personal-info.component.html @@ -1,120 +1,124 @@
- - + + +
-
- - - Main Applicant - -
-
- - - - - - - - - - - - - - - - - {{education}} - - - - - - - - {{earning}} - - - -
-
- -
-
- - -
- - - - - -
- - - Co Applicant - -
-
- - - - - - - - - - - - - - - - - - - - {{education}} - - - - - - - - - {{earning}} - - +
+ + + Main Applicant + +
+
+ + + - - - - {{rel.name}} - - - -
-
- - -
- -
- -
- -
- - + + + + + + + + + + + {{education}} + + + + + + + + {{earning}} + + + +
+
+ + + + + +
+ + + + + +
+ + + Co Applicant + +
+
+ + + + + + + + + + + + + + + + + + + + {{education}} + + + + + + + + + {{earning}} + + + + + + + + {{rel.name}} + + + +
+
+ + +
+ +
+ + +
+ +
+ + + + +
- +