Merge branch 'master' into hotfix-quitSaveOnEnter
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2024-12-11 21:51:52 +00:00
commit bae148174a
7 changed files with 71 additions and 54 deletions

View File

@ -51,10 +51,6 @@ const props = defineProps({
type: Object,
default: null,
},
staticParams: {
type: Array,
default: () => [],
},
exprBuilder: {
type: Function,
default: null,

View File

@ -78,29 +78,32 @@ async function setItemTypeData(data) {
{{ t('globals.summary.basicData') }}
<QIcon name="open_in_new" />
</router-link>
<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')">
<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('itemType.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('shared.temperature')"
:label="t('itemType.shared.category')"
:value="itemType.category?.name"
/>
<VnLv
:label="t('itemType.shared.temperature')"
:value="itemType.temperature?.name"
/>
<VnLv :label="t('summary.life')" :value="itemType.life" />
<VnLv :label="t('summary.promo')" :value="itemType.promo" />
<VnLv :label="t('itemType.summary.life')" :value="itemType.life" />
<VnLv :label="t('itemType.summary.promo')" :value="itemType.promo" />
<VnLv
:label="t('summary.itemPackingType')"
:label="t('itemType.summary.itemPackingType')"
:value="itemType.itemPackingType?.description"
/>
<VnLv
class="large-label"
:label="t('summary.isUnconventionalSize')"
:label="t('itemType.summary.isUnconventionalSize')"
:value="itemType.isUnconventionalSize"
/>
</QCard>

View File

@ -1,4 +1,5 @@
shared:
itemType:
shared:
code: Code
name: Name
worker: Worker
@ -8,7 +9,7 @@ shared:
itemPackingType: Item packing type
maxRefs: Maximum references
fragile: Fragile
summary:
summary:
id: id
life: Life
promo: Promo

View File

@ -1,4 +1,5 @@
shared:
itemType:
shared:
code: Código
name: Nombre
worker: Trabajador
@ -8,7 +9,7 @@ shared:
itemPackingType: Tipo de embalaje
maxRefs: Referencias máximas
fragile: Frágil
summary:
summary:
id: id
life: Vida
promo: Promoción

View File

@ -1,6 +1,6 @@
<script setup>
import axios from 'axios';
import { computed, ref, onMounted } from 'vue';
import { computed, ref, onBeforeMount } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n';
@ -46,7 +46,7 @@ const userParams = {
from: null,
to: null,
};
onMounted(() => {
onBeforeMount(() => {
initializeFromQuery();
stateStore.rightDrawer = true;
if (!route.query.createForm) return;

View File

@ -52,6 +52,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:last-day="lastDay"
:events="events"
v-model:formModeName="formModeName"
@open-zone-form="openForm"
/>
</QScrollArea>
</QDrawer>

View File

@ -11,10 +11,6 @@ import { dashIfEmpty } from 'src/filters';
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
import { useVnConfirm } from 'composables/useVnConfirm';
const formModeName = defineModel('formModeName', {
type: String,
required: true,
});
const props = defineProps({
firstDay: {
type: Date,
@ -31,8 +27,18 @@ const props = defineProps({
required: true,
default: () => [],
},
formModeName: {
type: String,
required: true,
default: 'include',
},
});
const formName = computed({
get: () => props.formModeName,
set: (value) => emit('update:formModeName', value),
});
const emit = defineEmits(['openZoneForm', 'update:formModeName']);
const { t } = useI18n();
const route = useRoute();
const weekdayStore = useWeekdayStore();
@ -80,6 +86,15 @@ const deleteEvent = async (id) => {
await fetchData();
};
const openInclusionForm = (event) => {
formName.value = 'include';
emit('openZoneForm', {
date: event.dated,
event,
isNewMode: false,
});
};
onMounted(async () => {
weekdayStore.initStore();
});
@ -92,13 +107,13 @@ onMounted(async () => {
t('eventsPanel.editMode')
}}</span>
<QRadio
v-model="formModeName"
v-model="formName"
dense
val="include"
:label="t('eventsPanel.include')"
/>
<QRadio
v-model="formModeName"
v-model="formName"
dense
val="exclude"
:label="t('eventsPanel.exclude')"