From 27dc5e77af0a9a773524e444e660ca7e5b12cadb Mon Sep 17 00:00:00 2001 From: "Adriano (daitarn)" Date: Wed, 7 Oct 2026 12:25:56 +0200 Subject: [PATCH 1/2] Schermate operatore: un solo Completato grande, Fermo linea solo con run aperto, AVVIA ATTIVITA, pannello lotto/seriale dopo la scelta (#60 #61 #62 #63 #64) Co-Authored-By: Claude Sonnet 5.5 --- .../templates/measure/select_recipe.html | 138 +++++++++--------- .../templates/measure/task_execute.html | 49 ++++--- .../templates/measure/task_list.html | 2 +- .../flask_app/tests/test_operator_flow_ui.py | 50 ++++++- .../translations/en/LC_MESSAGES/messages.po | 2 +- .../translations/it/LC_MESSAGES/messages.po | 4 +- .../flask_app/translations/messages.pot | 2 +- 7 files changed, 149 insertions(+), 98 deletions(-) diff --git a/src/frontend/flask_app/templates/measure/select_recipe.html b/src/frontend/flask_app/templates/measure/select_recipe.html index 98c1ae9..4a04009 100644 --- a/src/frontend/flask_app/templates/measure/select_recipe.html +++ b/src/frontend/flask_app/templates/measure/select_recipe.html @@ -13,6 +13,15 @@ barcodeInput: '', barcodeLoading: false, barcodeError: '', + /* #63/#64: ricetta scelta che richiede lotto/seriale; il pannello compare solo allora. */ + selected: null, + needsTrace(recipe) { + return !!(recipe && (recipe.requires_lot || recipe.requires_serial)); + }, + choose(recipe) { + this.selected = recipe; + this.$nextTick(() => { const el = document.getElementById('trace-panel'); if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' }); }); + }, get filteredRecipes() { if (!this.search) return this.recipes; const q = this.search.toLowerCase(); @@ -62,9 +71,12 @@ // The scanner is a way in like any other: a recipe that demands a lot // demands it here too, or the rule would last exactly as long as it // took someone to reach for the barcode reader. - const missing = this.missingTraceability(data); - if (missing.length) { - this.barcodeError = {{ _("Compila prima:")|tojson_attr }} + ' ' + missing.join(', '); + // #63/#64: se la ricetta chiede lotto/seriale mancanti, la si sceglie e + // compare il pannello con i soli campi richiesti. + if (this.missingTraceability(data).length) { + this.barcodeModal = false; + this.barcodeInput = ''; + this.choose(data); return; } this.barcodeModal = false; @@ -149,50 +161,6 @@ - -
-
-
- - - -
-

{{ _('Tracciabilità') }}

-

{{ _('Dati del pezzo da misurare — compila prima di selezionare la ricetta') }}

-
-
-
- -
- - -
- - -
- - -
-
-
-
-

@@ -269,30 +237,25 @@

- {# What this recipe insists on before anyone measures. Said on the card - rather than after the fact: a measurement taken without its lot cannot - be traced back, and finding that out later is finding it out too late. #} -
+ +
+
+
+ + + +
+

{{ _('Tracciabilità') }}:

+

{{ _('Dati del pezzo da misurare — compila prima di selezionare la ricetta') }}

+
+
+
+
+ + +
+
+ + +
+
+ + {{ _('AVVIA ATTIVITÀ') }} + +
+
+
diff --git a/src/frontend/flask_app/templates/measure/task_execute.html b/src/frontend/flask_app/templates/measure/task_execute.html index cd925b6..0e75aa6 100644 --- a/src/frontend/flask_app/templates/measure/task_execute.html +++ b/src/frontend/flask_app/templates/measure/task_execute.html @@ -115,20 +115,12 @@ {{ _('Lista task') }} - + {# #60: un solo «Completato», quello grande in fondo (touch); qui resta solo la lista. #}
{# Fermo linea + Fine produzione (measurement tasks only) #} -