From a940eb9861b9193d659cf0cc69e43f3b81fba3c0 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 18 Dec 2024 14:22:19 +0100 Subject: [PATCH] refactor: refs #8197 adapt Ticket to VnCardMain --- src/pages/Ticket/Card/TicketCard.vue | 20 +- src/pages/Ticket/TicketList.vue | 431 ++++++++++++++------------- src/router/modules/ticket.js | 379 +++++++++++------------ 3 files changed, 413 insertions(+), 417 deletions(-) diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue index 73b6f5543..6886a8e57 100644 --- a/src/pages/Ticket/Card/TicketCard.vue +++ b/src/pages/Ticket/Card/TicketCard.vue @@ -1,23 +1,7 @@ diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index eb03a4927..823f74fc5 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -8,13 +8,11 @@ import { useQuasar } from 'quasar'; import { toDate, toCurrency, dashIfEmpty } from 'src/filters/index'; import useNotify from 'src/composables/useNotify'; import TicketSummary from './Card/TicketSummary.vue'; -import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import VnTable from 'src/components/VnTable/VnTable.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnRow from 'src/components/ui/VnRow.vue'; -import RightMenu from 'src/components/common/RightMenu.vue'; import TicketFilter from './TicketFilter.vue'; import VnInput from 'src/components/common/VnInput.vue'; import FetchData from 'src/components/FetchData.vue'; @@ -23,6 +21,7 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; import { toTimeFormat } from 'src/filters/date'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; import TicketProblems from 'src/components/TicketProblems.vue'; +import VnSection from 'src/components/common/VnSection.vue'; const route = useRoute(); const router = useRouter(); @@ -66,6 +65,7 @@ const dialogData = ref(); const companiesOptions = ref([]); const accountingOptions = ref([]); const amountToReturn = ref(); +const dataKey = 'TicketList'; const columns = computed(() => [ { @@ -452,223 +452,228 @@ function setReference(data) { @on-fetch="(data) => (accountingOptions = data)" auto-load /> - - - + - + import('src/pages/Ticket/Card/TicketCard.vue'), + redirect: { name: 'TicketSummary' }, meta: { - title: 'tickets', - icon: 'vn:ticket', - moduleName: 'Ticket', - keyBinding: 't', - }, - component: RouterView, - redirect: { name: 'TicketMain' }, - menus: { - main: ['TicketList', 'TicketAdvance', 'TicketWeekly', 'TicketFuture'], - card: [ + menu: [ 'TicketBasicData', 'TicketSale', 'TicketLog', @@ -32,21 +25,200 @@ export default { 'TicketSms', ], }, + children: [ + { + path: 'summary', + name: 'TicketSummary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => import('src/pages/Ticket/Card/TicketSummary.vue'), + }, + { + path: 'basic-data', + name: 'TicketBasicData', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => + import('src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue'), + }, + { + path: 'sale', + name: 'TicketSale', + meta: { + title: 'sale', + icon: 'vn:lines', + }, + component: () => import('src/pages/Ticket/Card/TicketSale.vue'), + }, + { + path: 'request', + name: 'TicketPurchaseRequest', + meta: { + title: 'purchaseRequest', + icon: 'vn:buyrequest', + }, + component: () => import('src/pages/Ticket/Card/TicketPurchaseRequest.vue'), + }, + { + path: 'tracking', + name: 'TicketTracking', + meta: { + title: 'tracking', + icon: 'vn:eye', + }, + component: () => import('src/pages/Ticket/Card/TicketTracking.vue'), + }, + { + path: 'log', + name: 'TicketLog', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Ticket/Card/TicketLog.vue'), + }, + { + path: 'observation', + name: 'TicketNotes', + meta: { + title: 'notes', + icon: 'vn:notes', + }, + component: () => import('src/pages/Ticket/Card/TicketNotes.vue'), + }, + { + path: 'picture', + name: 'TicketPicture', + meta: { + title: 'pictures', + icon: 'vn:photo', + }, + component: () => import('src/pages/Ticket/Card/TicketPicture.vue'), + }, + { + path: 'volume', + name: 'TicketVolume', + meta: { + title: 'volume', + icon: 'vn:volume', + }, + component: () => import('src/pages/Ticket/Card/TicketVolume.vue'), + }, + { + path: 'expedition', + name: 'TicketExpedition', + meta: { + title: 'expedition', + icon: 'vn:package', + }, + component: () => import('src/pages/Ticket/Card/TicketExpedition.vue'), + }, + { + path: 'service', + name: 'TicketService', + meta: { + title: 'services', + icon: 'vn:services', + }, + component: () => import('src/pages/Ticket/Card/TicketService.vue'), + }, + { + path: 'package', + name: 'TicketPackage', + meta: { + title: 'packages', + icon: 'vn:bucket', + }, + component: () => import('src/pages/Ticket/Card/TicketPackage.vue'), + }, + { + path: 'components', + name: 'TicketComponents', + meta: { + title: 'components', + icon: 'vn:components', + }, + component: () => import('src/pages/Ticket/Card/TicketComponents.vue'), + }, + + { + path: 'sale-tracking', + name: 'TicketSaleTracking', + meta: { + title: 'saleTracking', + icon: 'assignment', + }, + component: () => import('src/pages/Ticket/Card/TicketSaleTracking.vue'), + }, + { + path: 'dms', + name: 'TicketDms', + meta: { + title: 'dms', + icon: 'cloud_upload', + }, + component: () => import('src/pages/Ticket/Card/TicketDms.vue'), + }, + { + path: 'boxing', + name: 'TicketBoxing', + meta: { + title: 'boxing', + icon: 'science', + }, + component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'), + }, + { + path: 'sms', + name: 'TicketSms', + meta: { + title: 'sms', + icon: 'sms', + }, + component: () => import('src/pages/Ticket/Card/TicketSms.vue'), + }, + ], +}; + +export default { + name: 'Ticket', + path: '/ticket', + meta: { + title: 'tickets', + icon: 'vn:ticket', + moduleName: 'Ticket', + keyBinding: 't', + menu: ['TicketList', 'TicketAdvance', 'TicketWeekly', 'TicketFuture'], + }, + component: RouterView, + redirect: { name: 'TicketMain' }, children: [ { name: 'TicketMain', path: '', - component: () => import('src/components/common/VnSectionMain.vue'), - redirect: { name: 'TicketList' }, + component: () => import('src/components/common/VnModule.vue'), + redirect: { name: 'TicketIndexMain' }, children: [ { - path: 'list', - name: 'TicketList', - meta: { - title: 'list', - icon: 'view_list', - }, + path: '', + name: 'TicketIndexMain', + redirect: { name: 'TicketList' }, component: () => import('src/pages/Ticket/TicketList.vue'), + children: [ + { + name: 'TicketList', + path: 'list', + meta: { + title: 'list', + icon: 'view_list', + }, + }, + ticketCard, + ], }, { path: 'create', @@ -86,170 +258,5 @@ export default { }, ], }, - { - name: 'TicketCard', - path: ':id', - component: () => import('src/pages/Ticket/Card/TicketCard.vue'), - redirect: { name: 'TicketSummary' }, - children: [ - { - path: 'summary', - name: 'TicketSummary', - meta: { - title: 'summary', - icon: 'launch', - }, - component: () => import('src/pages/Ticket/Card/TicketSummary.vue'), - }, - { - path: 'basic-data', - name: 'TicketBasicData', - meta: { - title: 'basicData', - icon: 'vn:settings', - }, - component: () => - import('src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue'), - }, - { - path: 'sale', - name: 'TicketSale', - meta: { - title: 'sale', - icon: 'vn:lines', - }, - component: () => import('src/pages/Ticket/Card/TicketSale.vue'), - }, - { - path: 'request', - name: 'TicketPurchaseRequest', - meta: { - title: 'purchaseRequest', - icon: 'vn:buyrequest', - }, - component: () => - import('src/pages/Ticket/Card/TicketPurchaseRequest.vue'), - }, - { - path: 'tracking', - name: 'TicketTracking', - meta: { - title: 'tracking', - icon: 'vn:eye', - }, - component: () => import('src/pages/Ticket/Card/TicketTracking.vue'), - }, - { - path: 'log', - name: 'TicketLog', - meta: { - title: 'log', - icon: 'history', - }, - component: () => import('src/pages/Ticket/Card/TicketLog.vue'), - }, - { - path: 'observation', - name: 'TicketNotes', - meta: { - title: 'notes', - icon: 'vn:notes', - }, - component: () => import('src/pages/Ticket/Card/TicketNotes.vue'), - }, - { - path: 'picture', - name: 'TicketPicture', - meta: { - title: 'pictures', - icon: 'vn:photo', - }, - component: () => import('src/pages/Ticket/Card/TicketPicture.vue'), - }, - { - path: 'volume', - name: 'TicketVolume', - meta: { - title: 'volume', - icon: 'vn:volume', - }, - component: () => import('src/pages/Ticket/Card/TicketVolume.vue'), - }, - { - path: 'expedition', - name: 'TicketExpedition', - meta: { - title: 'expedition', - icon: 'vn:package', - }, - component: () => import('src/pages/Ticket/Card/TicketExpedition.vue'), - }, - { - path: 'service', - name: 'TicketService', - meta: { - title: 'services', - icon: 'vn:services', - }, - component: () => import('src/pages/Ticket/Card/TicketService.vue'), - }, - { - path: 'package', - name: 'TicketPackage', - meta: { - title: 'packages', - icon: 'vn:bucket', - }, - component: () => import('src/pages/Ticket/Card/TicketPackage.vue'), - }, - { - path: 'components', - name: 'TicketComponents', - meta: { - title: 'components', - icon: 'vn:components', - }, - component: () => import('src/pages/Ticket/Card/TicketComponents.vue'), - }, - - { - path: 'sale-tracking', - name: 'TicketSaleTracking', - meta: { - title: 'saleTracking', - icon: 'assignment', - }, - component: () => - import('src/pages/Ticket/Card/TicketSaleTracking.vue'), - }, - { - path: 'dms', - name: 'TicketDms', - meta: { - title: 'dms', - icon: 'cloud_upload', - }, - component: () => import('src/pages/Ticket/Card/TicketDms.vue'), - }, - { - path: 'boxing', - name: 'TicketBoxing', - meta: { - title: 'boxing', - icon: 'science', - }, - component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'), - }, - { - path: 'sms', - name: 'TicketSms', - meta: { - title: 'sms', - icon: 'sms', - }, - component: () => import('src/pages/Ticket/Card/TicketSms.vue'), - }, - ], - }, ], };