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 @@ - -
{{ _('Dati del pezzo da misurare — compila prima di selezionare la ricetta') }}
-@@ -269,30 +237,25 @@
- - -
+ {# #63/#64: una ricetta con lotto/seriale obbligatori si sceglie prima + (il pannello compare sotto la griglia); le altre partono subito. #} + + + + + + + {{ _('AVVIA ATTIVITÀ') }} + - - - - {{ _('AVVIA IN SEQUENZA') }} - {# The whole list, for when the operator wants to see it or go back to a task left unfinished. Deliberately the quiet one of the two. #} @@ -306,6 +269,41 @@{{ _('Dati del pezzo da misurare — compila prima di selezionare la ricetta') }}
+