Ticket basic data #474

Merged
jsegarra merged 15 commits from :feature/TicketBasicData into dev 2024-06-25 20:28:01 +00:00
5 changed files with 29 additions and 14 deletions
Showing only changes of commit 5419bc4d52 - Show all commits

View File

@ -1,5 +1,6 @@
<script setup>
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import isValidDate from 'filters/isValidDate';
const props = defineProps({
@ -24,6 +25,9 @@ const hover = ref(false);
const emit = defineEmits(['update:modelValue']);
const { t } = useI18n();
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
const joinDateAndTime = (date, time) => {
if (!date) {
return null;
@ -91,6 +95,8 @@ const styleAttrs = computed(() => {
readonly
:model-value="displayDate(value)"
v-bind="{ ...$attrs, ...styleAttrs }"
:class="{ required: $attrs.required }"
:rules="$attrs.required ? [requiredFieldRule] : null"
@click="isPopupOpen = true"
>
<template #append>

View File

@ -17,8 +17,9 @@ const props = defineProps({
default: false,
},
});
const { t } = useI18n();
const emit = defineEmits(['update:modelValue']);
const { t } = useI18n();
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
const value = computed({
get() {
@ -71,6 +72,8 @@ const styleAttrs = computed(() => {
readonly
:model-value="formatTime(value)"
v-bind="{ ...$attrs, ...styleAttrs }"
:class="{ required: $attrs.required }"
:rules="$attrs.required ? [requiredFieldRule] : null"
@click="isPopupOpen = true"
>
<template #append>

View File

@ -116,12 +116,12 @@ const totalDifference = computed(() => {
return rows.value.reduce((acc, item) => acc + item.component?.difference || 0, 0);
});
const showMovablecolumn = computed(() => (haveDifferences.value > 0 ? ['movable'] : []));
const haveDifferences = computed(() => _ticketData.value.sale.haveDifferences);
const haveDifferences = computed(() => _ticketData.value.sale?.haveDifferences);
const ticketHaveNegatives = () => {
let _haveNegatives = false;
let haveNotNegatives = false;
_ticketData.value.withoutNegatives = false;
_ticketData.value.sale.items.forEach((item) => {
_ticketData.value?.sale?.items.forEach((item) => {
if (item.quantity > item.movable) _haveNegatives = true;
else haveNotNegatives = true;
});

View File

@ -396,7 +396,11 @@ onMounted(() => onFormModelInit());
</QIcon>
</template>
</VnSelect>
<VnInput :label="t('basicData.alias')" v-model="formData.nickname" />
<VnInput

deberia ser requerido no? Quiero decir, le falta el *

deberia ser requerido no? Quiero decir, le falta el *

Revisar el resto de campos

Revisar el resto de campos

Añadido.

Commit: 54e3eb6f0d

Añadido. Commit: https://gitea.verdnatura.es/verdnatura/salix-front/commit/54e3eb6f0d7de3726ffa6269e7d9c02b2b9faa5d
:label="t('basicData.alias')"
v-model="formData.nickname"
:required="true"
/>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md no-wrap">
<VnSelect
@ -417,7 +421,6 @@ onMounted(() => onFormModelInit());
:options="agenciesOptions"
hide-selected
map-options
Review

No se ve el texto, sino el id del registro

No se ve el texto, sino el id del registro
Review

No se ve el name ya que no hay no existen zoneOptions para los registros cargados, es algo medio raro la verdad como esta planteado, ya que en salix si desplegas el input de zonas te va a aparecer que no hay resultados.
Y en lilium esto es un problema porque el QSelect utiliza las options para mapear el resultado en base al value.

No se ve el name ya que no hay no existen `zoneOptions` para los registros cargados, es algo medio raro la verdad como esta planteado, ya que en salix si desplegas el input de zonas te va a aparecer que no hay resultados. Y en lilium esto es un problema porque el `QSelect` utiliza las options para mapear el resultado en base al value.
:required="true"
@focus="agencyFetchRef.fetch()"
/>
<VnSelect
@ -450,7 +453,11 @@ onMounted(() => onFormModelInit());
v-model="formData.shipped"
:required="true"
/>
<VnInputTime :label="t('basicData.shippedHour')" v-model="formData.shipped" />
<VnInputTime
:label="t('basicData.shippedHour')"
v-model="formData.shipped"
:required="true"
/>
<VnInputDate
:label="t('basicData.landed')"
v-model="formData.landed"

View File

@ -156,7 +156,6 @@ onBeforeMount(async () => await getTicketData());
v-model="step"
ref="stepperRef"
color="primary"
header-nav
animated
keep-alive
style="max-width: 800px; margin: auto"
@ -176,19 +175,19 @@ onBeforeMount(async () => await getTicketData());
/>
</QStep>
<template #navigation>
<QStepperNavigation>
<QStepperNavigation class="flex justify-between">
<QBtn
@click="onNextStep()"
color="primary"
:label="step === 2 ? t('basicData.finalize') : t('basicData.next')"
/>
<QBtn
v-if="step > 1"
flat
color="primary"
@click="stepperRef.previous()"
:label="t('basicData.back')"
class="q-ml-sm"
:class="{ invisible: step === 1 }"
/>
<QBtn
@click="onNextStep()"
color="primary"
:label="step === 2 ? t('basicData.finalize') : t('basicData.next')"
/>
</QStepperNavigation>
</template>