start pd complete button changes
This commit is contained in:
parent
36f04d383d
commit
43898682c6
@ -24,12 +24,11 @@
|
||||
<div fxFlex="20" align="end">
|
||||
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
|
||||
</div>
|
||||
<!-- <mat-card-subtitle>Karthi Kms</mat-card-subtitle> -->
|
||||
</mat-card-header>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
<!-- <mat-card-actions align="end">
|
||||
<button _ngcontent-c21="" matTooltip="Complete Question" matTooltipPosition="above" [disabled]="actualQuestions!=answeredQuestions" class="compose-btn mat-warn mat-raised-button mb-1" (click)="changePDStatus(pdStatusCheck.COMPLETED);" style="margin-top:10px;"><span>{{currentPDStatus==pdStatusCheck.INPROGRESS ? 'COMPLETE':(currentPDStatus==pdStatusCheck.QC_COMPLETED ? 'QC COMPLETED' : currentPDStatus ) }}</span></button>
|
||||
</mat-card-actions> -->
|
||||
<mat-card-actions align="end">
|
||||
<button _ngcontent-c21="" matTooltip="Complete Question" matTooltipPosition="above" [disabled]="actualQuestions!=answeredQuestions || currentPDStatus!=pdStatusCheck.INPROGRESS" class="compose-btn mat-warn mat-raised-button mb-1" (click)="changePDStatus(pdStatusCheck.COMPLETED);" style="margin-top:10px;"><span>{{currentPDStatus==pdStatusCheck.INPROGRESS ? 'COMPLETE':(currentPDStatus==pdStatusCheck.QC_COMPLETED ? 'QC COMPLETED' : currentPDStatus ) }}</span></button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
@ -40,141 +40,10 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
selectedCategory: any = [];
|
||||
categoryList: any = [];
|
||||
pdMasterList: any = [];
|
||||
optionsForm: FormGroup;
|
||||
checkBoxForm: FormGroup;
|
||||
textBoxForm: FormGroup;
|
||||
next: number;
|
||||
previous: number;
|
||||
selectedCategoryIndex: number;
|
||||
selectedQuestionIndex: number;
|
||||
getQuestionsLength: number;
|
||||
answerList: any = [];
|
||||
ansPDList: any = [];
|
||||
relationDetails: any = [1];
|
||||
rentalDetail: any = { form_id: "16", form_name: "Rental Information", isAnswered: true}
|
||||
// errorMessage:any;
|
||||
// selectedCategory:any=[];
|
||||
// categoryList: any=[];
|
||||
// pdMasterList: any=[];
|
||||
// optionsForm: FormGroup;
|
||||
// checkBoxForm:FormGroup;
|
||||
// textBoxForm:FormGroup;
|
||||
// next:number;
|
||||
// previous:number;
|
||||
// selectedCategoryIndex:number;
|
||||
// selectedQuestionIndex:number;
|
||||
// getQuestionsLength:number;
|
||||
// answerList:any=[];
|
||||
// ansPDList:any=[];
|
||||
|
||||
|
||||
// category static form buttons
|
||||
// categoryFormButtons: any = [
|
||||
// {
|
||||
// "form_id": 1,
|
||||
// "form_name": "Supplier Details"
|
||||
// },
|
||||
// {
|
||||
// "form_id": 2,
|
||||
// "form_name": "Client Details",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 3,
|
||||
// "form_name": "Personal Details",
|
||||
// },
|
||||
// {
|
||||
// "form_id":4,
|
||||
// "form_name":"Asset Details",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 5,
|
||||
// "form_name": "Address"
|
||||
// },
|
||||
// {
|
||||
// "form_id": 6,
|
||||
// "form_name": "Family",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 7,
|
||||
// "form_name": "Banking",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 8,
|
||||
// "form_name": "Current Loan",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 9,
|
||||
// "form_name": "Other Income",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 10,
|
||||
// "form_name": "Loan Details",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 11,
|
||||
// "form_name": "Stock",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 12,
|
||||
// "form_name": "Employmet Info",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 13,
|
||||
// "form_name": "Business Info",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 14,
|
||||
// "form_name": "Financial Info",
|
||||
// },
|
||||
// ];
|
||||
|
||||
pdFullDetails:any=[];
|
||||
|
||||
// category static form buttons
|
||||
categoryFormButtons: any;
|
||||
// = [
|
||||
// {
|
||||
// "form_id": 1,
|
||||
// "form_name": "Supplier Details"
|
||||
// },
|
||||
// {
|
||||
// "form_id": 2,
|
||||
// "form_name": "Client Details",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 3,
|
||||
// "form_name": "Personal Details",
|
||||
// },
|
||||
// {
|
||||
// "form_id":4,
|
||||
// "form_name":"Asset Details",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 5,
|
||||
// "form_name": "Address"
|
||||
// },
|
||||
// {
|
||||
// "form_id": 6,
|
||||
// "form_name": "Family",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 7,
|
||||
// "form_name": "Banking",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 8,
|
||||
// "form_name": "Current Loan",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 9,
|
||||
// "form_name": "Other Income",
|
||||
// },
|
||||
// {
|
||||
// "form_id": 10,
|
||||
// "form_name": "Loan Details",
|
||||
// },
|
||||
|
||||
// ];
|
||||
formsCategoryEnable: boolean = false;
|
||||
selectedFormsCategory: any;
|
||||
// create values for status check
|
||||
@ -190,15 +59,8 @@ pdFullDetails:any=[];
|
||||
currentPDStatus: string;
|
||||
actualQuestions: number;
|
||||
answeredQuestions: number;
|
||||
|
||||
|
||||
|
||||
// start
|
||||
|
||||
// end
|
||||
private notifier: NotifierService;
|
||||
|
||||
|
||||
constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) {
|
||||
@ -221,8 +83,6 @@ pdFullDetails:any=[];
|
||||
}
|
||||
|
||||
this.loadTemplates(this.startPD);
|
||||
this.next = 1;
|
||||
this.previous = 2;
|
||||
}
|
||||
// start
|
||||
|
||||
@ -237,93 +97,23 @@ pdFullDetails:any=[];
|
||||
return bool;
|
||||
}
|
||||
|
||||
// load pd template details
|
||||
|
||||
// loadTemplates(startID: string) {
|
||||
// this._pd.loadPDTemplates(startID).subscribe(
|
||||
// data => {
|
||||
// if (data.status == 200) {
|
||||
// this.pdMasterList = data.records.pdmaster_details;
|
||||
// this.categoryList = data.records.question_answers;
|
||||
// let filterApplicantName = data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
||||
// this.mainApplicantName = filterApplicantName[0].applicant_name;
|
||||
// this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
||||
//
|
||||
// this.actualQuestions = data.records.counts.overall_question_count;
|
||||
// this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||
//
|
||||
// }
|
||||
// else {
|
||||
// this.pdMasterList = "";
|
||||
// this.mainApplicantName = "";
|
||||
// this.categoryList = [];
|
||||
// this.currentPDStatus = "";
|
||||
// }
|
||||
// }, error => this.errorMessage = <any> error);
|
||||
// }
|
||||
// loadTemplates(startID: string) {
|
||||
// this._pd.loadPDTemplates(startID).subscribe(
|
||||
// data => {
|
||||
// if (data.status == 200) {
|
||||
// this.pdMasterList = data.records.pdmaster_details;
|
||||
// this.categoryList = data.records.question_answers;
|
||||
// // this.categoryFormButtons = data.records.template_forms;
|
||||
// let filterApplicantName = data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
||||
// this.mainApplicantName = filterApplicantName[0].applicant_name;
|
||||
// this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
||||
//
|
||||
// this.actualQuestions = data.records.counts.overall_question_count;
|
||||
// this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||
//
|
||||
// this.pdFullDetails = data.records
|
||||
// }
|
||||
// else {
|
||||
// this.pdMasterList = "";
|
||||
// this.mainApplicantName = "";
|
||||
// this.categoryList = [];
|
||||
// this.currentPDStatus = "";
|
||||
// }
|
||||
// }, error => this.errorMessage = <any> error);
|
||||
// }
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.listPDComponent.showListView(true);
|
||||
}
|
||||
|
||||
|
||||
isOver(): boolean {
|
||||
return window.matchMedia(`(max-width: 960px)`).matches;
|
||||
}
|
||||
|
||||
OnSelectDirectQuestions(selectedQuestions: any, categoryIndex: number, questionsIndex: number) {
|
||||
this.formsCategoryEnable = false;
|
||||
this.selectedCategory = selectedQuestions;
|
||||
this.selectedCategoryIndex = categoryIndex;
|
||||
this.selectedQuestionIndex = questionsIndex;
|
||||
|
||||
let serachQuestions = {
|
||||
"question_id": selectedQuestions.fk_question_id,
|
||||
"pd_id": this.startPD,
|
||||
"template_id": selectedQuestions.fk_template_id,
|
||||
"category_id": selectedQuestions.fk_template_question_category_id
|
||||
}
|
||||
this.getAnswers(serachQuestions);
|
||||
}
|
||||
|
||||
loadTemplates(startID:string){
|
||||
this._pd.loadPDTemplates(startID).subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdMasterList=data.records.pdmaster_details;
|
||||
this.categoryList=data.records.question_answers;
|
||||
this.categoryFormButtons = data.records.template_forms;
|
||||
// this.categoryList=data.records.question_answers;
|
||||
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
|
||||
this.mainApplicantName = filterApplicantName[0].applicant_name;
|
||||
this.currentPDStatus = data.records.pdmaster_details.pd_status;
|
||||
|
||||
this.actualQuestions = data.records.counts.overall_question_count;
|
||||
this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||
|
||||
this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]);
|
||||
this.actualQuestions = this.categoryFormButtons.length;
|
||||
let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered==true);
|
||||
this.answeredQuestions = getAnsweredFormsCount.length;
|
||||
this.pdFullDetails = data.records
|
||||
|
||||
|
||||
@ -339,292 +129,7 @@ pdFullDetails:any=[];
|
||||
});
|
||||
}
|
||||
|
||||
// load question based answer list
|
||||
getAnswers(serachList: any) {
|
||||
this.answerList = [];
|
||||
this._pd.getAnswersForPD(serachList).subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.answerList = data.records.answers;
|
||||
this.ansPDList = data.records;
|
||||
this.actualQuestions = data.records.counts.overall_question_count,
|
||||
this.answeredQuestions = data.records.counts.overall_answered_count
|
||||
|
||||
// this for options type questions
|
||||
if (this.selectedCategory.fk_question_answertype == 1) {
|
||||
this.loadOtionsForm(this.selectedCategory, this.answerList);
|
||||
}
|
||||
//this for text box type questions
|
||||
else if (this.selectedCategory.fk_question_answertype == 2) {
|
||||
|
||||
this.loadTextBoxForm(this.selectedCategory, this.answerList);
|
||||
}
|
||||
//this for check box type questions
|
||||
else if (this.selectedCategory.fk_question_answertype == 3) {
|
||||
|
||||
this.loadCheckBoxForm(this.selectedCategory, this.answerList);
|
||||
}
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// load check box form
|
||||
|
||||
loadCheckBoxForm(selectedCategory: any, ansItem: any) {
|
||||
// create checkbox group
|
||||
let checkboxGroup = new FormArray(ansItem.map(item => new FormGroup({
|
||||
fk_pd_id: new FormControl(this.startPD),
|
||||
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
||||
pd_answer_id: new FormControl(item.question_answer_id),
|
||||
pd_answer: new FormControl(item.answer),
|
||||
pd_answer_weightage: new FormControl(item.template_answer_weightage),
|
||||
checkbox: new FormControl(item.isactive == null ? false : true)
|
||||
})));
|
||||
// create documents group
|
||||
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
||||
pd_document_title: new FormControl(item.pd_document_title),
|
||||
pd_document_url: new FormControl(item.pd_document_name),
|
||||
|
||||
})));
|
||||
|
||||
// create a hidden reuired formControl to keep status of checkbox group
|
||||
let hiddenControl = new FormControl(this.mapItems(checkboxGroup.value), Validators.required);
|
||||
// update checkbox group's value to hidden formcontrol
|
||||
checkboxGroup.valueChanges.subscribe((v) => {
|
||||
hiddenControl.setValue(this.mapItems(v));
|
||||
});
|
||||
|
||||
|
||||
this.checkBoxForm = new FormGroup({
|
||||
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
|
||||
fk_pd_id: new FormControl(this.startPD),
|
||||
fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id),
|
||||
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
||||
pd_question: new FormControl(this.selectedCategory.question),
|
||||
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
||||
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
|
||||
items: checkboxGroup,
|
||||
selectedItems: hiddenControl,
|
||||
documents: documentsGroup
|
||||
});
|
||||
}
|
||||
|
||||
// map options form group values
|
||||
mapItems(items) {
|
||||
let selectedItems = items.filter((item) => item.checkbox).map((item) => item);
|
||||
return selectedItems.length ? selectedItems : null;
|
||||
}
|
||||
|
||||
// load Options form
|
||||
loadOtionsForm(selectedCategory: any, ansItem: any) {
|
||||
// create options type group
|
||||
let optionsGroup = new FormArray(ansItem.map(item => new FormGroup({
|
||||
fk_pd_id: new FormControl(this.startPD),
|
||||
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
||||
pd_answer_id: new FormControl(item.question_answer_id),
|
||||
pd_answer: new FormControl(item.answer),
|
||||
pd_answer_weightage: new FormControl(item.template_answer_weightage),
|
||||
options: new FormControl(item.isactive == null ? false : true)
|
||||
})));
|
||||
|
||||
// create documents group
|
||||
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
||||
pd_document_title: new FormControl(item.pd_document_title),
|
||||
pd_document_url: new FormControl(item.pd_document_name),
|
||||
|
||||
})));
|
||||
|
||||
// create a hidden reuired formControl to keep status of checkbox group
|
||||
let hiddenControl = new FormControl(this.optionsMapItems(optionsGroup.value), Validators.required);
|
||||
let checkedItem = hiddenControl.value != null ? new FormControl(hiddenControl.value[0].pd_answer_id) : new FormControl(null);
|
||||
|
||||
this.optionsForm = new FormGroup({
|
||||
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
|
||||
fk_pd_id: new FormControl(this.startPD),
|
||||
fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id),
|
||||
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
||||
pd_question: new FormControl(this.selectedCategory.question),
|
||||
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
||||
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
|
||||
items: optionsGroup,
|
||||
selectedItems: hiddenControl,
|
||||
modelValue: checkedItem,
|
||||
documents: documentsGroup
|
||||
|
||||
});
|
||||
this.optionsForm.controls.modelValue.valueChanges.subscribe((v) => {
|
||||
hiddenControl.setValue(this.updateOptionsMapItems(v, optionsGroup.value));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// map option type group values
|
||||
optionsMapItems(items) {
|
||||
|
||||
let optionSelectedItems = items.filter((item) => item.options == true).map((item) => item);
|
||||
return optionSelectedItems.length ? optionSelectedItems : null;
|
||||
}
|
||||
|
||||
// map options type while change options
|
||||
updateOptionsMapItems(key, items) {
|
||||
|
||||
let updateSelectedItems = items.filter((item) => item.pd_answer_id == key).map((item) => item);
|
||||
return updateSelectedItems.length ? updateSelectedItems : null;
|
||||
}
|
||||
|
||||
// load text box form
|
||||
loadTextBoxForm(selectedCategory: any, ansItem: any) {
|
||||
// create text box type group
|
||||
let textGroup = new FormArray(ansItem.map(item => new FormGroup({
|
||||
fk_pd_id: new FormControl(this.startPD),
|
||||
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
|
||||
pd_answer_id: new FormControl(item.question_answer_id),
|
||||
pd_answer: new FormControl(item.pd_answer),
|
||||
pd_answer_weightage: new FormControl(item.template_answer_weightage),
|
||||
text: new FormControl(item.pd_detail_answer_id == null ? false : true)
|
||||
})));
|
||||
|
||||
// create documents group
|
||||
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
|
||||
pd_document_title: new FormControl(item.pd_document_title),
|
||||
pd_document_url: new FormControl(item.pd_document_name),
|
||||
|
||||
})));
|
||||
|
||||
this.textBoxForm = new FormGroup({
|
||||
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
|
||||
fk_pd_id: new FormControl(this.startPD),
|
||||
fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id),
|
||||
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
|
||||
pd_question: new FormControl(this.selectedCategory.question),
|
||||
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
|
||||
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
|
||||
items: textGroup,
|
||||
documents: documentsGroup
|
||||
});
|
||||
}
|
||||
|
||||
// next save and previous save for options and check box type questions
|
||||
saveNextPrevious(details: any, type: number) {
|
||||
|
||||
let fetchAns = [];
|
||||
details.selectedItems.value.forEach((itemElement, itemIndex) => {
|
||||
let obj1 = {
|
||||
fk_pd_detail_id: details.pd_detail_id.value,
|
||||
fk_pd_id: itemElement.fk_pd_id,
|
||||
pd_detail_answer_id: itemElement.pd_detail_answer_id,
|
||||
pd_answer_id: itemElement.pd_answer_id,
|
||||
pd_answer: itemElement.pd_answer,
|
||||
pd_answer_weightage: itemElement.pd_answer_weightage,
|
||||
}
|
||||
fetchAns.push(obj1)
|
||||
});
|
||||
|
||||
let pd_details: any = [{
|
||||
"pd_detail_id": details.pd_detail_id.value,
|
||||
"fk_pd_id": details.fk_pd_id.value,
|
||||
"fk_category_id": details.fk_category_id.value,
|
||||
"fk_question_id": details.fk_question_id.value,
|
||||
"pd_question": details.pd_question.value,
|
||||
"pd_question_weightage": details.pd_question_weightage.value,
|
||||
"question_remark": details.pd_answer_remark.value,
|
||||
"answers": fetchAns,
|
||||
"images": []
|
||||
}];
|
||||
this._pd.savePDQuestions(pd_details).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
if (type == 1) {
|
||||
this.skipNextPrevious(this.next);
|
||||
}
|
||||
else {
|
||||
this.skipNextPrevious(this.previous);
|
||||
}
|
||||
}
|
||||
}, error => {
|
||||
});
|
||||
}
|
||||
|
||||
// next save and previous save for text type questions
|
||||
saveNextPreviousText(details: any, type: number) {
|
||||
let fetchAns = [];
|
||||
details.items.value.forEach((itemElement, itemIndex) => {
|
||||
let obj1 = {
|
||||
fk_pd_detail_id: details.pd_detail_id.value,
|
||||
fk_pd_id: itemElement.fk_pd_id,
|
||||
pd_detail_answer_id: itemElement.pd_detail_answer_id,
|
||||
pd_answer_id: itemElement.pd_answer_id,
|
||||
pd_answer: itemElement.pd_answer,
|
||||
pd_answer_weightage: itemElement.pd_answer_weightage,
|
||||
}
|
||||
fetchAns.push(obj1)
|
||||
});
|
||||
let pd_details: any = [{
|
||||
"pd_detail_id": details.pd_detail_id.value,
|
||||
"fk_pd_id": details.fk_pd_id.value,
|
||||
"fk_category_id": details.fk_category_id.value,
|
||||
"fk_question_id": details.fk_question_id.value,
|
||||
"pd_question": details.pd_question.value,
|
||||
"pd_question_weightage": details.pd_question_weightage.value,
|
||||
"question_remark": details.pd_answer_remark.value,
|
||||
"answers": fetchAns,
|
||||
"images": []
|
||||
}];
|
||||
this._pd.savePDQuestions(pd_details).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
if (type == 1) {
|
||||
this.skipNextPrevious(this.next);
|
||||
}
|
||||
else {
|
||||
this.skipNextPrevious(this.previous);
|
||||
}
|
||||
}
|
||||
}, error => {
|
||||
});
|
||||
}
|
||||
|
||||
// skip to previous and next questions
|
||||
|
||||
skipNextPrevious(type: number) {
|
||||
// for skip to next
|
||||
if (type == 1) {
|
||||
if (this.categoryList.length > this.selectedCategoryIndex) {
|
||||
let nextCatList = this.categoryList[this.selectedCategoryIndex];
|
||||
this.selectedQuestionIndex = this.selectedQuestionIndex < nextCatList.questions.length - 1 ? this.selectedQuestionIndex + 1 : this.selectedQuestionIndex;
|
||||
let nextQuesList = nextCatList.questions[this.selectedQuestionIndex];
|
||||
this.selectedCategory = nextQuesList;
|
||||
this.selectedCategoryIndex = this.selectedCategoryIndex;
|
||||
this.selectedQuestionIndex = this.selectedQuestionIndex;
|
||||
let serachQuestions = {
|
||||
"question_id": nextQuesList.fk_question_id,
|
||||
"pd_id": this.startPD,
|
||||
"template_id": nextQuesList.fk_template_id,
|
||||
"category_id": nextQuesList.fk_template_question_category_id
|
||||
}
|
||||
this.getAnswers(serachQuestions);
|
||||
}
|
||||
}
|
||||
// for skip to previous
|
||||
else if (type == 2) {
|
||||
if (this.categoryList.length > this.selectedCategoryIndex) {
|
||||
let preCatList = this.categoryList[this.selectedCategoryIndex];
|
||||
this.selectedQuestionIndex = this.selectedQuestionIndex == 0 ? this.selectedQuestionIndex : this.selectedQuestionIndex - 1;
|
||||
let preQuesList = preCatList.questions[this.selectedQuestionIndex];
|
||||
this.selectedCategory = preQuesList;
|
||||
this.selectedCategoryIndex = this.selectedCategoryIndex;
|
||||
this.selectedQuestionIndex = this.selectedQuestionIndex;
|
||||
let serachQuestions = {
|
||||
"question_id": preQuesList.fk_question_id,
|
||||
"pd_id": this.startPD,
|
||||
"template_id": preQuesList.fk_template_id,
|
||||
"category_id": preQuesList.fk_template_question_category_id
|
||||
}
|
||||
this.getAnswers(serachQuestions);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//change pd status
|
||||
changePDStatus(status: string) {
|
||||
@ -916,12 +421,12 @@ pdFullDetails:any=[];
|
||||
|
||||
}
|
||||
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.listPDComponent.showListView(true);
|
||||
}
|
||||
// load pd view component
|
||||
loadPdViewCompoent() {
|
||||
this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route});
|
||||
}
|
||||
|
||||
|
||||
// end
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user