0
0
Fork 0

Merge pull request '#7353 - Monitors requested changes' (!507) from hyervoni/salix-front-mindshore:7353-MonitorsFixes into dev

Reviewed-on: verdnatura/salix-front#507
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Javier Segarra 2024-07-16 07:28:55 +00:00
commit e921e36ce9
4 changed files with 342 additions and 443 deletions

View File

@ -14,10 +14,10 @@ const stateStore = useStateStore();
const expanded = ref(true); const expanded = ref(true);
onMounted(async () => { onMounted(async () => {
stateStore.rightDrawer = true; stateStore.leftDrawer = false;
}); });
onUnmounted(() => (stateStore.rightDrawer = false)); onUnmounted(() => (stateStore.leftDrawer = true));
</script> </script>
<template> <template>
@ -63,13 +63,15 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</template> </template>
</QExpansionItem> </QExpansionItem>
</QCard> </QCard>
<QCard class="full-width q-mb-lg"> <QCard class="full-width">
<QItem class="justify-between"> <QItem class="justify-between">
<QItemLabel class="slider-container"> <QItemLabel class="col slider-container">
<span class="text-body1" <span class="text-body1"
>{{ t('salesMonitor.ticketsMonitor') }} >{{ t('salesMonitor.ticketsMonitor') }}
</span> </span>
<QCardSection class="col"><SalesTicketsTable /> </QCardSection> <QCardSection class="col" style="padding-inline: 0"
><SalesTicketsTable />
</QCardSection>
</QItemLabel> </QItemLabel>
</QItem> </QItem>
</QCard> </QCard>

View File

@ -3,14 +3,11 @@ import { ref, computed, reactive, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnPaginate from 'components/ui/VnPaginate.vue';
import { toDateFormat } from 'src/filters/date.js'; import { toDateFormat } from 'src/filters/date.js';
import { dashIfEmpty } from 'src/filters'; import VnTable from 'src/components/VnTable/VnTable.vue';
const { t } = useI18n(); const { t } = useI18n();
@ -37,9 +34,11 @@ const filter = reactive({
}, },
}); });
const refetch = async () => await paginateRef.value.fetch();
watch(dateRange, (val) => { watch(dateRange, (val) => {
filter.where['v.stamp'].between = val; filter.where['v.stamp'].between = val;
paginateRef.value.fetch(); refetch();
}); });
function exprBuilder(param, value) { function exprBuilder(param, value) {
@ -53,25 +52,15 @@ function exprBuilder(param, value) {
const params = reactive({}); const params = reactive({});
const applyColumnFilter = async (col) => {
try {
const paramKey = col.columnFilter?.filterParamKey || col.field;
params[paramKey] = col.columnFilter.filterValue;
await paginateRef.value.addFilter(null, params);
} catch (err) {
console.error('Error applying column filter', err);
}
};
const columns = computed(() => [ const columns = computed(() => [
{ {
label: t('salesClientsTable.date'), label: t('salesClientsTable.date'),
name: 'date', name: 'dated',
field: 'dated', field: 'dated',
align: 'left', align: 'left',
columnFilter: null, columnFilter: null,
sortable: true, sortable: true,
format: (val) => toDateFormat(val), format: (row) => toDateFormat(row.dated),
}, },
{ {
label: t('salesClientsTable.hour'), label: t('salesClientsTable.hour'),
@ -86,19 +75,9 @@ const columns = computed(() => [
field: 'salesPerson', field: 'salesPerson',
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnField: {
component: VnSelect, component: null,
filterParamKey: 'salesPersonFk',
type: 'select',
filterValue: null,
attrs: {
options: workersActiveOptions.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
}, },
format: (val) => dashIfEmpty(val),
}, },
{ {
label: t('salesClientsTable.client'), label: t('salesClientsTable.client'),
@ -106,19 +85,9 @@ const columns = computed(() => [
name: 'client', name: 'client',
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnField: {
component: VnSelect, component: null,
filterParamKey: 'clientFk',
type: 'select',
filterValue: null,
attrs: {
options: clientsOptions.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
}, },
format: (val) => dashIfEmpty(val),
}, },
]); ]);
</script> </script>
@ -144,7 +113,7 @@ const columns = computed(() => [
@on-fetch="(data) => (clientsOptions = data)" @on-fetch="(data) => (clientsOptions = data)"
/> />
<QCard style="max-height: 380px; overflow-y: scroll"> <QCard style="max-height: 380px; overflow-y: scroll">
<VnPaginate <VnTable
ref="paginateRef" ref="paginateRef"
data-key="SalesMonitorClients" data-key="SalesMonitorClients"
url="SalesMonitors/clientsFilter" url="SalesMonitors/clientsFilter"
@ -155,63 +124,24 @@ const columns = computed(() => [
:filter="filter" :filter="filter"
:offset="50" :offset="50"
auto-load auto-load
:columns="columns"
:right-search="false"
default-mode="table"
dense
:without-header="true"
> >
<template #body="{ rows }"> <template #column-salesPerson="{ row }">
<QTable <QTd>
:rows="rows" <span class="link">{{ row.salesPerson }}</span>
:columns="columns" <WorkerDescriptorProxy :id="row.salesPersonFk" dense />
row-key="id" </QTd>
:pagination="{ rowsPerPage: 0 }"
class="full-width"
:no-data-label="t('globals.noResults')"
>
<template #top>
<VnInputDate
:label="t('salesClientsTable.from')"
dense
v-model="from"
class="q-mr-lg"
style="width: 150px"
/>
<VnInputDate
:label="t('salesClientsTable.to')"
dense
v-model="to"
style="width: 150px"
/>
</template>
<template #top-row="{ cols }">
<QTr>
<QTd
v-for="(col, index) in cols"
:key="index"
style="max-width: 100px"
>
<VnSelect
:is="col.columnFilter.component"
v-if="col.columnFilter"
v-model="col.columnFilter.filterValue"
v-bind="col.columnFilter.attrs"
@update:model-value="applyColumnFilter(col)"
dense
/>
</QTd>
</QTr>
</template>
<template #body-cell-salesPerson="{ row }">
<QTd>
<span class="link">{{ row.salesPerson }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
</QTd>
</template>
<template #body-cell-client="{ row }">
<QTd>
<span class="link">{{ row.clientName }}</span>
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
</template>
</QTable>
</template> </template>
</VnPaginate> <template #column-client="{ row }">
<QTd>
<span class="link">{{ row.clientName }}</span>
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
</template>
</VnTable>
</QCard> </QCard>
</template> </template>

View File

@ -5,7 +5,8 @@ import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnPaginate from 'components/ui/VnPaginate.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js'; import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
import { toCurrency } from 'src/filters'; import { toCurrency } from 'src/filters';
@ -50,19 +51,22 @@ const columns = computed(() => [
name: 'date', name: 'date',
field: 'dated', field: 'dated',
align: 'left', align: 'left',
columnFilter: null, sortable: true,
cardVisible: true,
}, },
{ {
label: t('salesOrdersTable.client'), label: t('salesOrdersTable.client'),
name: 'client', name: 'client',
align: 'left', align: 'left',
sortable: true, sortable: true,
cardVisible: true,
}, },
{ {
label: t('salesOrdersTable.salesPerson'), label: t('salesOrdersTable.salesPerson'),
name: 'salesPerson', name: 'salesPerson',
align: 'left', align: 'left',
sortable: true, sortable: true,
cardVisible: true,
}, },
]); ]);
@ -119,79 +123,78 @@ const redirectToOrderSummary = (orderId) => {
@on-fetch="(data) => (clientsOptions = data)" @on-fetch="(data) => (clientsOptions = data)"
/> />
<VnSubToolbar />
<QCard style="max-height: 380px; overflow-y: scroll"> <QCard style="max-height: 380px; overflow-y: scroll">
<VnPaginate <VnTable
ref="paginateRef" ref="paginateRef"
data-key="SalesMonitorOrders" data-key="SalesMonitorOrders"
url="SalesMonitors/ordersFilter" url="SalesMonitors/ordersFilter"
order="date_make DESC" order="date_make DESC"
:limit="6" :limit="6"
:right-search="false"
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
auto-load auto-load
:columns="columns"
:table="{
'row-key': 'id',
selection: 'multiple',
'hide-bottom': true,
}"
default-mode="table"
:without-header="false"
@row-click="(_, row) => redirectToOrderSummary(row.id)"
v-model:selected="selectedRows"
> >
<template #body="{ rows }"> <template #top-left>
<QTable <QBtn
:rows="rows" v-if="selectedRows.length > 0"
:columns="columns" icon="delete"
row-key="id" size="md"
selection="multiple" color="primary"
v-model:selected="selectedRows" @click="
:pagination="{ rowsPerPage: 0 }" openConfirmationModal(
:no-data-label="t('globals.noResults')" t('salesOrdersTable.deleteConfirmTitle'),
@row-click="(_, row) => redirectToOrderSummary(row.id)" t('salesOrdersTable.deleteConfirmMessage'),
removeOrders
)
"
> >
<template #top> <QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
<QBtn </QBtn>
v-if="selectedRows.length > 0"
icon="delete"
size="md"
color="primary"
@click="
openConfirmationModal(
t('salesOrdersTable.deleteConfirmTitle'),
t('salesOrdersTable.deleteConfirmMessage'),
removeOrders
)
"
>
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
</QBtn>
</template>
<template #body-cell-date="{ row }">
<QTd>
<QBadge
:color="getBadgeColor(row.date_send)"
text-color="black"
class="q-ma-none q-mb-md"
dense
style="font-size: 14px"
>
{{ toDateFormat(row.date_send) }}
</QBadge>
<div>{{ toDateTimeFormat(row.date_make) }}</div>
</QTd>
</template>
<template #body-cell-client="{ row }">
<QTd>
<div class="q-mb-md">
<span class="link">{{ row.clientName }}</span>
<CustomerDescriptorProxy :id="row.clientFk" />
</div>
<span> {{ row.agencyName }}</span>
</QTd>
</template>
<template #body-cell-salesPerson="{ row }">
<QTd>
<div class="q-mb-md">
<span class="link">{{ row.salesPerson }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
</div>
<span>{{ toCurrency(row.import) }}</span>
</QTd>
</template>
</QTable>
</template> </template>
</VnPaginate> <template #column-date="{ row }">
<QTd>
<QBadge
:color="getBadgeColor(row.date_send)"
text-color="black"
class="q-pa-sm q-mb-md"
style="font-size: 14px"
>
{{ toDateFormat(row.date_send) }}
</QBadge>
<div>{{ toDateTimeFormat(row.date_make) }}</div>
</QTd>
</template>
<template #column-client="{ row }">
<QTd>
<div class="q-mb-md">
<span class="link">{{ row.clientName }}</span>
<CustomerDescriptorProxy :id="row.clientFk" />
</div>
<span> {{ row.agencyName }}</span>
</QTd>
</template>
<template #column-salesPerson="{ row }">
<QTd>
<div class="q-mb-md">
<span class="link">{{ row.salesPerson }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
</div>
<span>{{ toCurrency(row.import) }}</span>
</QTd>
</template>
</VnTable>
</QCard> </QCard>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -6,7 +6,6 @@ import { useRouter } from 'vue-router';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnPaginate from 'components/ui/VnPaginate.vue';
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue'; import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
@ -15,6 +14,7 @@ import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { toDateFormat, toTimeFormat } from 'src/filters/date.js'; import { toDateFormat, toTimeFormat } from 'src/filters/date.js';
@ -103,7 +103,10 @@ const columns = computed(() => [
name: 'problems', name: 'problems',
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: null, columnFilter: false,
attrs: {
dense: true,
},
}, },
{ {
label: t('salesTicketsTable.identifier'), label: t('salesTicketsTable.identifier'),
@ -111,11 +114,10 @@ const columns = computed(() => [
field: 'id', field: 'id',
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnInput, component: 'input',
type: 'text', name: 'id',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
dense: true, dense: true,
}, },
@ -128,10 +130,8 @@ const columns = computed(() => [
field: 'nickname', field: 'nickname',
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnInput, component: 'input',
type: 'text', name: 'nickname',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
dense: true, dense: true,
}, },
@ -144,11 +144,8 @@ const columns = computed(() => [
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnSelect, component: 'select',
filterParamKey: 'salesPersonFk', name: 'salesPersonFk',
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
options: workersActiveOptions.value, options: workersActiveOptions.value,
'option-value': 'id', 'option-value': 'id',
@ -160,14 +157,12 @@ const columns = computed(() => [
{ {
label: t('salesTicketsTable.date'), label: t('salesTicketsTable.date'),
name: 'date', name: 'date',
style: { 'max-width': '100px' },
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnInputDate, component: 'date',
filterParamKey: 'shippedDate', name: 'shippedDate',
type: 'date',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
dense: true, dense: true,
}, },
@ -180,6 +175,13 @@ const columns = computed(() => [
align: 'left', align: 'left',
sortable: true, sortable: true,
format: (val) => toTimeFormat(val), format: (val) => toTimeFormat(val),
columnFilter: {
component: 'input',
name: 'theoreticalHour',
attrs: {
dense: true,
},
},
}, },
{ {
label: t('salesTicketsTable.practical'), label: t('salesTicketsTable.practical'),
@ -188,10 +190,8 @@ const columns = computed(() => [
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnInput, component: 'input',
type: 'text', name: 'practicalHour',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
dense: true, dense: true,
}, },
@ -204,6 +204,13 @@ const columns = computed(() => [
align: 'left', align: 'left',
sortable: true, sortable: true,
format: (val) => toTimeFormat(val), format: (val) => toTimeFormat(val),
columnFilter: {
component: 'input',
name: 'shippedDate',
attrs: {
dense: true,
},
},
}, },
{ {
@ -211,13 +218,11 @@ const columns = computed(() => [
name: 'province', name: 'province',
field: 'province', field: 'province',
align: 'left', align: 'left',
style: { 'max-width': '100px' },
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnSelect, component: 'select',
filterParamKey: 'provinceFk', name: 'provinceFk',
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
options: provincesOptions.value, options: provincesOptions.value,
'option-value': 'id', 'option-value': 'id',
@ -230,13 +235,11 @@ const columns = computed(() => [
label: t('salesTicketsTable.state'), label: t('salesTicketsTable.state'),
name: 'state', name: 'state',
align: 'left', align: 'left',
style: { 'max-width': '100px' },
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnSelect, component: 'select',
filterParamKey: 'stateFk', name: 'stateFk',
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
options: statesOptions.value, options: statesOptions.value,
'option-value': 'id', 'option-value': 'id',
@ -252,13 +255,13 @@ const columns = computed(() => [
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnInput, inWhere: true,
type: 'text', },
filterValue: null, attrs: {
event: getInputEvents, 'checked-icon': 'local_bar',
attrs: { 'unchecked-icon': 'local_bar',
dense: true, 'false-value': 0,
}, 'true-value': 1,
}, },
}, },
{ {
@ -267,11 +270,8 @@ const columns = computed(() => [
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnSelect, component: 'select',
filterParamKey: 'zoneFk', name: 'zoneFk',
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
options: zonesOptions.value, options: zonesOptions.value,
'option-value': 'id', 'option-value': 'id',
@ -285,21 +285,44 @@ const columns = computed(() => [
name: 'total', name: 'total',
field: 'totalWithVat', field: 'totalWithVat',
align: 'left', align: 'left',
style: { 'max-width': '75px' },
sortable: true, sortable: true,
columnFilter: { columnFilter: {
component: VnInput, component: 'input',
type: 'text', name: 'totalWithVat',
filterValue: null,
event: getInputEvents,
attrs: { attrs: {
dense: true, dense: true,
}, },
}, },
}, },
{ {
name: 'rowActions', align: 'right',
align: 'left', name: 'tableActions',
sortable: true, label: '',
actions: [
{
title: t('salesTicketsTable.goToLines'),
icon: 'vn:lines',
color: 'priamry',
action: (row) => redirectToSales(row.id),
isPrimary: true,
attrs: {
flat: true,
dense: true,
},
},
{
title: t('salesTicketsTable.preview'),
icon: 'preview',
color: 'priamry',
action: (row) => viewSummary(row.id, TicketSummary),
isPrimary: true,
attrs: {
flat: true,
dense: true,
},
},
],
}, },
]); ]);
@ -315,7 +338,9 @@ const getBadgeAttrs = (date) => {
if (comparation < 0) return { color: 'success', 'text-color': 'black' }; if (comparation < 0) return { color: 'success', 'text-color': 'black' };
return { color: 'transparent', 'text-color': 'white' }; return { color: 'transparent', 'text-color': 'white' };
}; };
let refreshTimer = null; let refreshTimer = null;
const autoRefreshHandler = (value) => { const autoRefreshHandler = (value) => {
if (value) if (value)
refreshTimer = setInterval(() => paginateRef.value.fetch(), DEFAULT_AUTO_REFRESH); refreshTimer = setInterval(() => paginateRef.value.fetch(), DEFAULT_AUTO_REFRESH);
@ -324,8 +349,10 @@ const autoRefreshHandler = (value) => {
refreshTimer = null; refreshTimer = null;
} }
}; };
const redirectToTicketSummary = (id) => { const redirectToTicketSummary = (id) => {
router.push({ name: 'TicketSummary', params: { id } }); const url = `#/ticket/${id}/summary`;
window.open(url, '_blank');
}; };
const stateColors = { const stateColors = {
@ -348,12 +375,17 @@ const formatShippedDate = (date) => {
return toDateFormat(_date); return toDateFormat(_date);
}; };
onMounted(async () => { const redirectToSales = (id) => {
const filteredColumns = columns.value.filter((col) => col.name !== 'rowActions'); const url = `#/ticket/${id}/sale`;
allColumnNames.value = filteredColumns.map((col) => col.name); window.open(url, '_blank');
params = fetchParams(); };
await paginateRef.value.addFilter(null, params);
}); // onMounted(async () => {
// const filteredColumns = columns.value.filter((col) => col.name !== 'rowActions');
// allColumnNames.value = filteredColumns.map((col) => col.name);
// params = fetchParams();
// await paginateRef.value.addFilter(null, params);
// });
</script> </script>
<template> <template>
@ -394,7 +426,7 @@ onMounted(async () => {
auto-load auto-load
@on-fetch="(data) => (zonesOptions = data)" @on-fetch="(data) => (zonesOptions = data)"
/> />
<VnPaginate <VnTable
ref="paginateRef" ref="paginateRef"
data-key="SalesMonitorTickets" data-key="SalesMonitorTickets"
url="SalesMonitors/salesFilter" url="SalesMonitors/salesFilter"
@ -403,221 +435,153 @@ onMounted(async () => {
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:user-params="params" :user-params="params"
:offset="50" :offset="50"
:columns="columns"
:visible-columns="visibleColumns"
:right-search="false"
default-mode="table"
auto-load
@row-click="(_, row) => redirectToTicketSummary(row.id)"
> >
<template #body="{ rows }"> <template #top-left>
<QTable <TableVisibleColumns
:rows="rows" :all-columns="allColumnNames"
:columns="columns" table-code="ticketsMonitor"
row-key="id" labels-traductions-path="salesTicketsTable"
:pagination="{ rowsPerPage: 0 }" @on-config-saved="visibleColumns = [...$event, 'rowActions']"
:visible-columns="visibleColumns" />
:no-data-label="t('globals.noResults')" <QCheckbox
@row-click="(_, row) => redirectToTicketSummary(row.id)" v-model="autoRefresh"
> :label="t('salesTicketsTable.autoRefresh')"
<template #top> @update:model-value="autoRefreshHandler"
<TableVisibleColumns />
:all-columns="allColumnNames"
table-code="ticketsMonitor"
labels-traductions-path="salesTicketsTable"
@on-config-saved="visibleColumns = [...$event, 'rowActions']"
/>
<QCheckbox
v-model="autoRefresh"
:label="t('salesTicketsTable.autoRefresh')"
@update:model-value="autoRefreshHandler"
/>
</template>
<template #top-row="{ cols }">
<QTr>
<QTd
v-for="(col, index) in cols"
:key="index"
style="max-width: 100px"
>
<component
:is="col.columnFilter.component"
v-if="col.columnFilter"
v-model="col.columnFilter.filterValue"
v-bind="col.columnFilter.attrs"
v-on="col.columnFilter.event(col)"
dense
style="padding-bottom: 0"
/>
</QTd>
</QTr>
</template>
<template #body-cell-problems="{ row }">
<QTd class="q-gutter-x-sm">
<QIcon
v-if="row.isTaxDataChecked === 0"
name="vn:no036"
color="primary"
size="xs"
>
<QTooltip>{{
t('salesTicketsTable.noVerifiedData')
}}</QTooltip>
</QIcon>
<QIcon
v-if="row.hasTicketRequest"
name="vn:buyrequest"
color="primary"
size="xs"
>
<QTooltip>{{
t('salesTicketsTable.purchaseRequest')
}}</QTooltip>
</QIcon>
<QIcon
v-if="row.itemShortage"
name="vn:unavailable"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.notVisible') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.isFreezed"
name="vn:frozen"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.clientFrozen') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.risk"
name="vn:risk"
:color="row.hasHighRisk ? 'negative' : 'primary'"
size="xs"
>
<QTooltip
>{{ t('salesTicketsTable.risk') }}:
{{ row.risk }}</QTooltip
>
</QIcon>
<QIcon
v-if="row.hasComponentLack"
name="vn:components"
color="primary"
size="xs"
>
<QTooltip>{{
t('salesTicketsTable.componentLack')
}}</QTooltip>
</QIcon>
<QIcon
v-if="row.isTooLittle"
name="vn:isTooLittle"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.tooLittle') }}</QTooltip>
</QIcon>
</QTd>
</template>
<template #body-cell-identifier="{ row }">
<QTd>
<span class="link" @click.stop.prevent>{{ row.id }}</span>
<TicketDescriptorProxy :id="row.id" />
</QTd>
</template>
<template #body-cell-client="{ row }">
<QTd @click.stop.prevent>
<span class="link">{{ row.nickname }}</span>
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
</template>
<template #body-cell-salesPerson="{ row }">
<QTd @click.stop.prevent>
<span class="link">{{ row.userName }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" />
</QTd>
</template>
<template #body-cell-date="{ row }">
<QTd>
<QBadge
v-bind="getBadgeAttrs(row.shippedDate)"
class="q-ma-none"
dense
style="font-size: 14px"
>
{{ formatShippedDate(row.shippedDate) }}
</QBadge>
</QTd>
</template>
<template #body-cell-state="{ row }">
<QTd @click.stop.prevent>
<div v-if="row.refFk">
<span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
</div>
<QBadge
v-else
:color="stateColors[row.classColor] || 'transparent'"
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
dense
style="font-size: 14px"
>
{{ row.state }}
</QBadge>
</QTd>
</template>
<template #body-cell-isFragile="{ row }">
<QTd>
<QIcon
v-if="row.isFragile"
name="local_bar"
color="primary"
size="sm"
>
<QTooltip>{{ t('salesTicketsTable.isFragile') }}</QTooltip>
</QIcon>
</QTd>
</template>
<template #body-cell-zone="{ row }">
<QTd @click.stop.prevent>
<span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" />
</QTd>
</template>
<template #body-cell-total="{ row }">
<QTd>
<QBadge
:color="totalPriceColor(row) || 'transparent'"
:text-color="totalPriceColor(row) ? 'black' : 'white'"
dense
style="font-size: 14px"
>
{{ toCurrency(row.totalWithVat) }}
</QBadge>
</QTd>
</template>
<template #body-cell-rowActions="{ row }">
<QTd @click.stop.prevent>
<QBtn
icon="vn:lines"
color="primary"
size="md"
class="q-mr-sm"
flat
dense
:to="{ name: 'TicketSale', params: { id: row.id } }"
>
<QTooltip>{{ t('salesTicketsTable.goToLines') }}</QTooltip>
</QBtn>
<QBtn
icon="preview"
color="primary"
size="md"
dense
flat
@click="viewSummary(row.id, TicketSummary)"
>
<QTooltip>{{ t('salesTicketsTable.preview') }}</QTooltip>
</QBtn>
</QTd>
</template>
</QTable>
</template> </template>
</VnPaginate> <template #column-problems="{ row }">
<QTd class="no-padding" style="max-width: 50px">
<QIcon
v-if="row.isTaxDataChecked === 0"
name="vn:no036"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.noVerifiedData') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.hasTicketRequest"
name="vn:buyrequest"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.purchaseRequest') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.itemShortage"
name="vn:unavailable"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.notVisible') }}</QTooltip>
</QIcon>
<QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
<QTooltip>{{ t('salesTicketsTable.clientFrozen') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.risk"
name="vn:risk"
:color="row.hasHighRisk ? 'negative' : 'primary'"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.risk') }}: {{ row.risk }}</QTooltip>
</QIcon>
<QIcon
v-if="row.hasComponentLack"
name="vn:components"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.componentLack') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.isTooLittle"
name="vn:isTooLittle"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.tooLittle') }}</QTooltip>
</QIcon>
</QTd>
</template>
<template #column-identifier="{ row }">
<QTd class="no-padding">
<span class="link" @click.stop.prevent>
{{ row.id }}
<TicketDescriptorProxy :id="row.id" />
</span>
</QTd>
</template>
<template #column-client="{ row }">
<QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.nickname }}</span>
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
</template>
<template #column-salesPerson="{ row }">
<QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.userName }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" />
</QTd>
</template>
<template #column-date="{ row }">
<QTd class="no-padding">
<QBadge
v-bind="getBadgeAttrs(row.shippedDate)"
class="q-pa-sm"
style="font-size: 14px"
>
{{ formatShippedDate(row.shippedDate) }}
</QBadge>
</QTd>
</template>
<template #column-state="{ row }">
<QTd class="no-padding" @click.stop.prevent>
<div v-if="row.refFk">
<span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
</div>
<QBadge
v-else
:color="stateColors[row.classColor] || 'transparent'"
:text-color="stateColors[row.classColor] ? 'black' : 'white'"
class="q-pa-sm"
style="font-size: 14px"
>
{{ row.state }}
</QBadge>
</QTd>
</template>
<template #column-isFragile="{ row }">
<QTd class="no-padding">
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
<QTooltip>{{ t('salesTicketsTable.isFragile') }}</QTooltip>
</QIcon>
</QTd>
</template>
<template #column-zone="{ row }">
<QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" />
</QTd>
</template>
<template #column-total="{ row }">
<QTd class="no-padding">
<QBadge
:color="totalPriceColor(row) || 'transparent'"
:text-color="totalPriceColor(row) ? 'black' : 'white'"
class="q-pa-sm"
style="font-size: 14px"
>
{{ toCurrency(row.totalWithVat) }}
</QBadge>
</QTd>
</template>
</VnTable>
</template> </template>