penambahan fitur ekspor di hse, qma, dan pg

This commit is contained in:
Ray1111-aa
2026-10-16 11:02:28 +07:00
parent a54f80a45e
commit 6e5ae727f9
34 changed files with 4964 additions and 169 deletions
@@ -22,17 +22,43 @@
</div>
<!-- Tombol Aksi Kanan -->
<div class="grid grid-cols-2 gap-2.5 w-full sm:flex sm:items-center sm:gap-3 sm:w-auto">
<div class="flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-2.5 w-full sm:w-auto">
<a href="{{ route('qma.vehicles.support') }}"
class="w-full sm:w-auto flex items-center justify-center space-x-2 text-xs font-bold text-slate-700 hover:text-slate-900 bg-white border border-gray-200 rounded-xl px-4 py-2.5 shadow-sm transition hover:bg-gray-50 cursor-pointer">
class="flex-1 sm:flex-none flex items-center justify-center space-x-2 text-xs font-bold text-slate-700 hover:text-slate-900 bg-white border border-gray-200 rounded-xl px-3 sm:px-4 py-2.5 shadow-sm transition hover:bg-gray-50 cursor-pointer">
<i class="fa-solid fa-arrow-left text-xs text-slate-500"></i>
<span>Kembali</span>
</a>
<!-- Dropdown Menu Ekspor Format it.allrole.web.id -->
<div class="relative inline-block flex-1 sm:flex-none" id="exportSupportUnitsDropdownContainer">
<button type="button"
onclick="toggleSupportUnitsExportMenu(event)"
id="btnSupportUnitsExportTrigger"
class="w-full sm:w-auto flex items-center justify-center space-x-2 border border-emerald-600/30 text-emerald-900 bg-white hover:bg-emerald-50/50 px-3 sm:px-4 py-2.5 rounded-xl text-xs font-bold transition shadow-sm cursor-pointer">
<i class="fa-regular fa-file-excel text-emerald-700 text-sm"></i>
<span class="truncate">Ekspor Unit</span>
<i class="fa-solid fa-chevron-down text-[9px] text-slate-400 ml-1"></i>
</button>
<div id="exportMenuSupportUnits" style="display: none;" class="absolute right-0 mt-2 w-52 bg-white rounded-xl shadow-[0_8px_30px_rgb(0,0,0,0.12)] border border-slate-100 z-50 overflow-hidden">
<a href="{{ route('qma.vehicles.support.units.export_pdf', array_merge(['id' => $category->id], request()->query())) }}" target="_blank" class="flex items-center px-4 py-3 text-xs text-slate-700 hover:bg-slate-50 hover:text-[#1b5e20] font-bold transition">
<i class="fa-regular fa-file-pdf text-rose-600 text-sm mr-2.5"></i>
<span>Format PDF (Cetak)</span>
</a>
<div class="h-px bg-slate-100 mx-2"></div>
<a href="{{ route('qma.vehicles.support.units.export_excel', array_merge(['id' => $category->id], request()->query())) }}" class="flex items-center px-4 py-3 text-xs text-emerald-700 hover:bg-emerald-50 font-bold transition">
<i class="fa-regular fa-file-excel text-emerald-600 text-sm mr-2.5"></i>
<span>Format Excel (.xlsx)</span>
</a>
</div>
</div>
@can('qma.vehicles.create')
<button onclick="openAddUnitModal()"
class="w-full sm:w-auto flex items-center justify-center space-x-2 bg-[#1b5e20] hover:bg-[#144919] text-white px-4 py-2.5 rounded-xl text-xs font-bold transition shadow-sm cursor-pointer">
class="w-full sm:w-auto flex-1 sm:flex-none flex items-center justify-center space-x-2 bg-[#1b5e20] hover:bg-[#144919] text-white px-3 sm:px-4 py-2.5 rounded-xl text-xs font-bold transition shadow-sm cursor-pointer">
<i class="fa-solid fa-plus text-xs"></i>
<span>Tambah Unit Baru</span>
<span class="truncate">Tambah Unit</span>
</button>
@endcan
</div>
</div>
@@ -825,5 +851,31 @@
}
}
});
// Dropdown Menu Ekspor Unit Support Kategori Ini
function toggleSupportUnitsExportMenu(event) {
event.stopPropagation();
const menu = document.getElementById('exportMenuSupportUnits');
if (menu) {
menu.style.display = menu.style.display === 'block' ? 'none' : 'block';
}
}
document.addEventListener('click', function(event) {
const container = document.getElementById('exportSupportUnitsDropdownContainer');
const menu = document.getElementById('exportMenuSupportUnits');
if (container && !container.contains(event.target)) {
if (menu) {
menu.style.display = 'none';
}
}
});
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
const exportMenu = document.getElementById('exportMenuSupportUnits');
if (exportMenu) exportMenu.style.display = 'none';
}
});
</script>
@endsection