antes de comenzar la vista tarifas

This commit is contained in:
Juan Felipe Duarte
2025-06-16 16:30:10 -07:00
parent 9425f519cc
commit 6eb6e3bd2f
8 changed files with 113 additions and 95 deletions
@@ -71,7 +71,7 @@
<div class="grid h-full place-items-center">
<div class="bg-white rounded-lg shadow-md sm:1/2 md:1/3 lg:1/3 xl:w-1/4">
{{-- PHOTO --}}
<div class="w-full text-left text-white px-4 bg-cover py-2 rounded-lg h-64 bg-[url({{asset($this->imagen)}})] ">
<div class="w-full text-left text-white px-4 bg-cover py-2 rounded-lg h-64 bg-[url({{asset($this->imagen)}})]">
</div>
<div class="text-left">
@@ -0,0 +1,3 @@
<div>
<h1>Tarifas</h1>
</div>
@@ -26,9 +26,7 @@
Usuario
</div>
<div class="flex gap-4">
@if (auth()->user()->rol->nombre === 'administrador' ||
auth()->user()->rol->nombre === 'editor' ||
auth()->user()->rol->nombre === 'super')
@if (auth()->user()->subvendedor || auth()->user()->rol->nombre === 'administrador' || auth()->user()->rol->nombre === 'editor' || auth()->user()->rol->nombre === 'super')
<a x-on:click="add = !add"
class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-3 md:mb-0">Añadir
usuario
@@ -64,10 +62,8 @@
<div>
<div class="flex items-center">
<input id="verPreciosPersonalizados" type="checkbox" wire:model="verPreciosPersonalizados"
class="h-4 w-4 text-[#B221FD] border-gray-300 rounded">
<label for="verPreciosPersonalizados" class="ml-2 block
text-sm text-gray-900">
<input id="verPreciosPersonalizados" type="checkbox" wire:model="verPreciosPersonalizados" class="h-4 w-4 text-[#B221FD] border-gray-300 rounded">
<label for="verPreciosPersonalizados" class="ml-2 block text-sm text-gray-900">
Precios personalizados
</label>
</div>
@@ -85,12 +81,14 @@
<th class="font-normal">Rol</th>
<th class="font-normal">Ventas</th>
<th class="font-normal">Saldo</th>
<th class="font-normal">
Precios personalizados
</th>
<th class="font-normal">Precios personalizados</th>
@if (auth()->user()->rol->nombre == 'super')
<th class="font-normal"></th>
<th class="rounded-r-lg font-normal"></th>
@elseif (Auth::user()->subvendedor)
<th class="rounded-r-lg font-normal"></th>
@else
@endif
</tr>
</x-slot>
@@ -116,46 +114,43 @@
@if (auth()->user()->rol->nombre == 'super')
<td>
<button wire:click="saldo({{ $usuario->id }})"
class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
<button wire:click="saldo({{ $usuario->id }})" class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
</td>
<td>
<button x-on:click="openOption=!openOption">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<td>
<button x-on:click="openOption=!openOption">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false"
class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=!openOption"
wire:click="editarPassword({{ $usuario->id }})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Editar
password</button>
<button x-on:click="openOption=false" wire:click="saldo({{ $usuario->id }})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Agregar
saldo</button>
<button x-on:click="openOption=false" wire:click="saldodesc({{ $usuario->id }})"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Descontar
saldo</button>
<button x-on:click="openOption=false,gestion=true"
wire:click="gestionar({{ $usuario->id }},'{{ $usuario->rol_id }}','{{ $usuario->name }}')"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Precio
servicio</button>
<button x-on:click="openOption=false,gestionPromo=true"
wire:click="gestionarPromociones({{ $usuario->id }},'{{ $usuario->name }}')"
class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 ">Precio
promocion</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})"
class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=!openOption" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Editar password</button>
<button x-on:click="openOption=false" wire:click="saldo({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Agregar saldo</button>
<button x-on:click="openOption=false" wire:click="saldodesc({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Descontar saldo</button>
<button x-on:click="openOption=false,gestion=true" wire:click="gestionar({{ $usuario->id }},'{{ $usuario->rol_id }}','{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio servicio</button>
<button x-on:click="openOption=false,gestionPromo=true" wire:click="gestionarPromociones({{ $usuario->id }},'{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio promocion</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
@elseif (Auth::user()->subvendedor)
<td>
<button x-on:click="openOption=!openOption">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=!openOption" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Editar password</button>
<button x-on:click="openOption=false,gestion=true" wire:click="gestionar({{ $usuario->id }},'{{ $usuario->rol_id }}','{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio servicio</button>
<button x-on:click="openOption=false,gestionPromo=true" wire:click="gestionarPromociones({{ $usuario->id }},'{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio promocion</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
@else
@endif
</tr>
@endforeach
</x-slot>
@@ -485,8 +480,7 @@
<div class="mb-4">
<label class="select-none text-gray-700 text-sm font-bold mb-2">Selecciona rol:</label>
<select name="estado_promocion" id="estado_promocion" wire:model="rol"
class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<select name="estado_promocion" id="estado_promocion" wire:model="rol" class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option selected>Rol</option>
@foreach ($roles as $rol)
<option value="{{ $rol->id }}">{{ $rol->nombre }}</option>