ARREGLOS: Errores de disposicion de errores corregidos.
This commit is contained in:
@@ -2,6 +2,18 @@
|
||||
|
||||
<x-section-header subtitle="Taller" title="Nueva " highlight="Orden de Reparación" />
|
||||
|
||||
<x-ui.alert />
|
||||
|
||||
@if($errors->any())
|
||||
<div class="w-120 bg-red-900/50 border border-red-500 text-red-300 px-4 py-3 rounded-lg mb-6 shadow-sm">
|
||||
<ul class="list-disc list-inside">
|
||||
@foreach($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="max-w-5xl mx-auto bg-panel-bg border border-neutral-800 rounded-xl p-8 shadow-lg">
|
||||
<form action="{{ route('taller.store') }}" method="POST" class="space-y-8" id="taller-form">
|
||||
@csrf
|
||||
@@ -19,11 +31,11 @@
|
||||
<option value="{{ $client->id }}">{{ $client->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<a href="{{ route('clients.create') }}" class="text-xs text-neon-lime hover:underline mt-1 inline-block">+ Nuevo Cliente</a>
|
||||
<a href="{{ route('clients.create', ['origin' => 'taller']) }}" class="text-xs text-neon-lime hover:underline mt-1 inline-block">+ Nuevo Cliente</a>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-400 uppercase mb-2">Teléfono Aviso (Opcional)</label>
|
||||
<input type="text" name="contact_phone" placeholder="Dejar vacío para usar el del perfil" class="w-full bg-neutral-900 border border-neutral-700 text-white rounded-lg p-2.5 focus:ring-neon-lime focus:border-neon-lime">
|
||||
<label class="block text-xs font-bold text-gray-400 uppercase mb-2">Teléfono Aviso</label>
|
||||
<input type="text" name="contact_phone" placeholder="Ingresar numero de telefono" class="w-full bg-neutral-900 border border-neutral-700 text-white rounded-lg p-2.5 focus:ring-neon-lime focus:border-neon-lime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -106,9 +118,22 @@
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const partsDB = @json($products);
|
||||
const clientsDB = @json($clients);
|
||||
let selectedParts = [];
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
// Telefono de Cliente al cambiar selección
|
||||
$('select[name="client_id"]').on('change', function() {
|
||||
let clientId = $(this).val();
|
||||
let client = clientsDB.find(c => c.id == clientId);
|
||||
if (client && client.phone) {
|
||||
$('input[name="contact_phone"]').val(client.phone);
|
||||
} else {
|
||||
$('input[name="contact_phone"]').val('');
|
||||
}
|
||||
});
|
||||
|
||||
// --- 1. Lógica del Buscador ---
|
||||
$('#part-search').on('keyup focus', function() {
|
||||
let term = $(this).val().toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user