pd report changes : kdk

This commit is contained in:
dineshkumarkannan 2018-12-26 17:57:29 +05:30
parent 0f57f5c359
commit 05d9a87460
6 changed files with 116 additions and 45 deletions

View File

@ -6,6 +6,11 @@
</div>
<mat-card style="min-height:540px;">
<mat-card-content>
<div align="end">
<button mat-raised-button color="blue" (click)="reportReview('REMARKS')" style="padding: 0 28px !important;" [disabled]="qcStatus === 'QC_COMPLETED'">QC Remarks</button>
<button mat-raised-button color="red" (click)="reportReview('COMPLETE')" style="padding: 0 28px !important;" [disabled]="qcStatus === 'QC_COMPLETED'">QC Complete</button>
<!--{{ qcStatus }} -->
</div>
<mat-tab-group>
<mat-tab label="PD Data">
<div>
@ -44,10 +49,8 @@
</mat-tab>
<mat-tab label="PD Report">
<div *ngIf="reGenerateBtn">
<mat-card >
<mat-card>
<mat-card-content>
@ -61,16 +64,16 @@
{{ pd.doc_name }}<span *ngIf="pd.is_latest == 1" [style.color]="'green'">( Current Version )</span><br>
<span style="color:rgba(117, 115, 115, 0.87)!important;font-size:13px !important;">{{pd.createdby}}</span><br>
<span style="color:rgba(117, 115, 115, 0.87)!important;font-size:13px !important;">{{pd.createdon}}</span>
<hr>
<hr>
</button>
<mat-card *ngIf="qcStatus === 'QC_COMPLETED'" style="text-align:center;position: absolute;
bottom: 10px;"> <button mat-raised-button color="red" *ngIf="reGenerateBtn" (click)="reportReview()" style="padding: 0 58px !important;">QC Review</button> </mat-card>
<!--<mat-card *ngIf="qcStatus === 'QC_COMPLETED'" style="text-align:center;position: absolute;
bottom: 10px;"> <button mat-raised-button color="red" *ngIf="reGenerateBtn" (click)="reportReview()" style="padding: 0 58px !important;">QC Review</button> </mat-card>-->
</mat-sidenav>
<div class="main-content" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
{{qcStatus}}
<!--{{qcStatus}}-->
<figure style="min-height: 240px;">
<div *ngIf="latestPDDetails">

View File

@ -179,9 +179,9 @@ export class PdReportComponent implements OnInit {
reportReview(): void {
reportReview(status): void {
const dialogRef = this.dialog.open(QcReviewComponent, {
data: { startId : this.startPD },
data: { startId : this.startPD, data_status: status },
disableClose: true
});
dialogRef.afterClosed()

View File

@ -1,23 +1,49 @@
<h2 mat-dialog-title>QC Completed Review</h2>
<mat-dialog-content class="mat-typography">
<!--<h3>Develop across all platforms</h3>-->
<div style="margin: 12px; width: 340px;">
<form role="form" *ngIf="showForm" [formGroup]="ngForm" accept-charset="UTF-8" novalidate>
<div>
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="qc_remarks"></textarea>
</mat-form-field>
</div>
<div>
<app-rating [rating]="ngForm.get('qc_rating').value" (ratingClick)='ratingComponentClick($event)'></app-rating>
<div *ngIf="showStatus == 'COMPLETE'">
<h2 mat-dialog-title>QC Complete</h2>
<mat-dialog-content class="mat-typography">
<!--<h3>Develop across all platforms</h3>-->
<div *ngIf="conformation === false" style="width: 220px;text-align: center; margin: 12px;">
<p>
Because you've marked the document as QC Complete, you can't edit this document.
</p>
</div>
</form>
</div>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button class="btn btn-primary" (click)="myClick()">Save</button>
<button mat-button mat-dialog-close>Cancel</button>
</mat-dialog-actions>
<div *ngIf="conformation" style="margin: 12px; width: 340px;">
<form role="form" *ngIf="showForm" [formGroup]="ngForm" accept-charset="UTF-8" novalidate>
<div>
<app-rating [rating]="ngForm.get('qc_rating').value" (ratingClick)='ratingComponentClick($event)'></app-rating>
</div>
<div>
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="qc_feedback"></textarea>
</mat-form-field>
</div>
</form>
</div>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button class="btn btn-primary" *ngIf="conformation === false" (click)="conformation = true">Ok</button>
<button mat-button class="btn btn-primary" *ngIf="conformation" (click)="myClick()">Save</button>
<button mat-button mat-dialog-close>Cancel</button>
</mat-dialog-actions>
</div>
<div *ngIf="showStatus == 'REMARKS'">
<h2 mat-dialog-title>QC Remarks</h2>
<mat-dialog-content class="mat-typography">
<div style="margin: 12px; width: 340px;">
<form role="form" *ngIf="showForm" [formGroup]="ngForm" accept-charset="UTF-8" novalidate>
<div>
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="qc_remarks"></textarea>
</mat-form-field>
</div>
</form>
</div>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button class="btn btn-primary" (click)="myClick()">Save</button>
<button mat-button mat-dialog-close>Cancel</button>
</mat-dialog-actions>
</div>

View File

@ -17,10 +17,12 @@ import {
})
export class QcReviewComponent implements OnInit {
conformation: Boolean = false;
@Input() questionId: number;
ngForm: FormGroup;
recordData: any;
showForm: Boolean;
showStatus : any;
/**
* Notifier service
*/
@ -31,7 +33,7 @@ export class QcReviewComponent implements OnInit {
private dialogRef: MatDialogRef<QcReviewComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {
this.notifier = notifier;
this.showStatus = this.data.data_status;
// this.mycontent = `<p>My html content</p>`;
}
@ -40,19 +42,39 @@ export class QcReviewComponent implements OnInit {
}
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 => {
let type ; '';
if( this.showStatus === 'REMARKS'){
type = 'QC_REMARKS';
this.pdTrigerService.getQCReportFinalReviewDetails(this.data.startId, type).subscribe(data => {
if(data['dataStatus']){
this.recordData = data.records[0];
this.ngForm = this._formBuilder.group({
qc_remarks: [this.recordData.qc_remarks],
pd_status: [this.recordData.pd_status]
})
this.showForm = true;
}
},err => {
});
});
} else if(this.showStatus === 'COMPLETE') {
type = 'QC';
this.pdTrigerService.getQCReportFinalReviewDetails(this.data.startId, type).subscribe(data => {
if(data['dataStatus']){
this.recordData = data.records[0];
this.ngForm = this._formBuilder.group({
qc_feedback: [this.recordData.qc_feedback],
qc_rating: [Number(this.recordData.qc_rating)],
pd_status: ["QC_COMPLETED"],
})
this.showForm = true;
}
},err => {
});
} else {
}
}
onChange($event: any): void {

View File

@ -13,7 +13,7 @@
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED || pdStatusCheck.COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
<br>
@ -175,6 +175,23 @@
</ng-template>
</div>
<div *ngIf="pdMasterData[0]?.pd_status === 'QC_COMPLETED'" class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<mat-card>
<div style="color:red !important;">
<h6>QC Remarks</h6>
</div>
<p>
{{ pdMasterData[0].qc_remarks}}</p>
<p>
{{ pdMasterData[0]?.qc_feedback}}</p>
<div>
<p>
<app-rating [rating]="pd_QC_Rating"></app-rating>
</p>
</div>
</mat-card>
</div>
</div>
</mat-card-content>
</div>

View File

@ -64,11 +64,14 @@ export class ViewPdComponent implements OnInit, OnDestroy {
this.viewPdDetails(this.viewID);
}
pd_QC_Rating: Number;
viewPdDetails(editID:string){
this._pd.editPdDetails(editID).subscribe(
data => {
if (data.status == 200) {
this.pdMasterData=data.records.pd_master_details;
this.pd_QC_Rating = Number(this.pdMasterData[0].qc_rating);
this.pdApplicantData= data.records.applicants_details;
this.pdDocumentsData=data.records.pd_documnets;
this.masterPdLogsData=data.records.pd_logs.master;