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

View File

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

View File

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

View File

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

View File

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

View File

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