Consommables : ajout compteur poses perdues + ratio corrige 0.5 (10/20)
- Nouvelle carte 'Poses perdues' dans le panneau consommables - Le ratio ruban optimal pour 10x15 est 0.5 (10cm sur 20cm de panneau) - Diagnostic enrichi : alerte epuisement, ruban avant papier, % gaspille - Reset poses perdues avec le ruban Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -937,7 +937,7 @@ html, body {
|
||||
|
||||
.conso-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
@@ -502,6 +502,12 @@
|
||||
<div class="conso-titre">Photos sorties</div>
|
||||
<div class="conso-gros" id="conso-photos">--</div>
|
||||
</div>
|
||||
<div class="conso-card" id="conso-card-perdues">
|
||||
<div class="conso-icon">⚠</div>
|
||||
<div class="conso-titre">Poses perdues</div>
|
||||
<div class="conso-gros" id="conso-perdues" style="color:#fb8c00">--</div>
|
||||
<div class="conso-chiffres">ruban gaspille sans rembobinage</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 style="margin-top:1.5rem">Capacites</h3>
|
||||
|
||||
@@ -1424,21 +1424,46 @@ async function chargerConsommables() {
|
||||
barrePapier.style.background = pctPapier < 10 ? '#f44336' : pctPapier < 25 ? '#fb8c00' : '#43a047';
|
||||
barreRuban.style.background = pctRuban < 10 ? '#f44336' : pctRuban < 25 ? '#fb8c00' : '#43a047';
|
||||
|
||||
const perdues = data.poses_perdues || 0;
|
||||
document.getElementById('conso-perdues').textContent = perdues;
|
||||
const cardPerdues = document.getElementById('conso-card-perdues');
|
||||
if (perdues > 0) {
|
||||
document.getElementById('conso-perdues').style.color = '#f44336';
|
||||
cardPerdues.style.borderLeft = '3px solid #f44336';
|
||||
} else {
|
||||
document.getElementById('conso-perdues').style.color = '#43a047';
|
||||
cardPerdues.style.borderLeft = '3px solid #43a047';
|
||||
}
|
||||
|
||||
const diag = document.getElementById('conso-diagnostic');
|
||||
const papierUsed = data.papier_utilise;
|
||||
const rubanUsed = data.ruban_utilise;
|
||||
let html = '<strong>Diagnostic</strong><br>';
|
||||
html += `Feuilles consommees : ${papierUsed}<br>`;
|
||||
const photos = data.photos_imprimees;
|
||||
let html = '<strong>Diagnostic consommables</strong><br>';
|
||||
html += `Feuilles papier consommees : ${papierUsed}<br>`;
|
||||
html += `Poses ruban consommees : ${rubanUsed}<br>`;
|
||||
html += `Photos imprimees : ${data.photos_imprimees}<br>`;
|
||||
html += `Photos imprimees : ${photos}<br>`;
|
||||
html += `Poses perdues (gaspillees) : ${perdues}<br>`;
|
||||
if (papierUsed > 0) {
|
||||
const ratio = (rubanUsed / papierUsed).toFixed(2);
|
||||
html += `<br>Ratio ruban/papier : <strong>${ratio}</strong>`;
|
||||
html += `<br>Ratio ruban/papier : <strong>${ratio}</strong><br>`;
|
||||
if (parseFloat(ratio) <= 0.75) {
|
||||
html += ' ✅ Rembobinage actif (economie ruban)';
|
||||
html += '✅ <strong>Rembobinage efficace</strong> — le ruban est economise';
|
||||
} else if (parseFloat(ratio) >= 0.95) {
|
||||
html += ' ⚠ Ratio 1:1 — pas d\'economie ruban';
|
||||
html += '⚠ <strong>Pas d\'economie ruban</strong> — activez le rembobinage dans Materiel';
|
||||
} else {
|
||||
html += '🔄 Rembobinage partiel';
|
||||
}
|
||||
if (perdues > 0) {
|
||||
const pctPerdu = ((perdues / (rubanUsed + perdues)) * 100).toFixed(0);
|
||||
html += `<br>🔴 ${pctPerdu}% du ruban gaspille (${perdues} poses pour rien)`;
|
||||
}
|
||||
}
|
||||
if (data.papier_restant <= 20 || data.ruban_restant <= 20) {
|
||||
html += '<br><br>🚨 <strong>Consommable bientot epuise !</strong>';
|
||||
}
|
||||
if (data.ruban_restant < data.papier_restant - 10) {
|
||||
html += '<br>⚠ Le ruban va s\'epuiser avant le papier';
|
||||
}
|
||||
diag.innerHTML = html;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user