7383-testToMaster #370
|
@ -199,8 +199,9 @@ es:
|
|||
templates:
|
||||
pendingPayment: 'Su pedido está pendiente de pago.
|
||||
Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias.'
|
||||
minAmount: 'Es necesario un importe mínimo de 50€ (Sin IVA) en su pedido
|
||||
{ orderId } con llegada { landing } para recibirlo sin portes adicionales.'
|
||||
minAmount: 'Te recordamos que tu pedido {orderId} es inferior a 50€.
|
||||
Te recomendamos amplíes para no generar costes extra, provocarán un incremento de tu tarifa.
|
||||
¡Un saludo!'
|
||||
orderChanges: 'Pedido {orderId} con llegada estimada día { landing }: { changes }'
|
||||
en: Inglés
|
||||
es: Español
|
||||
|
|
|
@ -108,6 +108,7 @@ async function search() {
|
|||
let targetUrl;
|
||||
|
||||
if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`);
|
||||
if (path.endsWith('-list')) targetUrl = path.replace('-list', `/${targetId}/summary`);
|
||||
else if (path.includes(':id')) targetUrl = path.replace(':id', targetId);
|
||||
|
||||
await router.push({ path: targetUrl });
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<script setup>
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const $props = defineProps({
|
||||
|
|
|
@ -1221,23 +1221,11 @@ item:
|
|||
minSalesQuantity: 'Cantidad mínima de venta'
|
||||
genus: 'Genus'
|
||||
specie: 'Specie'
|
||||
itemType:
|
||||
item/itemType:
|
||||
pageTitles:
|
||||
itemType: Item type
|
||||
basicData: Basic data
|
||||
summary: Summary
|
||||
shared:
|
||||
code: Code
|
||||
name: Name
|
||||
worker: Worker
|
||||
category: Category
|
||||
temperature: Temperature
|
||||
summary:
|
||||
id: id
|
||||
life: Life
|
||||
promo: Promo
|
||||
itemPackingType: Item packing type
|
||||
isUnconventionalSize: Is unconventional size
|
||||
components:
|
||||
topbar: {}
|
||||
itemsFilterPanel:
|
||||
|
|
|
@ -1220,28 +1220,11 @@ item:
|
|||
achieved: 'Conseguido'
|
||||
concept: 'Concepto'
|
||||
state: 'Estado'
|
||||
itemType:
|
||||
item/itemType:
|
||||
pageTitles:
|
||||
itemType: Familia
|
||||
basicData: Datos básicos
|
||||
summary: Resumen
|
||||
shared:
|
||||
code: Código
|
||||
name: Nombre
|
||||
worker: Trabajador
|
||||
category: Reino
|
||||
temperature: Temperatura
|
||||
summary:
|
||||
id: id
|
||||
code: Código
|
||||
name: Nombre
|
||||
worker: Trabajador
|
||||
category: Reino
|
||||
temperature: Temperatura
|
||||
life: Vida
|
||||
promo: Promoción
|
||||
itemPackingType: Tipo de embalaje
|
||||
isUnconventionalSize: Es de tamaño poco convencional
|
||||
components:
|
||||
topbar: {}
|
||||
itemsFilterPanel:
|
||||
|
|
|
@ -41,6 +41,7 @@ const workers = ref([]);
|
|||
const workersCopy = ref([]);
|
||||
const claimStates = ref([]);
|
||||
const claimStatesCopy = ref([]);
|
||||
const optionsList = ref([]);
|
||||
|
||||
function setWorkers(data) {
|
||||
workers.value = data;
|
||||
|
@ -51,9 +52,9 @@ function setClaimStates(data) {
|
|||
claimStates.value = data;
|
||||
claimStatesCopy.value = data;
|
||||
}
|
||||
let optionsList;
|
||||
|
||||
async function getEnumValues() {
|
||||
optionsList = [{ id: null, description: t('claim.basicData.null') }];
|
||||
optionsList.value = [{ id: null, description: t('claim.basicData.null') }];
|
||||
const { data } = await axios.get(`Applications/get-enum-values`, {
|
||||
params: {
|
||||
schema: 'vn',
|
||||
|
@ -62,8 +63,9 @@ async function getEnumValues() {
|
|||
},
|
||||
});
|
||||
for (let value of data)
|
||||
optionsList.push({ id: value, description: t(`claim.basicData.${value}`) });
|
||||
optionsList.value.push({ id: value, description: t(`claim.basicData.${value}`) });
|
||||
}
|
||||
|
||||
getEnumValues();
|
||||
|
||||
const workerFilter = {
|
||||
|
|
|
@ -149,6 +149,15 @@ const states = ref();
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
v-model="params.myTeam"
|
||||
:label="t('myTeam')"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<!-- <QItem>
|
||||
|
@ -192,6 +201,7 @@ en:
|
|||
claimResponsibleFk: Responsible
|
||||
claimStateFk: State
|
||||
created: Created
|
||||
myTeam: My team
|
||||
es:
|
||||
params:
|
||||
search: Contiene
|
||||
|
@ -211,4 +221,5 @@ es:
|
|||
Item: Artículo
|
||||
Created: Creada
|
||||
More options: Más opciones
|
||||
myTeam: Mi equipo
|
||||
</i18n>
|
||||
|
|
|
@ -180,10 +180,13 @@ function handleLocation(data, location) {
|
|||
:rules="validate('Worker.postcode')"
|
||||
:roles-allowed-to-create="['deliveryAssistant']"
|
||||
:options="postcodesOptions"
|
||||
v-model="data.location"
|
||||
v-model="data.postalCode"
|
||||
@update:model-value="(location) => handleLocation(data, location)"
|
||||
></VnLocation>
|
||||
</div>
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<div class="col">
|
||||
<VnSelect
|
||||
:label="t('Agency')"
|
||||
|
@ -202,7 +205,6 @@ function handleLocation(data, location) {
|
|||
<VnInput :label="t('Mobile')" clearable v-model="data.mobile" />
|
||||
</div>
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<div class="col">
|
||||
<VnSelect
|
||||
|
@ -229,7 +231,6 @@ function handleLocation(data, location) {
|
|||
</VnSelectDialog>
|
||||
</div>
|
||||
</VnRow>
|
||||
|
||||
<h4 class="q-mb-xs">{{ t('Notes') }}</h4>
|
||||
<VnRow
|
||||
:key="index"
|
||||
|
|
|
@ -1 +1,94 @@
|
|||
<template>Item barcode</template>
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import CrudModel from 'src/components/CrudModel.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
||||
const itemBarcodeRef = ref(null);
|
||||
|
||||
const insertRow = () => {
|
||||
itemBarcodeRef.value.insert();
|
||||
focusLastInput();
|
||||
};
|
||||
|
||||
const focusLastInput = () => {
|
||||
nextTick(() => {
|
||||
const inputs = document.querySelectorAll('[focusable-input]');
|
||||
const lastInput = inputs[inputs.length - 1];
|
||||
if (lastInput) lastInput.focus();
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
if (itemBarcodeRef.value) itemBarcodeRef.value.reload();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="full-width flex justify-center">
|
||||
<QPage class="card-width q-pa-lg">
|
||||
<CrudModel
|
||||
:data-required="{ itemFk: route.params.id }"
|
||||
:default-remove="false"
|
||||
:filter="{
|
||||
fields: ['id', 'itemFk', 'code'],
|
||||
where: { itemFk: route.params.id },
|
||||
}"
|
||||
data-key="ItemBarcodes"
|
||||
model="ItemBarcodes"
|
||||
ref="itemBarcodeRef"
|
||||
url="ItemBarcodes"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<QCard class="q-px-lg q-py-md">
|
||||
<div
|
||||
v-for="(row, index) in rows"
|
||||
:key="index"
|
||||
class="q-mb-md full-width row items-center no-wrap"
|
||||
>
|
||||
<VnInput
|
||||
:label="t('Code')"
|
||||
v-model="row.code"
|
||||
class="full-width"
|
||||
focusable-input
|
||||
/>
|
||||
<QIcon
|
||||
@click="itemBarcodeRef.remove([row])"
|
||||
class="cursor-pointer q-ml-md"
|
||||
color="primary"
|
||||
name="delete"
|
||||
size="sm"
|
||||
>
|
||||
<QTooltip class="text-no-wrap">
|
||||
{{ t('Remove barcode') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</div>
|
||||
<QIcon
|
||||
@click="insertRow()"
|
||||
class="cursor-pointer fill-icon-on-hover"
|
||||
color="primary"
|
||||
name="add_circle"
|
||||
size="sm"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add barcode') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</QCard>
|
||||
</template>
|
||||
</CrudModel>
|
||||
</QPage>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Code: Código
|
||||
Remove barcode: Quitar código de barras
|
||||
Add barcode: Añadir código de barras
|
||||
</i18n>
|
||||
|
|
|
@ -177,14 +177,27 @@ const openCloneDialog = async () => {
|
|||
<VnLv :label="t('item.descriptor.buyer')">
|
||||
<template #value>
|
||||
<span class="link">
|
||||
{{ t('item.descriptor.buyer') }}
|
||||
{{ entity.itemType?.worker?.user?.name }}
|
||||
<WorkerDescriptorProxy :id="entity.itemType?.worker?.id" />
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('item.descriptor.color')" :value="entity.value5"> </VnLv>
|
||||
<VnLv :label="t('item.descriptor.color')" :value="entity.value6" />
|
||||
<VnLv :label="t('item.descriptor.stems')" :value="entity.value7" />
|
||||
<VnLv
|
||||
v-if="entity.value5"
|
||||
:label="t('item.descriptor.color')"
|
||||
:value="entity.value5"
|
||||
>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
v-if="entity.value6"
|
||||
:label="t('item.descriptor.category')"
|
||||
:value="entity.value6"
|
||||
/>
|
||||
<VnLv
|
||||
v-if="entity.value7"
|
||||
:label="t('item.descriptor.stems')"
|
||||
:value="entity.value7"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{}">
|
||||
<QCardActions class="row justify-center">
|
||||
|
|
|
@ -12,6 +12,7 @@ import ItemDescriptorProxy from '../Item/Card/ItemDescriptorProxy.vue';
|
|||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import ItemSummary from '../Item/Card/ItemSummary.vue';
|
||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||
import ItemListFilter from './ItemListFilter.vue';
|
||||
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { toDateFormat } from 'src/filters/date.js';
|
||||
|
@ -69,7 +70,7 @@ const exprBuilder = (param, value) => {
|
|||
}
|
||||
};
|
||||
|
||||
const params = reactive({});
|
||||
const params = reactive({ isFloramondo: false, isActive: true });
|
||||
|
||||
const applyColumnFilter = async (col) => {
|
||||
try {
|
||||
|
@ -442,6 +443,11 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
<QSpace />
|
||||
<div id="st-actions"></div>
|
||||
</QToolbar>
|
||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||
<QScrollArea class="fit text-grey-8">
|
||||
<ItemListFilter data-key="ItemList" />
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<VnPaginate
|
||||
ref="paginateRef"
|
||||
|
|
|
@ -0,0 +1,460 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { onMounted } from 'vue';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import { QCheckbox } from 'quasar';
|
||||
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
import axios from 'axios';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const props = defineProps({
|
||||
dataKey: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const validationsStore = useValidator();
|
||||
|
||||
const itemTypesRef = ref(null);
|
||||
const categoriesOptions = ref([]);
|
||||
const itemTypesOptions = ref([]);
|
||||
const buyersOptions = ref([]);
|
||||
const suppliersOptions = ref([]);
|
||||
const tagValues = ref([]);
|
||||
const fieldFiltersValues = ref([]);
|
||||
const moreFields = ref([]);
|
||||
|
||||
const arrayData = useArrayData(props.dataKey);
|
||||
const itemTypesFilter = {
|
||||
fields: ['id', 'name', 'categoryFk'],
|
||||
include: 'category',
|
||||
order: 'name ASC',
|
||||
where: {},
|
||||
};
|
||||
|
||||
const onCategoryChange = async (categoryFk, search) => {
|
||||
if (!categoryFk) {
|
||||
itemTypesFilter.where.categoryFk = null;
|
||||
delete itemTypesFilter.where.categoryFk;
|
||||
} else {
|
||||
itemTypesFilter.where.categoryFk = categoryFk;
|
||||
}
|
||||
search();
|
||||
await itemTypesRef.value.fetch();
|
||||
};
|
||||
|
||||
const getSelectedTagValues = async (tag) => {
|
||||
try {
|
||||
tag.value = null;
|
||||
const filter = {
|
||||
fields: ['value'],
|
||||
order: 'value ASC',
|
||||
};
|
||||
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
const { data } = await axios.get(`Tags/${tag.selectedTag.id}/filterValue`, {
|
||||
params,
|
||||
});
|
||||
tag.valueOptions = data;
|
||||
} catch (err) {
|
||||
console.error('Error getting selected tag values');
|
||||
}
|
||||
};
|
||||
|
||||
const applyTags = (params, search) => {
|
||||
params.tags = tagValues.value
|
||||
.filter((tag) => tag.selectedTag && tag.value)
|
||||
.map((tag) => ({
|
||||
tagFk: tag.selectedTag.id,
|
||||
tagName: tag.selectedTag.name,
|
||||
value: tag.value,
|
||||
}));
|
||||
search();
|
||||
};
|
||||
|
||||
const removeTag = (index, params, search) => {
|
||||
(tagValues.value || []).splice(index, 1);
|
||||
applyTags(params, search);
|
||||
};
|
||||
|
||||
const applyFieldFilters = (params) => {
|
||||
fieldFiltersValues.value.forEach((fieldFilter) => {
|
||||
if (
|
||||
fieldFilter.selectedField &&
|
||||
(fieldFilter.value !== null ||
|
||||
fieldFilter.value !== '' ||
|
||||
fieldFilter.value !== undefined)
|
||||
) {
|
||||
params[fieldFilter.name] = fieldFilter.value;
|
||||
}
|
||||
});
|
||||
arrayData.applyFilter({ params });
|
||||
};
|
||||
|
||||
const removeFieldFilter = (index, params, search) => {
|
||||
delete params[fieldFiltersValues.value[index].name];
|
||||
(fieldFiltersValues.value || []).splice(index, 1);
|
||||
applyFieldFilters(params, search);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
if (arrayData.store?.userParams?.categoryFk)
|
||||
itemTypesFilter.where.categoryFk = arrayData.store?.userParams?.categoryFk;
|
||||
await itemTypesRef.value.fetch();
|
||||
const { models } = validationsStore;
|
||||
const properties = models.Item?.properties || {};
|
||||
|
||||
const _moreFields = ['id', 'description', 'name', 'isActive'];
|
||||
|
||||
_moreFields.forEach((field) => {
|
||||
let prop = properties[field];
|
||||
const label = t(`params.${field}`);
|
||||
moreFields.value.push({
|
||||
name: field,
|
||||
label,
|
||||
type: prop ? prop.type : null,
|
||||
});
|
||||
});
|
||||
|
||||
// Fill fieldFiltersValues with existent userParams
|
||||
if (arrayData.store?.userParams) {
|
||||
fieldFiltersValues.value = Object.entries(arrayData.store?.userParams)
|
||||
.filter(([key, value]) => value && _moreFields.includes(key))
|
||||
.map(([key, value]) => ({
|
||||
name: key,
|
||||
value,
|
||||
selectedField: moreFields.value.find((field) => field.name === key),
|
||||
}));
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="ItemCategories"
|
||||
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||
@on-fetch="(data) => (categoriesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
ref="itemTypesRef"
|
||||
url="ItemTypes"
|
||||
:filter="itemTypesFilter"
|
||||
@on-fetch="(data) => (itemTypesOptions = data)"
|
||||
/>
|
||||
<FetchData
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC' }"
|
||||
@on-fetch="(data) => (buyersOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="Suppliers"
|
||||
:filter="{ fields: ['id', 'name', 'nickname'], order: 'name ASC' }"
|
||||
@on-fetch="(data) => (suppliersOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="Tags"
|
||||
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
||||
auto-load
|
||||
@on-fetch="(data) => (tagOptions = data)"
|
||||
/>
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:hidden-tags="tagValues.length === 0 ? ['tags'] : []"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div>
|
||||
<strong>{{ t(`params.${tag.label}`) }}</strong>
|
||||
<span v-if="tag.label !== 'tags'">: {{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.search"
|
||||
:label="t('params.search')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.categoryFk')"
|
||||
v-model="params.categoryFk"
|
||||
@update:model-value="
|
||||
($event) => onCategoryChange($event, searchFn)
|
||||
"
|
||||
:options="categoriesOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.typeFk')"
|
||||
v-model="params.typeFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="itemTypesOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption>{{
|
||||
scope.opt?.category?.name
|
||||
}}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.buyerFk')"
|
||||
v-model="params.buyerFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="buyersOptions"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.supplierFk')"
|
||||
v-model="params.supplierFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="suppliersOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{
|
||||
scope.opt?.name + ': ' + scope.opt?.nickname
|
||||
}}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<!-- Tags filter -->
|
||||
<QItem class="row items-center">
|
||||
<QItemLabel>
|
||||
{{ t('params.tags') }}
|
||||
</QItemLabel>
|
||||
<QIcon
|
||||
name="add_circle"
|
||||
class="fill-icon-on-hover q-ml-md"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click="tagValues.push({})"
|
||||
/>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-for="(tag, index) in tagValues"
|
||||
:key="index"
|
||||
class="row items-center"
|
||||
>
|
||||
<QItemSection class="col">
|
||||
<VnSelect
|
||||
:label="t('params.tag')"
|
||||
v-model="tag.selectedTag"
|
||||
:options="tagOptions"
|
||||
option-label="name"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:emit-value="false"
|
||||
use-input
|
||||
:is-clearable="false"
|
||||
@update:model-value="getSelectedTagValues(tag)"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection class="col">
|
||||
<VnSelect
|
||||
v-if="!tag?.selectedTag?.isFree && tag.valueOptions"
|
||||
:label="t('params.tag')"
|
||||
v-model="tag.value"
|
||||
:options="tag.valueOptions || []"
|
||||
option-value="value"
|
||||
option-label="value"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
emit-value
|
||||
use-input
|
||||
:disable="!tag"
|
||||
:is-clearable="false"
|
||||
@update:model-value="applyTags(params, searchFn)"
|
||||
/>
|
||||
<VnInput
|
||||
v-else
|
||||
v-model="tag.value"
|
||||
:label="t('params.value')"
|
||||
:disable="!tag"
|
||||
is-outlined
|
||||
:is-clearable="false"
|
||||
@keydown.enter.prevent="applyTags(params, searchFn)"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QIcon
|
||||
name="delete"
|
||||
class="fill-icon-on-hover q-ml-xs"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click="removeTag(index, params, searchFn)"
|
||||
/>
|
||||
</QItem>
|
||||
<!-- Filter fields -->
|
||||
<QItem class="row items-center">
|
||||
<QItemLabel>
|
||||
{{ t('More fields') }}
|
||||
</QItemLabel>
|
||||
<QIcon
|
||||
name="add_circle"
|
||||
class="fill-icon-on-hover q-ml-md"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click="fieldFiltersValues.push({})"
|
||||
/>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-for="(fieldFilter, index) in fieldFiltersValues"
|
||||
:key="index"
|
||||
class="row items-center"
|
||||
>
|
||||
<QItemSection class="col">
|
||||
<VnSelect
|
||||
:label="t('params.tag')"
|
||||
:model-value="fieldFilter.selectedField"
|
||||
:options="moreFields"
|
||||
option-label="label"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:emit-value="false"
|
||||
use-input
|
||||
:is-clearable="false"
|
||||
@update:model-value="
|
||||
($event) => {
|
||||
fieldFilter.name = $event.name;
|
||||
fieldFilter.value = null;
|
||||
fieldFilter.selectedField = $event;
|
||||
}
|
||||
"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection class="col">
|
||||
<QCheckbox
|
||||
v-if="fieldFilter.selectedField?.type === 'boolean'"
|
||||
v-model="fieldFilter.value"
|
||||
:label="t('params.value')"
|
||||
@update:model-value="applyFieldFilters(params, searchFn)"
|
||||
/>
|
||||
<VnInput
|
||||
v-else
|
||||
v-model="fieldFilter.value"
|
||||
:label="t('params.value')"
|
||||
:disable="!fieldFilter.selectedField"
|
||||
is-outlined
|
||||
@keydown.enter="applyFieldFilters(params, searchFn)"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QIcon
|
||||
name="delete"
|
||||
class="fill-icon-on-hover q-ml-xs"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click="removeFieldFilter(index, params, searchFn)"
|
||||
/>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('params.isFloramondo')"
|
||||
v-model="params.isFloramondo"
|
||||
toggle-indeterminate
|
||||
@update:model-value="searchFn()"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
params:
|
||||
search: General search
|
||||
categoryFk: Category
|
||||
typeFk: Type
|
||||
buyerFk: Buyer
|
||||
supplierFk: Supplier
|
||||
tags: Tags
|
||||
tag: Tag
|
||||
value: Value
|
||||
isFloramondo: Floramondo
|
||||
isActive: Active
|
||||
description: Description
|
||||
name: Name
|
||||
id: Id
|
||||
es:
|
||||
More fields: Más campos
|
||||
params:
|
||||
search: Búsqueda general
|
||||
categoryFk: Reino
|
||||
typeFk: Tipo
|
||||
buyerFk: Comprador
|
||||
supplierFk: Proveedor
|
||||
tags: Etiquetas
|
||||
tag: Etiqueta
|
||||
value: Valor
|
||||
isFloramondo: Floramondo
|
||||
isActive: Activo
|
||||
description: Descripción
|
||||
name: Nombre
|
||||
id: Id
|
||||
</i18n>
|
|
@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useRouter } from 'vue-router';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
@ -58,7 +58,7 @@ const redirectToItemTypeBasicData = (_, { id }) => {
|
|||
<VnInput v-model="data.name" :label="t('itemType.shared.name')" />
|
||||
</VnRow>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelectFilter
|
||||
<VnSelect
|
||||
v-model="data.workerFk"
|
||||
:label="t('itemType.shared.worker')"
|
||||
:options="workersOptions"
|
||||
|
@ -66,7 +66,7 @@ const redirectToItemTypeBasicData = (_, { id }) => {
|
|||
option-label="firstName"
|
||||
hide-selected
|
||||
/>
|
||||
<VnSelectFilter
|
||||
<VnSelect
|
||||
v-model="data.categoryFk"
|
||||
:label="t('itemType.shared.category')"
|
||||
:options="categoriesOptions"
|
||||
|
@ -76,7 +76,7 @@ const redirectToItemTypeBasicData = (_, { id }) => {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelectFilter
|
||||
<VnSelect
|
||||
v-model="data.temperatureFk"
|
||||
:label="t('itemType.shared.temperature')"
|
||||
:options="temperaturesOptions"
|
||||
|
|
|
@ -66,8 +66,7 @@ const exprBuilder = (param, value) => {
|
|||
<VnSearchbar
|
||||
data-key="ItemTypeList"
|
||||
url="ItemTypes"
|
||||
:label="t('Search item type')"
|
||||
:redirect="false"
|
||||
:label="t('Search item type')"
|
||||
:info="t('Search itemType by id, name or code')"
|
||||
:expr-builder="exprBuilder"
|
||||
/>
|
||||
|
|
|
@ -7,7 +7,7 @@ import FetchData from 'components/FetchData.vue';
|
|||
import FormModel from 'components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -43,21 +43,21 @@ const temperaturesOptions = ref([]);
|
|||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInput v-model="data.code" :label="t('itemType.shared.code')" />
|
||||
<VnInput v-model="data.name" :label="t('itemType.shared.name')" />
|
||||
<VnInput v-model="data.code" :label="t('shared.code')" />
|
||||
<VnInput v-model="data.name" :label="t('shared.name')" />
|
||||
</VnRow>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelectFilter
|
||||
<VnSelect
|
||||
v-model="data.workerFk"
|
||||
:label="t('itemType.shared.worker')"
|
||||
:label="t('shared.worker')"
|
||||
:options="workersOptions"
|
||||
option-value="id"
|
||||
option-label="firstName"
|
||||
hide-selected
|
||||
/>
|
||||
<VnSelectFilter
|
||||
<VnSelect
|
||||
v-model="data.categoryFk"
|
||||
:label="t('itemType.shared.category')"
|
||||
:label="t('shared.category')"
|
||||
:options="categoriesOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
@ -65,9 +65,9 @@ const temperaturesOptions = ref([]);
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelectFilter
|
||||
<VnSelect
|
||||
v-model="data.temperatureFk"
|
||||
:label="t('itemType.shared.temperature')"
|
||||
:label="t('shared.temperature')"
|
||||
:options="temperaturesOptions"
|
||||
option-value="code"
|
||||
option-label="name"
|
||||
|
|
|
@ -1,26 +1,12 @@
|
|||
<script setup>
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
|
||||
import ItemTypeDescriptor from 'src/pages/ItemType/Card/ItemTypeDescriptor.vue';
|
||||
import LeftMenu from 'components/LeftMenu.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
</script>
|
||||
<template>
|
||||
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
||||
<QScrollArea class="fit">
|
||||
<ItemTypeDescriptor />
|
||||
<QSeparator />
|
||||
<LeftMenu source="card" />
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<QPageContainer>
|
||||
<QPage>
|
||||
<VnSubToolbar />
|
||||
<div class="q-pa-md column items-center">
|
||||
<RouterView></RouterView>
|
||||
</div>
|
||||
</QPage>
|
||||
</QPageContainer>
|
||||
<VnCard
|
||||
data-key="ItemTypeSummary"
|
||||
base-url="ItemTypes"
|
||||
:descriptor="ItemTypeDescriptor"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
|
|||
|
||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
|
||||
|
@ -65,13 +66,15 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
|
|||
</QBtn>
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('itemType.shared.code')" :value="entity.code" />
|
||||
<VnLv :label="t('itemType.shared.name')" :value="entity.name" />
|
||||
<VnLv
|
||||
:label="t('itemType.shared.worker')"
|
||||
:value="entity.worker?.firstName"
|
||||
/>
|
||||
<VnLv :label="t('itemType.shared.category')" :value="entity.category?.name" />
|
||||
<VnLv :label="t('shared.code')" :value="entity.code" />
|
||||
<VnLv :label="t('shared.name')" :value="entity.name" />
|
||||
<VnLv :label="t('shared.worker')">
|
||||
<template #value>
|
||||
<span class="link">{{ entity.worker?.firstName }}</span>
|
||||
<WorkerDescriptorProxy :id="entity.worker?.id" />
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('shared.category')" :value="entity.category?.name" />
|
||||
</template>
|
||||
</CardDescriptor>
|
||||
</template>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { ref, computed, onUpdated } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
|
@ -71,30 +72,29 @@ async function setItemTypeData(data) {
|
|||
{{ t('globals.summary.basicData') }}
|
||||
<QIcon name="open_in_new" />
|
||||
</router-link>
|
||||
<VnLv :label="t('itemType.summary.id')" :value="itemType.id" />
|
||||
<VnLv :label="t('itemType.shared.code')" :value="itemType.code" />
|
||||
<VnLv :label="t('itemType.shared.name')" :value="itemType.name" />
|
||||
<VnLv :label="t('summary.id')" :value="itemType.id" />
|
||||
<VnLv :label="t('shared.code')" :value="itemType.code" />
|
||||
<VnLv :label="t('shared.name')" :value="itemType.name" />
|
||||
<VnLv :label="t('shared.worker')">
|
||||
<template #value>
|
||||
<span class="link">{{ itemType.worker?.firstName }}</span>
|
||||
<WorkerDescriptorProxy :id="itemType.worker?.id" />
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('shared.category')" :value="itemType.category?.name" />
|
||||
<VnLv
|
||||
:label="t('itemType.shared.worker')"
|
||||
:value="itemType.worker?.firstName"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('itemType.shared.category')"
|
||||
:value="itemType.category?.name"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('itemType.shared.temperature')"
|
||||
:label="t('shared.temperature')"
|
||||
:value="itemType.temperature?.name"
|
||||
/>
|
||||
<VnLv :label="t('itemType.summary.life')" :value="itemType.life" />
|
||||
<VnLv :label="t('itemType.summary.promo')" :value="itemType.promo" />
|
||||
<VnLv :label="t('summary.life')" :value="itemType.life" />
|
||||
<VnLv :label="t('summary.promo')" :value="itemType.promo" />
|
||||
<VnLv
|
||||
:label="t('itemType.summary.itemPackingType')"
|
||||
:label="t('summary.itemPackingType')"
|
||||
:value="itemType.itemPackingType?.description"
|
||||
/>
|
||||
<VnLv
|
||||
class="large-label"
|
||||
:label="t('itemType.summary.isUnconventionalSize')"
|
||||
:label="t('summary.isUnconventionalSize')"
|
||||
:value="itemType.isUnconventionalSize"
|
||||
/>
|
||||
</QCard>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
shared:
|
||||
code: Code
|
||||
name: Name
|
||||
worker: Worker
|
||||
category: Category
|
||||
temperature: Temperature
|
||||
summary:
|
||||
id: id
|
||||
life: Life
|
||||
promo: Promo
|
||||
itemPackingType: Item packing type
|
||||
isUnconventionalSize: Is unconventional size
|
|
@ -0,0 +1,17 @@
|
|||
shared:
|
||||
code: Código
|
||||
name: Nombre
|
||||
worker: Trabajador
|
||||
category: Reino
|
||||
temperature: Temperatura
|
||||
summary:
|
||||
id: id
|
||||
code: Código
|
||||
name: Nombre
|
||||
worker: Trabajador
|
||||
category: Reino
|
||||
temperature: Temperatura
|
||||
life: Vida
|
||||
promo: Promoción
|
||||
itemPackingType: Tipo de embalaje
|
||||
isUnconventionalSize: Es de tamaño poco convencional
|
|
@ -20,14 +20,14 @@ const router = useRouter();
|
|||
const { t } = useI18n();
|
||||
|
||||
const entityId = computed(() => $props.id || route.params.id);
|
||||
const isDialog = Boolean($props.id);
|
||||
const hideRightDrawer = () => {
|
||||
if (!isDialog) {
|
||||
stateStore.rightDrawer = false;
|
||||
}
|
||||
};
|
||||
onMounted(hideRightDrawer);
|
||||
onUnmounted(hideRightDrawer);
|
||||
const isDialog = false;
|
||||
// const hideRightDrawer = () => {
|
||||
// if (!isDialog) {
|
||||
// stateStore.rightDrawer = false;
|
||||
// }
|
||||
// };
|
||||
// onMounted(hideRightDrawer);
|
||||
// onUnmounted(hideRightDrawer);
|
||||
const filter = {
|
||||
include: [
|
||||
{
|
||||
|
@ -46,23 +46,6 @@ const filter = {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="!isDialog && stateStore.isHeaderMounted()">
|
||||
<Teleport to="#actions-append">
|
||||
<div class="row q-gutter-x-sm">
|
||||
<QBtn
|
||||
flat
|
||||
@click="stateStore.toggleRightDrawer()"
|
||||
round
|
||||
dense
|
||||
icon="menu"
|
||||
>
|
||||
<QTooltip bottom anchor="bottom right">
|
||||
{{ t('globals.collapseMenu') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
<div class="q-pa-md">
|
||||
<CardSummary ref="summary" :url="`Shelvings/${entityId}`" :filter="filter">
|
||||
<template #header="{ entity }">
|
||||
|
@ -102,18 +85,4 @@ const filter = {
|
|||
</template>
|
||||
</CardSummary>
|
||||
</div>
|
||||
<QDrawer
|
||||
v-if="!isDialog"
|
||||
v-model="stateStore.rightDrawer"
|
||||
side="right"
|
||||
:width="256"
|
||||
show-if-above
|
||||
>
|
||||
<QScrollArea class="fit text-grey-8">
|
||||
<ShelvingFilter
|
||||
data-key="ShelvingList"
|
||||
@search="router.push({ name: 'ShelvingList' })"
|
||||
/>
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
</template>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { RouterView } from 'vue-router';
|
||||
|
||||
export default {
|
||||
path: '/item-type',
|
||||
path: '/item/item-type',
|
||||
name: 'ItemType',
|
||||
meta: {
|
||||
title: 'itemType',
|
||||
|
@ -9,7 +9,7 @@ export default {
|
|||
moduleName: 'ItemType',
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'ItemTypeCard' },
|
||||
redirect: { name: 'ItemTypeList' },
|
||||
menus: {
|
||||
main: [],
|
||||
card: ['ItemTypeBasicData'],
|
||||
|
|
Loading…
Reference in New Issue