This commit is contained in:
@@ -4,6 +4,73 @@
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_home') }}">← Zurück</a>
|
||||
</div>
|
||||
|
||||
{% if konflikte %}
|
||||
<div class="card">
|
||||
<h3>Maschine weicht ab – bitte entscheiden</h3>
|
||||
<p class="hint">
|
||||
In <strong>{{ dateiname }}</strong> weicht bei {{ konflikte|length }} bereits vorhandenen Aufträgen die Maschine
|
||||
von der im System ab. Bis zur Bestätigung wurde <strong>noch nichts verändert</strong>.
|
||||
Bei „Maschine aus Import übernehmen“ wechseln der Auftrag und alle seine Buchungen auf die neue Maschine.
|
||||
</p>
|
||||
{% if blockiert_vorab %}
|
||||
<div class="warn-box">
|
||||
Diese Aufträge werden nicht importiert:
|
||||
<ul>{% for z in blockiert_vorab %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="post" action="{{ url_for('leitstand_import') }}">
|
||||
<input type="hidden" name="token" value="{{ token }}">
|
||||
<div class="import-bulk">
|
||||
<button type="button" class="big-btn small neutral" data-alle="uebernehmen">Bei allen: Maschine aus Import übernehmen</button>
|
||||
<button type="button" class="big-btn small neutral" data-alle="behalten">Bei allen: Bisherige Maschine beibehalten</button>
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr><th>Zeile</th><th>FA.-Nr.</th><th>Artikel</th><th>Bisher im System</th><th>Laut Import</th><th>Entscheidung</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for k in konflikte %}
|
||||
<tr>
|
||||
<td>{{ k.zeile }}</td>
|
||||
<td>{{ k.auftragsnummer }}</td>
|
||||
<td>{{ k.artikel or "-" }}</td>
|
||||
<td>{{ k.alt }}</td>
|
||||
<td>{{ k.neu }}</td>
|
||||
<td>
|
||||
<div class="import-choice">
|
||||
<label>
|
||||
<input type="radio" name="entscheidung_{{ k.zeile }}" value="uebernehmen">
|
||||
<span>Maschine aus Import übernehmen<small>Auftrag und Buchungen wechseln zu „{{ k.neu }}“</small></span>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="entscheidung_{{ k.zeile }}" value="behalten" checked>
|
||||
<span>Bisherige Maschine beibehalten<small>Auftrag bleibt unverändert an „{{ k.alt }}“</small></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="action-row">
|
||||
<button type="submit" class="big-btn primary">✓ Import fortsetzen</button>
|
||||
<button type="submit" name="aktion" value="abbrechen" class="big-btn neutral" formnovalidate>Gesamten Import abbrechen</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
(function () {
|
||||
document.querySelectorAll('[data-alle]').forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
var wert = btn.getAttribute('data-alle');
|
||||
document.querySelectorAll('input[type=radio][value=' + wert + ']').forEach(function (r) { r.checked = true; });
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card compact">
|
||||
<p class="hint">
|
||||
Excel- (.xlsx) oder CSV-Datei mit den Spalten <strong>Maschine</strong>, <strong>man. Prio</strong>,
|
||||
@@ -16,7 +83,10 @@
|
||||
FA.-Nrn. werden nicht neu angelegt oder überschrieben – ist in der
|
||||
Datei aber eine gültige Priorität (man. Prio) angegeben, wird diese
|
||||
bei bereits vorhandenen Aufträgen trotzdem übernommen. Ist die
|
||||
Rest-Menge 0, wird der Auftrag direkt als abgeschlossen angelegt.
|
||||
Rest-Menge 0, wird der Auftrag direkt als abgeschlossen angelegt.<br>
|
||||
Weicht bei einem vorhandenen Auftrag die <strong>Maschine</strong> im Import von der im
|
||||
System ab, wirst du vor dem Import gefragt, welche gelten soll. Aufträge, die gerade
|
||||
an einer Maschine <strong>aktiv</strong> sind, werden nicht importiert.
|
||||
</p>
|
||||
<form method="post" action="{{ url_for('leitstand_import') }}" enctype="multipart/form-data" class="compact-form">
|
||||
<div class="form-group">
|
||||
@@ -68,14 +138,25 @@
|
||||
</script>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if ergebnis %}
|
||||
<div class="card">
|
||||
<h3>Ergebnis</h3>
|
||||
{% if ergebnis.blockiert_aktiv %}
|
||||
<div class="warn-box">
|
||||
Nicht importiert, weil gerade aktiv ({{ ergebnis.blockiert_aktiv|length }}):
|
||||
<ul>{% for z in ergebnis.blockiert_aktiv %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<p>
|
||||
{{ ergebnis.importiert|length }} importiert,
|
||||
{{ ergebnis.uebersprungen_vorhanden|length }} bereits vorhanden (übersprungen){% if ergebnis.prioritaet_aktualisiert %},
|
||||
{{ ergebnis.prioritaet_aktualisiert|length }} davon mit aktualisierter Priorität{% endif %},
|
||||
{{ ergebnis.verworfen_maschine|length }} wegen unbekannter Maschine verworfen{% if ergebnis.fehlerhafte_zeilen %},
|
||||
{% if ergebnis.maschine_gewechselt %}{{ ergebnis.maschine_gewechselt|length }} auf eine andere Maschine verschoben,
|
||||
{% endif %}{% if ergebnis.maschine_behalten %}{{ ergebnis.maschine_behalten|length }} mit beibehaltener Maschine,
|
||||
{% endif %}{% if ergebnis.blockiert_aktiv %}{{ ergebnis.blockiert_aktiv|length }} wegen aktivem Auftrag nicht importiert,
|
||||
{% endif %}{{ ergebnis.verworfen_maschine|length }} wegen unbekannter Maschine verworfen{% if ergebnis.fehlerhafte_zeilen %},
|
||||
{{ ergebnis.fehlerhafte_zeilen|length }} fehlerhaft{% endif %}.
|
||||
</p>
|
||||
|
||||
@@ -91,6 +172,18 @@
|
||||
<ul>{% for z in ergebnis.prioritaet_aktualisiert %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% if ergebnis.maschine_gewechselt %}
|
||||
<details open>
|
||||
<summary>Maschine aus Import übernommen ({{ ergebnis.maschine_gewechselt|length }})</summary>
|
||||
<ul>{% for z in ergebnis.maschine_gewechselt %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% if ergebnis.maschine_behalten %}
|
||||
<details open>
|
||||
<summary>Bisherige Maschine beibehalten ({{ ergebnis.maschine_behalten|length }})</summary>
|
||||
<ul>{% for z in ergebnis.maschine_behalten %}<li>{{ z }}</li>{% endfor %}</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% if ergebnis.uebersprungen_vorhanden %}
|
||||
<details>
|
||||
<summary>Bereits vorhanden – übersprungen ({{ ergebnis.uebersprungen_vorhanden|length }})</summary>
|
||||
|
||||
@@ -12,17 +12,22 @@
|
||||
<option value="{{ m.id }}" {% if filter_maschine_id|string == m.id|string %}selected{% endif %}>{{ m.name or ('Maschine ' ~ m.id) }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="submit">Filtern</button>
|
||||
<span>Suche:</span>
|
||||
<input type="search" name="q" value="{{ suchbegriff }}" placeholder="Auftragsnr. oder Artikel" autocomplete="off">
|
||||
<button type="submit">Suchen</button>
|
||||
{% if suchbegriff %}
|
||||
<a class="filter-reset" href="{{ url_for('leitstand_korrektur', maschine_id=filter_maschine_id or None) }}">Suche zurücksetzen</a>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
{% if not eintraege %}
|
||||
<div class="empty-state">Keine Einträge gefunden.</div>
|
||||
{% else %}
|
||||
<div class="list-meta">{{ eintraege|length }} Buchungen (neueste zuerst)</div>
|
||||
<div class="list-meta">{{ eintraege|length }} Buchungen (neueste zuerst){% if suchbegriff %} für „{{ suchbegriff }}“{% endif %}</div>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr><th>ID</th><th>Maschine</th><th>Zeit</th><th>Auftrag</th><th>Produziert</th><th>Status</th><th>Ø/h</th><th>Grund</th><th class="col-actions"></th></tr>
|
||||
<tr><th>ID</th><th>Maschine</th><th>Zeit</th><th>Auftrag</th><th>Artikel</th><th>Produziert</th><th>Status</th><th>Ø/h</th><th>Grund</th><th class="col-actions"></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for m in eintraege %}
|
||||
@@ -31,15 +36,17 @@
|
||||
<td>{{ m.maschine_id|int }}</td>
|
||||
<td>{{ m.zeit_fmt }}</td>
|
||||
<td>{{ m.order }}</td>
|
||||
<td>{{ m.artikel or '-' }}</td>
|
||||
<td>{{ m.produziert_fmt }}</td>
|
||||
<td>{{ m.status }}</td>
|
||||
<td>{{ m.h_avg_fmt }}</td>
|
||||
<td>{{ m.p_grund or '' }}</td>
|
||||
<td class="col-actions">
|
||||
<div class="row-actions">
|
||||
<a class="icon-btn" href="{{ url_for('leitstand_korrektur_bearbeiten', mde_id=m.id, maschine_id=filter_maschine_id) }}">Bearbeiten</a>
|
||||
<a class="icon-btn" href="{{ url_for('leitstand_korrektur_bearbeiten', mde_id=m.id, maschine_id=filter_maschine_id, q=suchbegriff or None) }}">Bearbeiten</a>
|
||||
<form method="post" action="{{ url_for('leitstand_korrektur_loeschen', mde_id=m.id) }}" class="order-form">
|
||||
<input type="hidden" name="maschine_id" value="{{ filter_maschine_id or '' }}">
|
||||
<input type="hidden" name="q" value="{{ suchbegriff }}">
|
||||
<button type="submit" class="icon-btn danger">Löschen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_korrektur', maschine_id=filter_maschine_id) }}">← Zurück</a>
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_korrektur', maschine_id=filter_maschine_id, q=suchbegriff or None) }}">← Zurück</a>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('leitstand_korrektur_bearbeiten', mde_id=eintrag.id) }}">
|
||||
<input type="hidden" name="maschine_id_filter" value="{{ filter_maschine_id or '' }}">
|
||||
<input type="hidden" name="q_filter" value="{{ suchbegriff or '' }}">
|
||||
<div class="card">
|
||||
<div class="form-group">
|
||||
<label for="order">Auftragsnummer</label>
|
||||
|
||||
@@ -17,13 +17,23 @@
|
||||
<option value="offen_pause" {% if filter_status == "offen_pause" %}selected{% endif %}>Offen/Pausiert/Aktiv</option>
|
||||
<option value="alle" {% if filter_status == "alle" %}selected{% endif %}>Alle</option>
|
||||
</select>
|
||||
<button type="submit">Filtern</button>
|
||||
<span>Suche:</span>
|
||||
<input type="search" name="q" value="{{ suchbegriff }}" placeholder="Auftragsnr. oder Artikel" autocomplete="off">
|
||||
<button type="submit">Suchen</button>
|
||||
{% if suchbegriff %}
|
||||
<a class="filter-reset" href="{{ url_for('leitstand_uebersicht', maschine_id=filter_maschine_id or None, status=filter_status) }}">Suche zurücksetzen</a>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
{% if not auftraege %}
|
||||
<div class="empty-state">Keine Aufträge gefunden.</div>
|
||||
<div class="empty-state">
|
||||
Keine Aufträge gefunden.
|
||||
{% if suchbegriff and filter_status == "offen_pause" %}
|
||||
<div class="hint" style="margin-top:8px;">Tipp: Status auf „Alle“ stellen, um auch abgeschlossene Aufträge zu durchsuchen.</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="list-meta">{{ auftraege|length }} Aufträge</div>
|
||||
<div class="list-meta">{{ auftraege|length }} Aufträge{% if suchbegriff %} für „{{ suchbegriff }}“{% endif %}</div>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
@@ -46,10 +56,11 @@
|
||||
<span style="color:var(--text-dim); font-size:0.85em;">gesperrt (aktiv an Maschine)</span>
|
||||
{% else %}
|
||||
<div class="row-actions">
|
||||
<a class="icon-btn" href="{{ url_for('leitstand_uebersicht_bearbeiten', auftrag_id=a.id, maschine_id=filter_maschine_id, status=filter_status) }}">Bearbeiten</a>
|
||||
<a class="icon-btn" href="{{ url_for('leitstand_uebersicht_bearbeiten', auftrag_id=a.id, maschine_id=filter_maschine_id, status=filter_status, q=suchbegriff or None) }}">Bearbeiten</a>
|
||||
<form method="post" action="{{ url_for('leitstand_uebersicht_loeschen', auftrag_id=a.id) }}" class="order-form">
|
||||
<input type="hidden" name="maschine_id" value="{{ filter_maschine_id or '' }}">
|
||||
<input type="hidden" name="status" value="{{ filter_status }}">
|
||||
<input type="hidden" name="q" value="{{ suchbegriff }}">
|
||||
<button type="submit" class="icon-btn danger">Löschen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="back-row top">
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_uebersicht', maschine_id=filter_maschine_id, status=filter_status) }}">← Zurück</a>
|
||||
<a class="big-btn small neutral" href="{{ url_for('leitstand_uebersicht', maschine_id=filter_maschine_id, status=filter_status, q=suchbegriff or None) }}">← Zurück</a>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('leitstand_uebersicht_bearbeiten', auftrag_id=auftrag.id) }}">
|
||||
<input type="hidden" name="maschine_id_filter" value="{{ filter_maschine_id or '' }}">
|
||||
<input type="hidden" name="status_filter" value="{{ filter_status or '' }}">
|
||||
<input type="hidden" name="q_filter" value="{{ suchbegriff or '' }}">
|
||||
<div class="card">
|
||||
<div class="form-group">
|
||||
<label for="maschine_id">Maschine</label>
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dashboard {{ maschine.name or ('Maschine ' ~ maschine.id) }} – Hour by Hour</title>
|
||||
<link rel="icon" type="image/svg+xml" href="{{ url_for('static', filename='logo.svg') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
<noscript><meta http-equiv="refresh" content="30"></noscript>
|
||||
</head>
|
||||
<body class="dash-body">
|
||||
<main class="dash">
|
||||
|
||||
<section class="dash-top">
|
||||
<div class="dash-tile dash-wide" data-live="aktuell">
|
||||
<div class="dash-title">Aktueller Auftrag</div>
|
||||
<div class="dash-order">{% if auftrag %}{{ auftrag.auftragsnummer }}{% endif %}</div>
|
||||
<div class="dash-article">{% if auftrag and auftrag.artikel %}{{ auftrag.artikel }}{% endif %}</div>
|
||||
</div>
|
||||
<div class="dash-tile dash-wide" data-live="naechster">
|
||||
<div class="dash-title">Nächster Auftrag</div>
|
||||
<div class="dash-order">{% if naechster %}{{ naechster.auftragsnummer }}{% endif %}</div>
|
||||
<div class="dash-article">{% if naechster and naechster.artikel %}{{ naechster.artikel }}{% endif %}</div>
|
||||
</div>
|
||||
<div class="dash-tile dash-clock">
|
||||
<div class="dash-clock-date" id="dash-date"> </div>
|
||||
<div class="dash-clock-time" id="dash-time"> </div>
|
||||
</div>
|
||||
<div class="dash-tile dash-logo">
|
||||
<img src="{{ url_for('static', filename='logo.svg') }}" alt="Logo">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="dash-kpis">
|
||||
<div class="dash-tile">
|
||||
<div class="dash-title">Stückzahl (gesamt)</div>
|
||||
<div class="dash-value green" data-live="k-gesamt">{% if k %}{{ k.gesamt }}{% endif %}</div>
|
||||
</div>
|
||||
<div class="dash-tile">
|
||||
<div class="dash-title">Stückzahl (produziert)</div>
|
||||
<div class="dash-value green" data-live="k-produziert">{% if k %}{{ k.produziert }}{% endif %}</div>
|
||||
</div>
|
||||
<div class="dash-tile">
|
||||
<div class="dash-title">Stückzahl (offen)</div>
|
||||
<div class="dash-value green" data-live="k-offen">{% if k %}{{ k.offen }}{% endif %}</div>
|
||||
</div>
|
||||
<div class="dash-tile">
|
||||
<div class="dash-title">Soll pro Stunde</div>
|
||||
<div class="dash-value green" data-live="k-soll">{% if k %}{{ k.soll_h }}{% endif %}</div>
|
||||
</div>
|
||||
<div class="dash-tile dash-key">
|
||||
<div class="dash-title">Stück/h (Buchung)</div>
|
||||
<div class="dash-value" data-live="k-ist">{% if k %}{{ k.ist_h }}{% endif %}</div>
|
||||
</div>
|
||||
<div class="dash-tile">
|
||||
<div class="dash-title">Abweichung</div>
|
||||
<div class="dash-value" data-live="k-abw">{% if k %}<span class="{{ 'green' if k.abweichung_positiv else 'red' }}">{{ k.abweichung }}</span>{% endif %}</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="dash-log">
|
||||
<div class="dash-title">Protokoll</div>
|
||||
<div class="dash-log-scroll">
|
||||
<table class="dash-table">
|
||||
<thead>
|
||||
<tr><th>Zeit</th><th>Status</th><th class="num">Produziert</th><th class="num">Teile/Stunde</th><th>Grund</th></tr>
|
||||
</thead>
|
||||
<tbody data-live="protokoll">
|
||||
{% for z in protokoll %}
|
||||
<tr>
|
||||
<td><time data-ts="{{ z.ts }}">{{ z.zeit }}</time></td>
|
||||
<td>{{ z.status }}</td>
|
||||
<td class="num">{{ z.produziert }}</td>
|
||||
<td class="num">{{ z.h_avg }}</td>
|
||||
<td>{{ z.grund }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
{% if maschine_badge_id %}<div class="machine-id-badge">M{{ maschine_badge_id }}</div>{% endif %}
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
function z2(n) { return (n < 10 ? '0' : '') + n; }
|
||||
|
||||
// Uhr (Browser-Zeit des Anzeigegeräts)
|
||||
function tick() {
|
||||
var d = new Date();
|
||||
document.getElementById('dash-date').textContent =
|
||||
z2(d.getDate()) + '.' + z2(d.getMonth() + 1) + '.' + d.getFullYear();
|
||||
document.getElementById('dash-time').textContent =
|
||||
z2(d.getHours()) + ':' + z2(d.getMinutes()) + ':' + z2(d.getSeconds());
|
||||
}
|
||||
tick();
|
||||
setInterval(tick, 1000);
|
||||
|
||||
// Protokollzeiten in der Zeitzone des Anzeigegeräts darstellen (der Server
|
||||
// läuft im Container meist in UTC).
|
||||
function zeiten() {
|
||||
document.querySelectorAll('time[data-ts]').forEach(function (el) {
|
||||
var ts = parseInt(el.getAttribute('data-ts'), 10);
|
||||
if (!ts) return;
|
||||
var d = new Date(ts * 1000);
|
||||
el.textContent = d.getFullYear() + '-' + z2(d.getMonth() + 1) + '-' + z2(d.getDate()) + ' ' +
|
||||
z2(d.getHours()) + ':' + z2(d.getMinutes()) + ':' + z2(d.getSeconds());
|
||||
});
|
||||
}
|
||||
zeiten();
|
||||
|
||||
// Daten alle 15 s ohne Neuladen der Seite aktualisieren. Schlägt ein Abruf
|
||||
// fehl (Netz/Server kurz weg), bleibt einfach der letzte Stand stehen.
|
||||
function aktualisieren() {
|
||||
fetch(window.location.href, { cache: 'no-store' })
|
||||
.then(function (r) { return r.ok ? r.text() : Promise.reject(); })
|
||||
.then(function (html) {
|
||||
var neu = new DOMParser().parseFromString(html, 'text/html');
|
||||
neu.querySelectorAll('[data-live]').forEach(function (n) {
|
||||
var ziel = document.querySelector('[data-live="' + n.getAttribute('data-live') + '"]');
|
||||
if (ziel && ziel.innerHTML !== n.innerHTML) ziel.innerHTML = n.innerHTML;
|
||||
});
|
||||
zeiten();
|
||||
})
|
||||
.catch(function () {});
|
||||
}
|
||||
setInterval(aktualisieren, 15000);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user