diff --git a/src/boot/axios.js b/src/boot/axios.js index 4fd83ddea..fa8a08003 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -55,10 +55,10 @@ const onResponseError = (error) => { } if (session.isLoggedIn() && response?.status === 401) { - session.destroy(); + session.destroy(false); const hash = window.location.hash; const url = hash.slice(1); - Router.push({ path: url }); + Router.push(`/login?redirect=${url}`); } else if (!session.isLoggedIn()) { return Promise.reject(error); } diff --git a/src/components/CreateManualInvoiceForm.vue b/src/components/CreateManualInvoiceForm.vue index 92399c20c..1aa95011f 100644 --- a/src/components/CreateManualInvoiceForm.vue +++ b/src/components/CreateManualInvoiceForm.vue @@ -46,22 +46,6 @@ const onDataSaved = async (formData, requestResponse) => { @on-fetch="(data) => (taxAreasOptions = data)" auto-load /> - - { option-value="id" v-model="data.ticketFk" @update:model-value="data.clientFk = null" + url="Tickets" + :where="{ refFk: null }" + :fields="['id', 'nickname']" + :filter-options="{ order: 'shipped DESC' }" > + + diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index d4395fa06..b0b7c4756 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -40,7 +40,7 @@ const enterEvent = { const defaultAttrs = { filled: !$props.showTitle, - class: 'q-px-sm q-pb-xs q-pt-none fit', + class: 'q-px-xs q-pb-xs q-pt-none fit', dense: true, }; @@ -101,7 +101,7 @@ const components = { component: markRaw(VnSelect), event: updateEvent, attrs: { - class: 'q-px-md q-pb-xs q-pt-none fit', + class: 'q-px-sm q-pb-xs q-pt-none fit', dense: true, filled: !$props.showTitle, }, diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 709ca16c8..a6bf5e049 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -13,6 +13,7 @@ import VnLv from 'components/ui/VnLv.vue'; import VnTableColumn from 'components/VnTable/VnColumn.vue'; import VnTableFilter from 'components/VnTable/VnFilter.vue'; import VnTableChip from 'components/VnTable/VnChip.vue'; +import TableVisibleColumns from 'src/components/VnTable/VnVisibleColumn.vue'; const $props = defineProps({ columns: { @@ -71,6 +72,14 @@ const $props = defineProps({ type: Boolean, default: false, }, + tableCode: { + type: String, + default: null, + }, + table: { + type: Object, + default: () => ({}), + }, }); const { t } = useI18n(); const stateStore = useStateStore(); @@ -119,6 +128,14 @@ watch( (val) => setUserParams(val) ); +const rowClickFunction = computed(() => { + if ($props.rowClick) return $props.rowClick; + if ($props.redirect) return ({ id }) => redirectFn(id); + return () => {}; +}); + +const isTableMode = computed(() => mode.value == TABLE_MODE); + function setUserParams(watchedParams) { if (!watchedParams) return; @@ -162,12 +179,6 @@ function splitColumns(columns) { } } -const rowClickFunction = computed(() => { - if ($props.rowClick) return $props.rowClick; - if ($props.redirect) return ({ id }) => redirectFn(id); - return () => {}; -}); - function redirectFn(id) { router.push({ path: `/${$props.redirect}/${id}` }); } @@ -240,7 +251,7 @@ defineExpose({ :limit="20" ref="CrudModelRef" :search-url="searchUrl" - :disable-infinite-scroll="mode == TABLE_MODE" + :disable-infinite-scroll="isTableMode" @save-changes="reload" :has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable" > @@ -253,16 +264,16 @@ defineExpose({ -