forked from verdnatura/salix-front
refactor: refs #8316 used VnSection and VnCardBeta
This commit is contained in:
parent
93047ab179
commit
37a87fa8e1
|
@ -1,25 +1,12 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import CustomerDescriptor from './CustomerDescriptor.vue';
|
||||
import CustomerFilter from '../CustomerFilter.vue';
|
||||
const route = useRoute();
|
||||
|
||||
const routeName = computed(() => route.name);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnCard
|
||||
<VnCardBeta
|
||||
data-key="Client"
|
||||
base-url="Clients"
|
||||
:descriptor="CustomerDescriptor"
|
||||
:filter-panel="routeName != 'CustomerConsumption' && CustomerFilter"
|
||||
search-data-key="CustomerList"
|
||||
:searchbar-props="{
|
||||
url: 'Clients/filter',
|
||||
label: 'Search customer',
|
||||
info: 'You can search by customer id or name',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -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',
|
||||
|
@ -390,21 +391,23 @@ function handleLocation(data, location) {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<VnSearchbar
|
||||
:info="t('You can search by customer id or name')"
|
||||
:label="t('Search customer')"
|
||||
data-key="CustomerList"
|
||||
/>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<VnSection
|
||||
:data-key="dataKey"
|
||||
:columns="columns"
|
||||
prefix="customer"
|
||||
:array-data-props="{
|
||||
url: 'Clients/filter',
|
||||
exprBuilder,
|
||||
}"
|
||||
>
|
||||
<template #rightMenu>
|
||||
<CustomerFilter data-key="CustomerList" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<template #body>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="CustomerList"
|
||||
:data-key="dataKey"
|
||||
url="Clients/filter"
|
||||
order="id DESC"
|
||||
:create="{
|
||||
urlCreate: 'Clients/createWithUser',
|
||||
title: t('globals.pageTitles.customerCreate'),
|
||||
|
@ -467,6 +470,8 @@ function handleLocation(data, location) {
|
|||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
<i18n>
|
||||
es:
|
||||
Web user: Usuario web
|
||||
|
|
|
@ -94,3 +94,5 @@ customer:
|
|||
hasToInvoiceByAddress: Invoice by address
|
||||
isToBeMailed: Mailing
|
||||
hasSepaVnl: VNL B2B received
|
||||
search: Search customer
|
||||
searchInfo: You can search by customer ID
|
||||
|
|
|
@ -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,3 +94,5 @@ customer:
|
|||
hasToInvoiceByAddress: Factura por consigna
|
||||
isToBeMailed: Env. emails
|
||||
hasSepaVnl: Recibido B2B VNL
|
||||
search: Buscar cliente
|
||||
searchInfo: Puedes buscar por id o nombre del cliente
|
||||
|
|
|
@ -1,24 +1,12 @@
|
|||
import { RouterView } from 'vue-router';
|
||||
|
||||
export default {
|
||||
path: '/customer',
|
||||
name: 'Customer',
|
||||
const customerCard = {
|
||||
name: 'CustomerCard',
|
||||
path: ':id',
|
||||
component: () => import('src/pages/Customer/Card/CustomerCard.vue'),
|
||||
redirect: { name: 'CustomerSummary' },
|
||||
meta: {
|
||||
title: 'customers',
|
||||
icon: 'vn:client',
|
||||
moduleName: 'Customer',
|
||||
keyBinding: 'c',
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'CustomerMain' },
|
||||
menus: {
|
||||
main: [
|
||||
'CustomerList',
|
||||
'CustomerPayments',
|
||||
'CustomerNotifications',
|
||||
'CustomerDefaulter',
|
||||
],
|
||||
card: [
|
||||
menu: [
|
||||
'CustomerBasicData',
|
||||
'CustomerFiscalData',
|
||||
'CustomerBillingData',
|
||||
|
@ -35,70 +23,6 @@ export default {
|
|||
'CustomerOthers',
|
||||
],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'CustomerMain',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
redirect: { name: 'CustomerList' },
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: 'CustomerList',
|
||||
meta: {
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () => import('src/pages/Customer/CustomerList.vue'),
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
name: 'CustomerCreate',
|
||||
meta: {
|
||||
title: 'customerCreate',
|
||||
icon: 'add',
|
||||
},
|
||||
component: () => import('src/pages/Customer/CustomerCreate.vue'),
|
||||
},
|
||||
{
|
||||
path: 'payments',
|
||||
name: 'CustomerPayments',
|
||||
meta: {
|
||||
title: 'webPayments',
|
||||
icon: 'vn:onlinepayment',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Customer/Payments/CustomerPayments.vue'),
|
||||
},
|
||||
{
|
||||
path: 'notifications',
|
||||
name: 'CustomerNotifications',
|
||||
meta: {
|
||||
title: 'notifications',
|
||||
icon: 'campaign',
|
||||
},
|
||||
component: () =>
|
||||
import(
|
||||
'src/pages/Customer/Notifications/CustomerNotifications.vue'
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'defaulter',
|
||||
name: 'CustomerDefaulter',
|
||||
meta: {
|
||||
title: 'defaulter',
|
||||
icon: 'vn:defaulter',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Customer/Defaulter/CustomerDefaulter.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'CustomerCard',
|
||||
path: ':id',
|
||||
component: () => import('src/pages/Customer/Card/CustomerCard.vue'),
|
||||
redirect: { name: 'CustomerSummary' },
|
||||
children: [
|
||||
{
|
||||
name: 'CustomerSummary',
|
||||
|
@ -107,8 +31,7 @@ export default {
|
|||
title: 'summary',
|
||||
icon: 'launch',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Customer/Card/CustomerSummary.vue'),
|
||||
component: () => import('src/pages/Customer/Card/CustomerSummary.vue'),
|
||||
},
|
||||
{
|
||||
path: 'basic-data',
|
||||
|
@ -503,6 +426,91 @@ export default {
|
|||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
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',
|
||||
name: 'CustomerCreate',
|
||||
meta: {
|
||||
title: 'customerCreate',
|
||||
icon: 'add',
|
||||
},
|
||||
component: () => import('src/pages/Customer/CustomerCreate.vue'),
|
||||
},
|
||||
{
|
||||
path: 'payments',
|
||||
name: 'CustomerPayments',
|
||||
meta: {
|
||||
title: 'webPayments',
|
||||
icon: 'vn:onlinepayment',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Customer/Payments/CustomerPayments.vue'),
|
||||
},
|
||||
{
|
||||
path: 'notifications',
|
||||
name: 'CustomerNotifications',
|
||||
meta: {
|
||||
title: 'notifications',
|
||||
icon: 'campaign',
|
||||
},
|
||||
component: () =>
|
||||
import(
|
||||
'src/pages/Customer/Notifications/CustomerNotifications.vue'
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'defaulter',
|
||||
name: 'CustomerDefaulter',
|
||||
meta: {
|
||||
title: 'defaulter',
|
||||
icon: 'vn:defaulter',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Customer/Defaulter/CustomerDefaulter.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue