forked from verdnatura/salix-front
perf: #7260 change params by filter
This commit is contained in:
parent
74f1ce88c7
commit
09c0a590cd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue