- -
+ {{qcStatus}} +
- + *ngIf="latestPDDetails.is_latest == 1 && qcStatus !== 'QC_COMPLETED'" (click)="addNewQuestion()">edit +
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 83f222a13..d7ad19799 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 @@ -10,6 +10,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material"; import { ModelEditPdReportComponent} from './model-edit-pd-report/model-edit-pd-report.component'; +import { QcReviewComponent } from './qc-review/qc-review.component'; /**sweet alert */ // import Swal from 'sweetalert2'; @@ -117,12 +118,14 @@ export class PdReportComponent implements OnInit { }) } + public qcStatus: string = ''; getPdReportVersionList(){ this.pdTrigerService.getPdDocVersionList(this.startPD).subscribe(data => { if(data.status == 200 && data.dataStatus){ - this.pdReportVersionList = [...data.records].reverse(); + this.pdReportVersionList = [...data.records.reports_urls].reverse(); let datas = this.pdReportVersionList.filter((a)=>{return a.is_latest == 1;}) this.latestPDDetails = datas[0]; + this.qcStatus = data.records.pdstatus; // alert(JSON.stringify(this.latestPDDetails)); this.reGenerateBtn = true; } else { @@ -174,6 +177,22 @@ export class PdReportComponent implements OnInit { console.log(this.latestPDDetails); } + + + reportReview(): void { + const dialogRef = this.dialog.open(QcReviewComponent, { + data: { startId : this.startPD }, + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.getPdReportFinalTemplateDetails(); + // this.getQuestionsMasters(); + // this.getBranch(); + // this.isPopupOpened = false; + }); + } + changeDocumentEdit() : void{ @@ -200,8 +219,6 @@ export class PdReportComponent implements OnInit { } else { } }); - - // Swal('User Created'); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html new file mode 100644 index 000000000..c67d819ea --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.html @@ -0,0 +1,23 @@ +

QC Completed Review

+ + +
+
+
+ + Remarks + + +
+
+ +
+
+
+
+ + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts new file mode 100644 index 000000000..0d0b84d1e --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { QcReviewComponent } from './qc-review.component'; + +describe('QcReviewComponent', () => { + let component: QcReviewComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ QcReviewComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QcReviewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts new file mode 100644 index 000000000..e87e9c5a0 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/qc-review/qc-review.component.ts @@ -0,0 +1,87 @@ +import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { PdTrigerService } from '../../../../pd-service/pd-triger.service'; +import { NotifierService } from "angular-notifier"; + + +import { + MatDialog, + MatDialogRef, + MAT_DIALOG_DATA +} from '@angular/material'; + +@Component({ + selector: 'app-qc-review', + templateUrl: './qc-review.component.html', + styleUrls: ['./qc-review.component.scss'] +}) +export class QcReviewComponent implements OnInit { + + @Input() questionId: number; + ngForm: FormGroup; + recordData: any; + showForm: Boolean; +/** + * Notifier service + */ + private notifier: NotifierService; + constructor( private _formBuilder: FormBuilder, + private pdTrigerService: PdTrigerService, + notifier: NotifierService , + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { + this.notifier = notifier; + + // this.mycontent = `

My html content

`; + } + + ngOnInit() { + this.getQcCompleteReviewStatus(); + } + + getQcCompleteReviewStatus() { + this.pdTrigerService.getQCReportFinalReviewDetails(this.data.startId, "QC").subscribe(data => { + if(data['dataStatus']){ + this.recordData = data.records[0]; + this.ngForm = this._formBuilder.group({ + qc_remarks: [this.recordData.qc_remarks], + qc_rating: [Number(this.recordData.qc_rating)], + pd_status: [this.recordData.pd_status], + }) + this.showForm = true; + } + },err => { + + }); + } + + onChange($event: any): void { + console.log('onChange'); + // this.log += new Date() + "
"; + } + + myClick(): void { + let template = this.ngForm.value; + template.pd_id = this.data.startId; + console.log(JSON.stringify(template)); + this.pdTrigerService.pdReviewStatusUpdate(template).subscribe(data=>{ + this.notifier.notify('success', 'Your Changes Updated.!'); + this.dialogRef.close(); + }, err => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + + }) + } + + + + // ============================= + + ratingClicked: number; + itemIdRatingClicked: string; + rating : number = 1; + + ratingComponentClick(e){ + this.ngForm.controls.qc_rating.setValue(e.rating); + } +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index f4a58047d..13cd38df4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -97,27 +97,29 @@
-
- +
+ Yes No - -
+
+
+
+
- - + + - - + + -
+
+
-
-
+ - + - + Yes No NA @@ -215,7 +215,7 @@
- +
@@ -223,7 +223,7 @@ + formControlName="business_name_of_the_owner" > {{owner.applicant_name}} @@ -238,7 +238,7 @@