diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 07992f616..95b4b5866 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -314,7 +314,19 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) { show-if-above > - + + + + + {{ formatFn(tag.value) }} + + + diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue index 014b84b31..3ede24274 100644 --- a/src/components/common/VnLocation.vue +++ b/src/components/common/VnLocation.vue @@ -70,6 +70,9 @@ const handleModelValue = (data) => { [], }, optionLabel: { - type: [String], + type: [String, Function], default: 'name', }, optionValue: { diff --git a/src/components/common/__tests__/VnInput.spec.js b/src/components/common/__tests__/VnInput.spec.js new file mode 100644 index 000000000..13f9ed804 --- /dev/null +++ b/src/components/common/__tests__/VnInput.spec.js @@ -0,0 +1,91 @@ +import { createWrapper } from 'app/test/vitest/helper'; +import { vi, describe, expect, it } from 'vitest'; +import VnInput from 'src/components/common/VnInput.vue'; + + +describe('VnInput', () => { + let vm; + let wrapper; + let input; + + function generateWrapper(value, isOutlined, emptyToNull, insertable) { + wrapper = createWrapper(VnInput, { + props: { + modelValue: value, + isOutlined, emptyToNull, insertable, + maxlength: 101 + }, + attrs: { + label: 'test', + required: true, + maxlength: 101, + maxLength: 10, + 'max-length':20 + }, + }); + wrapper = wrapper.wrapper; + vm = wrapper.vm; + input = wrapper.find('[data-cy="test_input"]'); + }; + + describe('value', () => { + it('should emit update:modelValue when value changes', async () => { + generateWrapper('12345', false, false, true) + await input.setValue('123'); + expect(wrapper.emitted('update:modelValue')).toBeTruthy(); + expect(wrapper.emitted('update:modelValue')[0]).toEqual(['123']); + }); + + it('should emit update:modelValue with null when input is empty', async () => { + generateWrapper('12345', false, true, true); + await input.setValue(''); + expect(wrapper.emitted('update:modelValue')[0]).toEqual([null]); + }); + }); + + describe('styleAttrs', () => { + it('should return empty styleAttrs when isOutlined is false', async () => { + generateWrapper('123', false, false, false); + expect(vm.styleAttrs).toEqual({}); + }); + + it('should set styleAttrs when isOutlined is true', async () => { + generateWrapper('123', true, false, false); + expect(vm.styleAttrs.outlined).toBe(true); + }); + }); + + describe('handleKeydown', () => { + it('should do nothing when "Backspace" key is pressed', async () => { + generateWrapper('12345', false, false, true); + await input.trigger('keydown', { key: 'Backspace' }); + expect(wrapper.emitted('update:modelValue')).toBeUndefined(); + const spyhandler = vi.spyOn(vm, 'handleInsertMode'); + expect(spyhandler).not.toHaveBeenCalled(); + + }); + + /* + TODO: #8399 REDMINE + */ + it.skip('handleKeydown respects insertable behavior', async () => { + const expectedValue = '12345'; + generateWrapper('1234', false, false, true); + vm.focus() + await input.trigger('keydown', { key: '5' }); + await vm.$nextTick(); + expect(wrapper.emitted('update:modelValue')).toBeTruthy(); + expect(wrapper.emitted('update:modelValue')[0]).toEqual([expectedValue ]); + expect(vm.value).toBe( expectedValue); + }); + }); + + describe('focus', () => { + it('should call focus method when input is focused', async () => { + generateWrapper('123', false, false, true); + const focusSpy = vi.spyOn(input.element, 'focus'); + vm.focus(); + expect(focusSpy).toHaveBeenCalled(); + }); + }); +}); diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 139917d05..f46884834 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -1,25 +1,12 @@ + - diff --git a/src/pages/Customer/Card/CustomerConsumptionFilter.vue b/src/pages/Customer/Card/CustomerConsumptionFilter.vue deleted file mode 100644 index 289b2eb08..000000000 --- a/src/pages/Customer/Card/CustomerConsumptionFilter.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - {{ t(`params.${tag.label}`) }}: - {{ formatFn(tag.value) }} - - - - - - - - - - - - - - - - - - - - {{ scope.opt?.name }} - {{ - scope.opt?.category?.name - }} - - - - - - - - - - - - - - - - - - {{ - t(`params.${scope.opt?.code}`) - }} - {{ - toDate(scope.opt.dated) - }} - - - - - - - - - - - - - - - - - - - - -en: - params: - item: Item id - buyer: Buyer - type: Type - category: Category - itemId: Item id - buyerId: Buyer - typeId: Type - categoryId: Category - from: From - to: To - campaignId: Campaña - valentinesDay: Valentine's Day - mothersDay: Mother's Day - allSaints: All Saints' Day -es: - params: - item: Id artículo - buyer: Comprador - type: Tipo - category: Categoría - itemId: Id Artículo - buyerId: Comprador - typeId: Tipo - categoryId: Reino - from: Desde - to: Hasta - campaignId: Campaña - valentinesDay: Día de San Valentín - mothersDay: Día de la Madre - allSaints: Día de Todos los Santos - diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index bd2947cfc..f6458fd64 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -5,18 +5,19 @@ import { useRouter } from 'vue-router'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { toDate } from 'src/filters'; -import RightMenu from 'src/components/common/RightMenu.vue'; import CustomerSummary from './Card/CustomerSummary.vue'; import CustomerFilter from './CustomerFilter.vue'; import VnTable from 'components/VnTable/VnTable.vue'; import VnLocation from 'src/components/common/VnLocation.vue'; -import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; +import VnSection from 'src/components/common/VnSection.vue'; const { t } = useI18n(); const router = useRouter(); const tableRef = ref(); +const dataKey = 'CustomerList'; + const columns = computed(() => [ { align: 'left', @@ -398,82 +399,91 @@ function handleLocation(data, location) { - - - + + - - - - - - + + + + + + + + {{ scope.opt?.name }} + {{ scope.opt?.nickname }}, + {{ scope.opt?.code }} + + + + + handleLocation(data, location)" /> + + + + + {{ + t('customer.basicData.youCanSaveMultipleEmails') + }} + + + - - - - {{ scope.opt?.name }} - {{ scope.opt?.nickname }}, - {{ scope.opt?.code }} - - - - - handleLocation(data, location)" - /> - - - - - {{ - t('customer.basicData.youCanSaveMultipleEmails') - }} - - - + - + es: diff --git a/src/pages/Customer/locale/en.yml b/src/pages/Customer/locale/en.yml index 1918838b7..118f04a31 100644 --- a/src/pages/Customer/locale/en.yml +++ b/src/pages/Customer/locale/en.yml @@ -94,6 +94,8 @@ customer: hasToInvoiceByAddress: Invoice by address isToBeMailed: Mailing hasSepaVnl: VNL B2B received + search: Search customer + searchInfo: You can search by customer ID params: id: Id isWorker: Is Worker diff --git a/src/pages/Customer/locale/es.yml b/src/pages/Customer/locale/es.yml index d5db3df1b..7c33ffee8 100644 --- a/src/pages/Customer/locale/es.yml +++ b/src/pages/Customer/locale/es.yml @@ -1,5 +1,3 @@ -Search customer: Buscar cliente -You can search by customer id or name: Puedes buscar por id o nombre del cliente customer: card: debt: Riesgo @@ -96,6 +94,8 @@ customer: hasToInvoiceByAddress: Factura por consigna isToBeMailed: Env. emails hasSepaVnl: Recibido B2B VNL + search: Buscar cliente + searchInfo: Puedes buscar por id o nombre del cliente params: id: ID isWorker: Es trabajador diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index 0b784b993..8e02e59a4 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -196,7 +196,7 @@ async function autofillBic(worker) { prefix="workerSearch" :array-data-props="{ url: 'Workers/filter', - order: ['id DESC'], + order: 'id DESC', }" > diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index 9e7f6fe70..67b00b161 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -1,24 +1,12 @@ import { RouterView } from 'vue-router'; -export default { - path: '/customer', - name: 'Customer', - meta: { - title: 'customers', - icon: 'vn:client', - moduleName: 'Customer', - keyBinding: 'c', - }, - component: RouterView, - redirect: { name: 'CustomerMain' }, - menus: { - main: [ - 'CustomerList', - 'CustomerPayments', - 'CustomerNotifications', - 'CustomerDefaulter', - ], - card: [ +const customerCard = { + name: 'CustomerCard', + path: ':id', + component: () => import('src/pages/Customer/Card/CustomerCard.vue'), + redirect: { name: 'CustomerSummary' }, + meta: { + menu: [ 'CustomerBasicData', 'CustomerFiscalData', 'CustomerBillingData', @@ -37,19 +25,449 @@ export default { }, children: [ { - path: '', - name: 'CustomerMain', - component: () => import('src/components/common/VnModule.vue'), - redirect: { name: 'CustomerList' }, + name: 'CustomerSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => import('src/pages/Customer/Card/CustomerSummary.vue'), + }, + { + path: 'basic-data', + name: 'CustomerBasicData', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => + import('src/pages/Customer/Card/CustomerBasicData.vue'), + }, + { + path: 'fiscal-data', + name: 'CustomerFiscalData', + meta: { + title: 'fiscalData', + icon: 'vn:dfiscales', + }, + component: () => + import('src/pages/Customer/Card/CustomerFiscalData.vue'), + }, + { + path: 'billing-data', + name: 'CustomerBillingData', + meta: { + title: 'billingData', + icon: 'vn:payment', + }, + component: () => + import('src/pages/Customer/Card/CustomerBillingData.vue'), + }, + { + path: 'address', + name: 'AddressCard', + redirect: { name: 'CustomerAddress' }, children: [ { - path: 'list', - name: 'CustomerList', + path: '', + name: 'CustomerAddress', meta: { - title: 'list', - icon: 'view_list', + icon: 'vn:delivery', + title: 'consignees', }, + component: () => + import('src/pages/Customer/Card/CustomerAddress.vue'), + }, + { + path: 'create', + name: 'CustomerAddressCreate', + meta: { + title: 'address-create', + }, + component: () => + import( + 'src/pages/Customer/components/CustomerAddressCreate.vue' + ), + }, + { + path: ':addressId', + name: 'CustomerAddressEditCard', + redirect: { name: 'CustomerAddressEdit' }, + children: [ + { + path: 'edit', + name: 'CustomerAddressEdit', + meta: { + title: 'addressEdit', + }, + component: () => + import( + 'src/pages/Customer/components/CustomerAddressEdit.vue' + ), + }, + ], + }, + ], + }, + { + path: 'notes', + name: 'CustomerNotes', + meta: { + title: 'notes', + icon: 'vn:notes', + }, + component: () => import('src/pages/Customer/Card/CustomerNotes.vue'), + }, + { + path: 'credits', + name: 'CustomerCredits', + meta: { + title: 'credits', + icon: 'vn:credit', + }, + component: () => + import('src/pages/Customer/Card/CustomerCredits.vue'), + }, + { + path: 'greuges', + name: 'CustomerGreuges', + meta: { + title: 'greuges', + icon: 'vn:greuge', + }, + component: () => + import('src/pages/Customer/Card/CustomerGreuges.vue'), + }, + { + path: 'balance', + name: 'CustomerBalance', + meta: { + title: 'balance', + icon: 'balance', + }, + component: () => + import('src/pages/Customer/Card/CustomerBalance.vue'), + }, + { + path: 'recoveries', + name: 'CustomerRecoveries', + meta: { + title: 'recoveries', + icon: 'vn:recovery', + }, + component: () => + import('src/pages/Customer/Card/CustomerRecoveries.vue'), + }, + { + path: 'web-access', + name: 'CustomerWebAccess', + meta: { + title: 'webAccess', + icon: 'vn:web', + }, + component: () => + import('src/pages/Customer/Card/CustomerWebAccess.vue'), + }, + { + path: 'log', + name: 'CustomerLog', + meta: { + title: 'log', + icon: 'vn:History', + }, + component: () => import('src/pages/Customer/Card/CustomerLog.vue'), + }, + { + path: 'sms', + name: 'CustomerSms', + meta: { + title: 'sms', + icon: 'sms', + }, + component: () => import('src/pages/Customer/Card/CustomerSms.vue'), + }, + { + path: 'credit-management', + name: 'CustomerCreditManagement', + meta: { + title: 'creditManagement', + icon: 'paid', + menuChildren: [ + { + name: 'CustomerCreditContracts', + title: 'creditContracts', + icon: 'vn:solunion', + }, + { + name: 'CustomerCreditOpinion', + title: 'creditOpinion', + icon: 'vn:linesprepaired', + }, + ], + }, + children: [ + { + path: 'credit-contracts', + name: 'CreditContractsCard', + redirect: { name: 'CustomerCreditContracts' }, + children: [ + { + path: '', + name: 'CustomerCreditContracts', + meta: { + title: 'creditContracts', + }, + component: () => + import( + 'src/pages/Customer/Card/CustomerCreditContracts.vue' + ), + }, + { + path: 'create', + name: 'CustomerCreditContractsCreate', + component: () => + import( + 'src/pages/Customer/components/CustomerCreditContractsCreate.vue' + ), + }, + { + path: 'insurance/:creditId', + name: 'CustomerCreditContractsInsurance', + component: () => + import( + 'src/pages/Customer/components/CustomerCreditContractsInsurance.vue' + ), + }, + ], + }, + { + path: 'credit-opinion', + name: 'CustomerCreditOpinion', + meta: { + title: 'creditOpinion', + }, + component: () => + import( + 'src/pages/Customer/Card/CustomerCreditOpinion.vue' + ), + }, + ], + }, + { + path: 'others', + name: 'CustomerOthers', + meta: { + title: 'others', + icon: 'pending', + menuChildren: [ + { + name: 'CustomerSamples', + title: 'samples', + icon: 'vn:notes', + }, + { + name: 'CustomerConsumption', + title: 'consumption', + icon: 'show_chart', + }, + { + name: 'CustomerMandates', + title: 'mandates', + icon: 'vn:mandatory', + }, + { + name: 'CustomerContacts', + title: 'contacts', + icon: 'contact_phone', + }, + { + name: 'CustomerWebPayment', + title: 'webPayment', + icon: 'vn:onlinepayment', + }, + { + name: 'CustomerFileManagement', + title: 'fileManagement', + icon: 'Upload', + }, + { + name: 'CustomerUnpaid', + title: 'unpaid', + icon: 'vn:defaulter', + }, + ], + }, + children: [ + { + path: 'samples', + name: 'CustomerSamples', + meta: { + title: 'samples', + }, + component: () => + import('src/pages/Customer/Card/CustomerSamples.vue'), + }, + { + path: 'samples', + name: 'CustomerSamplesCard', + redirect: { name: 'CustomerSamples' }, + children: [ + { + path: '', + name: 'CustomerSamples', + meta: { + title: 'samples', + }, + component: () => + import( + 'src/pages/Customer/Card/CustomerSamples.vue' + ), + }, + { + path: 'create', + name: 'CustomerSamplesCreate', + component: () => + import( + 'src/pages/Customer/components/CustomerSamplesCreate.vue' + ), + }, + ], + }, + { + path: 'consumption', + name: 'CustomerConsumption', + meta: { + title: 'consumption', + }, + component: () => + import('src/pages/Customer/Card/CustomerConsumption.vue'), + }, + { + path: 'mandates', + name: 'CustomerMandates', + meta: { + title: 'mandates', + }, + component: () => + import('src/pages/Customer/Card/CustomerMandates.vue'), + }, + { + path: 'contacts', + name: 'CustomerContacts', + meta: { + title: 'contacts', + }, + component: () => + import('src/pages/Customer/Card/CustomerContacts.vue'), + }, + { + path: 'web-payment', + name: 'CustomerWebPayment', + meta: { + title: 'webPayment', + }, + component: () => + import('src/pages/Customer/Card/CustomerWebPayment.vue'), + }, + { + path: 'file-management', + name: 'CustomerFileManagement', + meta: { + title: 'fileManagement', + }, + component: () => + import( + 'src/pages/Customer/Card/CustomerFileManagement.vue' + ), + }, + { + path: 'file-management', + name: 'CustomerFileManagementCard', + redirect: { name: 'CustomerFileManagement' }, + children: [ + { + path: '', + name: 'CustomerFileManagement', + meta: { + title: 'fileManagement', + }, + component: () => + import( + 'src/pages/Customer/Card/CustomerFileManagement.vue' + ), + }, + { + path: 'create', + name: 'CustomerFileManagementCreate', + component: () => + import( + 'src/pages/Customer/components/CustomerFileManagementCreate.vue' + ), + }, + { + path: ':dmsId/edit', + name: 'CustomerFileManagementEdit', + component: () => + import( + 'src/pages/Customer/components/CustomerFileManagementEdit.vue' + ), + }, + ], + }, + { + path: 'unpaid', + name: 'CustomerUnpaid', + meta: { + title: 'unpaid', + }, + component: () => + import('src/pages/Customer/Card/CustomerUnpaid.vue'), + }, + ], + }, + ], +}; + +export default { + name: 'Customer', + path: '/customer', + meta: { + title: 'customers', + icon: 'vn:client', + moduleName: 'Customer', + keyBinding: 'c', + menu: [ + 'CustomerList', + 'CustomerPayments', + 'CustomerNotifications', + 'CustomerDefaulter', + ], + }, + component: RouterView, + redirect: { name: 'CustomerMain' }, + children: [ + { + name: 'CustomerMain', + path: '', + component: () => import('src/components/common/VnModule.vue'), + redirect: { name: 'CustomerIndexMain' }, + children: [ + { + path: '', + name: 'CustomerIndexMain', + redirect: { name: 'CustomerList' }, component: () => import('src/pages/Customer/CustomerList.vue'), + children: [ + { + name: 'CustomerList', + path: 'list', + meta: { + title: 'list', + icon: 'view_list', + }, + }, + customerCard, + ], }, { path: 'create', @@ -94,415 +512,5 @@ export default { }, ], }, - { - name: 'CustomerCard', - path: ':id', - component: () => import('src/pages/Customer/Card/CustomerCard.vue'), - redirect: { name: 'CustomerSummary' }, - children: [ - { - name: 'CustomerSummary', - path: 'summary', - meta: { - title: 'summary', - icon: 'launch', - }, - component: () => - import('src/pages/Customer/Card/CustomerSummary.vue'), - }, - { - path: 'basic-data', - name: 'CustomerBasicData', - meta: { - title: 'basicData', - icon: 'vn:settings', - }, - component: () => - import('src/pages/Customer/Card/CustomerBasicData.vue'), - }, - { - path: 'fiscal-data', - name: 'CustomerFiscalData', - meta: { - title: 'fiscalData', - icon: 'vn:dfiscales', - }, - component: () => - import('src/pages/Customer/Card/CustomerFiscalData.vue'), - }, - { - path: 'billing-data', - name: 'CustomerBillingData', - meta: { - title: 'billingData', - icon: 'vn:payment', - }, - component: () => - import('src/pages/Customer/Card/CustomerBillingData.vue'), - }, - { - path: 'address', - name: 'AddressCard', - redirect: { name: 'CustomerAddress' }, - children: [ - { - path: '', - name: 'CustomerAddress', - meta: { - icon: 'vn:delivery', - title: 'consignees', - }, - component: () => - import('src/pages/Customer/Card/CustomerAddress.vue'), - }, - { - path: 'create', - name: 'CustomerAddressCreate', - meta: { - title: 'address-create', - }, - component: () => - import( - 'src/pages/Customer/components/CustomerAddressCreate.vue' - ), - }, - { - path: ':addressId', - name: 'CustomerAddressEditCard', - redirect: { name: 'CustomerAddressEdit' }, - children: [ - { - path: 'edit', - name: 'CustomerAddressEdit', - meta: { - title: 'addressEdit', - }, - component: () => - import( - 'src/pages/Customer/components/CustomerAddressEdit.vue' - ), - }, - ], - }, - ], - }, - { - path: 'notes', - name: 'CustomerNotes', - meta: { - title: 'notes', - icon: 'vn:notes', - }, - component: () => import('src/pages/Customer/Card/CustomerNotes.vue'), - }, - { - path: 'credits', - name: 'CustomerCredits', - meta: { - title: 'credits', - icon: 'vn:credit', - }, - component: () => - import('src/pages/Customer/Card/CustomerCredits.vue'), - }, - { - path: 'greuges', - name: 'CustomerGreuges', - meta: { - title: 'greuges', - icon: 'vn:greuge', - }, - component: () => - import('src/pages/Customer/Card/CustomerGreuges.vue'), - }, - { - path: 'balance', - name: 'CustomerBalance', - meta: { - title: 'balance', - icon: 'balance', - }, - component: () => - import('src/pages/Customer/Card/CustomerBalance.vue'), - }, - { - path: 'recoveries', - name: 'CustomerRecoveries', - meta: { - title: 'recoveries', - icon: 'vn:recovery', - }, - component: () => - import('src/pages/Customer/Card/CustomerRecoveries.vue'), - }, - { - path: 'web-access', - name: 'CustomerWebAccess', - meta: { - title: 'webAccess', - icon: 'vn:web', - }, - component: () => - import('src/pages/Customer/Card/CustomerWebAccess.vue'), - }, - { - path: 'log', - name: 'CustomerLog', - meta: { - title: 'log', - icon: 'vn:History', - }, - component: () => import('src/pages/Customer/Card/CustomerLog.vue'), - }, - { - path: 'sms', - name: 'CustomerSms', - meta: { - title: 'sms', - icon: 'sms', - }, - component: () => import('src/pages/Customer/Card/CustomerSms.vue'), - }, - { - path: 'credit-management', - name: 'CustomerCreditManagement', - meta: { - title: 'creditManagement', - icon: 'paid', - menuChildren: [ - { - name: 'CustomerCreditContracts', - title: 'creditContracts', - icon: 'vn:solunion', - }, - { - name: 'CustomerCreditOpinion', - title: 'creditOpinion', - icon: 'vn:linesprepaired', - }, - ], - }, - children: [ - { - path: 'credit-contracts', - name: 'CreditContractsCard', - redirect: { name: 'CustomerCreditContracts' }, - children: [ - { - path: '', - name: 'CustomerCreditContracts', - meta: { - title: 'creditContracts', - }, - component: () => - import( - 'src/pages/Customer/Card/CustomerCreditContracts.vue' - ), - }, - { - path: 'create', - name: 'CustomerCreditContractsCreate', - component: () => - import( - 'src/pages/Customer/components/CustomerCreditContractsCreate.vue' - ), - }, - { - path: 'insurance/:creditId', - name: 'CustomerCreditContractsInsurance', - component: () => - import( - 'src/pages/Customer/components/CustomerCreditContractsInsurance.vue' - ), - }, - ], - }, - { - path: 'credit-opinion', - name: 'CustomerCreditOpinion', - meta: { - title: 'creditOpinion', - }, - component: () => - import( - 'src/pages/Customer/Card/CustomerCreditOpinion.vue' - ), - }, - ], - }, - { - path: 'others', - name: 'CustomerOthers', - meta: { - title: 'others', - icon: 'pending', - menuChildren: [ - { - name: 'CustomerSamples', - title: 'samples', - icon: 'vn:notes', - }, - { - name: 'CustomerConsumption', - title: 'consumption', - icon: 'show_chart', - }, - { - name: 'CustomerMandates', - title: 'mandates', - icon: 'vn:mandatory', - }, - { - name: 'CustomerContacts', - title: 'contacts', - icon: 'contact_phone', - }, - { - name: 'CustomerWebPayment', - title: 'webPayment', - icon: 'vn:onlinepayment', - }, - { - name: 'CustomerFileManagement', - title: 'fileManagement', - icon: 'Upload', - }, - { - name: 'CustomerUnpaid', - title: 'unpaid', - icon: 'vn:defaulter', - }, - ], - }, - children: [ - { - path: 'samples', - name: 'CustomerSamples', - meta: { - title: 'samples', - }, - component: () => - import('src/pages/Customer/Card/CustomerSamples.vue'), - }, - { - path: 'samples', - name: 'CustomerSamplesCard', - redirect: { name: 'CustomerSamples' }, - children: [ - { - path: '', - name: 'CustomerSamples', - meta: { - title: 'samples', - }, - component: () => - import( - 'src/pages/Customer/Card/CustomerSamples.vue' - ), - }, - { - path: 'create', - name: 'CustomerSamplesCreate', - component: () => - import( - 'src/pages/Customer/components/CustomerSamplesCreate.vue' - ), - }, - ], - }, - { - path: 'consumption', - name: 'CustomerConsumption', - meta: { - title: 'consumption', - }, - component: () => - import('src/pages/Customer/Card/CustomerConsumption.vue'), - }, - { - path: 'mandates', - name: 'CustomerMandates', - meta: { - title: 'mandates', - }, - component: () => - import('src/pages/Customer/Card/CustomerMandates.vue'), - }, - { - path: 'contacts', - name: 'CustomerContacts', - meta: { - title: 'contacts', - }, - component: () => - import('src/pages/Customer/Card/CustomerContacts.vue'), - }, - { - path: 'web-payment', - name: 'CustomerWebPayment', - meta: { - title: 'webPayment', - }, - component: () => - import('src/pages/Customer/Card/CustomerWebPayment.vue'), - }, - { - path: 'file-management', - name: 'CustomerFileManagement', - meta: { - title: 'fileManagement', - }, - component: () => - import( - 'src/pages/Customer/Card/CustomerFileManagement.vue' - ), - }, - { - path: 'file-management', - name: 'CustomerFileManagementCard', - redirect: { name: 'CustomerFileManagement' }, - children: [ - { - path: '', - name: 'CustomerFileManagement', - meta: { - title: 'fileManagement', - }, - component: () => - import( - 'src/pages/Customer/Card/CustomerFileManagement.vue' - ), - }, - { - path: 'create', - name: 'CustomerFileManagementCreate', - component: () => - import( - 'src/pages/Customer/components/CustomerFileManagementCreate.vue' - ), - }, - { - path: ':dmsId/edit', - name: 'CustomerFileManagementEdit', - component: () => - import( - 'src/pages/Customer/components/CustomerFileManagementEdit.vue' - ), - }, - ], - }, - { - path: 'unpaid', - name: 'CustomerUnpaid', - meta: { - title: 'unpaid', - }, - component: () => - import('src/pages/Customer/Card/CustomerUnpaid.vue'), - }, - ], - }, - ], - }, ], };