Files
alro65 67a0e674ca Initial commit — MarineMaintenance v1.0
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>
2026-05-05 01:54:20 -04:00

90 lines
4.3 KiB
HTML

{% extends 'base.html' %}
{% block title %}{% if msds %}Editar{% else %}Nueva{% endif %} MSDS{% endblock %}
{% block page_title %}{% if msds %}Editar MSDS — {{ msds.product_name }}{% else %}Nueva Ficha MSDS{% endif %}{% endblock %}
{% block topbar_actions %}
<a href="{{ url_for('msds_index') }}" class="btn btn-secondary">← Volver</a>
{% endblock %}
{% block content %}
<div class="card" style="max-width:820px">
<form method="POST" enctype="multipart/form-data">
<div class="form-grid">
<div class="form-group">
<label>Nombre del Producto *</label>
<input type="text" name="product_name" required value="{{ msds.product_name if msds else '' }}">
</div>
<div class="form-group">
<label>Fabricante</label>
<input type="text" name="manufacturer" value="{{ msds.manufacturer if msds else '' }}">
</div>
<div class="form-group">
<label>Clase de Peligro (GHS)</label>
<select name="hazard_class">
<option value="">— Seleccionar —</option>
{% for cls in ['GHS01 Explosivo','GHS02 Inflamable','GHS03 Oxidante','GHS04 Gas comprimido','GHS05 Corrosivo','GHS06 Tóxico','GHS07 Nocivo/Irritante','GHS08 Peligro salud','GHS09 Peligro ambiental'] %}
<option value="{{ cls }}" {% if msds and msds.hazard_class==cls %}selected{% endif %}>{{ cls }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label>Repuesto Vinculado (opcional)</label>
<select name="part_id">
<option value="">— Sin vincular —</option>
{% for p in parts %}
<option value="{{ p.id }}" {% if msds and msds.part_id==p.id %}selected{% endif %}>{{ p.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label>Versión</label>
<input type="text" name="version" value="{{ msds.version if msds else 'v1.0' }}">
</div>
<div class="form-group full">
<label>Riesgos y Peligros</label>
<textarea name="hazards" rows="3">{{ msds.hazards if msds else '' }}</textarea>
</div>
<div class="form-group full">
<label>Primeros Auxilios</label>
<textarea name="first_aid" rows="3">{{ msds.first_aid if msds else '' }}</textarea>
</div>
<div class="form-group full">
<label>EPP Requerido</label>
<textarea name="ppe_required" rows="2">{{ msds.ppe_required if msds else '' }}</textarea>
</div>
<div class="form-group">
<label>Manejo</label>
<textarea name="handling" rows="2">{{ msds.handling if msds else '' }}</textarea>
</div>
<div class="form-group">
<label>Almacenamiento</label>
<textarea name="storage" rows="2">{{ msds.storage if msds else '' }}</textarea>
</div>
<div class="form-group">
<label>Procedimiento de derrame</label>
<textarea name="spill_procedure" rows="2">{{ msds.spill_procedure if msds else '' }}</textarea>
</div>
<div class="form-group">
<label>Disposición / Desecho</label>
<textarea name="disposal" rows="2">{{ msds.disposal if msds else '' }}</textarea>
</div>
<div class="form-group full">
<label>Referencias (OSHA, SDS, etc.)</label>
<textarea name="ref_standards" rows="2">{{ msds.ref_standards if msds else '' }}</textarea>
</div>
<div class="form-group full">
<label>PDF Oficial del Fabricante</label>
<input type="file" name="pdf_file" accept=".pdf" style="padding:8px">
{% if msds and msds.pdf_filename %}
<div style="margin-top:6px;font-size:12px;color:var(--gray)">
Actual: <a href="/static/uploads/docs/{{ msds.pdf_filename }}" target="_blank" style="color:var(--cyan)">{{ msds.pdf_filename }}</a>
</div>
{% endif %}
</div>
</div>
<div class="flex gap-3 mt-6">
<button type="submit" class="btn btn-primary">💾 Guardar MSDS</button>
<a href="{{ url_for('msds_index') }}" class="btn btn-secondary">Cancelar</a>
</div>
</form>
</div>
{% endblock %}