refactor: refs #7553 modified QDrawer and table columns
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jon Elias 2024-09-04 14:12:27 +02:00
parent 1889aa85b5
commit f5eacea483
1 changed files with 35 additions and 28 deletions

View File

@ -1,11 +1,10 @@
<script setup> <script setup>
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'; import { ref, computed, onUnmounted, watch, nextTick } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import FetchedTags from 'components/ui/FetchedTags.vue'; import FetchedTags from 'components/ui/FetchedTags.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
@ -42,28 +41,36 @@ const columns = computed(() => [
align: 'left', align: 'left',
label: t('volume.item'), label: t('volume.item'),
name: 'itemFk', name: 'itemFk',
chip: {
condition: () => true,
},
isId: true,
}, },
{ {
align: 'left', align: 'left',
label: t('volume.description'), label: t('volume.description'),
name: 'concept', name: 'concept',
columnClass: 'expand', columnClass: 'expand',
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('volume.packingType'), label: t('volume.packingType'),
name: 'itemPackingTypeFk', name: 'itemPackingTypeFk',
cardVisible: true,
format: (row, dashIfEmpty) => dashIfEmpty(row.item.itemPackingTypeFk), format: (row, dashIfEmpty) => dashIfEmpty(row.item.itemPackingTypeFk),
}, },
{ {
align: 'left', align: 'left',
label: t('volume.quantity'), label: t('volume.quantity'),
name: 'quantity', name: 'quantity',
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('volume.volumeQuantity'), label: t('volume.volumeQuantity'),
name: 'volume', name: 'volume',
cardVisible: true,
}, },
]); ]);
@ -86,10 +93,6 @@ const applyVolumes = async (salesData) => {
} }
}; };
onMounted(() => {
stateStore.rightDrawer = true;
});
onUnmounted(() => (stateStore.rightDrawer = false)); onUnmounted(() => (stateStore.rightDrawer = false));
</script> </script>
@ -101,8 +104,12 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@on-fetch="(data) => applyVolumes(data)" @on-fetch="(data) => applyVolumes(data)"
auto-load auto-load
/> />
<RightMenu v-if="packingTypeVolume.length"> <QDrawer
<template #right-panel> v-if="packingTypeVolume.length"
side="right"
:width="270"
v-model="stateStore.rightDrawer"
>
<QCard <QCard
v-for="(packingType, index) in packingTypeVolume" v-for="(packingType, index) in packingTypeVolume"
:key="index" :key="index"
@ -121,8 +128,8 @@ onUnmounted(() => (stateStore.rightDrawer = false));
<span> {{ t('volume.volume') }}: {{ packingType.volume }} </span> <span> {{ t('volume.volume') }}: {{ packingType.volume }} </span>
</QCardSection> </QCardSection>
</QCard> </QCard>
</template> </QDrawer>
</RightMenu>
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="TicketVolume" data-key="TicketVolume"