{{ t(`params.${tag.label}`) }}:
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 149a794a9..6df8f5c0e 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -5,7 +5,7 @@ import { useRoute, useRouter } from 'vue-router';
import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
-import { toDate, toCurrency, dashIfEmpty } from 'src/filters/index';
+import { toDate, toCurrency, dashIfEmpty, dateRange } from 'src/filters/index';
import useNotify from 'src/composables/useNotify';
import TicketSummary from './Card/TicketSummary.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
@@ -46,12 +46,14 @@ const userParams = {
from: null,
to: null,
};
+
onMounted(() => {
initializeFromQuery();
stateStore.rightDrawer = true;
if (!route.query.createForm) return;
onClientSelected(JSON.parse(route.query.createForm));
});
+
const initializeFromQuery = () => {
const query = route.query.table ? JSON.parse(route.query.table) : {};
from.value = query.from || from.toISOString();
@@ -67,6 +69,60 @@ const companiesOptions = ref([]);
const accountingOptions = ref([]);
const amountToReturn = ref();
+const exprBuilder = (param, value) => {
+ switch (param) {
+ case 'stateFk':
+ return { 'ts.stateFk': value };
+ case 'salesPersonFk':
+ return { 'c.salesPersonFk': value };
+ case 'provinceFk':
+ return { 'a.provinceFk': value };
+ case 'hour':
+ return { 'z.hour': value };
+ case 'shipped':
+ return {
+ 't.shipped': {
+ between: dateRange(value),
+ },
+ };
+ case 'id':
+ case 'refFk':
+ case 'zoneFk':
+ case 'nickname':
+ case 'agencyModeFk':
+ case 'warehouseFk':
+ return { [`t.${param}`]: value };
+ }
+};
+
+const contextMenuItems = [
+ {
+ label: t('components.contextMenu.filterBySelection'),
+ action: 'filterBySelection',
+ type: 'filter',
+ },
+ {
+ label: t('components.contextMenu.excludeSelection'),
+ action: 'excludeSelection',
+ type: 'filter',
+ },
+ {
+ label: t('components.contextMenu.removeFilter'),
+ action: 'removeFilter',
+ type: 'filter',
+ },
+ {
+ label: t('components.contextMenu.removeAllFilters'),
+ action: 'removeAllFilters',
+ type: null,
+ },
+ {
+ label: t('components.contextMenu.copyValue'),
+ action: 'copyValue',
+ type: 'action',
+ },
+];
+
const columns = computed(() => [
{
align: 'left',
@@ -74,6 +130,11 @@ const columns = computed(() => [
hidden: true,
format: () => '',
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: false,
+ actionEnabled: false,
+ },
},
{
align: 'left',
@@ -83,6 +144,11 @@ const columns = computed(() => [
condition: () => true,
},
isId: true,
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
},
{
align: 'left',
@@ -100,11 +166,17 @@ const columns = computed(() => [
component: null,
},
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ copyValueField: 'salesPerson',
+ },
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
},
{
align: 'left',
- name: 'shippedDate',
+ name: 'shipped',
cardVisible: true,
label: t('ticketList.shipped'),
columnFilter: {
@@ -112,18 +184,34 @@ const columns = computed(() => [
alias: 't',
inWhere: true,
},
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
format: ({ shippedDate }) => toDate(shippedDate),
},
{
align: 'left',
- name: 'shipped',
+ name: 'shippedHour',
label: t('ticketList.hour'),
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: false,
+ actionEnabled: false,
+ },
format: (row) => toTimeFormat(row.shipped),
},
{
+ //TODO: Revisar porque no anda exclude filter
align: 'left',
name: 'zoneLanding',
label: t('ticketList.closure'),
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
format: (row, dashIfEmpty) => dashIfEmpty(toTimeFormat(row.zoneLanding)),
},
{
@@ -131,18 +219,34 @@ const columns = computed(() => [
name: 'nickname',
label: t('ticketList.nickname'),
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
},
{
align: 'left',
name: 'addressNickname',
label: t('ticketList.addressNickname'),
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: false,
+ actionEnabled: true,
+ },
},
{
align: 'left',
- name: 'province',
+ name: 'provinceFk',
label: t('ticketList.province'),
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
+ format: (row) => row.province,
},
{
align: 'left',
@@ -157,6 +261,11 @@ const columns = computed(() => [
},
},
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
},
{
align: 'left',
@@ -172,13 +281,24 @@ const columns = computed(() => [
inWhere: true,
},
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
format: (row, dashIfEmpty) => dashIfEmpty(row.zoneName),
},
{
align: 'left',
- name: 'warehouse',
+ name: 'warehouseFk',
label: t('ticketList.warehouse'),
columnClass: 'expand',
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: true,
+ actionEnabled: true,
+ },
+ format: (row) => row.warehouse,
},
{
align: 'left',
@@ -189,12 +309,22 @@ const columns = computed(() => [
component: 'number',
inWhere: true,
},
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: false,
+ actionEnabled: true,
+ },
format: (row) => toCurrency(row.totalWithVat),
},
{
align: 'left',
name: 'packing',
label: t('ticketSale.packaging'),
+ contextMenuProps: {
+ menuEnabled: true,
+ filterEnabled: false,
+ actionEnabled: false,
+ },
format: (row, dashIfEmpty) => dashIfEmpty(row.packing),
},
{
@@ -221,6 +351,11 @@ const columns = computed(() => [
},
},
],
+ contextMenuProps: {
+ menuEnabled: false,
+ filterEnabled: false,
+ actionEnabled: false,
+ },
},
]);
function redirectToLines(id) {
@@ -463,6 +598,7 @@ function setReference(data) {
+
>>>>>> Stashed changes
>
@@ -495,7 +636,7 @@ function setReference(data) {
-
+
{{ toDate(row.shippedDate) }}