Add comprehensive printer configuration support: - New Printers.php config with role-based printer defaults (lab, phlebo, reception) - Update LabelController for configurable printer routing with error handling - Add ResponseTrait for proper JSON responses (success/error status) - Update routes to accept optional printer parameter for label printing - Add default printer configuration per role in shared config Enhance report generation workflow: - Support REPORT_LANG from CM_REQUESTS table for language preference - Prioritize URL parameter, then database value, then default - Add language info to PDF generation response (Indonesian/English) - Update all report methods (view, eng, preview, generate) with unified logic Improve UI and user experience: - Add dialog_results_generate to all role dashboards (superuser, admin, lab, phlebo, cs) - Update skeleton loading states widths in content requests - Add printer selection capability in sample collection flow Add comprehensive UAT documentation: - New UAT_GDC_CMOD_Checklist.md with 150+ test cases - Cover all roles: superuser, admin, lab, phlebo, cs, and cross-role scenarios - Include acceptance criteria (functional, security, performance, usability, data integrity) - Test categories: authentication, user management, validation, sample management, audit trail, reporting - Detailed sign-off structure for stakeholders Add barcode printing documentation: - docs/barcode_print_all.php - all labels printing implementation - docs/barcode_print_coll.php - collection label implementation - docs/barcode_print_disp.php - dispatch label implementation Update TODO tracking: - Mark Reprint Label and PDF Generation as completed - Update pending tasks for testing and audit trails
109 lines
4.9 KiB
PHP
109 lines
4.9 KiB
PHP
<div x-show="isGenerateDialogOpen" class="modal modal-open" style="z-index: 9999;">
|
|
<div class="modal-box max-w-4xl h-[85vh] flex flex-col">
|
|
<!-- Header -->
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h3 class="font-bold text-lg">
|
|
Generate Result: <span class="font-mono" x-text="generateAccessnumber"></span>
|
|
</h3>
|
|
<button @click="closeGenerateDialog()" class="btn btn-sm btn-circle btn-ghost">
|
|
✕
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Language Selector -->
|
|
<div class="flex items-center gap-4 mb-4 p-4 bg-base-200 rounded-lg">
|
|
<span class="font-semibold">Language:</span>
|
|
<div class="join">
|
|
<button
|
|
@click="generateLang = 0"
|
|
:class="generateLang === 0 ? 'btn-active' : ''"
|
|
class="btn join-item">
|
|
<i class="fa fa-language mr-1"></i> Indo
|
|
</button>
|
|
<button
|
|
@click="generateLang = 1"
|
|
:class="generateLang === 1 ? 'btn-active' : ''"
|
|
class="btn join-item">
|
|
<i class="fa fa-language mr-1"></i> Eng
|
|
</button>
|
|
</div>
|
|
<div class="flex-1"></div>
|
|
<button
|
|
@click="generatePdfFromDialog()"
|
|
:disabled="pdfStatus === 'queued' || pdfStatus === 'processing'"
|
|
class="btn btn-primary">
|
|
<i class="fa fa-file-pdf mr-1"></i> Generate PDF
|
|
</button>
|
|
</div>
|
|
|
|
<!-- PDF Display Area -->
|
|
<div class="flex-1 flex flex-col min-h-0">
|
|
<!-- Loading State -->
|
|
<template x-if="pdfStatus === 'queued' || pdfStatus === 'processing'">
|
|
<div class="flex-1 flex items-center justify-center">
|
|
<div class="text-center">
|
|
<span class="loading loading-spinner loading-lg text-primary"></span>
|
|
<p class="mt-4 text-lg">
|
|
Generating <span x-text="generateLang === 1 ? 'English' : 'Indonesian'"></span> PDF...
|
|
</p>
|
|
<p class="text-sm text-base-content/60 mt-2">Please wait</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- Success State - Show PDF -->
|
|
<template x-if="pdfStatus === 'completed' && pdfUrl">
|
|
<iframe
|
|
:src="pdfUrl"
|
|
class="w-full h-full border-0 rounded-lg"
|
|
style="min-height: 60vh;"></iframe>
|
|
</template>
|
|
|
|
<!-- Idle State - Before First Generation -->
|
|
<template x-if="pdfStatus === 'idle'">
|
|
<div class="flex-1 flex items-center justify-center">
|
|
<div class="text-center text-base-content/60">
|
|
<i class="fa fa-file-pdf text-6xl mb-4 opacity-30"></i>
|
|
<p class="text-lg">Select language and click Generate PDF</p>
|
|
<p class="text-sm mt-2">Indonesian PDF is automatically generated after validation.</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- Failed State -->
|
|
<template x-if="pdfStatus === 'failed'">
|
|
<div class="flex-1 flex items-center justify-center">
|
|
<div class="text-center text-error">
|
|
<i class="fa fa-exclamation-circle text-6xl mb-4"></i>
|
|
<p class="text-lg font-semibold">PDF Generation Failed</p>
|
|
<button
|
|
@click="generatePdfFromDialog()"
|
|
class="btn btn-sm btn-outline btn-error mt-4">
|
|
<i class="fa fa-sync-alt mr-1"></i> Retry
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<div class="flex justify-between items-center mt-4 pt-4 border-t border-base-300">
|
|
<div class="text-sm text-base-content/60">
|
|
<template x-if="pdfJobId">
|
|
<span>Job ID: <span class="font-mono" x-text="pdfJobId"></span></span>
|
|
</template>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<template x-if="pdfStatus === 'completed' && pdfUrl">
|
|
<a :href="pdfUrl" target="_blank" class="btn btn-sm btn-outline">
|
|
<i class="fa fa-external-link-alt mr-1"></i> Open in New Tab
|
|
</a>
|
|
</template>
|
|
<button @click="closeGenerateDialog()" class="btn btn-sm">
|
|
Close
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|