forked from verdnatura/salix-front
Merge pull request 'Ticket notes' (!487) from hyervoni/salix-front-mindshore:feature/TicketNotes into dev
Reviewed-on: verdnatura/salix-front#487 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es> Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
fc7f4fda49
|
@ -444,6 +444,7 @@ ticket:
|
||||||
sms: Sms
|
sms: Sms
|
||||||
notes: Notes
|
notes: Notes
|
||||||
sale: Sale
|
sale: Sale
|
||||||
|
observation: Notes
|
||||||
ticketAdvance: Advance tickets
|
ticketAdvance: Advance tickets
|
||||||
futureTickets: Future tickets
|
futureTickets: Future tickets
|
||||||
purchaseRequest: Purchase request
|
purchaseRequest: Purchase request
|
||||||
|
|
|
@ -443,6 +443,7 @@ ticket:
|
||||||
sms: Sms
|
sms: Sms
|
||||||
notes: Notas
|
notes: Notas
|
||||||
sale: Lineas del pedido
|
sale: Lineas del pedido
|
||||||
|
observation: Notas
|
||||||
ticketAdvance: Adelantar tickets
|
ticketAdvance: Adelantar tickets
|
||||||
futureTickets: Tickets a futuro
|
futureTickets: Tickets a futuro
|
||||||
purchaseRequest: Petición de compra
|
purchaseRequest: Petición de compra
|
||||||
|
|
|
@ -71,7 +71,7 @@ const filter = {
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
const setData = (entity) =>
|
const setData = (entity) =>
|
||||||
(data.value = useCardDescription(entity.client.name, entity.id));
|
(data.value = useCardDescription(entity.client?.name, entity.id));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -92,7 +92,7 @@ const setData = (entity) =>
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ entity.clientFk }}
|
{{ entity.clientFk }}
|
||||||
<CustomerDescriptorProxy :id="entity.client.id" />
|
<CustomerDescriptorProxy :id="entity.client?.id" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
@ -109,8 +109,8 @@ const setData = (entity) =>
|
||||||
<VnLv :label="t('ticket.summary.salesPerson')">
|
<VnLv :label="t('ticket.summary.salesPerson')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
:name="entity.client.salesPersonUser?.name"
|
:name="entity.client?.salesPersonUser?.name"
|
||||||
:worker-id="entity.client.salesPersonFk"
|
:worker-id="entity.client?.salesPersonFk"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
|
@ -0,0 +1,106 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref, watch, computed, reactive } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import CrudModel from 'components/CrudModel.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const ticketNotesCrudRef = ref(null);
|
||||||
|
const observationTypes = ref([]);
|
||||||
|
const arrayData = useArrayData('TicketNotes');
|
||||||
|
const { store } = arrayData;
|
||||||
|
|
||||||
|
const crudModelFilter = reactive({
|
||||||
|
where: { ticketFk: route.params.id },
|
||||||
|
fields: ['id', 'ticketFk', 'observationTypeFk', 'description'],
|
||||||
|
});
|
||||||
|
|
||||||
|
const crudModelRequiredData = computed(() => ({ ticketFk: route.params.id }));
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => route.params.id,
|
||||||
|
async () => {
|
||||||
|
crudModelFilter.where.ticketFk = route.params.id;
|
||||||
|
store.filter = crudModelFilter;
|
||||||
|
await ticketNotesCrudRef.value.reload();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
@on-fetch="(data) => (observationTypes = data)"
|
||||||
|
auto-load
|
||||||
|
url="ObservationTypes"
|
||||||
|
/>
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<CrudModel
|
||||||
|
ref="ticketNotesCrudRef"
|
||||||
|
data-key="TicketNotes"
|
||||||
|
url="TicketObservations"
|
||||||
|
model="TicketNotes"
|
||||||
|
:filter="crudModelFilter"
|
||||||
|
:data-required="crudModelRequiredData"
|
||||||
|
:default-remove="false"
|
||||||
|
auto-load
|
||||||
|
style="max-width: 800px"
|
||||||
|
>
|
||||||
|
<template #body="{ rows }">
|
||||||
|
<QCard class="q-px-lg q-py-md">
|
||||||
|
<div
|
||||||
|
v-for="(row, index) in rows"
|
||||||
|
:key="index"
|
||||||
|
class="q-mb-md row items-center q-gutter-x-md"
|
||||||
|
>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('ticketNotes.observationType')"
|
||||||
|
:options="observationTypes"
|
||||||
|
hide-selected
|
||||||
|
option-label="description"
|
||||||
|
option-value="id"
|
||||||
|
v-model="row.observationTypeFk"
|
||||||
|
:disable="!!row.id"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('ticketNotes.description')"
|
||||||
|
v-model="row.description"
|
||||||
|
class="col"
|
||||||
|
/>
|
||||||
|
<QIcon
|
||||||
|
name="delete"
|
||||||
|
size="sm"
|
||||||
|
class="cursor-pointer"
|
||||||
|
color="primary"
|
||||||
|
@click="ticketNotesCrudRef.remove([row])"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('ticketNotes.removeNote') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</div>
|
||||||
|
<VnRow v-if="observationTypes.length > rows.length">
|
||||||
|
<QIcon
|
||||||
|
name="add_circle"
|
||||||
|
class="fill-icon-on-hover q-ml-md"
|
||||||
|
size="sm"
|
||||||
|
color="primary"
|
||||||
|
@click="ticketNotesCrudRef.insert()"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('ticketNotes.addNote') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
|
</VnRow>
|
||||||
|
</QCard>
|
||||||
|
</template>
|
||||||
|
</CrudModel>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -1,3 +1,11 @@
|
||||||
|
card:
|
||||||
|
search: Search tickets
|
||||||
|
searchInfo: You can search by ticket id or alias
|
||||||
|
ticketNotes:
|
||||||
|
observationType: Observation type
|
||||||
|
description: Description
|
||||||
|
removeNote: Remove note
|
||||||
|
addNote: Add note
|
||||||
ticketSale:
|
ticketSale:
|
||||||
id: Id
|
id: Id
|
||||||
visible: Visible
|
visible: Visible
|
||||||
|
@ -113,9 +121,6 @@ basicData:
|
||||||
negativesConfirmMessage: Negatives are going to be generated, are you sure you want to advance all the lines?
|
negativesConfirmMessage: Negatives are going to be generated, are you sure you want to advance all the lines?
|
||||||
chooseAnOption: Choose an option
|
chooseAnOption: Choose an option
|
||||||
unroutedTicket: The ticket has been unrouted
|
unroutedTicket: The ticket has been unrouted
|
||||||
card:
|
|
||||||
search: Search tickets
|
|
||||||
searchInfo: You can search by ticket id or alias
|
|
||||||
purchaseRequest:
|
purchaseRequest:
|
||||||
id: Id
|
id: Id
|
||||||
description: Description
|
description: Description
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
card:
|
card:
|
||||||
search: Buscar tickets
|
search: Buscar tickets
|
||||||
searchInfo: Buscar tickets por identificador o alias
|
searchInfo: Buscar tickets por identificador o alias
|
||||||
|
ticketNotes:
|
||||||
|
observationType: Tipo de observación
|
||||||
|
description: Descripción
|
||||||
|
removeNote: Quitar nota
|
||||||
|
addNote: Añadir nota
|
||||||
purchaseRequest:
|
purchaseRequest:
|
||||||
Id: Id
|
Id: Id
|
||||||
description: Descripción
|
description: Descripción
|
||||||
|
@ -112,8 +117,6 @@ futureTickets:
|
||||||
moveTicketSuccess: Tickets movidos correctamente
|
moveTicketSuccess: Tickets movidos correctamente
|
||||||
searchInfo: Buscar tickets por fecha
|
searchInfo: Buscar tickets por fecha
|
||||||
futureTicket: Tickets a futuro
|
futureTicket: Tickets a futuro
|
||||||
Search ticket: Buscar tickets
|
|
||||||
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
|
|
||||||
ticketSale:
|
ticketSale:
|
||||||
id: Id
|
id: Id
|
||||||
visible: Visible
|
visible: Visible
|
||||||
|
@ -138,3 +141,5 @@ ticketSale:
|
||||||
shipped: F. Envío
|
shipped: F. Envío
|
||||||
agency: Agencia
|
agency: Agencia
|
||||||
address: Consignatario
|
address: Consignatario
|
||||||
|
Search ticket: Buscar tickets
|
||||||
|
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
|
||||||
|
|
|
@ -19,6 +19,7 @@ export default {
|
||||||
'TicketSale',
|
'TicketSale',
|
||||||
'TicketLog',
|
'TicketLog',
|
||||||
'TicketPurchaseRequest',
|
'TicketPurchaseRequest',
|
||||||
|
'TicketNotes',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -147,6 +148,15 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Ticket/Card/TicketSms.vue'),
|
component: () => import('src/pages/Ticket/Card/TicketSms.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'observation',
|
||||||
|
name: 'TicketNotes',
|
||||||
|
meta: {
|
||||||
|
title: 'notes',
|
||||||
|
icon: 'vn:notes',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Ticket/Card/TicketNotes.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue