fix(measure): START cycle advances to next task instead of blocking
When all subtasks of a task were measured, the completion overlay only offered "Riepilogo" (which leaves the work cycle) or "Conferma ciclo" (which keeps the operator stuck on the same task and starts the interval timer). During the START run — before production is started — neither lets the operator simply move to the next task. Make the overlay phase-aware: - Production started: keep "Conferma ciclo". - START, not the last task: primary action "Task successivo" -> goToNextTask(). - START, last task: "Avvio Produzione" -> startProductionFromOverlay(), which starts production and kicks off the interval cycle. Add isLastTask getter and startProductionFromOverlay(); EN translation for the new label. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -584,13 +584,36 @@
|
||||
class="btn btn-secondary flex-1 justify-center gap-2">
|
||||
{{ _('Riepilogo') }}
|
||||
</button>
|
||||
<button @click="showCompletionOverlay = false; cycleConfirmed = true"
|
||||
|
||||
{# Production phase: confirm the cycle (starts the interval timer) #}
|
||||
<button x-show="productionStarted"
|
||||
@click="showCompletionOverlay = false; cycleConfirmed = true"
|
||||
class="btn btn-primary flex-1 justify-center gap-2">
|
||||
{{ _('Conferma ciclo') }}
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{# START phase, more tasks to go: advance without blocking or exiting #}
|
||||
<button x-show="!productionStarted && !isLastTask"
|
||||
@click="goToNextTask()"
|
||||
class="btn btn-primary flex-1 justify-center gap-2">
|
||||
{{ _('Task successivo') }}
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{# START phase, last task: start production #}
|
||||
<button x-show="!productionStarted && isLastTask"
|
||||
@click="startProductionFromOverlay()"
|
||||
class="btn flex-1 justify-center gap-2 bg-emerald-600 hover:bg-emerald-700 text-white">
|
||||
{{ _('Avvio Produzione') }}
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 3l14 9-14 9V3z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -980,6 +1003,25 @@ function taskExecute() {
|
||||
// await fetch('/measure/api/gaia/start-production', { method: 'POST', ... });
|
||||
},
|
||||
|
||||
// Is the current task the last one in the recipe sequence?
|
||||
get isLastTask() {
|
||||
const taskIds = window.__allTaskIds || [];
|
||||
const idx = taskIds.indexOf(this.task.id);
|
||||
return idx === -1 || idx >= taskIds.length - 1;
|
||||
},
|
||||
|
||||
// Start production from the completion overlay (last START task) and begin
|
||||
// the measurement-interval cycle if the recipe defines one.
|
||||
startProductionFromOverlay() {
|
||||
this.showCompletionOverlay = false;
|
||||
this.startProduction();
|
||||
this.cycleConfirmed = true;
|
||||
this.cycleCount++;
|
||||
if (this.measurementIntervalMinutes && this.measurementIntervalMinutes > 0) {
|
||||
this.startMeasurementTimer();
|
||||
}
|
||||
},
|
||||
|
||||
get timerDisplay() {
|
||||
var m = Math.floor(this.timerRemaining / 60);
|
||||
var s = this.timerRemaining % 60;
|
||||
|
||||
@@ -2188,3 +2188,6 @@ msgstr "E.g. SN-000123 (optional)"
|
||||
msgid "Supervisor (capoturno)"
|
||||
msgstr "Supervisor (shift leader)"
|
||||
|
||||
msgid "Task successivo"
|
||||
msgstr "Next task"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user