cotizador/pages/brasil.html

121 lines
8.0 KiB
HTML

<!-- Header Section -->
<div class="bg-white shadow-sm border-b">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-6">
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between space-y-3 sm:space-y-0">
<div class="flex items-center space-x-3 sm:space-x-4">
<div class="text-3xl sm:text-4xl" id="country-flag">🇧🇷</div>
<div>
<h1 class="text-xl sm:text-2xl lg:text-3xl font-bold text-gray-800" id="page-title">Comparador de Precios - Brasil</h1>
<p class="text-sm sm:text-base text-gray-600 mt-1">Bienvenido, <span id="nombreUsuario" class="font-semibold"></span></p>
</div>
</div>
<div class="flex items-center space-x-2 text-xs sm:text-sm">
<span class="text-gray-500 hidden sm:inline">Última actualización:</span>
<span class="text-gray-500 sm:hidden">Actualizado:</span>
<span id="lastUpdate" class="font-medium text-gray-700">-</span>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Loading Spinner -->
<div id="loadingSpinner" class="hidden flex items-center justify-center py-12">
<div class="animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600"></div>
</div>
<!-- Page Content -->
<div id="pageContent">
<!-- Formulario de Agregar Artículo -->
<div class="bg-white rounded-lg shadow-md mb-6">
<div class="bg-indigo-600 text-white px-4 sm:px-6 py-3 sm:py-4 rounded-t-lg">
<h2 class="text-lg sm:text-xl font-semibold">Agregar Artículo</h2>
</div>
<div class="p-4 sm:p-6">
<form id="formAgregarArticulo">
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-6 gap-3 sm:gap-4">
<div class="sm:col-span-2 lg:col-span-2">
<label class="block text-xs sm:text-sm font-medium text-gray-700 mb-1">Artículo</label>
<input type="text" id="articulo" class="w-full px-3 sm:px-4 py-2 text-sm sm:text-base border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="Nombre del artículo" required>
</div>
<div class="sm:col-span-1 lg:col-span-1">
<label class="block text-xs sm:text-sm font-medium text-gray-700 mb-1">Precio AR</label>
<input type="number" id="precioAr" class="w-full px-3 sm:px-4 py-2 text-sm sm:text-base border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="$ AR" step="0.1" required>
</div>
<div class="sm:col-span-1 lg:col-span-1">
<label class="block text-xs sm:text-sm font-medium text-gray-700 mb-1">Precio R$</label>
<input type="number" id="precioExtranjero" class="w-full px-3 sm:px-4 py-2 text-sm sm:text-base border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" placeholder="R$" step="0.1" required>
</div>
<div class="sm:col-span-1 lg:col-span-1">
<label class="block text-xs sm:text-sm font-medium text-gray-700 mb-1">Responsable</label>
<select id="responsable" class="w-full px-3 sm:px-4 py-2 text-sm sm:text-base border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500" required>
<option value="" disabled selected>Seleccionar</option>
<option value="Marce">Marce</option>
<option value="Eli">Eli</option>
</select>
</div>
<div class="sm:col-span-2 lg:col-span-1">
<label class="block text-xs sm:text-sm font-medium text-gray-700 mb-1 opacity-0">.</label>
<button type="submit" class="w-full bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2 px-4 rounded-lg transition text-sm sm:text-base">
Agregar
</button>
</div>
</div>
</form>
</div>
</div>
<!-- Cotización -->
<div class="bg-blue-50 border border-blue-200 rounded-lg p-3 sm:p-4 mb-6">
<div class="flex flex-col sm:flex-row sm:items-center space-y-2 sm:space-y-0 sm:space-x-4 text-sm sm:text-base text-gray-700">
<div class="flex items-center space-x-2">
<span class="font-semibold">BRL:</span>
<span id="cotizacionMoneda" class="font-bold text-indigo-600">Cargando...</span>
</div>
<span class="hidden sm:inline text-gray-400">|</span>
<div class="flex items-center space-x-2">
<span class="font-semibold">USD:</span>
<span id="cotizacionUsd" class="font-bold text-indigo-600">Cargando...</span>
</div>
</div>
</div>
<!-- Tabla de Productos -->
<div class="bg-white rounded-lg shadow-md overflow-hidden">
<div class="overflow-x-auto -mx-4 sm:mx-0">
<div class="inline-block min-w-full align-middle">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-indigo-600">
<tr>
<th class="px-3 sm:px-4 lg:px-6 py-2 sm:py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Artículo</th>
<th class="px-3 sm:px-4 lg:px-6 py-2 sm:py-3 text-left text-xs font-medium text-white uppercase tracking-wider">AR</th>
<th class="px-3 sm:px-4 lg:px-6 py-2 sm:py-3 text-left text-xs font-medium text-white uppercase tracking-wider hidden sm:table-cell">Reales</th>
<th class="px-3 sm:px-4 lg:px-6 py-2 sm:py-3 text-left text-xs font-medium text-white uppercase tracking-wider sm:hidden">R$</th>
<th class="px-3 sm:px-4 lg:px-6 py-2 sm:py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Dif.</th>
<th class="px-3 sm:px-4 lg:px-6 py-2 sm:py-3 text-left text-xs font-medium text-white uppercase tracking-wider hidden lg:table-cell">Responsable</th>
<th class="px-3 sm:px-4 lg:px-6 py-2 sm:py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Acciones</th>
</tr>
</thead>
<tbody id="priceList" class="bg-white divide-y divide-gray-200">
<!-- Contenido dinámico -->
</tbody>
<tfoot class="bg-blue-50">
<tr>
<td colspan="2" class="px-3 sm:px-4 lg:px-6 py-3 sm:py-4 text-right font-bold text-xs sm:text-sm text-gray-700">
<span class="hidden sm:inline">Total Diferencia Global</span>
<span class="sm:hidden">Total</span>
</td>
<td class="px-3 sm:px-4 lg:px-6 py-3 sm:py-4 font-bold text-sm sm:text-base lg:text-lg" id="totalDiferencia">0</td>
<td colspan="2"></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>