clqms-be/app/Views/v2/master/tests/title_dialog.php
mahdahar 97451496c3 feat(tests): enhance Test Management module with v2 UI dialogs
- Add new dialog forms for test calc, group, param, and title management
- Refactor test_dialog.php to new location (master/tests/)
- Update TestDefCalModel, TestDefSiteModel, TestDefTechModel, TestMapModel
- Modify Tests controller and Routes for new dialog handlers
- Update migration schema for test definitions
- Add new styles for v2 test management interface
- Include Test Management documentation files
2025-12-30 16:54:33 +07:00

121 lines
4.6 KiB
PHP

<!-- Title Test Form Modal -->
<div
x-show="showModal && currentDialogType === 'TITLE'"
x-cloak
class="modal-overlay"
@click.self="closeModal()"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
>
<div
class="modal-content p-6 max-w-2xl w-full"
@click.stop
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 transform scale-95"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-95"
>
<!-- Header -->
<div class="flex items-center justify-between mb-6">
<h3 class="font-bold text-xl flex items-center gap-2" style="color: rgb(var(--color-text));">
<i class="fa-solid fa-heading" style="color: rgb(var(--color-warning));"></i>
<span x-text="isEditing ? 'Edit Report Title' : 'New Report Title'"></span>
</h3>
<button class="btn btn-ghost btn-sm btn-square" @click="closeModal()">
<i class="fa-solid fa-times"></i>
</button>
</div>
<!-- Form -->
<div class="space-y-4">
<div class="grid grid-cols-2 gap-4">
<div>
<label class="label">
<span class="label-text font-medium">Title Name <span style="color: rgb(var(--color-error));">*</span></span>
</label>
<input
type="text"
class="input"
:class="errors.TestSiteName && 'input-error'"
x-model="form.TestSiteName"
placeholder="Hematology Results"
/>
<label class="label" x-show="errors.TestSiteName">
<span class="label-text-alt" style="color: rgb(var(--color-error));" x-text="errors.TestSiteName"></span>
</label>
</div>
<div>
<label class="label">
<span class="label-text font-medium">Title Code <span style="color: rgb(var(--color-error));">*</span></span>
</label>
<input
type="text"
class="input font-mono"
:class="errors.TestSiteCode && 'input-error'"
x-model="form.TestSiteCode"
placeholder="HEMO"
/>
<label class="label" x-show="errors.TestSiteCode">
<span class="label-text-alt" style="color: rgb(var(--color-error));" x-text="errors.TestSiteCode"></span>
</label>
</div>
</div>
<div>
<label class="label">
<span class="label-text font-medium">Description</span>
</label>
<textarea
class="input h-16 pt-2"
x-model="form.Description"
placeholder="Title description..."
></textarea>
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="label">
<span class="label-text font-medium">Seq (Screen)</span>
</label>
<input type="number" class="input text-center" x-model="form.SeqScr" />
</div>
<div>
<label class="label">
<span class="label-text font-medium">Seq (Report)</span>
</label>
<input type="number" class="input text-center" x-model="form.SeqRpt" />
</div>
</div>
<div class="flex items-center gap-6 p-4 rounded-xl border border-slate-100 bg-slate-50/50">
<label class="flex items-center gap-2 cursor-pointer">
<input type="checkbox" class="checkbox" x-model="form.VisibleScr" :true-value="1" :false-value="0" />
<span class="label-text">Visible in Screen</span>
</label>
<label class="flex items-center gap-2 cursor-pointer">
<input type="checkbox" class="checkbox" x-model="form.VisibleRpt" :true-value="1" :false-value="0" />
<span class="label-text">Visible in Report</span>
</label>
</div>
</div>
<!-- Actions -->
<div class="flex gap-3 mt-8 pt-6" style="border-top: 1px solid rgb(var(--color-border));">
<button class="btn btn-ghost flex-1" @click="closeModal()">Cancel</button>
<button class="btn btn-warning flex-1" @click="save()" :disabled="saving">
<span x-show="saving" class="spinner spinner-sm"></span>
<i x-show="!saving" class="fa-solid fa-save mr-2"></i>
<span x-text="saving ? 'Saving...' : 'Save Title'"></span>
</button>
</div>
</div>
</div>