gdc_cmod/app/Views/shared/dialog_sample.php
mahdahar 08337b300d feat: Add specimen collection page and improve error handling
- Add new phlebo/collect.php view (341 lines) for specimen collection workflow
- Add route for phlebotomist collection page in Routes.php
- Add collect() method to PhlebotomistController
- Update error pages (notfound.php, unauthorized.php) for better user experience
- Enhance login page with improved UI elements
- Update shared dialogs (dialog_results_generate.php, dialog_sample.php) with improvements
- Update config.php with new configurations
- Update UAT checklist documentation
- Fix AuthController login handling
2026-02-09 13:39:51 +07:00

120 lines
3.8 KiB
PHP

<dialog class="modal" :open="isDialogSampleOpen">
<div class="modal-box w-2/3 max-w-5xl">
<div class='flex justify-between items-center mb-2'>
<div class='flex items-center gap-2'>
<label class="text-xs font-medium text-base-content/70">Printer:</label>
<select x-model="selectedPrinter" class="select select-bordered select-xs w-32">
<option value="lab">Lab Printer</option>
<option value="phlebo">Phlebo Printer</option>
<option value="reception">Reception Printer</option>
</select>
</div>
<div class='flex gap-2 ml-auto'>
<template x-if="item.accessnumber">
<button class="btn btn-xs btn-outline btn-info" @click="openAuditDialog(item.accessnumber)">
<i class="fa fa-history"></i> Audit
</button>
</template>
<button class="btn btn-xs btn-neutral" @click="closeSampleDialog()">X</button>
</div>
</div>
<template x-if="isSampleLoading">
<div class="text-center py-10">
<span class="loading loading-spinner loading-lg text-primary"></span>
<p class="mt-2">Loading data...</p>
</div>
</template>
<template x-if="!isSampleLoading">
<div>
<table class="table table-xs table-compact w-full mb-4">
<tr>
<td>MR# </td>
<td x-text="': '+item.patnumber"></td>
<td>Patient Name </td>
<td x-text="': '+item.patname"></td>
</tr>
<tr>
<td>KTP# </td>
<td x-text="': '+item.ktp"></td>
<td>Sex / Age </td>
<td x-text="': '+item.placeofbirth+' '+item.gender+' / '+item.age"></td>
</tr>
<tr>
<td>Note</td>
<td colspan='3' x-text="item.comment"></td>
</tr>
</table>
<table class="table table-xs table-compact w-full">
<thead>
<tr>
<th>Sample Code</th>
<th>Sample Name</th>
<th class='text-center'>Collected</th>
<th class='text-center'>Received</th>
<th>Action</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>All</td>
<td></td>
<td></td>
<td>
<button class="btn btn-sm btn-secondary px-2 py-1" @click="printAllLabels(item.accessnumber)"><i class="fa-solid fa-print"></i></button>
</td>
</tr>
<tr>
<td></td>
<td>Collection</td>
<td></td>
<td></td>
<td>
<button class="btn btn-sm btn-secondary px-2 py-1" @click="printCollectionLabel(item.accessnumber)"><i class="fa-solid fa-print"></i></button>
</td>
</tr>
<template x-for="sample in item.samples">
<tr>
<td x-text="sample.sampcode"></td>
<td x-text="sample.name"></td>
<td class='text-center'>
<input type="checkbox" class="checkbox" x-bind:checked="sample.colstatus == 1" disabled>
</td>
<td class='text-center'>
<input type="checkbox" class="checkbox" x-bind:checked="sample.tubestatus != 0" disabled>
</td>
<td>
<button class="btn btn-sm btn-secondary px-2 py-1" @click="printSampleLabel(item.accessnumber, sample.sampcode)"><i class="fa-solid fa-print"></i></button>
<?php if ($config['sampleDialog']['showCollectButtons'] ?? true): ?>
<template x-if="sample.colstatus == 0">
<button class="btn btn-sm btn-success px-2 py-1"
@click="collect(sample.sampcode, item.accessnumber)">
<h6 class="p-0 m-0">Coll.</h6>
</button>
</template>
<template x-if="sample.tubestatus != 0">
<button class="btn btn-sm btn-error px-2 py-1"
@click="unreceive(sample.sampcode, item.accessnumber)">
<h6 class="p-0 m-0">Un-Recv.</h6>
</button>
</template>
<?php endif; ?>
</td>
<td></td>
</tr>
</template>
</tbody>
</table>
</div>
</template>
</div>
</dialog>