diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index c13e8b250..1ee37a36a 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -10,6 +10,7 @@ import { useValidator } from 'src/composables/useValidator'; import useNotify from 'src/composables/useNotify.js'; import SkeletonForm from 'components/ui/SkeletonForm.vue'; import VnConfirm from './ui/VnConfirm.vue'; +import { tMobile } from 'src/composables/tMobile'; const quasar = useQuasar(); const state = useState(); @@ -43,6 +44,10 @@ const $props = defineProps({ type: Boolean, default: true, }, + defaultButtons: { + type: Object, + default: () => {}, + }, autoLoad: { type: Boolean, default: false, @@ -128,7 +133,19 @@ const hasChanges = ref(!$props.observeFormChanges); const originalData = ref({ ...$props.formInitialData }); const formData = computed(() => state.get($props.model)); const formUrl = computed(() => $props.url); - +const defaultButtons = computed(() => ({ + save: { + color: 'primary', + icon: 'restart_alt', + label: 'globals.save', + }, + reset: { + color: 'primary', + icon: 'save', + label: 'globals.reset', + }, + ...$props.defaultButtons, +})); const startFormWatcher = () => { watch( () => formData.value, @@ -140,10 +157,6 @@ const startFormWatcher = () => { ); }; -function tMobile(...args) { - if (!quasar.platform.is.mobile) return t(...args); -} - async function fetch() { const { data } = await axios.get($props.url, { params: { filter: JSON.stringify($props.filter) }, @@ -242,21 +255,21 @@ watch(formUrl, async () => { diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 94d552be3..0be04003e 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -31,6 +31,7 @@ export default { close: 'Close', cancel: 'Cancel', confirm: 'Confirm', + assign: 'Assign', back: 'Back', yes: 'Yes', no: 'No', @@ -833,6 +834,7 @@ export default { notifications: 'Notifications', workerCreate: 'New worker', department: 'Department', + pda: 'PDA', }, list: { name: 'Name', @@ -874,6 +876,13 @@ export default { subscribed: 'Subscribed to the notification', unsubscribed: 'Unsubscribed from the notification', }, + pda: { + newPDA: 'New PDA', + currentPDA: 'Current PDA', + model: 'Model', + serialNumber: 'Serial number', + removePDA: 'Deallocate PDA', + }, create: { name: 'Name', lastName: 'Last name', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index bcd780f5b..610c6017f 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -31,6 +31,7 @@ export default { close: 'Cerrar', cancel: 'Cancelar', confirm: 'Confirmar', + assign: 'Asignar', back: 'Volver', yes: 'Si', no: 'No', @@ -833,6 +834,7 @@ export default { notifications: 'Notificaciones', workerCreate: 'Nuevo trabajador', department: 'Departamentos', + pda: 'PDA', }, list: { name: 'Nombre', @@ -874,6 +876,13 @@ export default { subscribed: 'Se ha suscrito a la notificación', unsubscribed: 'Se ha dado de baja de la notificación', }, + pda: { + newPDA: 'Nueva PDA', + currentPDA: 'PDA Actual', + model: 'Modelo', + serialNumber: 'Número de serie', + removePDA: 'Desasignar PDA', + }, create: { name: 'Nombre', lastName: 'Apellido', diff --git a/src/pages/Worker/Card/WorkerPda.vue b/src/pages/Worker/Card/WorkerPda.vue new file mode 100644 index 000000000..ef8c3fe8e --- /dev/null +++ b/src/pages/Worker/Card/WorkerPda.vue @@ -0,0 +1,140 @@ + + + + + +es: + PDA deallocated: PDA desasignada + diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index 171e346c6..1c722afe8 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'WorkerMain' }, menus: { main: ['WorkerList', 'WorkerDepartment'], - card: ['WorkerNotificationsManager'], + card: ['WorkerNotificationsManager', 'WorkerPda'], departmentCard: ['BasicData'], }, children: [ @@ -76,6 +76,15 @@ export default { component: () => import('src/pages/Worker/Card/WorkerNotificationsManager.vue'), }, + { + name: 'WorkerPda', + path: 'pda', + meta: { + title: 'pda', + icon: 'phone_android', + }, + component: () => import('src/pages/Worker/Card/WorkerPda.vue'), + }, ], }, ],