67a0e674ca
Marine maintenance management: work orders with photos, ISM/SWP procedures, MSDS, inventory, RFQ/purchases, vessel history, bilingual PDF reports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48 lines
1.7 KiB
HTML
48 lines
1.7 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}Proveedores{% endblock %}
|
|
{% block page_title %}Proveedores{% endblock %}
|
|
{% block topbar_actions %}
|
|
<a href="{{ url_for('supplier_new') }}" class="btn btn-primary">+ Nuevo Proveedor</a>
|
|
{% endblock %}
|
|
{% block content %}
|
|
<div class="card">
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr><th>Nombre</th><th>Contacto</th><th>Teléfono</th><th>Email</th><th>Dirección</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for s in suppliers %}
|
|
<tr>
|
|
<td><strong>{{ s.name }}</strong></td>
|
|
<td>{{ s.contact_name or '—' }}</td>
|
|
<td>{{ s.phone or '—' }}</td>
|
|
<td>{{ s.email or '—' }}</td>
|
|
<td class="text-gray" style="font-size:12px">{{ s.address or '—' }}</td>
|
|
<td class="flex gap-2">
|
|
<a href="{{ url_for('supplier_edit', sid=s.id) }}" class="btn btn-sm btn-secondary">✏️</a>
|
|
<button onclick="deleteSupplier({{ s.id }}, this.closest('tr'))" class="btn btn-sm btn-danger">🗑️</button>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="6" class="text-gray" style="text-align:center;padding:30px">Sin proveedores.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% block scripts %}
|
|
<script>
|
|
function deleteSupplier(id, row) {
|
|
if (!confirm('¿Eliminar este proveedor? Solo si no tiene órdenes de compra asociadas.')) return;
|
|
fetch('/suppliers/' + id + '/delete', {method: 'DELETE'})
|
|
.then(r => r.json())
|
|
.then(d => {
|
|
if (d.ok) row.remove();
|
|
else alert('No se puede eliminar: ' + (d.error || 'tiene registros asociados'));
|
|
});
|
|
}
|
|
</script>
|
|
{% endblock %}
|