Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
4e0a4bbf84
@ -1,4 +1,4 @@
|
|||||||
<form [formGroup]="_personalForm">
|
<form [formGroup]="_personalForm" (submit)="submitPersonalForm(_personalForm.value)">
|
||||||
|
|
||||||
<!-- start main applicant details -->
|
<!-- start main applicant details -->
|
||||||
|
|
||||||
@ -12,38 +12,33 @@
|
|||||||
<div [formArrayName]="'mainItem'" *ngFor="let mainDetails of pdMainapplicant.controls; let i = index;">
|
<div [formArrayName]="'mainItem'" *ngFor="let mainDetails of pdMainapplicant.controls; let i = index;">
|
||||||
<div [formGroup]="mainDetails">
|
<div [formGroup]="mainDetails">
|
||||||
|
|
||||||
<mat-form-field style="width: 100%" *ngIf="mainDetails.controls.pd_question_type.value==0">
|
<mat-form-field style="width: 100%">
|
||||||
<!-- <mat-label>{{mainDetails.controls.pd_question.value}}</mat-label> -->
|
<input matInput [placeholder]="mainDetails.controls.name_ques.value" formControlName="name_ans" type="text" required>
|
||||||
<input matInput [placeholder]="mainDetails.controls.pd_question.value" formControlName="pd_answer" type="text" required>
|
</mat-form-field>
|
||||||
</mat-form-field>
|
<mat-form-field style="width: 100%">
|
||||||
<mat-form-field style="width: 100%" *ngIf="mainDetails.controls.pd_question_type.value==1">
|
|
||||||
<!-- <mat-label>{{mainDetails.controls.pd_question.value}}</mat-label> -->
|
<input matInput [placeholder]="mainDetails.controls.age_ques.value" formControlName="age_ans" type="text" required>
|
||||||
|
</mat-form-field>
|
||||||
<input matInput [placeholder]="mainDetails.controls.pd_question.value" formControlName="pd_answer" type="text" required>
|
<mat-form-field style="width: 100%">
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field style="width: 100%" *ngIf="mainDetails.controls.pd_question_type.value==2">
|
<input matInput [placeholder]="mainDetails.controls.entity_ques.value" formControlName="entity_ans" type="text" required>
|
||||||
<!-- <mat-label>{{mainDetails.controls.pd_question.value}}</mat-label> -->
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput [placeholder]="mainDetails.controls.pd_question.value" formControlName="pd_answer" type="text" required>
|
|
||||||
</mat-form-field>
|
<mat-select [placeholder]="mainDetails.controls.qualification_ques.value" formControlName="qualification_ans" required>
|
||||||
<mat-form-field style="width: 100%" *ngIf="mainDetails.controls.pd_question_type.value==3">
|
<mat-option *ngFor="let education of qualifications" [value]="education" >
|
||||||
<!-- <mat-label>{{mainDetails.controls.pd_question.value}}</mat-label> -->
|
{{education}}
|
||||||
|
</mat-option>
|
||||||
<mat-select [placeholder]="mainDetails.controls.pd_question.value" formControlName="pd_answer" required>
|
</mat-select>
|
||||||
<mat-option *ngFor="let education of qualifications" [value]="education" >
|
|
||||||
{{education}}
|
</mat-form-field>
|
||||||
</mat-option>
|
<mat-form-field style="width: 100%">
|
||||||
</mat-select>
|
<mat-select [placeholder]="mainDetails.controls.earningStatus_ques.value" formControlName="earning_ans" required>
|
||||||
|
<mat-option *ngFor="let earning of earningStatus" [value]="earning" >
|
||||||
</mat-form-field>
|
{{earning}}
|
||||||
<mat-form-field style="width: 100%" *ngIf="mainDetails.controls.pd_question_type.value==4">
|
</mat-option>
|
||||||
<!-- <mat-label>{{mainDetails.controls.pd_question.value}}</mat-label> -->
|
</mat-select>
|
||||||
<mat-select [placeholder]="mainDetails.controls.pd_question.value" formControlName="pd_answer" required>
|
</mat-form-field>
|
||||||
<mat-option *ngFor="let earning of earningStatus" [value]="earning" >
|
|
||||||
{{earning}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -57,48 +52,48 @@
|
|||||||
<!-- end main applicant details -->
|
<!-- end main applicant details -->
|
||||||
|
|
||||||
<!-- start co applicant form details -->
|
<!-- start co applicant form details -->
|
||||||
<div fxFlex="50" class="text-xs-left">
|
<div fxFlex="50" class="text-xs-left" [formArrayName]="'coItem'" *ngFor="let coDetails of pdCoapplicant.controls; let i = index;">
|
||||||
|
|
||||||
<mat-card>
|
<mat-card>
|
||||||
<mat-card-title>Co Applicant</mat-card-title>
|
<mat-card-title>Co Applicant</mat-card-title>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div [formArrayName]="'coItem'" *ngFor="let coDetails of pdCoapplicant.controls; let i = index;">
|
<div >
|
||||||
<div [formGroup]="coDetails">
|
<div [formGroup]="coDetails">
|
||||||
<mat-form-field style="width: 100%" *ngIf="coDetails.controls.pd_question_type.value==0">
|
<mat-form-field style="width: 100%">
|
||||||
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
||||||
<input matInput [placeholder]="coDetails.controls.pd_question.value" formControlName="pd_answer" type="text" required>
|
<input matInput [placeholder]="coDetails.controls.name_ques.value" formControlName="name_ans" type="text" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%" *ngIf="coDetails.controls.pd_question_type.value==1">
|
<mat-form-field style="width: 100%">
|
||||||
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
||||||
|
|
||||||
<input matInput [placeholder]="coDetails.controls.pd_question.value" formControlName="pd_answer" type="text" required>
|
<input matInput [placeholder]="coDetails.controls.age_ques.value" formControlName="age_ans" type="text" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%" *ngIf="coDetails.controls.pd_question_type.value==2">
|
<mat-form-field style="width: 100%">
|
||||||
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
||||||
|
|
||||||
<input matInput [placeholder]="coDetails.controls.pd_question.value" formControlName="pd_answer" type="text" required>
|
<input matInput [placeholder]="coDetails.controls.entity_ques.value" formControlName="entity_ans" type="text" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%" *ngIf="coDetails.controls.pd_question_type.value==3">
|
<mat-form-field style="width: 100%">
|
||||||
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
||||||
|
|
||||||
<mat-select [placeholder]="coDetails.controls.pd_question.value" formControlName="pd_answer" required>
|
<mat-select [placeholder]="coDetails.controls.qualification_ques.value" formControlName="qualification_ans" required>
|
||||||
<mat-option *ngFor="let education of qualifications" [value]="education" >
|
<mat-option *ngFor="let education of qualifications" [value]="education" >
|
||||||
{{education}}
|
{{education}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%" *ngIf="coDetails.controls.pd_question_type.value==4">
|
<mat-form-field style="width: 100%">
|
||||||
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
||||||
<mat-select [placeholder]="coDetails.controls.pd_question.value" formControlName="pd_answer" required>
|
<mat-select [placeholder]="coDetails.controls.earningStatus_ques.value" formControlName="earning_ans" required>
|
||||||
<mat-option *ngFor="let earning of earningStatus" [value]="earning" >
|
<mat-option *ngFor="let earning of earningStatus" [value]="earning" >
|
||||||
{{earning}}
|
{{earning}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%" *ngIf="coDetails.controls.pd_question_type.value==5">
|
<mat-form-field style="width: 100%">
|
||||||
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
<!-- <mat-label>{{coDetails.controls.pd_question.value}}</mat-label> -->
|
||||||
<mat-select [placeholder]="coDetails.controls.pd_question.value" formControlName="pd_answer" required>
|
<mat-select [placeholder]="coDetails.controls.relationShip_ques.value" formControlName="relation_ans" required>
|
||||||
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
|
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
|
||||||
{{rel.name}}
|
{{rel.name}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
@ -109,17 +104,17 @@
|
|||||||
|
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<mat-card-actions align="end">
|
|
||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="Save" matTooltipPosition="above" [disabled]="!_personalForm.valid "><mat-icon>save</mat-icon></button>
|
|
||||||
|
|
||||||
</mat-card-actions>
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- end co applicant form details -->
|
<!-- end co applicant form details -->
|
||||||
|
<mat-card-actions align="end">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="Save" matTooltipPosition="above" [disabled]="!_personalForm.valid "><mat-icon>save</mat-icon></button>
|
||||||
|
|
||||||
|
</mat-card-actions>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -15,12 +15,17 @@ export class PersonalInfoComponent implements OnInit {
|
|||||||
earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"];
|
earningStatus:any=["Earning Member","House Wife","Student","Retired","Pensioner","Other Non earning member"];
|
||||||
relationShipList:any=[];
|
relationShipList:any=[];
|
||||||
@Input() pdid : string;
|
@Input() pdid : string;
|
||||||
|
@Input() pd_all_details:any;
|
||||||
form_id:number;
|
form_id:number;
|
||||||
private notifier: NotifierService;
|
private notifier: NotifierService;
|
||||||
public _personalForm: FormGroup;
|
public _personalForm: FormGroup;
|
||||||
|
|
||||||
public mainApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status"];
|
public mainApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status"];
|
||||||
public coApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status","Relationship"];
|
public coApplicantQuestions : any = ["Name","Age","Entity","Educational Qualification","Earning Status","Relationship"];
|
||||||
|
|
||||||
|
public mainApplicantDetails :any=[];
|
||||||
|
public coApplicantDetails :any=[];
|
||||||
|
|
||||||
errorMessage:any;
|
errorMessage:any;
|
||||||
//coItem:any;
|
//coItem:any;
|
||||||
//mainItem:any;
|
//mainItem:any;
|
||||||
@ -35,53 +40,106 @@ export class PersonalInfoComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.loadPDDetails(this.pdid,this.form_id);
|
this.loadPDDetails(this.pdid,this.form_id);
|
||||||
this.loadFormData();
|
|
||||||
this.getRelationMaster();
|
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
|
// load form pd details
|
||||||
loadPDDetails(pd:string,form:number){
|
loadPDDetails(pd:string,form:number){
|
||||||
|
|
||||||
// this._pd.getAllMasterDatas(pdid,form_id).subscribe(
|
this._pd.getPDFormDetailsWithID(this.pdid,this.form_id).subscribe(
|
||||||
// data => {
|
data => {
|
||||||
// if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
// this.relationShipList=data.records;
|
|
||||||
|
|
||||||
// }
|
}
|
||||||
// }, error => this.errorMessage = <any> error);
|
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.mainApplicantQuestions.length; j++)
|
||||||
|
{
|
||||||
|
if(j==0){
|
||||||
|
let generateRow = {
|
||||||
|
"pd_question":"",
|
||||||
|
"pd_answer": this.mainApplicantDetails[0].applicant_name,
|
||||||
|
}
|
||||||
|
defaultMainApp.push(generateRow);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let generateRow = {
|
||||||
|
"pd_question":"",
|
||||||
|
"pd_answer": "",
|
||||||
|
}
|
||||||
|
defaultMainApp.push(generateRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.loadFormData(defaultMainApp,this.coApplicantDetails);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}, error => this.errorMessage = <any> error);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadFormData(){
|
loadFormData(mainApp,coApp){
|
||||||
// main applicant
|
// main applicant
|
||||||
let mainApplicantGroup = new FormArray(this.mainApplicantQuestions.map((item,key) => new FormGroup({
|
let mainApplicantGroup = new FormArray(this.mainApplicantDetails.map((item,key) => new FormGroup({
|
||||||
fk_pd_id:new FormControl(null),
|
name_ques:new FormControl(this.mainApplicantQuestions[0]),
|
||||||
pd_question:new FormControl(this.mainApplicantQuestions[key]),
|
name_ans:new FormControl(item.applicant_name, Validators.required),
|
||||||
pd_question_type:new FormControl(key),
|
name_id:new FormControl(0),
|
||||||
pd_detail_answer_id: new FormControl(null),
|
age_ques:new FormControl(this.mainApplicantQuestions[1]),
|
||||||
pd_answer_id: new FormControl(null,),
|
age_id:new FormControl(1),
|
||||||
pd_answer: new FormControl(null,Validators.required),
|
age_ans:new FormControl(null, Validators.required),
|
||||||
pd_answer_weightage:new FormControl(null),
|
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
|
// co applicant
|
||||||
let coApplicantGroup = new FormArray(this.coApplicantQuestions.map((item,key) => new FormGroup({
|
let iterateCoApp=[];
|
||||||
fk_pd_id:new FormControl(null),
|
|
||||||
pd_question:new FormControl(this.coApplicantQuestions[key]),
|
let coApplicantGroup = new FormArray(this.coApplicantDetails.map((item,key) => new FormGroup({
|
||||||
pd_question_type:new FormControl(key),
|
name_ques:new FormControl(this.coApplicantQuestions[0]),
|
||||||
pd_detail_answer_id: new FormControl(null),
|
name_ans:new FormControl(item.applicant_name, Validators.required),
|
||||||
pd_answer_id: new FormControl(null),
|
name_id:new FormControl(0),
|
||||||
pd_answer: new FormControl(null, Validators.required),
|
age_ques:new FormControl(this.coApplicantQuestions[1]),
|
||||||
pd_answer_weightage:new FormControl(null),
|
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({
|
this._personalForm = this._fb.group({
|
||||||
pdid:null,
|
pdid:null,
|
||||||
form_id:null,
|
form_id:null,
|
||||||
mainItem: mainApplicantGroup,
|
mainItem: mainApplicantGroup,
|
||||||
coItem: coApplicantGroup,
|
coItem: coApplicantGroup,
|
||||||
});
|
});
|
||||||
|
//console.log(this._personalForm);
|
||||||
|
|
||||||
console.log(this._personalForm.controls.coItem)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//get pd main applicant array values
|
//get pd main applicant array values
|
||||||
@ -102,5 +160,53 @@ export class PersonalInfoComponent implements OnInit {
|
|||||||
}, error => this.errorMessage = <any> error);
|
}, error => this.errorMessage = <any> 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.!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,7 +389,7 @@
|
|||||||
|
|
||||||
<!-- start personal type questions -->
|
<!-- start personal type questions -->
|
||||||
<ng-container *ngSwitchCase="3">
|
<ng-container *ngSwitchCase="3">
|
||||||
<app-personal-info [pdid]="startPD"></app-personal-info>
|
<app-personal-info [pdid]="startPD" [pd_all_details]="pdFullDetails"></app-personal-info>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- end personal type questions -->
|
<!-- end personal type questions -->
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@ -29,6 +29,7 @@ selectedQuestionIndex:number;
|
|||||||
getQuestionsLength:number;
|
getQuestionsLength:number;
|
||||||
answerList:any=[];
|
answerList:any=[];
|
||||||
ansPDList:any=[];
|
ansPDList:any=[];
|
||||||
|
pdFullDetails:any=[];
|
||||||
|
|
||||||
// category static form buttons
|
// category static form buttons
|
||||||
categoryFormButtons : any=[
|
categoryFormButtons : any=[
|
||||||
@ -107,6 +108,8 @@ loadTemplates(startID:string){
|
|||||||
this.actualQuestions = data.records.counts.overall_question_count;
|
this.actualQuestions = data.records.counts.overall_question_count;
|
||||||
this.answeredQuestions = data.records.counts.overall_answered_count;
|
this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||||
|
|
||||||
|
this.pdFullDetails = data.records
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.pdMasterList="";
|
this.pdMasterList="";
|
||||||
|
|||||||
@ -34,54 +34,23 @@
|
|||||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editEntity(product)"><mat-icon>edit</mat-icon></button>
|
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editEntity(product)"><mat-icon>edit</mat-icon></button>
|
||||||
|
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-card-content>
|
<div *ngIf="!noQuesMasterRecrdFound">
|
||||||
<!----<ng-container *ngIf="enityList.length > 0">
|
<mat-paginator [length]="enityList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||||
<div style="padding: 0 12px;">
|
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
||||||
<mat-card class="product-card" *ngFor="let product of dataSource.connect() | async">
|
</mat-paginator>
|
||||||
<div fxLayout="row" fxLayoutAlign="start start">
|
|
||||||
<div fxFlex="90%" style="padding-top: 10px;">
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
|
|
||||||
<div fxFlex="0 1 auto" class="ml-xs" fxFlex="10%">
|
|
||||||
{{ product.entity_name }}
|
|
||||||
</div>
|
|
||||||
<div fxFlex="0 1 auto" class="ml-xs" fxFlex="40%">
|
|
||||||
<div> {{ product.full_name }} ({{product.short_name}})</div>
|
|
||||||
<div> {{ product.branch_name }} </div>
|
|
||||||
<div> {{product.city_name}}<span *ngIf="product.state_name">,</span> {{product.state_name}} </div>
|
|
||||||
</div>
|
|
||||||
<div fxFlex="0 1 auto" class="ml-xs" fxFlex="30%">
|
|
||||||
<div> {{ product.phone_number }}</div>
|
|
||||||
<div> {{ product.official_email }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="flex-start">
|
|
||||||
<div fxFlex="0 1 auto" class="ml-xs">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div fxFlex="10%">
|
|
||||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editEntity(product)"><mat-icon>edit</mat-icon></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</mat-card-content>
|
||||||
</mat-card>
|
|
||||||
</div>
|
|
||||||
</ng-container>-->
|
|
||||||
<mat-card *ngIf="noQuesMasterRecrdFound">
|
<mat-card *ngIf="noQuesMasterRecrdFound">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div class="no-record-found">No Record Found ... </div>
|
<div class="no-record-found">No Record Found ... </div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<div *ngIf="enityList.length > 0">
|
|
||||||
<mat-paginator [length]="enityList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
|
||||||
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
|
||||||
</mat-paginator>
|
|
||||||
</div>
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -36,14 +36,14 @@ export class EntityListComponent implements OnInit {
|
|||||||
// pagination variable details
|
// pagination variable details
|
||||||
length = 50;
|
length = 50;
|
||||||
pageIndex = 0;
|
pageIndex = 0;
|
||||||
pageSize = 10;
|
pageSize = 10;
|
||||||
pageEvent: PageEvent;
|
pageEvent: PageEvent;
|
||||||
|
|
||||||
// data source variable details
|
// data source variable details
|
||||||
questionListData = null;
|
questionListData = null;
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['categroy_name', 'question', 'actions'];
|
displayedColumns = ['entity_name', 'name','contact', 'actions'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
|
|||||||
@ -47,11 +47,10 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<div *ngIf="productList.length > 0">
|
|
||||||
<mat-paginator [length]="productList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
<mat-paginator #paginator [length]="productList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||||
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
||||||
</mat-paginator>
|
</mat-paginator>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!---- <ng-container *ngIf="productList.length > 0">
|
<!---- <ng-container *ngIf="productList.length > 0">
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
<!--<button mat-stroked-button color="primary" (click)="addNewQuestion()">Add Questions</button>-->
|
<!--<button mat-stroked-button color="primary" (click)="addNewQuestion()">Add Questions</button>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngIf="templateList.length > 0">
|
<mat-card-content>
|
||||||
<div style="padding: 0 12px;">
|
<ng-container >
|
||||||
<mat-table [dataSource]="dataSource" >
|
<mat-table [dataSource]="dataSource" *ngIf="templateList.length > 0" >
|
||||||
|
|
||||||
<ng-container matColumnDef="template_name">
|
<ng-container matColumnDef="template_name">
|
||||||
<mat-cell fxFlex="25%" *matCellDef="let template;">
|
<mat-cell fxFlex="25%" *matCellDef="let template;">
|
||||||
@ -33,7 +33,7 @@
|
|||||||
<ng-container matColumnDef="lender_details">
|
<ng-container matColumnDef="lender_details">
|
||||||
<mat-cell fxFlex="65%" *matCellDef="let template;">
|
<mat-cell fxFlex="65%" *matCellDef="let template;">
|
||||||
<div *ngIf="template.lender_details.length > 0" class="text-line-limit">
|
<div *ngIf="template.lender_details.length > 0" class="text-line-limit">
|
||||||
<span *ngFor="let lender of template.lender_details ; let last = last" > {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} <i *ngIf="!last">,<br></i></span>
|
<span *ngFor="let lender of template.lender_details ; let last = last" > {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} <span *ngIf="!last">,<br><br></span></span>
|
||||||
</div>
|
</div>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
@ -45,38 +45,18 @@
|
|||||||
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
|
||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
</ng-container>
|
||||||
<!----<mat-card class="product-card" *ngFor="let template of dataSource.connect() | async">
|
|
||||||
<div fxLayout="row" fxLayoutAlign="start start" style="padding: 6px 2px;">
|
|
||||||
|
|
||||||
<div fxFlex="90%" style="padding: 12px 8px;">
|
<mat-paginator [length]="templateList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||||
|
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
||||||
<div fxLayout="row" fxLayoutWrap fxLayoutAlign="start center">
|
</mat-paginator>
|
||||||
<div class="ml-xs" fxFlex="20%">
|
|
||||||
<span> {{ template.template_name }}</span>
|
<mat-card *ngIf="noTemplMasterRecrdFound">
|
||||||
</div>
|
<mat-card-content>
|
||||||
<div class="ml-xs" fxFlex="80%">
|
|
||||||
<div *ngIf="template.lender_details.length > 0">
|
|
||||||
<span *ngFor="let lender of template.lender_details ; let last = last"> {{lender.full_name}} - {{lender.product_name}} - {{lender.customer_segment_name}} <i *ngIf="!last">,<br></i></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div fxFlex="10%">
|
|
||||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="goToEdit(template.template_id)"><mat-icon>edit</mat-icon></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</mat-card>-->
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
<mat-card *ngIf="noQuesMasterRecrdFound">
|
|
||||||
<div class="no-record-found">No Record Found ... </div>
|
<div class="no-record-found">No Record Found ... </div>
|
||||||
</mat-card>
|
</mat-card-content>
|
||||||
<div *ngIf="templateList.length > 0">
|
</mat-card>
|
||||||
<mat-paginator #paginator class="mat-elevation-z1" [length]="templateList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
</mat-card-content>
|
||||||
[pageSizeOptions]="[5, 10, 25, 50, 100]" (page)="pageEvent = $event; pageChange($event)" showFirstLastButtons>
|
|
||||||
</mat-paginator>
|
|
||||||
</div>
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -25,8 +25,8 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
// white-space: nowrap;
|
// white-space: nowrap;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
line-height: 16px; /* fallback */
|
line-height: 15px; /* fallback */
|
||||||
max-height: 32px; /* fallback */
|
max-height: 44px; /* fallback */
|
||||||
-webkit-line-clamp: 2; /* number of lines to show */
|
-webkit-line-clamp: 2; /* number of lines to show */
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
|
||||||
|
|||||||
@ -20,12 +20,13 @@ import { TemplatesAddComponent } from './templates-add/templates-add.component';
|
|||||||
})
|
})
|
||||||
export class TemplateListComponent implements OnInit, OnDestroy {
|
export class TemplateListComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
public templateList = [];
|
public templateList: any[] = [];
|
||||||
public listView: boolean;
|
public listView: boolean;
|
||||||
public names: string;
|
public names: string;
|
||||||
public noTemplMasterRecrdFound: boolean = false;
|
public noTemplMasterRecrdFound: boolean = false;
|
||||||
public search_cid : any;
|
public search_cid : any;
|
||||||
|
|
||||||
|
|
||||||
// pagination variable details
|
// pagination variable details
|
||||||
length = 50;
|
length = 50;
|
||||||
pageIndex = 0;
|
pageIndex = 0;
|
||||||
@ -55,6 +56,10 @@ export class TemplateListComponent implements OnInit, OnDestroy {
|
|||||||
this.getTemplateMastersListDetails();
|
this.getTemplateMastersListDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
this.dataSource.paginator = this.paginator;
|
||||||
|
this.dataSource.sort = this.sort;
|
||||||
|
}
|
||||||
|
|
||||||
// get question master list details
|
// get question master list details
|
||||||
getTemplateMastersListDetails() {
|
getTemplateMastersListDetails() {
|
||||||
@ -123,7 +128,10 @@ export class TemplateListComponent implements OnInit, OnDestroy {
|
|||||||
//Called once, before the instance is destroyed.
|
//Called once, before the instance is destroyed.
|
||||||
//Add 'implements OnDestroy' to the class.
|
//Add 'implements OnDestroy' to the class.
|
||||||
}
|
}
|
||||||
|
// padination page event call
|
||||||
|
pageChange(e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
|
||||||
public m_templateList = {
|
public m_templateList = {
|
||||||
"dataStatus": true,
|
"dataStatus": true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user