refactor: refs #8684 refs #8363 multiple refactor on item sections

This commit is contained in:
Pablo Natek 2025-04-24 13:24:46 +02:00
parent f01eb6c49c
commit 2cbbd92021
17 changed files with 169 additions and 221 deletions

View File

@ -162,7 +162,6 @@ async function fetch() {
align-items: start; align-items: start;
.label { .label {
color: var(--vn-label-color); color: var(--vn-label-color);
width: 9em;
overflow: hidden; overflow: hidden;
white-space: wrap; white-space: wrap;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -247,10 +247,6 @@ const toModule = computed(() => {
.label { .label {
color: var(--vn-label-color); color: var(--vn-label-color);
font-size: 14px; font-size: 14px;
&:not(:has(a))::after {
content: ':';
}
} }
.value { .value {
color: var(--vn-text-color); color: var(--vn-text-color);

View File

@ -63,7 +63,6 @@ defineExpose({
spinner-color="primary" spinner-color="primary"
:error-src="`/no_image${getDarkSuffix()}.png`" :error-src="`/no_image${getDarkSuffix()}.png`"
/> />
{{ console.log(getDarkSuffix()) }}
<QDialog v-if="$props.zoom" v-model="show"> <QDialog v-if="$props.zoom" v-model="show">
<QImg <QImg
:draggable="true" :draggable="true"

View File

@ -40,10 +40,10 @@ const val = computed(() => $props.value);
<template v-else> <template v-else>
<div v-if="label || $slots.label" class="label"> <div v-if="label || $slots.label" class="label">
<slot name="label"> <slot name="label">
<span style="color: var(--vn-label-color)">{{ label }}</span> <span style="color: var(--vn-label-color)">{{ label }}:</span>
</slot> </slot>
</div> </div>
<div class="value" v-if="value || $slots.value"> <div class="value">
<slot name="value"> <slot name="value">
<span :title="value" style="text-overflow: ellipsis"> <span :title="value" style="text-overflow: ellipsis">
{{ dash ? dashIfEmpty(value) : value }} {{ dash ? dashIfEmpty(value) : value }}
@ -71,21 +71,13 @@ const val = computed(() => $props.value);
visibility: visible; visibility: visible;
cursor: pointer; cursor: pointer;
} }
.label,
.value {
white-space: pre-line;
word-wrap: break-word;
}
.copy { .copy {
visibility: hidden; visibility: hidden;
} }
.info { .info {
margin-left: 5px; margin-left: 5px;
} }
} }
:deep(.q-checkbox.disabled) { :deep(.q-checkbox.disabled) {
opacity: 1 !important; opacity: 1 !important;
} }

View File

@ -498,26 +498,6 @@ entry:
isRaid: Raid isRaid: Raid
invoiceNumber: Invoice invoiceNumber: Invoice
reference: Ref/Alb/Guide reference: Ref/Alb/Guide
params:
isExcludedFromAvailable: Excluir del inventario
isOrdered: Pedida
isConfirmed: Lista para etiquetar
isReceived: Recibida
isRaid: Redada
landed: Fecha
supplierFk: Proveedor
invoiceNumber: Nº Factura
reference: Ref/Alb/Guía
agencyModeId: Agencia
isBooked: Asentado
companyFk: Empresa
travelFk: Envio
evaNotes: Notas
warehouseOutFk: Origen
warehouseInFk: Destino
entryTypeDescription: Tipo entrada
invoiceAmount: Importe
dated: Fecha
ticket: ticket:
params: params:
ticketFk: Ticket ID ticketFk: Ticket ID

View File

@ -230,7 +230,7 @@ const onIntrastatCreated = (response, formData) => {
/> />
<VnInput <VnInput
type="textarea" type="textarea"
:label="t('globals.comment')" :label="t('item.basicData.photoMotivation')"
v-model="data.photoMotivation" v-model="data.photoMotivation"
fill-input fill-input
/> />

View File

@ -102,20 +102,21 @@ const columns = computed(() => [
label: t('itemDiary.in'), label: t('itemDiary.in'),
field: 'invalue', field: 'invalue',
name: 'in', name: 'in',
align: 'left', align: 'right',
format: (val) => dashIfEmpty(val), format: (val) => dashIfEmpty(val),
}, },
{ {
label: t('itemDiary.out'), label: t('itemDiary.out'),
field: 'out', field: 'out',
name: 'out', name: 'out',
align: 'left', align: 'right',
format: (val) => dashIfEmpty(val), format: (val) => dashIfEmpty(val),
}, },
{ {
label: t('itemDiary.balance'), label: t('itemDiary.balance'),
name: 'balance', name: 'balance',
align: 'left', align: 'right',
class: 'q-px-sm',
}, },
]); ]);
@ -217,7 +218,8 @@ async function updateWarehouse(warehouseFk) {
<QTable <QTable
:rows="itemBalances" :rows="itemBalances"
:columns="columns" :columns="columns"
class="full-width q-mt-md" class="full-width q-mt-md q-px-md"
style="background-color: var(--vn-section-color)"
:no-data-label="t('globals.noResults')" :no-data-label="t('globals.noResults')"
> >
<template #body-cell-claim="{ row }"> <template #body-cell-claim="{ row }">
@ -294,14 +296,14 @@ async function updateWarehouse(warehouseFk) {
</QTd> </QTd>
</template> </template>
<template #body-cell-in="{ row }"> <template #body-cell-in="{ row }">
<QTd @click.stop> <QTd @click.stop class="text-right">
<span :class="{ 'is-in': row.invalue }"> <span :class="{ 'is-in': row.invalue }">
{{ dashIfEmpty(row.invalue) }} {{ dashIfEmpty(row.invalue) }}
</span> </span>
</QTd> </QTd>
</template> </template>
<template #body-cell-balance="{ row }"> <template #body-cell-balance="{ row }">
<QTd @click.stop> <QTd @click.stop class="text-right">
<QBadge <QBadge
class="balance-negative" class="balance-negative"
:color=" :color="

View File

@ -48,7 +48,7 @@ const columns = computed(() => [
label: t('itemDiary.warehouse'), label: t('itemDiary.warehouse'),
name: 'warehouse', name: 'warehouse',
field: 'warehouse', field: 'warehouse',
align: 'center', align: 'left',
}, },
{ {
label: t('lastEntries.landed'), label: t('lastEntries.landed'),
@ -60,7 +60,7 @@ const columns = computed(() => [
label: t('lastEntries.entry'), label: t('lastEntries.entry'),
name: 'entry', name: 'entry',
field: 'stateName', field: 'stateName',
align: 'center', align: 'right',
format: (val) => dashIfEmpty(val), format: (val) => dashIfEmpty(val),
}, },
{ {
@ -75,14 +75,14 @@ const columns = computed(() => [
label: t('lastEntries.printedStickers'), label: t('lastEntries.printedStickers'),
name: 'printedStickers', name: 'printedStickers',
field: 'printedStickers', field: 'printedStickers',
align: 'center', align: 'right',
format: (val) => dashIfEmpty(val), format: (val) => dashIfEmpty(val),
}, },
{ {
label: t('lastEntries.label'), label: t('lastEntries.label'),
name: 'stickers', name: 'stickers',
field: 'stickers', field: 'stickers',
align: 'center', align: 'right',
format: (val) => dashIfEmpty(val), format: (val) => dashIfEmpty(val),
style: (row) => highlightedRow(row), style: (row) => highlightedRow(row),
}, },
@ -90,39 +90,39 @@ const columns = computed(() => [
label: 'Packing', label: 'Packing',
name: 'packing', name: 'packing',
field: 'packing', field: 'packing',
align: 'center', align: 'right',
}, },
{ {
label: t('lastEntries.grouping'), label: t('lastEntries.grouping'),
name: 'grouping', name: 'grouping',
field: 'grouping', field: 'grouping',
align: 'center', align: 'right',
}, },
{ {
label: t('itemBasicData.stems'), label: t('itemBasicData.stems'),
name: 'stems', name: 'stems',
field: 'stems', field: 'stems',
align: 'center', align: 'right',
style: (row) => highlightedRow(row), style: (row) => highlightedRow(row),
}, },
{ {
label: t('lastEntries.quantity'), label: t('lastEntries.quantity'),
name: 'quantity', name: 'quantity',
field: 'quantity', field: 'quantity',
align: 'center', align: 'right',
style: (row) => highlightedRow(row), style: (row) => highlightedRow(row),
}, },
{ {
label: t('lastEntries.cost'), label: t('lastEntries.cost'),
name: 'cost', name: 'cost',
field: 'cost', field: 'right',
align: 'center', align: 'right',
}, },
{ {
label: 'Kg', label: 'Kg',
name: 'weight', name: 'weight',
field: 'weight', field: 'weight',
align: 'center', align: 'right',
style: (row) => highlightedRow(row), style: (row) => highlightedRow(row),
}, },
{ {
@ -136,7 +136,7 @@ const columns = computed(() => [
label: t('lastEntries.supplier'), label: t('lastEntries.supplier'),
name: 'supplier', name: 'supplier',
field: 'supplier', field: 'supplier',
align: 'center', align: 'left',
}, },
]); ]);
@ -269,7 +269,7 @@ function highlightedRow(row) {
</template> </template>
<template #body-cell-entry="{ row }"> <template #body-cell-entry="{ row }">
<QTd @click.stop :style="highlightedRow(row)"> <QTd @click.stop :style="highlightedRow(row)">
<div class="full-width flex justify-center"> <div class="full-width text-right">
<EntryDescriptorProxy :id="row.entryFk" class="q-ma-none" dense /> <EntryDescriptorProxy :id="row.entryFk" class="q-ma-none" dense />
<span class="link">{{ row.entryFk }}</span> <span class="link">{{ row.entryFk }}</span>
</div> </div>
@ -282,16 +282,16 @@ function highlightedRow(row) {
</QTd> </QTd>
</template> </template>
<template #body-cell-printedStickers="{ row }"> <template #body-cell-printedStickers="{ row }">
<QTd @click.stop class="text-center" :style="highlightedRow(row)"> <QTd @click.stop class="text-right" :style="highlightedRow(row)">
<span style="color: var(--vn-label-color)"> <span style="color: var(--vn-label-color)">
{{ row.printedStickers }}</span {{ row.printedStickers }}</span
> >
</QTd> </QTd>
</template> </template>
<template #body-cell-packing="{ row }"> <template #body-cell-packing="{ row }">
<QTd @click.stop :style="highlightedRow(row)"> <QTd @click.stop :style="highlightedRow(row)" class="text-right">
<QBadge <QBadge
class="center-content" class="grouping-badge"
:class="getBadgeClass(row.groupingMode, 'packing')" :class="getBadgeClass(row.groupingMode, 'packing')"
rounded rounded
> >
@ -301,9 +301,9 @@ function highlightedRow(row) {
</QTd> </QTd>
</template> </template>
<template #body-cell-grouping="{ row }"> <template #body-cell-grouping="{ row }">
<QTd @click.stop :style="highlightedRow(row)"> <QTd @click.stop :style="highlightedRow(row)" class="text-right">
<QBadge <QBadge
class="center-content" class="grouping-badge"
:class="getBadgeClass(row.groupingMode, 'grouping')" :class="getBadgeClass(row.groupingMode, 'grouping')"
rounded rounded
> >
@ -313,7 +313,7 @@ function highlightedRow(row) {
</QTd> </QTd>
</template> </template>
<template #body-cell-cost="{ row }"> <template #body-cell-cost="{ row }">
<QTd @click.stop class="text-center" :style="highlightedRow(row)"> <QTd @click.stop class="text-right" :style="highlightedRow(row)">
<span> <span>
{{ toCurrency(row.cost, 'EUR', 3) }} {{ toCurrency(row.cost, 'EUR', 3) }}
<QTooltip> <QTooltip>
@ -357,10 +357,7 @@ function highlightedRow(row) {
.q-badge--rounded { .q-badge--rounded {
border-radius: 50%; border-radius: 50%;
} }
.center-content { .grouping-badge {
display: flex;
max-width: max-content;
margin: auto;
padding: 0 11px; padding: 0 11px;
height: 28px; height: 28px;
} }

View File

@ -58,7 +58,7 @@ const columns = computed(() => [
{ {
label: t('shelvings.item'), label: t('shelvings.item'),
name: 'itemFk', name: 'itemFk',
align: 'left', align: 'right',
columnFilter: false, columnFilter: false,
}, },
{ {
@ -102,19 +102,20 @@ const columns = computed(() => [
name: 'label', name: 'label',
align: 'left', align: 'left',
columnFilter: { inWhere: true }, columnFilter: { inWhere: true },
component: 'number',
format: (row) => (row.stock / row.packing).toFixed(2), format: (row) => (row.stock / row.packing).toFixed(2),
}, },
{ {
label: t('shelvings.packing'), label: t('shelvings.packing'),
name: 'packing', name: 'packing',
attrs: { inWhere: true }, attrs: { inWhere: true },
align: 'left', component: 'number',
}, },
{ {
label: t('globals.visible'), label: t('globals.visible'),
name: 'stock', name: 'stock',
attrs: { inWhere: true }, attrs: { inWhere: true },
align: 'left', component: 'number',
}, },
]); ]);
@ -138,21 +139,12 @@ watchEffect(selectedRows);
<template> <template>
<template v-if="stateStore.isHeaderMounted()"> <template v-if="stateStore.isHeaderMounted()">
<Teleport to="#st-data"> <Teleport to="#st-data">
<div class="q-pa-md q-mr-lg q-ma-xs" style="border: 2px solid #222"> <QCardSection class="column items-center" horizontal>
<QCardSection horizontal> <div>
<span class="text-weight-bold text-subtitle1 text-center full-width"> <span class="details-label">{{ t('shelvings.totalLabels') }} </span>
{{ t('shelvings.total') }} <span>: {{ totalLabels }}</span>
</span> </div>
</QCardSection> </QCardSection>
<QCardSection class="column items-center" horizontal>
<div>
<span class="details-label"
>{{ t('shelvings.totalLabels') }}
</span>
<span>: {{ totalLabels }}</span>
</div></QCardSection
>
</div>
</Teleport> </Teleport>
<Teleport to="#st-actions"> <Teleport to="#st-actions">
<QBtn <QBtn

View File

@ -2,6 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { dashIfEmpty } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
@ -48,7 +49,7 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
<ItemDescriptorMenu :entity-id="entityId" :warehouse-fk="warehouseFk" /> <ItemDescriptorMenu :entity-id="entityId" :warehouse-fk="warehouseFk" />
</template> </template>
<template #body="{ entity: { item, tags, visible, available, botanical } }"> <template #body="{ entity: { item, tags, visible, available, botanical } }">
<QCard class="vn-one photo"> <QCard class="vn-one photo" v-if="$route.name != 'ItemSummary'">
<ItemDescriptorImage <ItemDescriptorImage
:entity-id="entityId" :entity-id="entityId"
:visible="visible" :visible="visible"
@ -56,84 +57,108 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
:show-edit-button="false" :show-edit-button="false"
/> />
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-three">
<VnTitle <VnTitle
:url="getUrl(entityId, 'basic-data')" :url="getUrl(entityId, 'basic-data')"
:text="t('globals.summary.basicData')" :text="t('globals.summary.basicData')"
/> />
<VnLv :label="t('globals.name')" :value="item.name" /> <div class="vn-card-group">
<VnLv :label="t('item.summary.completeName')" :value="item.longName" /> <div class="vn-card-content">
<VnLv :label="t('item.summary.family')" :value="item.itemType.name" /> <VnLv :label="t('globals.name')" :value="item.name" />
<VnLv :label="t('globals.size')" :value="item.size" /> <VnLv
<VnLv :label="t('globals.origin')" :value="item.origin.name" /> :label="t('item.summary.completeName')"
<VnLv :label="t('item.summary.stems')" :value="item.stems" /> :value="item.longName"
<VnLv />
:label="t('item.summary.multiplier')" <VnLv
:value="item.stemMultiplier" :label="t('item.summary.family')"
/> :value="item.itemType.name"
/>
<VnLv :label="t('globals.size')" :value="item.size" />
<VnLv :label="t('globals.origin')" :value="item.origin.name" />
<VnLv :label="t('item.summary.stems')" :value="item.stems" />
<VnLv
:label="t('item.summary.multiplier')"
:value="item.stemMultiplier"
/>
<VnLv :label="t('item.summary.buyer')"> <VnLv :label="t('item.summary.buyer')">
<template #value> <template #value>
<VnUserLink <VnUserLink
:name="item.itemType.worker.user.name" :name="item.itemType.worker.user.name"
:worker-id="item.itemType.worker.id" :worker-id="item.itemType.worker.id"
/>
</template>
</VnLv>
<VnLv :info="t('Este artículo necesita una foto')">
<template #value>
<QCheckbox
:label="t('item.summary.doPhoto')"
v-model="item.isPhotoRequested"
:disable="true"
size="xs"
/>
</template>
</VnLv>
<VnLv :label="t('globals.description')">
<template #value>
<span
style="
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
"
v-text="dashIfEmpty(item.description)"
/>
</template>
</VnLv>
</div>
<div class="vn-card-content">
<VnLv
:label="t('item.summary.intrastatCode')"
:value="item.intrastat.id"
/> />
</template> <VnLv
</VnLv> :label="t('globals.intrastat')"
<VnLv :info="t('Este artículo necesita una foto')"> :value="item.intrastat.description"
<template #value>
<QCheckbox
:label="t('item.summary.doPhoto')"
v-model="item.isPhotoRequested"
:disable="true"
/> />
</template> <VnLv :label="t('item.summary.ref')" :value="item.comment" />
</VnLv> <VnLv
</QCard> :label="t('item.summary.relevance')"
<QCard class="vn-one"> :value="item.relevancy"
<VnTitle />
:url="getUrl(entityId, 'basic-data')" <VnLv
:text="t('item.summary.otherData')" :label="t('item.summary.weight')"
/> :value="item.weightByPiece"
<VnLv />
:label="t('item.summary.intrastatCode')" <VnLv :label="t('item.summary.units')" :value="item.packingOut" />
:value="item.intrastat.id" <VnLv
/> :label="t('item.summary.expense')"
<VnLv :value="item.expense.name"
:label="t('globals.intrastat')" />
:value="item.intrastat.description" <VnLv
/> :label="t('item.summary.generic')"
<VnLv :label="t('item.summary.ref')" :value="item.comment" /> :value="item.genericFk"
<VnLv :label="t('item.summary.relevance')" :value="item.relevancy" /> />
<VnLv :label="t('item.summary.weight')" :value="item.weightByPiece" /> <VnLv
<VnLv :label="t('item.summary.units')" :value="item.packingOut" /> :label="t('item.summary.recycledPlastic')"
<VnLv :label="t('item.summary.expense')" :value="item.expense.name" /> :value="item.recycledPlastic"
<VnLv :label="t('item.summary.generic')" :value="item.genericFk" /> />
<VnLv <VnLv
:label="t('item.summary.recycledPlastic')" :label="t('item.summary.nonRecycledPlastic')"
:value="item.recycledPlastic" :value="item.nonRecycledPlastic"
/> />
<VnLv </div>
:label="t('item.summary.nonRecycledPlastic')" </div>
:value="item.nonRecycledPlastic"
/>
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle :url="getUrl(entityId, 'tags')" :text="t('globals.tags')" /> <VnTitle :url="getUrl(entityId, 'tags')" :text="t('globals.tags')" />
<VnLv <VnLv
v-for="(tag, index) in tags" v-for="(tag, index) in tags"
:key="index" :key="index"
:label="`${tag.priority} ${tag.tag.name}:`" :label="`${tag.priority} ${tag.tag.name}`"
:value="tag.value" :value="tag.value"
/> />
</QCard> </QCard>
<QCard class="vn-one" v-if="item.description">
<VnTitle
:url="getUrl(entityId, 'basic-data')"
:text="t('globals.description')"
/>
<p v-text="item.description" />
</QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle :url="getUrl(entityId, 'tax')" :text="t('item.summary.tax')" /> <VnTitle :url="getUrl(entityId, 'tax')" :text="t('item.summary.tax')" />
<VnLv <VnLv

View File

@ -76,15 +76,7 @@ const insertTag = (rows) => {
model="ItemTags" model="ItemTags"
url="ItemTags" url="ItemTags"
:data-required="{ :data-required="{
$index: undefined,
itemFk: route.params.id, itemFk: route.params.id,
priority: undefined,
tag: {
isFree: undefined,
value: undefined,
name: undefined,
},
tagFk: undefined,
}" }"
:default-remove="false" :default-remove="false"
:user-filter="{ :user-filter="{
@ -106,7 +98,7 @@ const insertTag = (rows) => {
<VnRow <VnRow
v-for="(row, index) in rows" v-for="(row, index) in rows"
:key="index" :key="index"
class="items-center" class="items-center q-py-sm"
> >
<VnSelect <VnSelect
:label="t('itemTags.tag')" :label="t('itemTags.tag')"
@ -132,9 +124,7 @@ const insertTag = (rows) => {
emit-value emit-value
use-input use-input
class="col" class="col"
:is-clearable="false"
:required="false" :required="false"
:rules="validate('itemTag.tagFk')"
:use-like="false" :use-like="false"
sort-by="value" sort-by="value"
/> />
@ -145,7 +135,6 @@ const insertTag = (rows) => {
v-model="row.value" v-model="row.value"
:label="t('itemTags.value')" :label="t('itemTags.value')"
:is-clearable="false" :is-clearable="false"
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
:data-cy="`tag${row?.tag?.name}Value`" :data-cy="`tag${row?.tag?.name}Value`"
/> />
<VnInput <VnInput
@ -154,7 +143,7 @@ const insertTag = (rows) => {
v-model="row.priority" v-model="row.priority"
:required="true" :required="true"
:rules="validate('itemTag.priority')" :rules="validate('itemTag.priority')"
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)" style="max-width: 60%"
/> />
<div class="row justify-center" style="flex: 0"> <div class="row justify-center" style="flex: 0">
<QIcon <QIcon
@ -181,11 +170,8 @@ const insertTag = (rows) => {
v-shortcut="'+'" v-shortcut="'+'"
fab fab
data-cy="createNewTag" data-cy="createNewTag"
> :title="t('globals.add')"
<QTooltip> />
{{ t('itemTags.addTag') }}
</QTooltip>
</QBtn>
</QPageSticky> </QPageSticky>
</template> </template>
</CrudModel> </CrudModel>

View File

@ -64,27 +64,29 @@ const submitTaxes = async (data) => {
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard class="q-px-lg q-py-md"> <div style="display: flex; justify-content: center">
<VnRow <QCard class="q-px-lg q-py-md">
v-for="(row, index) in rows" <VnRow
:key="index" v-for="(row, index) in rows"
class="row q-gutter-md q-mb-md" :key="index"
> class="row q-gutter-md q-mb-md"
<VnInput >
:label="t('tax.country')" <VnInput
v-model="row.country.name" :label="t('tax.country')"
disable v-model="row.country.name"
/> disable
<VnSelect />
:label="t('tax.class')" <VnSelect
v-model="row.taxClassFk" :label="t('tax.class')"
:options="taxesOptions" v-model="row.taxClassFk"
option-label="description" :options="taxesOptions"
option-value="id" option-label="description"
hide-selected option-value="id"
/> hide-selected
</VnRow> />
</QCard> </VnRow>
</QCard>
</div>
</template> </template>
</CrudModel> </CrudModel>
</template> </template>

View File

@ -1,7 +1,6 @@
<script setup> <script setup>
import { ref, computed, onBeforeMount } from 'vue'; import { ref, computed, onBeforeMount } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnImg from 'src/components/ui/VnImg.vue'; import VnImg from 'src/components/ui/VnImg.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
@ -18,17 +17,13 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import axios from 'axios'; import axios from 'axios';
import VnSection from 'src/components/common/VnSection.vue'; import VnSection from 'src/components/common/VnSection.vue';
const entityId = computed(() => route.params.id);
const { openCloneDialog } = cloneItem(); const { openCloneDialog } = cloneItem();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const { t } = useI18n(); const { t } = useI18n();
const tableRef = ref(); const tableRef = ref();
const route = useRoute();
const dataKey = 'ItemList'; const dataKey = 'ItemList';
const validPriorities = ref([]); const validPriorities = ref([]);
const defaultTag = ref(); const defaultItem = ref(null);
const defaultPriority = ref();
const defaultItem = ref();
const itemFilter = { const itemFilter = {
include: [ include: [
@ -305,9 +300,7 @@ const columns = computed(() => [
onBeforeMount(async () => { onBeforeMount(async () => {
const { data } = await axios.get('ItemConfigs/findOne'); const { data } = await axios.get('ItemConfigs/findOne');
defaultItem.value = data; defaultItem.value = data;
console.log('defaultItem.value: ', defaultItem.value);
}); });
const dafaultComputed = computed(() => defaultItem.value);
</script> </script>
<template> <template>
<VnSection <VnSection
@ -325,6 +318,7 @@ const dafaultComputed = computed(() => defaultItem.value);
</template> </template>
<template #body> <template #body>
<VnTable <VnTable
v-if="defaultItem"
:data-key="dataKey" :data-key="dataKey"
ref="tableRef" ref="tableRef"
search-url="ItemList" search-url="ItemList"
@ -335,8 +329,8 @@ const dafaultComputed = computed(() => defaultItem.value);
title: t('item.list.newItem'), title: t('item.list.newItem'),
onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`), onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`),
formInitialData: { formInitialData: {
tag: 1, tag: defaultItem?.defaultTag,
priority: 1, priority: defaultItem?.defaultPriority,
}, },
}" }"
:columns="columns" :columns="columns"
@ -380,7 +374,6 @@ const dafaultComputed = computed(() => defaultItem.value);
</span> </span>
</template> </template>
<template #more-create-dialog="{ data }"> <template #more-create-dialog="{ data }">
{{ data }}
<VnInput <VnInput
v-model="data.provisionalName" v-model="data.provisionalName"
:label="t('Provisional name')" :label="t('Provisional name')"
@ -388,7 +381,7 @@ const dafaultComputed = computed(() => defaultItem.value);
/> />
<VnSelect <VnSelect
url="Tags" url="Tags"
v-model="data.defaultTag" v-model="data.tag"
:label="t('globals.tag')" :label="t('globals.tag')"
:fields="['id', 'name']" :fields="['id', 'name']"
option-label="name" option-label="name"
@ -487,8 +480,5 @@ const dafaultComputed = computed(() => defaultItem.value);
</style> </style>
<i18n> <i18n>
es: es:
New item: Nuevo artículo
Create Item: Crear artículo
You can search by id: Puedes buscar por id
Provisional name: Nombre provisional Provisional name: Nombre provisional
</i18n> </i18n>

View File

@ -7,7 +7,7 @@ import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import { useValidator } from 'src/composables/useValidator'; import { useValidator } from 'src/composables/useValidator';
import axios from 'axios'; import axios from 'axios';

View File

@ -99,9 +99,6 @@ item:
concept: Concept concept: Concept
denyOptions: Deny denyOptions: Deny
scopeDays: Scope days scopeDays: Scope days
searchbar:
label: Search item
info: You can search by id
descriptor: descriptor:
item: Item item: Item
buyer: Buyer buyer: Buyer
@ -158,6 +155,7 @@ item:
isPhotoRequestedTooltip: This item does need a photo isPhotoRequestedTooltip: This item does need a photo
isCustomInspectionRequired: Needs physical inspection (PIF) isCustomInspectionRequired: Needs physical inspection (PIF)
description: Description description: Description
fotoMotivation: Comment for the photographer
fixedPrice: fixedPrice:
itemFk: Item ID itemFk: Item ID
groupingPrice: Grouping price groupingPrice: Grouping price
@ -216,7 +214,7 @@ item:
genus: Genus genus: Genus
specie: Specie specie: Specie
search: 'Search item' search: 'Search item'
searchInfo: 'You can search by id' searchInfo: 'You can search by id or barcode'
regularizeStock: Regularize stock regularizeStock: Regularize stock
itemProposal: Items proposal itemProposal: Items proposal
proposal: proposal:

View File

@ -148,15 +148,16 @@ item:
weightByPiece: Peso (gramos)/tallo weightByPiece: Peso (gramos)/tallo
boxUnits: Unidades/caja boxUnits: Unidades/caja
recycledPlastic: Plastico reciclado recycledPlastic: Plastico reciclado
nonRecycledPlastic: Plático no reciclado nonRecycledPlastic: Plástico no reciclado
isActive: Activo isActive: Activo
hasKgPrice: Precio en kg hasKgPrice: Precio en kg
isFragile: Frágil isFragile: Frágil
isFragileTooltip: Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...) isFragileTooltip: Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...)
isPhotoRequested: Hacer foto isPhotoRequested: Hacer foto
isPhotoRequestedTooltip: Este artículo necesita una foto isPhotoRequestedTooltip: Este artículo necesita una foto
isCustomInspectionRequired: Necesita inspección física (PIF) isCustomInspectionRequired: Necesita insp. física (PIF)
description: Descripción description: Descripción
photoMotivation: Comentario para el fotógrafo
fixedPrice: fixedPrice:
itemFk: ID Artículo itemFk: ID Artículo
groupingPrice: Precio grouping groupingPrice: Precio grouping
@ -203,6 +204,8 @@ item:
minSalesQuantity: Cantidad mínima de venta minSalesQuantity: Cantidad mínima de venta
genus: Genus genus: Genus
specie: Specie specie: Specie
search: 'Buscar artículo'
searchInfo: 'Puedes buscar por id de artículo o código de barras'
regularizeStock: Regularizar stock regularizeStock: Regularizar stock
buyRequest: buyRequest:
ticketId: 'ID Ticket' ticketId: 'ID Ticket'

View File

@ -203,19 +203,6 @@ export default {
}, },
component: () => import('src/pages/Item/ItemRequest.vue'), component: () => import('src/pages/Item/ItemRequest.vue'),
}, },
{
path: 'waste-breakdown',
name: 'WasteBreakdown',
meta: {
title: 'wasteBreakdown',
icon: 'vn:claims',
},
beforeEnter: (to, from, next) => {
next({ name: 'ItemList' });
window.location.href =
'https://grafana.verdnatura.es/d/TTNXQAxVk';
},
},
{ {
path: 'fixed-price', path: 'fixed-price',
name: 'ItemFixedPrice', name: 'ItemFixedPrice',