Merge branch 'dev' into 7017_formModel_validations
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2024-07-16 09:50:25 +00:00
commit 305a06aaee
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,40 +75,20 @@ 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'),
field: 'clientName', field: 'clientName',
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
>
<template #body="{ rows }">
<QTable
:rows="rows"
:columns="columns" :columns="columns"
row-key="id" :right-search="false"
:pagination="{ rowsPerPage: 0 }" default-mode="table"
class="full-width" dense
:no-data-label="t('globals.noResults')" :without-header="true"
> >
<template #top> <template #column-salesPerson="{ row }">
<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> <QTd>
<span class="link">{{ row.salesPerson }}</span> <span class="link">{{ row.salesPerson }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" dense /> <WorkerDescriptorProxy :id="row.salesPersonFk" dense />
</QTd> </QTd>
</template> </template>
<template #body-cell-client="{ row }"> <template #column-client="{ row }">
<QTd> <QTd>
<span class="link">{{ row.clientName }}</span> <span class="link">{{ row.clientName }}</span>
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.clientFk" />
</QTd> </QTd>
</template> </template>
</QTable> </VnTable>
</template>
</VnPaginate>
</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,28 +123,29 @@ 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
>
<template #body="{ rows }">
<QTable
:rows="rows"
:columns="columns" :columns="columns"
row-key="id" :table="{
selection="multiple" 'row-key': 'id',
v-model:selected="selectedRows" selection: 'multiple',
:pagination="{ rowsPerPage: 0 }" 'hide-bottom': true,
:no-data-label="t('globals.noResults')" }"
default-mode="table"
:without-header="false"
@row-click="(_, row) => redirectToOrderSummary(row.id)" @row-click="(_, row) => redirectToOrderSummary(row.id)"
v-model:selected="selectedRows"
> >
<template #top> <template #top-left>
<QBtn <QBtn
v-if="selectedRows.length > 0" v-if="selectedRows.length > 0"
icon="delete" icon="delete"
@ -157,13 +162,12 @@ const redirectToOrderSummary = (orderId) => {
<QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip> <QTooltip>{{ t('salesOrdersTable.delete') }}</QTooltip>
</QBtn> </QBtn>
</template> </template>
<template #body-cell-date="{ row }"> <template #column-date="{ row }">
<QTd> <QTd>
<QBadge <QBadge
:color="getBadgeColor(row.date_send)" :color="getBadgeColor(row.date_send)"
text-color="black" text-color="black"
class="q-ma-none q-mb-md" class="q-pa-sm q-mb-md"
dense
style="font-size: 14px" style="font-size: 14px"
> >
{{ toDateFormat(row.date_send) }} {{ toDateFormat(row.date_send) }}
@ -171,7 +175,7 @@ const redirectToOrderSummary = (orderId) => {
<div>{{ toDateTimeFormat(row.date_make) }}</div> <div>{{ toDateTimeFormat(row.date_make) }}</div>
</QTd> </QTd>
</template> </template>
<template #body-cell-client="{ row }"> <template #column-client="{ row }">
<QTd> <QTd>
<div class="q-mb-md"> <div class="q-mb-md">
<span class="link">{{ row.clientName }}</span> <span class="link">{{ row.clientName }}</span>
@ -180,7 +184,8 @@ const redirectToOrderSummary = (orderId) => {
<span> {{ row.agencyName }}</span> <span> {{ row.agencyName }}</span>
</QTd> </QTd>
</template> </template>
<template #body-cell-salesPerson="{ row }">
<template #column-salesPerson="{ row }">
<QTd> <QTd>
<div class="q-mb-md"> <div class="q-mb-md">
<span class="link">{{ row.salesPerson }}</span> <span class="link">{{ row.salesPerson }}</span>
@ -189,9 +194,7 @@ const redirectToOrderSummary = (orderId) => {
<span>{{ toCurrency(row.import) }}</span> <span>{{ toCurrency(row.import) }}</span>
</QTd> </QTd>
</template> </template>
</QTable> </VnTable>
</template>
</VnPaginate>
</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,
event: getInputEvents,
attrs: {
dense: true,
}, },
attrs: {
'checked-icon': 'local_bar',
'unchecked-icon': 'local_bar',
'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,18 +435,14 @@ onMounted(async () => {
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:user-params="params" :user-params="params"
:offset="50" :offset="50"
>
<template #body="{ rows }">
<QTable
:rows="rows"
:columns="columns" :columns="columns"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
:no-data-label="t('globals.noResults')" :right-search="false"
default-mode="table"
auto-load
@row-click="(_, row) => redirectToTicketSummary(row.id)" @row-click="(_, row) => redirectToTicketSummary(row.id)"
> >
<template #top> <template #top-left>
<TableVisibleColumns <TableVisibleColumns
:all-columns="allColumnNames" :all-columns="allColumnNames"
table-code="ticketsMonitor" table-code="ticketsMonitor"
@ -427,36 +455,15 @@ onMounted(async () => {
@update:model-value="autoRefreshHandler" @update:model-value="autoRefreshHandler"
/> />
</template> </template>
<template #top-row="{ cols }"> <template #column-problems="{ row }">
<QTr> <QTd class="no-padding" style="max-width: 50px">
<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 <QIcon
v-if="row.isTaxDataChecked === 0" v-if="row.isTaxDataChecked === 0"
name="vn:no036" name="vn:no036"
color="primary" color="primary"
size="xs" size="xs"
> >
<QTooltip>{{ <QTooltip>{{ t('salesTicketsTable.noVerifiedData') }}</QTooltip>
t('salesTicketsTable.noVerifiedData')
}}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
v-if="row.hasTicketRequest" v-if="row.hasTicketRequest"
@ -464,9 +471,7 @@ onMounted(async () => {
color="primary" color="primary"
size="xs" size="xs"
> >
<QTooltip>{{ <QTooltip>{{ t('salesTicketsTable.purchaseRequest') }}</QTooltip>
t('salesTicketsTable.purchaseRequest')
}}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
v-if="row.itemShortage" v-if="row.itemShortage"
@ -476,12 +481,7 @@ onMounted(async () => {
> >
<QTooltip>{{ t('salesTicketsTable.notVisible') }}</QTooltip> <QTooltip>{{ t('salesTicketsTable.notVisible') }}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon v-if="row.isFreezed" name="vn:frozen" color="primary" size="xs">
v-if="row.isFreezed"
name="vn:frozen"
color="primary"
size="xs"
>
<QTooltip>{{ t('salesTicketsTable.clientFrozen') }}</QTooltip> <QTooltip>{{ t('salesTicketsTable.clientFrozen') }}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
@ -490,10 +490,7 @@ onMounted(async () => {
:color="row.hasHighRisk ? 'negative' : 'primary'" :color="row.hasHighRisk ? 'negative' : 'primary'"
size="xs" size="xs"
> >
<QTooltip <QTooltip>{{ t('salesTicketsTable.risk') }}: {{ row.risk }}</QTooltip>
>{{ t('salesTicketsTable.risk') }}:
{{ row.risk }}</QTooltip
>
</QIcon> </QIcon>
<QIcon <QIcon
v-if="row.hasComponentLack" v-if="row.hasComponentLack"
@ -501,9 +498,7 @@ onMounted(async () => {
color="primary" color="primary"
size="xs" size="xs"
> >
<QTooltip>{{ <QTooltip>{{ t('salesTicketsTable.componentLack') }}</QTooltip>
t('salesTicketsTable.componentLack')
}}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
v-if="row.isTooLittle" v-if="row.isTooLittle"
@ -515,38 +510,39 @@ onMounted(async () => {
</QIcon> </QIcon>
</QTd> </QTd>
</template> </template>
<template #body-cell-identifier="{ row }"> <template #column-identifier="{ row }">
<QTd> <QTd class="no-padding">
<span class="link" @click.stop.prevent>{{ row.id }}</span> <span class="link" @click.stop.prevent>
{{ row.id }}
<TicketDescriptorProxy :id="row.id" /> <TicketDescriptorProxy :id="row.id" />
</span>
</QTd> </QTd>
</template> </template>
<template #body-cell-client="{ row }"> <template #column-client="{ row }">
<QTd @click.stop.prevent> <QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.nickname }}</span> <span class="link">{{ row.nickname }}</span>
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.clientFk" />
</QTd> </QTd>
</template> </template>
<template #body-cell-salesPerson="{ row }"> <template #column-salesPerson="{ row }">
<QTd @click.stop.prevent> <QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.userName }}</span> <span class="link">{{ row.userName }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" /> <WorkerDescriptorProxy :id="row.salesPersonFk" />
</QTd> </QTd>
</template> </template>
<template #body-cell-date="{ row }"> <template #column-date="{ row }">
<QTd> <QTd class="no-padding">
<QBadge <QBadge
v-bind="getBadgeAttrs(row.shippedDate)" v-bind="getBadgeAttrs(row.shippedDate)"
class="q-ma-none" class="q-pa-sm"
dense
style="font-size: 14px" style="font-size: 14px"
> >
{{ formatShippedDate(row.shippedDate) }} {{ formatShippedDate(row.shippedDate) }}
</QBadge> </QBadge>
</QTd> </QTd>
</template> </template>
<template #body-cell-state="{ row }"> <template #column-state="{ row }">
<QTd @click.stop.prevent> <QTd class="no-padding" @click.stop.prevent>
<div v-if="row.refFk"> <div v-if="row.refFk">
<span class="link">{{ row.refFk }}</span> <span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" /> <InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
@ -555,69 +551,37 @@ onMounted(async () => {
v-else v-else
:color="stateColors[row.classColor] || 'transparent'" :color="stateColors[row.classColor] || 'transparent'"
:text-color="stateColors[row.classColor] ? 'black' : 'white'" :text-color="stateColors[row.classColor] ? 'black' : 'white'"
dense class="q-pa-sm"
style="font-size: 14px" style="font-size: 14px"
> >
{{ row.state }} {{ row.state }}
</QBadge> </QBadge>
</QTd> </QTd>
</template> </template>
<template #body-cell-isFragile="{ row }"> <template #column-isFragile="{ row }">
<QTd> <QTd class="no-padding">
<QIcon <QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
v-if="row.isFragile"
name="local_bar"
color="primary"
size="sm"
>
<QTooltip>{{ t('salesTicketsTable.isFragile') }}</QTooltip> <QTooltip>{{ t('salesTicketsTable.isFragile') }}</QTooltip>
</QIcon> </QIcon>
</QTd> </QTd>
</template> </template>
<template #body-cell-zone="{ row }"> <template #column-zone="{ row }">
<QTd @click.stop.prevent> <QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.zoneName }}</span> <span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" /> <ZoneDescriptorProxy :id="row.zoneFk" />
</QTd> </QTd>
</template> </template>
<template #body-cell-total="{ row }"> <template #column-total="{ row }">
<QTd> <QTd class="no-padding">
<QBadge <QBadge
:color="totalPriceColor(row) || 'transparent'" :color="totalPriceColor(row) || 'transparent'"
:text-color="totalPriceColor(row) ? 'black' : 'white'" :text-color="totalPriceColor(row) ? 'black' : 'white'"
dense class="q-pa-sm"
style="font-size: 14px" style="font-size: 14px"
> >
{{ toCurrency(row.totalWithVat) }} {{ toCurrency(row.totalWithVat) }}
</QBadge> </QBadge>
</QTd> </QTd>
</template> </template>
<template #body-cell-rowActions="{ row }"> </VnTable>
<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>
</VnPaginate>
</template> </template>