0
0
Fork 0

perf: #7260 change params by filter

This commit is contained in:
Javier Segarra 2024-11-20 11:19:58 +01:00
parent 74f1ce88c7
commit 09c0a590cd
1 changed files with 17 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref, reactive, onUnmounted, nextTick, computed } from 'vue';
import { onMounted, ref, onUnmounted, nextTick, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
@ -37,11 +37,9 @@ const fixedPrices = ref([]);
const warehousesOptions = ref([]);
const rowsSelected = ref([]);
const itemFixedPriceFilterRef = ref();
const params = reactive({});
onMounted(async () => {
stateStore.rightDrawer = true;
params.warehouseFk = user.value.warehouseFk;
});
onUnmounted(() => (stateStore.rightDrawer = false));
@ -132,13 +130,21 @@ const columns = computed(() => [
{
label: t('item.fixedPrice.warehouse'),
field: 'warehouseFk',
name: 'warehouseFk',
...defaultColumnAttrs,
name: 'warehouseFk',
columnClass: 'shrink',
component: 'select',
options: warehousesOptions,
columnFilter: {
name: 'warehouseFk',
inWhere: true,
component: 'select',
attrs: {
options: warehousesOptions,
'option-label': 'name',
'option-value': 'id',
},
},
},
{
align: 'right',
@ -418,9 +424,13 @@ function handleOnDataSave({ CrudModelRef }) {
url="FixedPrices/filter"
:order="['itemFk DESC', 'name DESC']"
save-url="FixedPrices/crud"
:user-params="{ warehouseFk: user.warehouseFk }"
ref="tableRef"
dense
:filter="{
where: {
warehouseFk: user.warehouseFk,
},
}"
:columns="columns"
default-mode="table"
auto-load