0
0
Fork 0
This commit is contained in:
William Buezas 2024-01-04 18:13:46 -03:00
commit 073a8f5c70
6 changed files with 448 additions and 466 deletions

View File

@ -14,8 +14,8 @@ const { t } = useI18n();
</script> </script>
<template> <template>
<div class="card_balance"> <div class="card_balance q-px-md q-py-sm q-my-sm">
<h6 class="title_balance">{{ t('Total') }}</h6> <h6 class="title_balance text-center">{{ t('Total') }}</h6>
<div class="row"> <div class="row">
<p class="key_balance">{{ t('Balance due') }}:&ensp;</p> <p class="key_balance">{{ t('Balance due') }}:&ensp;</p>
<b class="value_balance"> <b class="value_balance">
@ -28,21 +28,18 @@ const { t } = useI18n();
<style lang="scss"> <style lang="scss">
.card_balance { .card_balance {
border: 1px solid black; border: 1px solid black;
margin: 7px;
padding: 5px 7px;
} }
.title_balance { .title_balance {
color: white; color: var(--vn-text);
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
text-align: center;
} }
.key_balance { .key_balance {
color: grey; color: var(--vn-label);
margin-bottom: 0; margin-bottom: 0;
} }
.value_balance { .value_balance {
color: white; color: var(--vn-text);
margin-bottom: 0; margin-bottom: 0;
} }
</style> </style>

View File

@ -38,27 +38,27 @@ onBeforeMount(async () => {
const rows = computed(() => arrayData.value.store.data); const rows = computed(() => arrayData.value.store.data);
const selected = ref([]); const selected = ref([]);
const worderId = ref(0); const workerId = ref(0);
const customerId = ref(0); const customerId = ref(0);
const tableColumnComponents = { const tableColumnComponents = {
client: { client: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: (prop) => selectClientId(prop.row.clientFk), event: ({ row }) => selectCustomerId(row.clientFk),
}, },
isWorker: { isWorker: {
component: QCheckbox, component: QCheckbox,
props: (prop) => ({ props: ({ value }) => ({
disable: true, disable: true,
'model-value': Boolean(prop.value), 'model-value': Boolean(value),
}), }),
event: () => {}, event: () => {},
}, },
salesperson: { salesperson: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: (prop) => selectSalespersonId(prop.row.salesPersonFk), event: ({ row }) => selectWorkerId(row.salesPersonFk),
}, },
country: { country: {
component: 'span', component: 'span',
@ -78,7 +78,7 @@ const tableColumnComponents = {
author: { author: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue' }),
event: (prop) => selectAuthorId(prop.row.workerFk), event: ({ row }) => selectWorkerId(row.workerFk),
}, },
lastObservation: { lastObservation: {
component: 'span', component: 'span',
@ -102,8 +102,7 @@ const tableColumnComponents = {
}, },
}; };
const columns = computed(() => { const columns = computed(() => [
return [
{ {
align: 'left', align: 'left',
field: 'clientName', field: 'clientName',
@ -136,7 +135,7 @@ const columns = computed(() => {
}, },
{ {
align: 'left', align: 'left',
field: (row) => toCurrency(row.amount), field: ({ amount }) => toCurrency(amount),
label: t('Balance D.'), label: t('Balance D.'),
name: 'balance', name: 'balance',
}, },
@ -154,38 +153,32 @@ const columns = computed(() => {
}, },
{ {
align: 'left', align: 'left',
field: (row) => toDate(row.created), field: ({ created }) => toDate(created),
label: t('L. O. Date'), label: t('L. O. Date'),
name: 'date', name: 'date',
}, },
{ {
align: 'left', align: 'left',
field: (row) => toCurrency(row.creditInsurance), field: ({ creditInsurance }) => toCurrency(creditInsurance),
label: t('Credit I.'), label: t('Credit I.'),
name: 'credit', name: 'credit',
}, },
{ {
align: 'left', align: 'left',
field: (row) => toDate(row.defaulterSinced), field: ({ defaulterSinced }) => toDate(defaulterSinced),
label: t('From'), label: t('From'),
name: 'from', name: 'from',
}, },
]; ]);
});
const selectClientId = (id) => { const selectCustomerId = (id) => {
worderId.value = 0; workerId.value = 0;
customerId.value = id; customerId.value = id;
}; };
const selectSalespersonId = (id) => { const selectWorkerId = (id) => {
customerId.value = 0; customerId.value = 0;
worderId.value = id; workerId.value = id;
};
const selectAuthorId = (id) => {
customerId.value = 0;
worderId.value = id;
}; };
</script> </script>
@ -226,7 +219,7 @@ const selectAuthorId = (id) => {
> >
{{ props.value }} {{ props.value }}
<WorkerDescriptorProxy v-if="worderId" :id="worderId" /> <WorkerDescriptorProxy v-if="workerId" :id="workerId" />
<CustomerDescriptorProxy v-else :id="customerId" /> <CustomerDescriptorProxy v-else :id="customerId" />
</component> </component>
</QTr> </QTr>

View File

@ -262,8 +262,7 @@ const tableColumnComponents = {
}, },
}; };
const columns = computed(() => { const columns = computed(() => [
return [
{ {
align: 'left', align: 'left',
field: '', field: '',
@ -469,8 +468,7 @@ const columns = computed(() => {
label: '', label: '',
name: 'actions', name: 'actions',
}, },
]; ]);
});
const stopEventPropagation = (event, col) => { const stopEventPropagation = (event, col) => {
if (!['id', 'salesPersonFk'].includes(col.name)) return; if (!['id', 'salesPersonFk'].includes(col.name)) return;

View File

@ -57,8 +57,7 @@ const tableColumnComponents = {
}, },
}; };
const columns = computed(() => { const columns = computed(() => [
return [
{ {
align: 'left', align: 'left',
field: 'id', field: 'id',
@ -89,8 +88,7 @@ const columns = computed(() => {
label: t('Email'), label: t('Email'),
name: 'email', name: 'email',
}, },
]; ]);
});
const selectCustomerId = (id) => { const selectCustomerId = (id) => {
selectedCustomerId.value = id; selectedCustomerId.value = id;

View File

@ -49,8 +49,7 @@ const tableColumnComponents = {
}, },
}; };
const columns = computed(() => { const columns = computed(() => [
return [
{ label: 'Id', field: 'clientId', name: 'clientId', align: 'left' }, { label: 'Id', field: 'clientId', name: 'clientId', align: 'left' },
{ {
label: t('invoiceOut.globalInvoices.table.client'), label: t('invoiceOut.globalInvoices.table.client'),
@ -71,8 +70,7 @@ const columns = computed(() => {
align: 'left', align: 'left',
}, },
{ label: 'Error', field: 'message', name: 'message', align: 'left' }, { label: 'Error', field: 'message', name: 'message', align: 'left' },
]; ]);
});
const rows = computed(() => { const rows = computed(() => {
if (!errors && !errors.length > 0) return []; if (!errors && !errors.length > 0) return [];

View File

@ -103,8 +103,7 @@ const tableColumnComponents = {
}, },
}; };
const columns = computed(() => { const columns = computed(() => [
return [
{ {
label: 'id', label: 'id',
field: 'id', field: 'id',
@ -206,8 +205,7 @@ const columns = computed(() => {
format: (value) => toDate(value.substring(0, 10)), format: (value) => toDate(value.substring(0, 10)),
showValue: true, showValue: true,
}, },
]; ]);
});
async function getData() { async function getData() {
await arrayData.fetch({ append: false }); await arrayData.fetch({ append: false });