0
0
Fork 0

Solucion a comentarios 32

This commit is contained in:
carlosfonseca 2024-03-07 20:45:52 -05:00
parent dc3b91032c
commit c844d26ccb
1 changed files with 47 additions and 14 deletions

View File

@ -12,6 +12,7 @@ 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';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInput from 'src/components/common/VnInput.vue';
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue'; import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
const { t } = useI18n(); const { t } = useI18n();
@ -24,19 +25,20 @@ const rows = ref([]);
const tableColumnComponents = { const tableColumnComponents = {
client: { client: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue', noCaps: true }),
event: () => {}, event: () => {},
}, },
isWorker: { isWorker: {
component: QCheckbox, component: QCheckbox,
props: ({ row }) => ({ props: (prop) => ({
disable: true, disable: true,
'model-value': Boolean(row.selected), 'model-value': Boolean(prop.value),
}), }),
event: () => {},
}, },
salesPerson: { salesPerson: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue', noCaps: true }),
event: () => {}, event: () => {},
}, },
country: { country: {
@ -44,7 +46,7 @@ const tableColumnComponents = {
props: () => {}, props: () => {},
event: () => {}, event: () => {},
}, },
paymentMethod: { payMethod: {
component: 'span', component: 'span',
props: () => {}, props: () => {},
event: () => {}, event: () => {},
@ -56,7 +58,7 @@ const tableColumnComponents = {
}, },
author: { author: {
component: QBtn, component: QBtn,
props: () => ({ flat: true, color: 'blue' }), props: () => ({ flat: true, color: 'blue', noCaps: true }),
event: () => {}, event: () => {},
}, },
lastObservation: { lastObservation: {
@ -87,6 +89,7 @@ const columns = computed(() => [
field: 'clientName', field: 'clientName',
label: t('Client'), label: t('Client'),
name: 'client', name: 'client',
sortable: true,
}, },
{ {
align: 'left', align: 'left',
@ -99,54 +102,68 @@ const columns = computed(() => [
field: 'salesPersonName', field: 'salesPersonName',
label: t('Salesperson'), label: t('Salesperson'),
name: 'salesPerson', name: 'salesPerson',
sortable: true,
}, },
{ {
align: 'left', align: 'left',
field: 'country', field: 'country',
label: t('Country'), label: t('Country'),
name: 'country', name: 'country',
sortable: true,
}, },
{ {
align: 'left', align: 'left',
field: 'payMethod', field: 'payMethod',
label: t('P. Method'), label: t('P. Method'),
name: 'paymentMethod', name: 'payMethod',
sortable: true,
tooltip: t('Pay method'),
}, },
{ {
align: 'left', align: 'left',
field: ({ amount }) => toCurrency(amount), field: ({ amount }) => toCurrency(amount),
label: t('Balance D.'), label: t('Balance D.'),
name: 'balance', name: 'balance',
sortable: true,
tooltip: t('Balance due'),
}, },
{ {
align: 'left', align: 'left',
field: 'workerName', field: 'workerName',
label: t('Author'), label: t('Author'),
name: 'author', name: 'author',
sortable: true,
tooltip: t('Worker who made the last observation'),
}, },
{ {
align: 'left', align: 'left',
field: 'observation', field: 'observation',
label: t('Last observation'), label: t('Last observation'),
name: 'lastObservation', name: 'lastObservation',
sortable: true,
}, },
{ {
align: 'left', align: 'left',
field: ({ created }) => toDate(created), field: ({ created }) => toDate(created),
label: t('L. O. Date'), label: t('L. O. Date'),
name: 'date', name: 'date',
sortable: true,
tooltip: t('Last observation date'),
}, },
{ {
align: 'left', align: 'left',
field: ({ creditInsurance }) => toCurrency(creditInsurance), field: ({ creditInsurance }) => toCurrency(creditInsurance),
label: t('Credit I.'), label: t('Credit I.'),
name: 'credit', name: 'credit',
sortable: true,
tooltip: t('Credit insurance'),
}, },
{ {
align: 'left', align: 'left',
field: ({ defaulterSinced }) => toDate(defaulterSinced), field: ({ defaulterSinced }) => toDate(defaulterSinced),
label: t('From'), label: t('From'),
name: 'from', name: 'from',
sortable: true,
}, },
]); ]);
@ -170,15 +187,17 @@ const viewAddObservation = (rowsSelected) => {
const refreshData = () => { const refreshData = () => {
setRows(); setRows();
}; };
const onFetch = (data) => {
for (const element of data) {
element.isWorker = element.businessTypeFk === 'worker';
}
rows.value = data;
};
</script> </script>
<template> <template>
<FetchData <FetchData :filter="filter" @on-fetch="onFetch" auto-load url="Defaulters/filter" />
:filter="filter"
@on-fetch="(data) => (rows = data)"
auto-load
url="Defaulters/filter"
/>
<QDrawer side="right" :width="256" show-if-above> <QDrawer side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8"> <QScrollArea class="fit text-grey-8">
@ -220,7 +239,16 @@ const refreshData = () => {
v-bind="tableColumnComponents[props.col.name].props(props)" v-bind="tableColumnComponents[props.col.name].props(props)"
@click="tableColumnComponents[props.col.name].event(props)" @click="tableColumnComponents[props.col.name].event(props)"
> >
{{ props.value }} <template v-if="props.col.name !== 'isWorker'">
<div v-if="props.col.name === 'lastObservation'">
<VnInput
type="textarea"
v-model="props.value"
autogrow
/>
</div>
<div v-else>{{ props.value }}</div>
</template>
<WorkerDescriptorProxy <WorkerDescriptorProxy
:id="props.row.salesPersonFk" :id="props.row.salesPersonFk"
@ -256,10 +284,15 @@ es:
Salesperson: Comercial Salesperson: Comercial
Country: País Country: País
P. Method: F. Pago P. Method: F. Pago
Pay method: Forma de pago
Balance D.: Saldo V. Balance D.: Saldo V.
Balance due: Saldo vencido
Author: Autor Author: Autor
Worker who made the last observation: Trabajador que ha realizado la última observación
Last observation: Última observación Last observation: Última observación
L. O. Date: Fecha Ú. O. L. O. Date: Fecha Ú. O.
Last observation date: Fecha última observación
Credit I.: Crédito A. Credit I.: Crédito A.
Credit insurance: Crédito asegurado
From: Desde From: Desde
</i18n> </i18n>