refs #6897 change image, fit component

This commit is contained in:
Carlos Satorres 2024-06-28 14:55:44 +02:00
parent 9fe5fd2391
commit e62e914e48
6 changed files with 105 additions and 20 deletions

View File

@ -39,7 +39,7 @@ const enterEvent = {
const defaultAttrs = {
filled: !$props.showTitle,
class: 'q-px-sm q-pb-xs q-pt-none',
class: 'q-px-sm q-pb-xs q-pt-none fit',
dense: true,
};
@ -80,7 +80,7 @@ const components = {
event: updateEvent,
attrs: {
dense: true,
class: $props.showTitle ? 'q-py-sm q-mt-md' : 'q-px-md q-py-xs',
class: $props.showTitle ? 'q-py-sm q-mt-md' : 'q-px-md q-py-xs fit',
'toggle-indeterminate': true,
},
forceAttrs,
@ -89,7 +89,7 @@ const components = {
component: markRaw(VnSelect),
event: updateEvent,
attrs: {
class: 'q-px-md q-pb-xs q-pt-none',
class: 'q-px-md q-pb-xs q-pt-none fit',
dense: true,
filled: !$props.showTitle,
},

View File

@ -54,7 +54,6 @@ function toValueAttrs(attrs) {
v-bind="mix(toComponent).attrs"
v-on="mix(toComponent).event ?? {}"
v-model="model"
class="fit"
/>
</span>
</template>

View File

@ -442,6 +442,8 @@ entry:
packagingFk: Package
packingOut: Package out
landing: Landing
isExcludedFromAvailable: Es inventory
isRaid: Raid
ticket:
pageTitles:
tickets: Tickets

View File

@ -441,6 +441,8 @@ entry:
packagingFk: Embalaje
packingOut: Embalaje envíos
landing: Llegada
isExcludedFromAvailable: Es inventario
isRaid: Redada
ticket:
pageTitles:
tickets: Tickets

View File

@ -12,6 +12,8 @@ const router = useRouter();
const stateStore = useStateStore();
const { t } = useI18n();
import { toDate } from 'src/filters';
import VnImg from 'src/components/ui/VnImg.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const rowsFetchDataRef = ref(null);
const editTableCellDialogRef = ref(null);
const allColumnNames = ref([]);
@ -73,10 +75,20 @@ const getInputEvents = (col) => {
};
};
const columns = computed(() => [
const columns = [
{
label: t('entry.latestBuys.tableVisibleColumns.picture'),
name: 'picture',
label: t('entry.latestBuys.tableVisibleColumns.image'),
name: 'image',
columnField: {
component: VnImg,
attrs: (id) => {
return {
id,
width: '50px',
}
},
},
columnFilter: false
},
{
align: 'left',
@ -229,7 +241,7 @@ const columns = computed(() => [
},
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landing))
},
]);
];
const editTableCellFormFieldsOptions = [
{ field: 'packing', label: t('entry.latestBuys.packing') },
@ -267,15 +279,16 @@ const applyColumnFilter = async (col) => {
onMounted(async () => {
stateStore.rightDrawer = true;
const filteredColumns = columns.value.filter((col) => col.name !== 'picture');
allColumnNames.value = filteredColumns.map((col) => col.name);
await arrayData.fetch({ append: false });
// const filteredColumns = columns.value.filter((col) => col.name !== 'picture');
// allColumnNames.value = filteredColumns.map((col) => col.name);
// await arrayData.fetch({ append: false });
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>
<VnSubToolbar/>
<VnTable
ref="tableRef"
data-key="LatestBuys"

View File

@ -7,31 +7,45 @@ import EntryFilter from './EntryFilter.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
import VnTable from 'components/VnTable/VnTable.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue';
import { toDate } from 'src/filters';
const stateStore = useStateStore();
const router = useRouter();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const route = useRoute();
const entityId = computed(() => route.params.id);
function navigate(id) {
router.push({ path: `/entry/${id}` });
}
const redirectToCreateView = () => {
router.push({ name: 'EntryCreate' });
const entryFilter = {
include: [
{
relation: 'supplier',
scope: {
fields: ['id', 'name'],
},
},
{
relation: 'travel',
scope: {
fields: ['id', 'ref'],
},
},
{
relation: 'company',
scope: {
fields: ['id', 'code'],
},
},
],
};
const columns = computed(() => [
{
align: 'left',
label: t('entry.list.tableVisibleColumns.id'),
name: 'id',
isTitle: true,
create: true,
cardVisible: true,
},
{
align: 'left',
@ -39,12 +53,14 @@ const columns = computed(() => [
name: 'reference',
isTitle: true,
create: true,
cardVisible: true,
},
{
align: 'left',
label: t('entry.list.tableVisibleColumns.created'),
name: 'created',
create: true,
cardVisible: true,
component: 'date',
columnField: {
component: null,
@ -56,6 +72,7 @@ const columns = computed(() => [
label: t('entry.list.tableVisibleColumns.supplierFk'),
name: 'supplierFk',
create: true,
cardVisible: true,
component: 'select',
attrs: {
url: 'suppliers',
@ -70,6 +87,7 @@ const columns = computed(() => [
align: 'left',
label: t('entry.list.tableVisibleColumns.isBooked'),
name: 'isBooked',
cardVisible: true,
create: true,
component: 'checkbox',
},
@ -77,6 +95,7 @@ const columns = computed(() => [
align: 'left',
label: t('entry.list.tableVisibleColumns.isConfirmed'),
name: 'isConfirmed',
cardVisible: true,
create: true,
component: 'checkbox',
},
@ -84,9 +103,58 @@ const columns = computed(() => [
align: 'left',
label: t('entry.list.tableVisibleColumns.isOrdered'),
name: 'isOrdered',
cardVisible: true,
create: true,
component: 'checkbox',
},
{
align: 'left',
label: t('entry.list.tableVisibleColumns.companyFk'),
name: 'companyFk',
component: 'select',
attrs: {
url: 'companies',
fields: ['id', 'code'],
},
create: true,
},
{
align: 'left',
label: t('entry.list.tableVisibleColumns.travelFk'),
name: 'travelFk',
component: 'select',
attrs: {
url: 'travels',
fields: ['id', 'ref'],
},
create: true,
},
{
align: 'left',
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
name: 'isExcludedFromAvailable',
chip: {
color: null,
condition: (value) => value,
icon: 'vn:inventory',
},
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('entry.list.tableVisibleColumns.isRaid'),
name: 'isRaid',
chip: {
color: null,
condition: (value) => value,
icon: 'vn:net',
},
columnFilter: {
inWhere: true,
},
},
]);
onMounted(async () => {
stateStore.rightDrawer = true;
@ -110,6 +178,7 @@ onMounted(async () => {
url="Entries/filter"
url-create="Entries"
save-url="Entries/crud"
:filter="entryFilter"
:create="{
urlCreate: 'Entries',
title: 'Create entry',