Se definen los iconos de las tarjetas en summary y se organiza cabeceras de tablas

This commit is contained in:
carlosfonseca 2024-01-03 14:53:01 -05:00
parent 54d77c9851
commit ead8bb4992
5 changed files with 81 additions and 26 deletions

View File

@ -130,7 +130,7 @@ export default {
log: 'Log', log: 'Log',
sms: 'Sms', sms: 'Sms',
creditManagement: 'Credit management', creditManagement: 'Credit management',
others: 'Other', others: 'Others',
}, },
list: { list: {
phone: 'Phone', phone: 'Phone',

View File

@ -0,0 +1,54 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { toCurrency } from 'filters/index';
const $props = defineProps({
amount: {
type: Number,
required: true,
},
});
const { t } = useI18n();
</script>
<template>
<div class="card_balance">
<h6 class="title_balance">{{ t('Total') }}</h6>
<div style="display: flex">
<p class="key_balance">{{ t('Balance due') }}:&ensp;</p>
<b class="value_balance">
{{ toCurrency($props.amount) }}
</b>
</div>
</div>
</template>
<style lang="scss">
.card_balance {
border: 1px solid black;
margin: 7px;
padding: 5px 7px;
}
.title_balance {
color: white;
margin-top: 0;
margin-bottom: 0;
text-align: center;
}
.key_balance {
color: grey;
margin-bottom: 0;
}
.value_balance {
color: white;
margin-bottom: 0;
}
</style>
<i18n>
es:
Total: Total
Balance due: Saldo vencido
</i18n>

View File

@ -4,11 +4,12 @@ import { useI18n } from 'vue-i18n';
import { QBtn, QCheckbox } from 'quasar'; import { QBtn, QCheckbox } from 'quasar';
import { toCurrency, toDate } from 'filters/index';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { toCurrency, toDate } from 'filters/index';
import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue'; import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue';
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
@ -16,6 +17,7 @@ const { t } = useI18n();
const stateStore = useStateStore(); const stateStore = useStateStore();
const arrayData = ref(null); const arrayData = ref(null);
const balanceDueTotal = ref(0);
onBeforeMount(async () => { onBeforeMount(async () => {
arrayData.value = useArrayData('CustomerDefaulter', { arrayData.value = useArrayData('CustomerDefaulter', {
@ -23,6 +25,13 @@ onBeforeMount(async () => {
limit: 0, limit: 0,
}); });
await arrayData.value.fetch({ append: false }); await arrayData.value.fetch({ append: false });
balanceDueTotal.value = arrayData.value.store.data.reduce(
(accumulator, currentValue) => {
return accumulator + (currentValue['amount'] || 0);
},
0
);
console.log(balanceDueTotal.value);
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
}); });
@ -188,7 +197,9 @@ const selectAuthorId = (id) => {
</QDrawer> </QDrawer>
<QToolbar class="bg-vn-dark"> <QToolbar class="bg-vn-dark">
<div id="st-data"></div> <div id="st-data">
<CustomerBalanceDueTotal :amount="balanceDueTotal" />
</div>
<QSpace /> <QSpace />
<div id="st-actions"></div> <div id="st-actions"></div>
</QToolbar> </QToolbar>
@ -204,11 +215,6 @@ const selectAuthorId = (id) => {
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"
> >
<template #top>
<div v-if="rows" class="full-width flex justify-end">
{{ `${rows.length} ${t('route.cmr.list.results')}` }}
</div>
</template>
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
<QTr :props="props" class="cursor-pointer"> <QTr :props="props" class="cursor-pointer">

View File

@ -121,11 +121,6 @@ const selectCustomerId = (id) => {
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"
> >
<template #top>
<div v-if="rows" class="full-width flex justify-end">
{{ `${rows.length} ${t('route.cmr.list.results')}` }}
</div>
</template>
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
<QTr :props="props" class="cursor-pointer"> <QTr :props="props" class="cursor-pointer">

View File

@ -135,7 +135,7 @@ export default {
name: 'CustomerFiscalData', name: 'CustomerFiscalData',
meta: { meta: {
title: 'fiscalData', title: 'fiscalData',
icon: 'vn:settings', icon: 'vn:dfiscales',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerFiscalData.vue'), import('src/pages/Customer/Card/CustomerFiscalData.vue'),
@ -145,7 +145,7 @@ export default {
name: 'CustomerBillingData', name: 'CustomerBillingData',
meta: { meta: {
title: 'billingData', title: 'billingData',
icon: 'vn:settings', icon: 'vn:payment',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerBillingData.vue'), import('src/pages/Customer/Card/CustomerBillingData.vue'),
@ -155,7 +155,7 @@ export default {
name: 'CustomerConsignees', name: 'CustomerConsignees',
meta: { meta: {
title: 'consignees', title: 'consignees',
icon: 'vn:settings', icon: 'vn:delivery',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerConsignees.vue'), import('src/pages/Customer/Card/CustomerConsignees.vue'),
@ -165,7 +165,7 @@ export default {
name: 'CustomerNotes', name: 'CustomerNotes',
meta: { meta: {
title: 'notes', title: 'notes',
icon: 'vn:settings', icon: 'vn:notes',
}, },
component: () => import('src/pages/Customer/Card/CustomerNotes.vue'), component: () => import('src/pages/Customer/Card/CustomerNotes.vue'),
}, },
@ -174,7 +174,7 @@ export default {
name: 'CustomerCredits', name: 'CustomerCredits',
meta: { meta: {
title: 'credits', title: 'credits',
icon: 'vn:settings', icon: 'vn:credit',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerCredits.vue'), import('src/pages/Customer/Card/CustomerCredits.vue'),
@ -184,7 +184,7 @@ export default {
name: 'CustomerGreuges', name: 'CustomerGreuges',
meta: { meta: {
title: 'greuges', title: 'greuges',
icon: 'vn:settings', icon: 'vn:greuge',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerGreuges.vue'), import('src/pages/Customer/Card/CustomerGreuges.vue'),
@ -194,7 +194,7 @@ export default {
name: 'CustomerBalance', name: 'CustomerBalance',
meta: { meta: {
title: 'balance', title: 'balance',
icon: 'vn:settings', icon: 'vn:invoice',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerBalance.vue'), import('src/pages/Customer/Card/CustomerBalance.vue'),
@ -204,7 +204,7 @@ export default {
name: 'CustomerRecoveries', name: 'CustomerRecoveries',
meta: { meta: {
title: 'recoveries', title: 'recoveries',
icon: 'vn:settings', icon: 'vn:recovery',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerRecoveries.vue'), import('src/pages/Customer/Card/CustomerRecoveries.vue'),
@ -214,7 +214,7 @@ export default {
name: 'CustomerWebAccess', name: 'CustomerWebAccess',
meta: { meta: {
title: 'webAccess', title: 'webAccess',
icon: 'vn:settings', icon: 'vn:web',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerWebAccess.vue'), import('src/pages/Customer/Card/CustomerWebAccess.vue'),
@ -224,7 +224,7 @@ export default {
name: 'CustomerLog', name: 'CustomerLog',
meta: { meta: {
title: 'log', title: 'log',
icon: 'vn:settings', icon: 'vn:History',
}, },
component: () => import('src/pages/Customer/Card/CustomerLog.vue'), component: () => import('src/pages/Customer/Card/CustomerLog.vue'),
}, },
@ -233,7 +233,7 @@ export default {
name: 'CustomerSms', name: 'CustomerSms',
meta: { meta: {
title: 'sms', title: 'sms',
icon: 'vn:settings', icon: 'sms',
}, },
component: () => import('src/pages/Customer/Card/CustomerSms.vue'), component: () => import('src/pages/Customer/Card/CustomerSms.vue'),
}, },
@ -242,7 +242,7 @@ export default {
name: 'CustomerCreditManagement', name: 'CustomerCreditManagement',
meta: { meta: {
title: 'creditManagement', title: 'creditManagement',
icon: 'vn:settings', icon: 'paid',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerCreditManagement.vue'), import('src/pages/Customer/Card/CustomerCreditManagement.vue'),
@ -252,7 +252,7 @@ export default {
name: 'CustomerOthers', name: 'CustomerOthers',
meta: { meta: {
title: 'others', title: 'others',
icon: 'vn:settings', icon: 'pending',
}, },
component: () => import('src/pages/Customer/Card/CustomerOthers.vue'), component: () => import('src/pages/Customer/Card/CustomerOthers.vue'),
}, },