diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts index feaa0db..0316f48 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts @@ -126,7 +126,7 @@ export class PdReportComponent implements OnInit { this.pdTrigerService.getPDReportFinalDocument(data).subscribe(data => { if (data.dataStatus) { this.notifier.notify('success', 'Your Changes Updated.!'); - this.getPdReportVersionList(); + // this.getPdReportVersionList(); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); } @@ -173,15 +173,37 @@ export class PdReportComponent implements OnInit { } getPdReportDetails() { - this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => { - if (data.status == 200) { - // this.pdReportRecords = data.records.question_answers; - this.pdReportRecords = data.records; - this.getPdReportVersionList() - // this.pdReportRecords = data.records.qu; - } - }, err => { + //OLD FUN + // this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => { + // if (data.status == 200) { + // // this.pdReportRecords = data.records.question_answers; + // this.pdReportRecords = data.records; + // this.getPdReportVersionList() + // // this.pdReportRecords = data.records.qu; + // } + // }, err => { + // }) + this.pdTrigerService.getPdFinalReportDetails(this.startPD).subscribe(data => { + if (data.status == 200) { + // console.log('getPdReportDetails',data); + this.pdReportRecords = data.records; + this.qcStatus = data.records.pd_status; + // console.log(this.qcStatus); + this.generateBtn = data.records.is_original_report_created == 1 ? false : true; + // console.log(this.generateBtn); + this.reGenerateBtn = data.records.is_original_report_created == 1 ? true : false; + // console.log(this.reGenerateBtn); + } + else{ + this.generateBtn = true; + // console.log('else',this.generateBtn); + this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + } + this.getHTMLPDReport() + }, err => { + this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); + // alert(err.html_format); }) }