diff --git a/src/boot/keyShortcut.js b/src/boot/keyShortcut.js new file mode 100644 index 000000000..5afb5b74a --- /dev/null +++ b/src/boot/keyShortcut.js @@ -0,0 +1,34 @@ +export default { + mounted: function (el, binding) { + const shortcut = binding.value ?? '+'; + + const { key, ctrl, alt, callback } = + typeof shortcut === 'string' + ? { + key: shortcut, + ctrl: true, + alt: true, + callback: () => + document + .querySelector(`button[shortcut="${shortcut}"]`) + ?.click(), + } + : binding.value; + + const handleKeydown = (event) => { + if (event.key === key && (!ctrl || event.ctrlKey) && (!alt || event.altKey)) { + callback(); + } + }; + + // Attach the event listener to the window + window.addEventListener('keydown', handleKeydown); + + el._handleKeydown = handleKeydown; + }, + unmounted: function (el) { + if (el._handleKeydown) { + window.removeEventListener('keydown', el._handleKeydown); + } + }, +}; diff --git a/src/boot/quasar.js b/src/boot/quasar.js index caf573ac7..e2035c880 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -1,8 +1,10 @@ import { boot } from 'quasar/wrappers'; import qFormMixin from './qformMixin'; import mainShortcutMixin from './mainShortcutMixin'; +import keyShortcut from './keyShortcut'; export default boot(({ app }) => { app.mixin(qFormMixin); app.mixin(mainShortcutMixin); + app.directive('shortcut', keyShortcut); }); diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index e80a293c6..00faaebc2 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -24,7 +24,13 @@ const pinnedModulesRef = ref(); - + {{ createForm.title }} diff --git a/src/components/common/RightMenu.vue b/src/components/common/RightMenu.vue index 732e5367d..3aa1891f9 100644 --- a/src/components/common/RightMenu.vue +++ b/src/components/common/RightMenu.vue @@ -37,7 +37,7 @@ const stateStore = useStateStore(); @click="stateStore.toggleRightDrawer()" round dense - icon="menu" + icon="dock_to_left" > {{ t('globals.collapseMenu') }} diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index a7fe651ad..5cee06582 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -1,6 +1,6 @@ - + {{ t('New payment') }} diff --git a/src/pages/Customer/Card/CustomerCreditContracts.vue b/src/pages/Customer/Card/CustomerCreditContracts.vue index 568adcf0b..12719b2cf 100644 --- a/src/pages/Customer/Card/CustomerCreditContracts.vue +++ b/src/pages/Customer/Card/CustomerCreditContracts.vue @@ -193,6 +193,7 @@ const updateData = () => { color="primary" fab icon="add" + shortcut="+" /> {{ t('New contract') }} diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue index 4c02ccf84..213e25b4a 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue @@ -5,6 +5,7 @@ import { useRouter } from 'vue-router'; import { useQuasar } from 'quasar'; import TransferInvoiceForm from 'src/components/TransferInvoiceForm.vue'; +import RefundInvoiceForm from 'src/components/RefundInvoiceForm.vue'; import SendEmailDialog from 'components/common/SendEmailDialog.vue'; import useNotify from 'src/composables/useNotify'; @@ -141,6 +142,15 @@ const showTransferInvoiceForm = async () => { }, }); }; + +const showRefundInvoiceForm = () => { + quasar.dialog({ + component: RefundInvoiceForm, + componentProps: { + invoiceOutData: $props.invoiceOutData, + }, + }); +}; - + {{ t('supplier.agencyTerms.addRow') }} diff --git a/src/pages/Ticket/Card/TicketPurchaseRequest.vue b/src/pages/Ticket/Card/TicketPurchaseRequest.vue index 281dc46a1..8d84e2b46 100644 --- a/src/pages/Ticket/Card/TicketPurchaseRequest.vue +++ b/src/pages/Ticket/Card/TicketPurchaseRequest.vue @@ -252,7 +252,13 @@ const openCreateModal = () => createTicketRequestDialogRef.value.show(); - + {{ t('purchaseRequest.newRequest') }} diff --git a/src/pages/Ticket/Card/TicketTracking.vue b/src/pages/Ticket/Card/TicketTracking.vue index 53f59adf9..f7cbb14e9 100644 --- a/src/pages/Ticket/Card/TicketTracking.vue +++ b/src/pages/Ticket/Card/TicketTracking.vue @@ -82,7 +82,7 @@ const openCreateModal = () => createTrackingDialogRef.value.show(); data-key="TicketTracking" :filter="paginateFilter" url="TicketTrackings" - auto-load + auto-load order="created DESC" :limit="0" > @@ -114,7 +114,13 @@ const openCreateModal = () => createTrackingDialogRef.value.show(); - + {{ t('tracking.addState') }} diff --git a/src/pages/Travel/Card/TravelThermographs.vue b/src/pages/Travel/Card/TravelThermographs.vue index 9f224154c..6d83581ee 100644 --- a/src/pages/Travel/Card/TravelThermographs.vue +++ b/src/pages/Travel/Card/TravelThermographs.vue @@ -196,6 +196,7 @@ const removeThermograph = async (id) => { icon="add" color="primary" @click="redirectToThermographForm('create')" + shortcut="+" /> {{ t('Add thermograph') }} diff --git a/src/pages/Wagon/Type/WagonTypeList.vue b/src/pages/Wagon/Type/WagonTypeList.vue index 3ecca1ea3..b7bbf8c5d 100644 --- a/src/pages/Wagon/Type/WagonTypeList.vue +++ b/src/pages/Wagon/Type/WagonTypeList.vue @@ -74,7 +74,7 @@ async function remove(row) { - + diff --git a/src/pages/Wagon/WagonList.vue b/src/pages/Wagon/WagonList.vue index a8b6728c3..c4824b861 100644 --- a/src/pages/Wagon/WagonList.vue +++ b/src/pages/Wagon/WagonList.vue @@ -94,7 +94,7 @@ async function remove(row) { - + diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue index 0abcdcafd..5f9fa0f8e 100644 --- a/src/pages/Worker/Card/WorkerCard.vue +++ b/src/pages/Worker/Card/WorkerCard.vue @@ -15,5 +15,6 @@ import WorkerFilter from '../WorkerFilter.vue'; label: 'Search worker', info: 'You can search by worker id or name', }" + :redirect-on-error="true" /> diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index 154db1258..778f78e2b 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -38,29 +38,6 @@ const entityId = computed(() => { const worker = ref(); const workerExcluded = ref(false); -const filter = { - include: [ - { - relation: 'user', - scope: { - fields: ['email', 'name', 'nickname'], - }, - }, - { - relation: 'department', - scope: { - include: [ - { - relation: 'department', - }, - ], - }, - }, - { - relation: 'sip', - }, - ], -}; const sip = ref(null); watch( @@ -74,14 +51,6 @@ watch( } ); -const data = ref(useCardDescription()); -const setData = (entity) => { - if (!entity) return; - data.value = useCardDescription(entity.user?.nickname, entity.id); -}; - -const openChangePasswordForm = () => changePasswordFormDialog.value.show(); - const getIsExcluded = async () => { try { const { data } = await axios.get( @@ -115,14 +84,12 @@ const refetch = async () => await cardDescriptorRef.value.getData(); ref="cardDescriptorRef" module="Worker" data-key="workerData" - :url="`Workers/${entityId}`" - :filter="filter" - :title="data.title" - :subtitle="data.subtitle" + url="Workers/descriptor" + :filter="{ where: { id: entityId } }" + title="user.nickname" @on-fetch=" (data) => { worker = data; - setData(data); getIsExcluded(); } " @@ -141,7 +108,7 @@ const refetch = async () => await cardDescriptorRef.value.getData(); v-if="!worker.user.emailVerified && user.id != worker.id" v-ripple clickable - @click="openChangePasswordForm()" + @click="$refs.changePasswordFormDialog.show()" > {{ t('Change password') }} diff --git a/src/pages/Worker/Card/WorkerMedical.vue b/src/pages/Worker/Card/WorkerMedical.vue new file mode 100644 index 000000000..6bca4ae85 --- /dev/null +++ b/src/pages/Worker/Card/WorkerMedical.vue @@ -0,0 +1,91 @@ + + diff --git a/src/pages/Worker/Card/WorkerPda.vue b/src/pages/Worker/Card/WorkerPda.vue index 4e0abc20c..a53aac270 100644 --- a/src/pages/Worker/Card/WorkerPda.vue +++ b/src/pages/Worker/Card/WorkerPda.vue @@ -116,7 +116,7 @@ function reloadData() { - + - - - + + + diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index f560fcfed..f68614575 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -629,6 +629,9 @@ onMounted(async () => { margin-bottom: 0px; } } +:deep(.q-td) { + min-width: 170px; +} diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue index 21991481a..32a7db4c4 100644 --- a/src/pages/Zone/Card/ZoneEvents.vue +++ b/src/pages/Zone/Card/ZoneEvents.vue @@ -44,15 +44,34 @@ onUnmounted(() => (stateStore.rightDrawer = false));