diff --git a/frontend/src/components/orders/OrderLineForm.vue b/frontend/src/components/orders/OrderLineForm.vue new file mode 100644 index 0000000..84bd742 --- /dev/null +++ b/frontend/src/components/orders/OrderLineForm.vue @@ -0,0 +1,132 @@ + + + Adauga linie + + + + + + Manopera + + + + Material + + + + + + + + + + + + Ore + + + + Pret/ora (RON) + + + + + + + + Cantitate + + + + Pret unitar (RON) + + + + UM + + + + + + + + Total: {{ computedTotal.toFixed(2) }} RON + + + Adauga + + + + + + + diff --git a/frontend/src/components/vehicles/VehiclePicker.vue b/frontend/src/components/vehicles/VehiclePicker.vue new file mode 100644 index 0000000..b4542b5 --- /dev/null +++ b/frontend/src/components/vehicles/VehiclePicker.vue @@ -0,0 +1,108 @@ + + + {{ label }} + + + + {{ selected.nr_inmatriculare }} - {{ selected.client_nume }} + ({{ selected.marca_denounire }} {{ selected.model_denumire }}) + Sterge + + + + + {{ v.nr_inmatriculare }} + {{ v.client_nume }} + + ({{ v.marca_denumire }} {{ v.model_denumire }}) + + + + + + Niciun vehicul gasit + + + + + diff --git a/frontend/src/composables/useSync.js b/frontend/src/composables/useSync.js new file mode 100644 index 0000000..f2897e9 --- /dev/null +++ b/frontend/src/composables/useSync.js @@ -0,0 +1,29 @@ +import { onMounted, onUnmounted } from 'vue' +import { syncEngine } from '../db/sync.js' +import { useAuthStore } from '../stores/auth.js' + +export function useSync() { + const auth = useAuthStore() + let interval = null + + function onFocus() { + if (auth.isAuthenticated && syncEngine.online) { + syncEngine.incrementalSync() + } + } + + onMounted(() => { + window.addEventListener('focus', onFocus) + // Periodic sync every 60s + interval = setInterval(() => { + if (auth.isAuthenticated && syncEngine.online) { + syncEngine.incrementalSync() + } + }, 60000) + }) + + onUnmounted(() => { + window.removeEventListener('focus', onFocus) + if (interval) clearInterval(interval) + }) +} diff --git a/frontend/src/layouts/AppLayout.vue b/frontend/src/layouts/AppLayout.vue index ac03d1e..985c67d 100644 --- a/frontend/src/layouts/AppLayout.vue +++ b/frontend/src/layouts/AppLayout.vue @@ -1,10 +1,23 @@ - -