diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index b18433d4e..aea4923a9 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -156,9 +156,12 @@ const startFormWatcher = () => { async function fetch() { try { - const { data } = await axios.get($props.url, { + let { data } = await axios.get($props.url, { params: { filter: JSON.stringify($props.filter) }, }); + + if (Array.isArray(data)) data = data[0]; + state.set($props.model, data); originalData.value = data && JSON.parse(JSON.stringify(data)); diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index d8fb231f0..743165a3d 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -826,6 +826,7 @@ worker: log: Log calendar: Calendar timeControl: Time control + locker: Locker list: name: Name email: Email diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 67e075935..556e328f1 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -824,6 +824,7 @@ worker: log: Historial calendar: Calendario timeControl: Control de horario + locker: Taquilla list: name: Nombre email: Email diff --git a/src/pages/Worker/Card/WorkerLocker.vue b/src/pages/Worker/Card/WorkerLocker.vue new file mode 100644 index 000000000..403aa7160 --- /dev/null +++ b/src/pages/Worker/Card/WorkerLocker.vue @@ -0,0 +1,46 @@ + + diff --git a/src/pages/Worker/locale/es.yml b/src/pages/Worker/locale/es.yml index 86dd9d0d9..a960dffe6 100644 --- a/src/pages/Worker/locale/es.yml +++ b/src/pages/Worker/locale/es.yml @@ -1,2 +1,3 @@ Search worker: Buscar trabajador You can search by worker id or name: Puedes buscar por id o nombre del trabajador +Locker: Taquilla diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index d4d3bc3e7..384978d13 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -22,6 +22,7 @@ export default { 'WorkerCalendar', 'WorkerDms', 'WorkerTimeControl', + 'WorkerLocker', ], departmentCard: ['BasicData'], }, @@ -167,6 +168,15 @@ export default { component: () => import('src/pages/Worker/Card/WorkerTimeControl.vue'), }, + { + name: 'WorkerLocker', + path: 'locker', + meta: { + title: 'locker', + icon: 'lock', + }, + component: () => import('src/pages/Worker/Card/WorkerLocker.vue'), + }, ], }, ],