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..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 @@ -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,53 @@ 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({ + "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, + }) + } + + }); + formData.coItem.forEach((Coelement,Cokey) => { + 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, + }) + + }); + + let save_details:any={ + "pdid": this.pdid, + "formid": this.form_id, + "applicant_details":applicantDetails + }; + this._pd.savePDFormDetailsWithID(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 bc826bf96..8653773ec 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=""; 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,