forked from verdnatura/salix-front
reafactor: refs #6942 use meta moduleName
This commit is contained in:
parent
332e96f184
commit
90cebb85fe
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||
|
@ -8,12 +8,11 @@ import CrudModel from 'src/components/CrudModel.vue';
|
|||
import FetchData from 'src/components/FetchData.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { push, currentRoute } = useRouter();
|
||||
const { t } = useI18n();
|
||||
|
||||
const invoiceId = route.params.id;
|
||||
const arrayData = useArrayData('InvoiceIn');
|
||||
const invoiceId = +currentRoute.value.params.id;
|
||||
const arrayData = useArrayData(currentRoute.value.meta.moduleName);
|
||||
const invoiceIn = computed(() => arrayData.store.data);
|
||||
const invoiceInCorrectionRef = ref();
|
||||
const filter = {
|
||||
|
@ -74,7 +73,7 @@ const rowsSelected = ref([]);
|
|||
|
||||
const requiredFieldRule = (val) => val || t('globals.requiredField');
|
||||
|
||||
const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/summary`);
|
||||
const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
|
|
@ -13,13 +13,13 @@ import { toCurrency } from 'src/filters';
|
|||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const arrayData = useArrayData('InvoiceIn');
|
||||
const arrayData = useArrayData(route.meta.moduleName);
|
||||
const invoiceIn = computed(() => arrayData.store.data);
|
||||
|
||||
const rowsSelected = ref([]);
|
||||
const banks = ref([]);
|
||||
const invoiceInFormRef = ref();
|
||||
const invoiceId = route.params.id;
|
||||
const invoiceId = +route.params.id;
|
||||
|
||||
const placeholder = 'yyyy/mm/dd';
|
||||
|
||||
|
|
|
@ -10,13 +10,16 @@ import { useArrayData } from 'src/composables/useArrayData';
|
|||
|
||||
const { t } = useI18n();
|
||||
|
||||
const currency = computed(() => useArrayData('invoiceIn').store.data?.currency?.code);
|
||||
const route = useRoute();
|
||||
const currency = computed(
|
||||
() => useArrayData(route.meta.moduleName).store.data?.currency?.code
|
||||
);
|
||||
const invoceInIntrastat = ref([]);
|
||||
const rowsSelected = ref([]);
|
||||
const countries = ref([]);
|
||||
const intrastats = ref([]);
|
||||
const invoiceInFormRef = ref();
|
||||
const invoiceInId = computed(() => +useRoute().params.id);
|
||||
const invoiceInId = computed(() => +route.params.id);
|
||||
const filter = { where: { invoiceInFk: invoiceInId.value } };
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
|
|
@ -13,9 +13,10 @@ import VnTitle from 'src/components/common/VnTitle.vue';
|
|||
|
||||
const props = defineProps({ id: { type: [Number, String], default: 0 } });
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
||||
const entityId = computed(() => props.id || useRoute().params.id);
|
||||
const invoiceIn = computed(() => useArrayData('InvoiceIn').store.data);
|
||||
const entityId = computed(() => props.id || +route.params.id);
|
||||
const invoiceIn = computed(() => useArrayData(route.meta.moduleName).store.data);
|
||||
const currency = computed(() => invoiceIn.value?.currency?.code);
|
||||
const invoiceInUrl = ref();
|
||||
const amountsNotMatch = ref(null);
|
||||
|
|
|
@ -15,7 +15,7 @@ const { currentRoute } = useRouter();
|
|||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
|
||||
const arrayData = useArrayData('InvoiceIn');
|
||||
const arrayData = useArrayData(currentRoute.value.meta.moduleName);
|
||||
const invoiceIn = computed(() => arrayData.store.data);
|
||||
const invoiceId = +currentRoute.value.params.id;
|
||||
const currency = computed(() => invoiceIn.value?.currency?.code);
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
<script setup>
|
||||
import useRoute from 'src/composables/useRoute';
|
||||
import axios from 'axios';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
|
||||
const { notify, dialog } = useQuasar();
|
||||
const { t } = useI18n();
|
||||
|
||||
defineExpose({ checkToBook });
|
||||
|
||||
const { store } = useArrayData('InvoiceIn');
|
||||
const { store } = useArrayData(useRoute().meta.moduleName);
|
||||
|
||||
async function checkToBook(id) {
|
||||
let directBooking = true;
|
||||
|
|
Loading…
Reference in New Issue