Commit 66a890c0 by pantakan konthang

แก้ปุ่ม PDF

parent 530c28df
......@@ -617,7 +617,7 @@
<app-pms-idp [currentTap]="currentTap" [canSave]="canSave" [appraisalIdp]="compentency.data.idp"
[evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId"
[canEdit]="evaluationForm=='sup'?canEdit:false" [currentStep]="compentency.data.currentStep"
[dateIso]="dateIso" (idpForm)="compentency.data.idp=$event" [complete]="complete" [pdfPrint]="pdfPrint" (pdfPrinted)="onPdfPrinted()"></app-pms-idp>
[dateIso]="dateIso" (idpForm)="compentency.data.idp=$event" [complete]="complete"></app-pms-idp>
</div>
<ng-container *ngIf="compentency.data&&canSave">
<div class="box-footer text-end space-x-3 rtl:space-x-reverse"
......@@ -626,11 +626,11 @@
<textarea type="text" class="ti-form-input" rows="2" placeholder="ใส่ Comment ที่นี่"
[(ngModel)]="comment"></textarea>
</div>
<button (click)="toggleStatusPdfPrint()" class="ti-btn m-0 ti-btn-soft-warning"
<!-- <button (click)="toggleStatusPdfPrint()" class="ti-btn m-0 ti-btn-soft-warning"
*ngIf="currentTap == 'แผนพัฒนาบุคลากร'">
<i class="ri-draft-fill"></i>
PDF
</button>
</button> -->
<button (click)="save('approve')" class="ti-btn m-0 ti-btn-soft-secondary"
[disabled]="compentencyFormRemain||kpiFormRemain"
[class.ti-btn-disabled]="compentencyFormRemain||kpiFormRemain">
......
......@@ -74,7 +74,6 @@ export class PmsFormEmployeeComponent {
complete = false
@ViewChild('scrollContainer') scrollContainer!: ElementRef;
pdfPrint = false;
constructor(
private router: Router,
......@@ -760,13 +759,4 @@ export class PmsFormEmployeeComponent {
imgElement.src = './assets/img/users/defaultperson.jpg';
}
toggleStatusPdfPrint() {
this.pdfPrint = !this.pdfPrint; // สลับ true/false เพื่อให้ Child จับการเปลี่ยน
}
onPdfPrinted() {
// เมื่อ Child แจ้งว่าพิมพ์เสร็จ ให้รีเซ็ตกลับเป็น false
this.pdfPrint = false;
}
}
......@@ -2,10 +2,26 @@
<ng-template #idpEvaluation>
<ng-container *ngIf="appraisalIdp">
<div style="overflow-y: auto; padding-top: 1rem" #pdfArea class="pdf-container">
<div class="pb-2">
<!-- <ng-container *ngIf="pdfPrintCheck === 1">
<div *ngFor="let item of [1,2,3]" class="ti-spinner w-8 h-8 text-secondary mx-1"
role="status" aria-label="loading">
<span class="sr-only">Loading...</span>
</div>
</ng-container> -->
<ng-container>
<div class="pb-2 flex justify-between items-center">
<div class="font-size-18px font-weight-700 text-gray-500">
ส่วนที่ 1: ข้อมูลทั่วไป
</div>
<!-- <button class="ti-btn m-0 ti-btn-soft-warning" *ngIf="pdfPrintCheck == 0" (click)="exportPdf()" >
<i class="ri-draft-fill"></i>
PDF
</button> -->
<button class="ti-btn m-0 ti-btn-soft-warning" data-html2canvas-ignore="true" data-hide-in-pdf (click)="exportPdf()">
<i class="ri-draft-fill"></i> PDF
</button>
</div>
<div class="pt-2 pb-2rem">
<div class="flex flex-row gap-2 ">
......@@ -344,7 +360,7 @@
</ng-container>
</ng-container>
<ng-container *ngIf="pdfPrintCheck == 1">
<ng-container *ngIf="pdfPrintCheck != 0">
{{convertDateFormat(appraisalIdp.masfromEvaluationRound.apsPeriodStart)}}
<ng-container
*ngIf="appraisalIdp.masfromEvaluationRound.apsPeriodStart &&appraisalIdp.masfromEvaluationRound.apsPeriodEnd">
......@@ -361,6 +377,9 @@
</table>
</div>
</div>
</ng-container>
</div>
</ng-container>
</ng-template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment