fix: refs #6900 improve logic
This commit is contained in:
parent
de24a3efdb
commit
6dd9029871
|
@ -1,11 +1,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onBeforeMount } from 'vue';
|
import { ref, computed, onBeforeMount } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import InvoiceInSerialFilter from './InvoiceInSerialFilter.vue';
|
import InvoiceInSerialFilter from './InvoiceInSerialFilter.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -30,15 +30,18 @@ const cols = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const arrayData = useArrayData('InvoiceInSerial');
|
const daysAgo = ref(0);
|
||||||
const table = ref();
|
|
||||||
onBeforeMount(async () => {
|
|
||||||
const { data } = await axios.get('InvoiceInConfigs/findOne', {
|
|
||||||
params: { filter: { fields: ['daysAgo'] } },
|
|
||||||
});
|
|
||||||
|
|
||||||
arrayData.store.userParams.daysAgo = data.daysAgo;
|
onBeforeMount(async () => {
|
||||||
await table.value.reload();
|
const tableParam = useRoute().query.table;
|
||||||
|
|
||||||
|
if (tableParam) daysAgo.value = JSON.parse(tableParam).daysAgo;
|
||||||
|
else
|
||||||
|
daysAgo.value = (
|
||||||
|
await axios.get('InvoiceInConfigs/findOne', {
|
||||||
|
params: { filter: { fields: ['daysAgo'] } },
|
||||||
|
})
|
||||||
|
).data?.daysAgo;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -48,12 +51,14 @@ onBeforeMount(async () => {
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="table"
|
v-if="daysAgo"
|
||||||
data-key="InvoiceInSerial"
|
data-key="InvoiceInSerial"
|
||||||
url="InvoiceIns/getSerial"
|
url="InvoiceIns/getSerial"
|
||||||
:columns="cols"
|
:columns="cols"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
|
:user-params="{ daysAgo }"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
|
auto-load
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
Loading…
Reference in New Issue