diff --git a/src/pages/Monitor/MonitorList.vue b/src/pages/Monitor/MonitorList.vue index 1b1ccb5b3..4906247e8 100644 --- a/src/pages/Monitor/MonitorList.vue +++ b/src/pages/Monitor/MonitorList.vue @@ -14,10 +14,10 @@ const stateStore = useStateStore(); const expanded = ref(true); onMounted(async () => { - stateStore.rightDrawer = true; + stateStore.leftDrawer = false; }); -onUnmounted(() => (stateStore.rightDrawer = false)); +onUnmounted(() => (stateStore.leftDrawer = true)); @@ -63,13 +63,15 @@ onUnmounted(() => (stateStore.rightDrawer = false)); - + - + {{ t('salesMonitor.ticketsMonitor') }} - + + diff --git a/src/pages/Monitor/SalesClientsTable.vue b/src/pages/Monitor/SalesClientsTable.vue index 8008b1fda..2fb9e8e2f 100644 --- a/src/pages/Monitor/SalesClientsTable.vue +++ b/src/pages/Monitor/SalesClientsTable.vue @@ -3,14 +3,11 @@ import { ref, computed, reactive, watch } from 'vue'; import { useI18n } from 'vue-i18n'; 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 CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; -import VnPaginate from 'components/ui/VnPaginate.vue'; import { toDateFormat } from 'src/filters/date.js'; -import { dashIfEmpty } from 'src/filters'; +import VnTable from 'src/components/VnTable/VnTable.vue'; const { t } = useI18n(); @@ -37,9 +34,11 @@ const filter = reactive({ }, }); +const refetch = async () => await paginateRef.value.fetch(); + watch(dateRange, (val) => { filter.where['v.stamp'].between = val; - paginateRef.value.fetch(); + refetch(); }); function exprBuilder(param, value) { @@ -53,25 +52,15 @@ function exprBuilder(param, value) { 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(() => [ { label: t('salesClientsTable.date'), - name: 'date', + name: 'dated', field: 'dated', align: 'left', columnFilter: null, sortable: true, - format: (val) => toDateFormat(val), + format: (row) => toDateFormat(row.dated), }, { label: t('salesClientsTable.hour'), @@ -86,19 +75,9 @@ const columns = computed(() => [ field: 'salesPerson', align: 'left', sortable: true, - columnFilter: { - component: VnSelect, - filterParamKey: 'salesPersonFk', - type: 'select', - filterValue: null, - attrs: { - options: workersActiveOptions.value, - 'option-value': 'id', - 'option-label': 'name', - dense: true, - }, + columnField: { + component: null, }, - format: (val) => dashIfEmpty(val), }, { label: t('salesClientsTable.client'), @@ -106,19 +85,9 @@ const columns = computed(() => [ name: 'client', align: 'left', sortable: true, - columnFilter: { - component: VnSelect, - filterParamKey: 'clientFk', - type: 'select', - filterValue: null, - attrs: { - options: clientsOptions.value, - 'option-value': 'id', - 'option-label': 'name', - dense: true, - }, + columnField: { + component: null, }, - format: (val) => dashIfEmpty(val), }, ]); @@ -144,7 +113,7 @@ const columns = computed(() => [ @on-fetch="(data) => (clientsOptions = data)" /> - [ :filter="filter" :offset="50" auto-load + :columns="columns" + :right-search="false" + default-mode="table" + dense + :without-header="true" > - - - - - - - - - - - - - - - - {{ row.salesPerson }} - - - - - - {{ row.clientName }} - - - - + + + {{ row.salesPerson }} + + - + + + {{ row.clientName }} + + + + diff --git a/src/pages/Monitor/SalesOrdersTable.vue b/src/pages/Monitor/SalesOrdersTable.vue index 0ba900393..f0c389aa6 100644 --- a/src/pages/Monitor/SalesOrdersTable.vue +++ b/src/pages/Monitor/SalesOrdersTable.vue @@ -5,7 +5,8 @@ import { useI18n } from 'vue-i18n'; import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.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 { toCurrency } from 'src/filters'; @@ -50,19 +51,22 @@ const columns = computed(() => [ name: 'date', field: 'dated', align: 'left', - columnFilter: null, + sortable: true, + cardVisible: true, }, { label: t('salesOrdersTable.client'), name: 'client', align: 'left', sortable: true, + cardVisible: true, }, { label: t('salesOrdersTable.salesPerson'), name: 'salesPerson', align: 'left', sortable: true, + cardVisible: true, }, ]); @@ -119,79 +123,78 @@ const redirectToOrderSummary = (orderId) => { @on-fetch="(data) => (clientsOptions = data)" /> + - redirectToOrderSummary(row.id)" + v-model:selected="selectedRows" > - - redirectToOrderSummary(row.id)" + + - - - {{ t('salesOrdersTable.delete') }} - - - - - - {{ toDateFormat(row.date_send) }} - - {{ toDateTimeFormat(row.date_make) }} - - - - - - {{ row.clientName }} - - - {{ row.agencyName }} - - - - - - {{ row.salesPerson }} - - - {{ toCurrency(row.import) }} - - - + {{ t('salesOrdersTable.delete') }} + - + + + + {{ toDateFormat(row.date_send) }} + + {{ toDateTimeFormat(row.date_make) }} + + + + + + {{ row.clientName }} + + + {{ row.agencyName }} + + + + + + + {{ row.salesPerson }} + + + {{ toCurrency(row.import) }} + + +