diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/js/job_workspace.js b/fusion_plating/fusion_plating_shopfloor/static/src/js/job_workspace.js index 9cca1c97..58e91f32 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/js/job_workspace.js +++ b/fusion_plating/fusion_plating_shopfloor/static/src/js/job_workspace.js @@ -25,16 +25,18 @@ import { WorkflowChip } from "./components/workflow_chip"; import { GateViz } from "./components/gate_viz"; import { FpSignaturePad } from "./components/signature_pad"; import { FpHoldComposer } from "./components/hold_composer"; +import { FpTabletLock } from "./tablet_lock"; export class FpJobWorkspace extends Component { static template = "fusion_plating_shopfloor.JobWorkspace"; static props = ["*"]; - static components = { WorkflowChip, GateViz, FpSignaturePad, FpHoldComposer }; + static components = { WorkflowChip, GateViz, FpSignaturePad, FpHoldComposer, FpTabletLock }; setup() { this.notification = useService("notification"); this.action = useService("action"); this.dialog = useService("dialog"); + this.techStore = useService("fp_shopfloor_tech_store"); this.state = useState({ data: null, @@ -76,6 +78,11 @@ export class FpJobWorkspace extends Component { this.action.doAction({ type: "ir.actions.act_window_close" }); } + // ---- Hand-Off (Phase 6.2) --------------------------------------------- + handOff() { + this.techStore.lock(); + } + onJumpToBlocker({ model, id }) { // If the predecessor is in this same workspace, just scroll to it const inThisJob = (this.state.data.steps || []).find((s) => s.id === id); diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/js/manager_dashboard.js b/fusion_plating/fusion_plating_shopfloor/static/src/js/manager_dashboard.js index b00363f6..dd8de876 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/js/manager_dashboard.js +++ b/fusion_plating/fusion_plating_shopfloor/static/src/js/manager_dashboard.js @@ -17,15 +17,17 @@ import { registry } from "@web/core/registry"; import { rpc } from "@web/core/network/rpc"; import { useService } from "@web/core/utils/hooks"; import { QrScanner } from "./qr_scanner"; +import { FpTabletLock } from "./tablet_lock"; export class ManagerDashboard extends Component { static template = "fusion_plating_shopfloor.ManagerDashboard"; static props = ["*"]; - static components = { QrScanner }; + static components = { QrScanner, FpTabletLock }; setup() { this.notification = useService("notification"); this.action = useService("action"); + this.techStore = useService("fp_shopfloor_tech_store"); this.state = useState({ overview: null, @@ -148,6 +150,11 @@ export class ManagerDashboard extends Component { this.state.mode = this.state.mode === "quick" ? "detailed" : "quick"; } + // ---- Hand-Off (Phase 6.2) --------------------------------------------- + handOff() { + this.techStore.lock(); + } + toggleCard(jobId) { this.state.expandedJobId = this.state.expandedJobId === jobId ? null : jobId; } diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/js/shopfloor_landing.js b/fusion_plating/fusion_plating_shopfloor/static/src/js/shopfloor_landing.js index fbd78702..923bf472 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/js/shopfloor_landing.js +++ b/fusion_plating/fusion_plating_shopfloor/static/src/js/shopfloor_landing.js @@ -23,6 +23,7 @@ import { rpc } from "@web/core/network/rpc"; import { useService } from "@web/core/utils/hooks"; import { QrScanner } from "./qr_scanner"; import { FpKanbanCard } from "./components/kanban_card"; +import { FpTabletLock } from "./tablet_lock"; const LS_STATION_ID = "fp_landing_station_id"; const LS_MODE = "fp_landing_mode"; @@ -31,11 +32,12 @@ const REFRESH_MS = 15000; export class FpShopfloorLanding extends Component { static template = "fusion_plating_shopfloor.ShopfloorLanding"; static props = ["*"]; - static components = { QrScanner, FpKanbanCard }; + static components = { QrScanner, FpKanbanCard, FpTabletLock }; setup() { this.notification = useService("notification"); this.action = useService("action"); + this.techStore = useService("fp_shopfloor_tech_store"); this.state = useState({ mode: localStorage.getItem(LS_MODE) || "all_plant", @@ -120,6 +122,12 @@ export class FpShopfloorLanding extends Component { this.refresh(); } + // ---- Hand-Off (Phase 6.2) --------------------------------------------- + handOff() { + // Tech walking away: lock the tablet so the next operator must PIN in + this.techStore.lock(); + } + // ---- Search ------------------------------------------------------------ onSearchInput(ev) { this.state.search = ev.target.value; diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/xml/job_workspace.xml b/fusion_plating/fusion_plating_shopfloor/static/src/xml/job_workspace.xml index b112164b..cb403cc6 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/xml/job_workspace.xml +++ b/fusion_plating/fusion_plating_shopfloor/static/src/xml/job_workspace.xml @@ -2,6 +2,8 @@ + + @@ -20,6 +22,12 @@ Back + + + Hand Off + · @@ -225,6 +233,8 @@ + + diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/xml/manager_dashboard.xml b/fusion_plating/fusion_plating_shopfloor/static/src/xml/manager_dashboard.xml index d3626983..1395a25d 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/xml/manager_dashboard.xml +++ b/fusion_plating/fusion_plating_shopfloor/static/src/xml/manager_dashboard.xml @@ -7,6 +7,8 @@ + + @@ -45,6 +47,12 @@ + + + Hand Off + Quick View @@ -583,6 +591,8 @@ Loading manager data… + + diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/xml/shopfloor_landing.xml b/fusion_plating/fusion_plating_shopfloor/static/src/xml/shopfloor_landing.xml index ce47dc78..fb83a1bd 100644 --- a/fusion_plating/fusion_plating_shopfloor/static/src/xml/shopfloor_landing.xml +++ b/fusion_plating/fusion_plating_shopfloor/static/src/xml/shopfloor_landing.xml @@ -2,6 +2,8 @@ + + @@ -62,6 +64,13 @@ + + + Hand Off + + @@ -158,6 +167,8 @@ + +