forked from verdnatura/salix-front
Nueva correccion por comentario
This commit is contained in:
parent
f9cbf03991
commit
bf19ce630d
|
@ -1,31 +1,17 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, onBeforeMount, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
|
||||||
|
|
||||||
const arrayData = ref(null);
|
|
||||||
const provincesLocation = ref([]);
|
const provincesLocation = ref([]);
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
|
||||||
arrayData.value = useArrayData('CustomerConsignees', {
|
|
||||||
url: `Clients/${route.params.id}/addresses`,
|
|
||||||
limit: 0,
|
|
||||||
});
|
|
||||||
await arrayData.value.fetch({ append: false });
|
|
||||||
stateStore.rightDrawer = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
const data = computed(() => arrayData.value.store.data);
|
|
||||||
|
|
||||||
const setProvince = (provinceFk) => {
|
const setProvince = (provinceFk) => {
|
||||||
const result = provincesLocation.value.filter(
|
const result = provincesLocation.value.filter(
|
||||||
(province) => province.id === provinceFk
|
(province) => province.id === provinceFk
|
||||||
|
@ -49,14 +35,19 @@ const toCustomerConsigneeEdit = () => {
|
||||||
url="Provinces/location"
|
url="Provinces/location"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<QCard class="q-pa-sm">
|
<QCard class="q-pa-lg">
|
||||||
<QCardSection>
|
<VnPaginate
|
||||||
<div v-if="data?.length">
|
data-key="CustomerConsignees"
|
||||||
<div v-for="(item, index) in data" :key="index">
|
:url="`Clients/${route.params.id}/addresses`"
|
||||||
|
order="id"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #body="{ rows }">
|
||||||
|
<div v-for="(item, index) in rows" :key="index">
|
||||||
<div
|
<div
|
||||||
:class="{
|
:class="{
|
||||||
'consignees-card': true,
|
'consignees-card': true,
|
||||||
'q-mb-md': index + 1 === data.length ? false : true,
|
'q-mb-md': index + 1 === rows.length ? false : true,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div class="consignees-card-icon">
|
<div class="consignees-card-icon">
|
||||||
|
@ -89,20 +80,19 @@ const toCustomerConsigneeEdit = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<QPageSticky :offset="[18, 18]">
|
||||||
</QCardSection>
|
<QBtn
|
||||||
|
@click.stop="toCustomerConsigneeCreate()"
|
||||||
<QPageSticky :offset="[18, 18]">
|
color="primary"
|
||||||
<QBtn
|
fab
|
||||||
@click.stop="toCustomerConsigneeCreate()"
|
icon="add"
|
||||||
color="primary"
|
/>
|
||||||
fab
|
<QTooltip>
|
||||||
icon="add"
|
{{ t('New consignee') }}
|
||||||
/>
|
</QTooltip>
|
||||||
<QTooltip>
|
</QPageSticky>
|
||||||
{{ t('New consignee') }}
|
</template>
|
||||||
</QTooltip>
|
</VnPaginate>
|
||||||
</QPageSticky>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue