This commit is contained in:
Javier Segarra 2024-06-13 09:37:39 +02:00
parent 1641ad396c
commit bb58f72e3f
13 changed files with 77 additions and 28 deletions

View File

@ -63,6 +63,7 @@ globals:
shipped: Shipped shipped: Shipped
totalEntries: Total entries totalEntries: Total entries
amount: Amount amount: Amount
removeSelection: Clear selection
packages: Packages packages: Packages
download: Download download: Download
selectRows: 'Select all { numberRows } row(s)' selectRows: 'Select all { numberRows } row(s)'

View File

@ -71,7 +71,8 @@ globals:
requiredField: Campo obligatorio requiredField: Campo obligatorio
class: clase class: clase
type: Tipo type: Tipo
reason: motivo reason: Motivo
removeSelection: Eliminar selección
noResults: Sin resultados noResults: Sin resultados
results: resultados results: resultados
system: Sistema system: Sistema

View File

@ -134,7 +134,8 @@ const columns = computed(() => [
}, },
]); ]);
async function confirm() { async function confirm() {
quantity.value = 0; console.log('');
// quantity.value = 0;
// const response = { address: address.value }; // const response = { address: address.value };
// if (props.promise) { // if (props.promise) {
// isLoading.value = true; // isLoading.value = true;
@ -170,13 +171,13 @@ async function confirm() {
</QCardSection> </QCardSection>
<QCardSection class="row items-center justify-center column items-stretch"> <QCardSection class="row items-center justify-center column items-stretch">
<span class="text-h6 text-grey"> <span class="text-h6 text-grey">
{{ currentTicket }} <!-- {{ currentTicket }} -->
{{ {{
t('proposal.title', { t('proposal.title', {
ticketFk: currentTicket.ticketFk, ticketFk: currentTicket.ticketFk,
saleFk: currentTicket.saleFk, saleFk: currentTicket.saleFk,
}) })
}}** }}
</span> </span>
</QCardSection> </QCardSection>
<QCardSection class="row items-center justify-center column items-stretch"> <QCardSection class="row items-center justify-center column items-stretch">
@ -189,7 +190,11 @@ async function confirm() {
@click="changeTicket(false)" @click="changeTicket(false)"
:disable="index === 0" :disable="index === 0"
/> />
<!-- <span>{{ currentTicket.ticketFk }}</span> --> <span>
Ticket #{{ currentTicket.ticketFk }} -
<!-- {{ currentTicket.client?.name }} ({{ currentTicket.client?.id }}) -->
{{ currentTicket.nickname }}</span
>
<QBtn <QBtn
icon="arrow_right" icon="arrow_right"
flat flat
@ -279,19 +284,37 @@ async function confirm() {
</div> </div>
</QCardSection> </QCardSection>
<QCardActions align="right"> <QCardActions align="right">
<QBtn :label="t('globals.cancel')" color="primary" flat v-close-popup />
<QBtn <QBtn
:label="t('globals.replace')" :label="t('globals.removeSelection')"
color="primary"
flat
:disable="proposalSelected.length < 1 || quantity === 0"
@click="proposalSelected = []"
/>
<QBtnDropdown
top
split
:label="t('proposal.replace')"
color="primary" color="primary"
:loading="isLoading" :loading="isLoading"
@click="confirm" @click="confirm"
:disable="proposalSelected.length < 1 || quantity === 0" :disable="proposalSelected.length < 1 || quantity === 0"
unelevated unelevated
/> ><QList>
<QItem clickable @click="confirm">
<QItemSection>
<QItemLabel>
{{ t('proposal.replaceAndConfirm') }}
</QItemLabel>
</QItemSection>
</QItem>
</QList></QBtnDropdown
>
<QInput <QInput
v-model="quantity" v-model.number="quantity"
v-if="quantity > -1" v-if="quantity > -1"
@update:model-value="(val) => (quantity = +val)" @update:model-value="(val) => (quantity = val)"
type="number" type="number"
min="0" min="0"
:label="t('proposal.quantityToReplace')" :label="t('proposal.quantityToReplace')"

View File

@ -89,7 +89,7 @@ itemType:
category: Reino category: Reino
temperature: Temperatura temperature: Temperatura
proposal: proposal:
title: Items de sustitución para el ticket {ticketFk}:{saleFk} title: Items de sustitución para los tickets seleccionados
itemFk: Item itemFk: Item
longName: Nombre longName: Nombre
subName: Productor subName: Productor
@ -106,3 +106,5 @@ proposal:
itemOldPrice: Precio itemOld itemOldPrice: Precio itemOld
status: Estado status: Estado
quantityToReplace: Cantidad a reemplazar quantityToReplace: Cantidad a reemplazar
replace: Sustituir para este ticket
replaceAndConfirm: Sustituir y confirmar precio

View File

@ -3,10 +3,10 @@ import { computed, nextTick, onMounted, onUnmounted, ref, toRefs } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { QBtn, QCheckbox, useQuasar } from 'quasar'; import { QBtn, QCheckbox, useQuasar } from 'quasar';
import axios from 'axios'; import axios from 'axios';
import HandleSplited from 'pages/Ticket/Negative/HandleSplited.vue'; import HandleSplited from 'pages/Ticket/Negative/components/HandleSplited.vue';
import ChangeQuantityDialog from 'pages/Ticket/Negative/ChangeQuantityDialog.vue'; import ChangeQuantityDialog from 'pages/Ticket/Negative/components/ChangeQuantityDialog.vue';
import ChangeStateDialog from 'pages/Ticket/Negative/ChangeStateDialog.vue'; import ChangeStateDialog from 'pages/Ticket/Negative/components/ChangeStateDialog.vue';
import ItemProposal from 'src/pages/Item/components/ItemProposal.vue'; import ItemProposal from 'pages/Item/components/ItemProposal.vue';
import { useVnConfirm } from 'composables/useVnConfirm'; import { useVnConfirm } from 'composables/useVnConfirm';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue';
@ -19,6 +19,7 @@ import useNotify from 'src/composables/useNotify.js';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useDialogPluginComponent } from 'quasar'; import { useDialogPluginComponent } from 'quasar';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import ZoneDescriptorProxy from 'pages/Zone/Card/ZoneDescriptorProxy.vue';
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
const { t } = useI18n(); const { t } = useI18n();
@ -153,8 +154,8 @@ const tableColumnComponents = computed(() => ({
event: getInputEvents, event: getInputEvents,
}, },
zoneName: { zoneName: {
component: 'span', component: QBtn,
props: {}, props: { color: 'blue', sortable: true, flat: true },
event: () => ({}), event: () => ({}),
}, },
nickname: { nickname: {
@ -496,10 +497,10 @@ const split = async () => {
>{{ col.value }} >{{ col.value }}
<ItemDescriptorProxy :id="$props.entityId" <ItemDescriptorProxy :id="$props.entityId"
/></template> /></template>
<template v-if="col.name === 'itemFk'" <template v-if="col.name === 'zoneName'">
>{{ col.value }} {{ col.value }}
<ItemDescriptorProxy :id="$props.entityId" <ZoneDescriptorProxy :id="props.row.zoneFk" />
/></template> </template>
</component> </component>
</template> </template>
</QTd> </QTd>

View File

@ -2,6 +2,8 @@
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputTime from 'components/common/VnInputTime.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
@ -112,6 +114,25 @@ const onCategoryChange = async (categoryFk, search) => {
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QCard bordered>
<QItem>
<QItemSection>
<VnInputDate
:label="t('negative.date')"
v-model="params.date"
></VnInputDate
></QItemSection>
</QItem>
<QItem>
<QItemSection
><VnInputTime
:label="t('negative.timed')"
v-model="params.time"
></VnInputTime>
</QItemSection>
</QItem>
</QCard>
<QCard bordered> <QCard bordered>
<QItem> <QItem>
<QItemSection v-if="categoriesOptions"> <QItemSection v-if="categoriesOptions">

View File

@ -7,8 +7,8 @@ import TicketLackFilter from 'pages/Ticket/Negative/TicketLackFilter.vue';
import TicketLackDetail from 'pages/Ticket/Negative/TicketLackDetail.vue'; import TicketLackDetail from 'pages/Ticket/Negative/TicketLackDetail.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import NegativeOriginDialog from 'pages/Ticket/Negative/NegativeOriginDialog.vue'; import NegativeOriginDialog from 'pages/Ticket/Negative/components/NegativeOriginDialog.vue';
import TotalNegativeOriginDialog from 'pages/Ticket/Negative/TotalNegativeOriginDialog.vue'; import TotalNegativeOriginDialog from 'pages/Ticket/Negative/components/TotalNegativeOriginDialog.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { onBeforeMount } from 'vue'; import { onBeforeMount } from 'vue';
@ -33,11 +33,10 @@ const originDialogRef = ref();
const totalNegativeDialogRef = ref(); const totalNegativeDialogRef = ref();
const columns = computed(() => [ const columns = computed(() => [
{ {
name: 'Date', name: 'date',
label: t('negative.minTimed'), label: t('negative.date'),
field: 'timed', field: 'timed',
format: (val) => toDate(val), format: (val) => toDate(val),
sortable: true, sortable: true,
}, },
{ {
@ -161,7 +160,7 @@ const handleWarehouses = async (data) => {
ref="vnPaginateRef" ref="vnPaginateRef"
data-key="NegativeList" data-key="NegativeList"
:url="`Tickets/itemLack`" :url="`Tickets/itemLack`"
:order="['itemFk DESC']" :order="['itemFk DESC, date DESC, timed DESC']"
:user-params="negativeParams" :user-params="negativeParams"
> >
<template #body="{ rows }"> <template #body="{ rows }">

View File

@ -17,7 +17,8 @@ negative:
warehouse: 'Almacen' warehouse: 'Almacen'
lack: 'Negativo' lack: 'Negativo'
inkFk: 'Color' inkFk: 'Color'
timed: 'Timed' timed: 'Hora'
date: 'Fecha'
minTimed: 'Hora' minTimed: 'Hora'
type: 'Tipo' type: 'Tipo'
negativeAction: 'Negativo' negativeAction: 'Negativo'