step 39 : order page desktop, mb result desktop

This commit is contained in:
sindhu
2025-03-20 11:41:58 +07:00
parent 6e53dbd7cb
commit a1d235d629
3 changed files with 401 additions and 118 deletions

View File

@@ -665,129 +665,241 @@
<!-- body -->
<div class="flex flex-1 bg-white px-6 py-5">
<div class="relative w-full">
<!-- instrument -->
<fieldset @click.outside="openInstrument = false"
class="relative border border-gray-400 rounded-md focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 px-3 pt-2 pb-2">
<span
x-text="selectedInstrumentEdit.idInstrument != -1 ? 'Instrument' : selectedInstrumentEdit.namaInstrument"
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
</span>
<button @click="openInstrument = !openInstrument" type="button"
class="w-full flex items-center justify-between bg-transparent text-gray-900 py-0.5 focus:outline-none">
<span x-text="selectedInstrumentEdit.namaInstrument" class="text-left"></span>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 transition-transform"
:class="{ 'rotate-180': openInstrument }" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M19 9l-7 7-7-7" />
</svg>
</button>
</fieldset>
<div x-show="openInstrument"
class="absolute bg-white w-full border border-gray-300 rounded-md shadow-lg z-10 max-h-[200px] overflow-y-auto">
<ul>
<template x-if="dataInstrument.length === 0">
<li class="py-2 px-3 text-gray-500 text-center">Data tidak ada</li>
</template>
<template x-for="item in dataInstrument" :key="item.idInstrument">
<li :id="item.idInstrument" @click="onChangeInstrument(item)"
class="py-2 px-3 hover:bg-blue-100 cursor-pointer text-gray-700">
<button x-text="item.namaInstrument"></button>
</li>
</template>
</ul>
</div>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<!-- Assay Code -->
<label for="Assay Code"
<!-- Order Date -->
<label for="Order Date"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<input type="text" id="Assay Code" x-model="assayCodeEdit" autocomplete="off"
<input type="text" id="Order Date" autocomplete="off" x-model="e_datepickerValueOD"
@click="e_showDatepickerOD = !e_showDatepickerOD" readonly
class="peer pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-hidden"
placeholder="Assay Code" />
placeholder="Order Date" />
<span
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
Assay Code
Order Date
</span>
</label>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<!-- Decimal Font -->
<label for="Decimal"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<input type="text" id="Decimal" x-model="decimalFontEdit"
class="peer pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-hidden"
placeholder="Decimal" autocomplete="off" />
<span
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
Decimal
</span>
</label>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<label for="Formula"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<textarea id="Formula" x-model="formulaEdit" autocomplete="off"
class="resize-none peer w-full pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-none"
placeholder="Formula"></textarea>
<span class="pointer-events-none absolute left-2.5 bg-white p-0.5 text-xs text-gray-700 transition-all
peer-placeholder-shown:top-[10%] peer-placeholder-shown:text-sm peer-placeholder-shown:translate-y-0
peer-focus:top-0 peer-focus:text-xs peer-focus:-translate-y-1/2"
:class="formulaEdit.length > 0 ? 'top-0 text-xs -translate-y-1/2' : ''">
Formula
</span>
</label>
<!-- btn verifikasi -->
<div class="flex justify-end items-end">
<button @click="onProcessVerifikasi()" :class="isVerifikasiDone == false
? 'flex items-center justify-center gap-2 text-white bg-[#4CAF50] font-bold text-sm uppercase px-4 py-2 rounded-md transition duration-200 hover:bg-[#388E3C] focus:outline-none focus:ring-2 focus:ring-green-400'
: 'flex items-center justify-center gap-2 bg-[#0000001F] text-[#00000042] cursor-not-allowed font-bold text-sm uppercase px-4 py-2 rounded-md transition duration-200'
">
<!-- Loading Spinner -->
<div x-show="loadingVerifikasi"
class="inline-block h-5 w-5 animate-spin rounded-full border-4 border-solid border-white border-e-transparent">
</div>
<span x-text="loadingVerifikasi ? 'Verifikasi' : 'Verifikasi'"></span>
</button>
<!-- Datepicker Order Date -->
<div class="bg-white shadow-md mt-12 rounded-lg p-4 absolute top-0 left-0 w-[18rem]"
x-show="e_showDatepickerOD" @click.away="e_showDatepickerOD = false">
<div class="flex justify-between items-center mb-2">
<button @click="e_prevMonthOD()" class="p-1 rounded-full hover:bg-gray-200">
<svg class="h-6 w-6 text-gray-500" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 19l-7-7 7-7" />
</svg>
</button>
<span class="text-lg font-bold text-gray-800"
x-text="MONTH_NAMES[e_monthOD] + ' ' + e_yearOD"></span>
<button @click="e_nextMonthOD()" class="p-1 rounded-full hover:bg-gray-200">
<svg class="h-6 w-6 text-gray-500" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 5l7 7-7 7" />
</svg>
</button>
</div>
<div class="grid grid-cols-7 text-xs font-bold text-center text-gray-800">
<template x-for="day in DAYS">
<div x-text="day"></div>
</template>
</div>
<div class="grid grid-cols-7 text-sm">
<template x-for="date in e_no_of_daysOD">
<div class="text-center cursor-pointer p-2 rounded-full transition hover:bg-blue-200"
:class="{'bg-blue-500 text-white': e_isSelectedOD(date)}"
@click="e_setDateOD(date)">
<span x-text="date"></span>
</div>
</template>
</div>
</div>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<!-- hasil verifikasi -->
<!-- MRN -->
<label for="MRN"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<input type="text" id="MRN" autocomplete="off" x-model="e_mrn"
@change="onChangeMrnEdit()"
class="peer pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-hidden"
placeholder="MRN" />
<span
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
MRN
</span>
</label>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<!-- SID -->
<label for="SID"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<input type="text" id="SID" autocomplete="off" x-model="e_sid"
@change="onChangeSidEdit()"
class="peer pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-hidden"
placeholder="SID" />
<span
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
SID
</span>
</label>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<!-- Name -->
<label for="Name"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<input type="text" id="Name" autocomplete="off" x-model="e_name"
@change="onChangeNameEdit()"
class="peer pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-hidden"
placeholder="Name" />
<span
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
Name
</span>
</label>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<!-- dob -->
<label for="DOB"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<input type="text" id="DOB" autocomplete="off" x-model="e_datepickerValueDOB"
@click="e_showDatepickerDOB = !e_showDatepickerDOB" readonly
class="peer pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-hidden"
placeholder="DOB" />
<span
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
DOB
</span>
</label>
<div class="bg-white shadow-md mt-12 rounded-lg p-4 absolute top-0 left-0 w-[18rem]"
x-show="e_showDatepickerDOB" @click.away="e_showDatepickerDOB = false">
<div class="flex justify-between items-center mb-2">
<button @click="e_prevMonthDOB()" class="p-1 rounded-full hover:bg-gray-200">
<svg class="h-6 w-6 text-gray-500" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 19l-7-7 7-7" />
</svg>
</button>
<span class="text-lg font-bold text-gray-800"
x-text="MONTH_NAMES[e_monthDOB] + ' ' + e_yearDOB"></span>
<button @click="e_nextMonthDOB()" class="p-1 rounded-full hover:bg-gray-200">
<svg class="h-6 w-6 text-gray-500" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 5l7 7-7 7" />
</svg>
</button>
</div>
<div class="grid grid-cols-7 text-xs font-bold text-center text-gray-800">
<template x-for="day in DAYS">
<div x-text="day"></div>
</template>
</div>
<div class="grid grid-cols-7 text-sm">
<template x-for="date in e_no_of_daysDOB">
<div class="text-center cursor-pointer p-2 rounded-full transition hover:bg-blue-200"
:class="{'bg-blue-500 text-white': e_isSelectedDOB(date)}"
@click="e_setDateDOB(date)">
<span x-text="date"></span>
</div>
</template>
</div>
</div>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
<!-- pemeriksaan -->
<label for="Pemeriksaan"
class="relative block rounded-md border border-gray-400 focus-within:border-blue-600 focus-within:ring-1 focus-within:ring-blue-600">
<input type="text" id="Pemeriksaan" autocomplete="off" x-model="e_searchPemeriksaan"
@click="openPemeriksaanEdit = true" @input="e_filterItemPemeriksaan()"
class="peer pl-2 border-none py-3 bg-transparent placeholder-transparent focus:border-transparent focus:ring-0 focus:outline-hidden"
placeholder="Cari Pemeriksaan" />
<span
class="pointer-events-none absolute start-2.5 top-0 -translate-y-1/2 bg-white p-0.5 text-xs text-gray-700 transition-all peer-placeholder-shown:top-1/2 peer-placeholder-shown:text-sm peer-focus:top-0 peer-focus:text-xs">
Cari Pemeriksaan
</span>
</label>
<div>
<template x-if="isErrorVerifikasi === false">
<p class="text-[#388E3C] italic" x-text="hasilVerifikasi"></p>
</template>
<template x-if="isErrorVerifikasi === true">
<p class="text-[#FF5252] italic" x-text="hasilVerifikasi"></p>
</template>
<!-- List Dipilih -->
<div class="flex flex-wrap gap-2 mt-2">
<template x-for="(item, index) in e_selectedPemeriksaan" :key="item.idPemeriksaan">
<div
class="flex items-center bg-blue-100 text-blue-700 text-sm px-2 py-1 rounded-md">
<span x-text="item.namaPemeriksaan"></span>
<button @click="e_removeItemPemeriksaan(index)"
class="ml-2 focus:outline-none">
<svg class="w-4 h-4 text-blue-500 hover:text-blue-700" fill="none"
stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</template>
</div>
<!-- Dropdown List -->
<div x-show="openPemeriksaanEdit" @click.away="openPemeriksaanEdit = false"
class="absolute left-0 mt-2 w-full bg-white border border-gray-300 rounded-lg shadow-lg z-10 max-h-48 overflow-y-auto transition-all duration-200">
<template x-if="e_filteredPemeriksaan.length === 0">
<div class="p-2 text-gray-500 text-sm text-center">Tidak ada hasil</div>
</template>
<template x-for="item in e_filteredPemeriksaan" :key="item.idPemeriksaan">
<div @click="e_ItemPemeriksaan(item)"
class="cursor-pointer p-2 hover:bg-blue-100 flex items-center justify-between"
:class="e_selectedPemeriksaan.some(p => p.idPemeriksaan === item.idPemeriksaan) ? 'bg-yellow-100 text-yellow-800' : ''">
<span x-text="item.namaPemeriksaan"></span>
<svg x-show="e_selectedPemeriksaan.some(p => p.idPemeriksaan === item.idPemeriksaan)"
class="w-4 h-4 text-yellow-500" fill="none" stroke="currentColor"
stroke-width="2" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7">
</path>
</svg>
</div>
</template>
</div>
</div>
<!-- space 20 -->
<div class="mb-0 lg:mb-5"></div>
</div>
</div>
<!-- footer -->
<div class="h-10 px-4 py-2 mb-5">
<div class="flex items-end justify-end">
<button @click="closeDialogEdit()" class="mr-3 text-[#FF5252] hover:text-white font-bold text-sm uppercase transition duration-200
hover:bg-[#FF5252] px-4 py-2 rounded-md">
Cancel
</button>
<button class="text-[#1976D2] font-bold text-sm uppercase px-4 py-2 rounded-md transition duration-200
hover:bg-[#1976D2] hover:text-white">
Save
<div class="flex justify-between items-center">
<button @click="closeDialogEdit()" class="text-[#1976D2] hover:text-white font-bold text-sm uppercase transition duration-200
hover:bg-[#1976D2] px-4 py-2 rounded-md">
Batalkan
</button>
<div class="flex items-center space-x-3">
<button @click="closeDialogEdit()" class="text-[#FF5252] hover:text-white font-bold text-sm uppercase transition duration-200
hover:bg-[#FF5252] px-4 py-2 rounded-md">
Cancel
</button>
<button @click="save()" class="text-white bg-[#4CAF50] font-bold text-sm uppercase px-4 py-2 rounded-md transition duration-200
hover:bg-[#388E3C]">
Save
</button>
</div>
</div>
</div>
</div>