gmao/app_new/templates/lots/task_form.html
root 4f8237aba9
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
Lier le cycle de vie à la maintenance préventive
2026-08-19 22:49:15 +00:00

31 lines
5.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block title %}{{ 'Nouvelle tâche' if creating else 'Modifier la tâche' }} — {{ lot.name }}{% endblock %}
{% block content %}
<div class="container-fluid" style="max-width:1100px">
<nav aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="{{ url_for('lots.index') }}">Lots</a></li><li class="breadcrumb-item"><a href="{{ url_for('lots.detail', id=lot.id) }}">{{ lot.name }}</a></li><li class="breadcrumb-item active">Règle préventive</li></ol></nav>
<h1 class="h3 mb-3">{{ 'Nouvelle tâche préventive' if creating else 'Modifier la tâche préventive' }}</h1>
<form method="post" class="card"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="card-body">
<div class="row g-3">
<div class="col-md-3"><label class="form-label">Numéro</label><input class="form-control" name="num_tache" value="{{ task.num_tache or '' }}"></div>
<div class="col-md-9"><label class="form-label">Tâche *</label><input class="form-control" name="tache" required value="{{ task.tache or '' }}"></div>
<div class="col-12"><label class="form-label">Périodicité lisible</label><input class="form-control" name="periodicite" value="{{ task.periodicite or '' }}" placeholder="Ex. tous les ans pendant les vacances d'été"></div>
<div class="col-md-4"><label class="form-label">Déclenchement</label><select class="form-select" name="trigger_type"><option value="calendar" {% if task.trigger_type == 'calendar' %}selected{% endif %}>Calendrier</option><option value="season" {% if task.trigger_type == 'season' %}selected{% endif %}>Saison</option><option value="event" {% if task.trigger_type == 'event' %}selected{% endif %}>Événement</option><option value="weather" {% if task.trigger_type == 'weather' %}selected{% endif %}>Météo</option><option value="meter" {% if task.trigger_type == 'meter' %}selected{% endif %}>Compteur</option></select></div>
<div class="col-md-4"><label class="form-label">Intervalle (jours)</label><input class="form-control" type="number" min="1" name="jours_entre_interventions" value="{{ task.jours_entre_interventions or '' }}"></div>
<div class="col-md-4"><label class="form-label">Anticipation (jours)</label><input class="form-control" type="number" min="0" name="advance_days" value="{{ task.advance_days or 0 }}"></div>
<div class="col-md-4"><label class="form-label">Durée par cible (minutes)</label><input class="form-control" type="number" min="1" name="duree_minutes" value="{{ task.duree_minutes or '' }}"></div>
<div class="col-md-4"><label class="form-label">Événement</label><input class="form-control" name="trigger_event" value="{{ task.trigger_event or '' }}" placeholder="orage, gel…"></div>
<div class="col-md-4"><label class="form-label">Seuil compteur</label><input class="form-control" type="number" step="0.01" name="meter_threshold" value="{{ task.meter_threshold or '' }}"></div>
<div class="col-md-3"><label class="form-label">Début de saison</label><input class="form-control" type="number" min="1" max="12" name="season_start_month" value="{{ task.season_start_month or '' }}"></div>
<div class="col-md-3"><label class="form-label">Fin de saison</label><input class="form-control" type="number" min="1" max="12" name="season_end_month" value="{{ task.season_end_month or '' }}"></div>
<div class="col-md-6"><label class="form-label">Portée</label><select class="form-select" name="application_scope"><option value="auto" {% if task.application_scope == 'auto' %}selected{% endif %}>Automatique selon le type déquipement</option><option value="group" {% if task.application_scope == 'group' %}selected{% endif %}>Une tâche par groupe/localisation</option><option value="unit" {% if task.application_scope == 'unit' %}selected{% endif %}>Une tâche par unité individualisée</option></select><div class="form-text">Pour 30 chaises, « groupe » crée une seule tâche dans la salle.</div></div>
<div class="col-md-6"><label class="form-label">Si léquipement est indisponible</label><select class="form-select" name="unavailable_policy"><option value="suspend" {% if task.unavailable_policy == 'suspend' %}selected{% endif %}>Suspendre et reprendre après réparation</option><option value="keep" {% if task.unavailable_policy == 'keep' %}selected{% endif %}>Maintenir la tâche</option><option value="postpone" {% if task.unavailable_policy == 'postpone' %}selected{% endif %}>Ne pas générer avant remise en service</option></select></div>
<div class="col-md-6"><label class="form-label">Après réparation</label><select class="form-select" name="after_repair_policy"><option value="preserve" {% if task.after_repair_policy == 'preserve' %}selected{% endif %}>Conserver léchéance dorigine</option><option value="reset" {% if task.after_repair_policy == 'reset' %}selected{% endif %}>Repartir de la date de réparation</option></select></div>
<div class="col-md-3 form-check ms-2 mt-5"><input class="form-check-input" type="checkbox" name="is_safety_critical" id="safety" {% if task.is_safety_critical %}checked{% endif %}><label class="form-check-label" for="safety">Tâche de sécurité</label></div>
<div class="col-md-2 form-check ms-2 mt-5"><input class="form-check-input" type="checkbox" name="is_active" id="active" {% if task.is_active %}checked{% endif %}><label class="form-check-label" for="active">Active</label></div>
</div>
</div>
<div class="card-footer d-flex justify-content-end gap-2"><a class="btn btn-outline-secondary" href="{{ url_for('lots.detail', id=lot.id) }}">Annuler</a><button class="btn btn-primary"><i class="bi bi-check-lg"></i> Enregistrer</button></div>
</form>
</div>
{% endblock %}