forked from verdnatura/salix-front
WIP
This commit is contained in:
parent
fb12d4ddc0
commit
8e538fb463
|
@ -443,11 +443,7 @@ ticket:
|
|||
sms: Sms
|
||||
notes: Notes
|
||||
sale: Sale
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
dms: File management
|
||||
services: Service
|
||||
>>>>>>> Stashed changes
|
||||
list:
|
||||
nickname: Nickname
|
||||
state: State
|
||||
|
|
|
@ -441,11 +441,7 @@ ticket:
|
|||
sms: Sms
|
||||
notes: Notas
|
||||
sale: Lineas del pedido
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
dms: Gestión documental
|
||||
service: Servicios
|
||||
>>>>>>> Stashed changes
|
||||
list:
|
||||
nickname: Alias
|
||||
state: Estado
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<script setup>
|
||||
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits(['onDataSaved']);
|
||||
|
||||
const nameInputRef = ref(null);
|
||||
const serviceFormData = reactive({});
|
||||
|
||||
const onDataSaved = (formData, requestResponse) => {
|
||||
emit('onDataSaved', formData, requestResponse);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await nextTick();
|
||||
nameInputRef.value.focus();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FormModelPopup
|
||||
url-create="TicketServiceTypes"
|
||||
model="TicketServiceType"
|
||||
:title="t('New service type')"
|
||||
:form-initial-data="serviceFormData"
|
||||
@on-data-saved="onDataSaved"
|
||||
>
|
||||
<template #form-inputs="{ data }">
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInput
|
||||
ref="nameInputRef"
|
||||
:label="t('service.description')"
|
||||
v-model="data.name"
|
||||
:required="true"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormModelPopup>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
New service type: Nuevo tipo de servicio
|
||||
</i18n>
|
|
@ -1 +1,137 @@
|
|||
<template>Ticket service</template>
|
||||
<script setup>
|
||||
import { ref, watch, computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import CrudModel from 'components/CrudModel.vue';
|
||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import TicketCreateServiceType from './TicketCreateServiceType.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const ticketServiceTypeFetchRef = ref(null);
|
||||
const ticketServiceCrudRef = ref(null);
|
||||
const ticketServiceOptions = ref([]);
|
||||
const arrayData = useArrayData('TicketNotes');
|
||||
const { store } = arrayData;
|
||||
|
||||
const selectedServices = ref(new Set());
|
||||
|
||||
const toggleCheckSelection = (id) => {
|
||||
if (selectedServices.value.has(id)) selectedServices.value.delete(id);
|
||||
else selectedServices.value.add(id);
|
||||
};
|
||||
|
||||
const crudModelFilter = computed(() => ({
|
||||
where: { ticketFk: route.params.id },
|
||||
}));
|
||||
|
||||
const crudModelRequiredData = computed(() => ({ ticketFk: route.params.id }));
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
async () => {
|
||||
store.filter = crudModelFilter.value;
|
||||
await ticketServiceCrudRef.value.reload();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
ref="ticketServiceTypeFetchRef"
|
||||
@on-fetch="(data) => (ticketServiceOptions = data)"
|
||||
auto-load
|
||||
url="TicketServiceTypes"
|
||||
/>
|
||||
<!-- <Teleport v-if="" to="#st-actions">
|
||||
<QBtn
|
||||
color="primary"
|
||||
:label="t('service.pay')"
|
||||
:disabled="!selectedServices.size"
|
||||
@click.stop="viewAddObservation(selected)"
|
||||
/>
|
||||
</Teleport> -->
|
||||
<CrudModel
|
||||
ref="ticketServiceCrudRef"
|
||||
data-key="TicketService"
|
||||
url="TicketServices"
|
||||
model="TicketService"
|
||||
:filter="crudModelFilter"
|
||||
:data-required="crudModelRequiredData"
|
||||
:default-remove="false"
|
||||
auto-load
|
||||
>
|
||||
<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"
|
||||
>
|
||||
<QCheckbox
|
||||
size="sm"
|
||||
@update:model-value="toggleCheckSelection(row.id)"
|
||||
:model-value="selectedServices.has(row.id)"
|
||||
:toggle-indeterminate="false"
|
||||
/>
|
||||
<VnSelectDialog
|
||||
:label="t('service.description')"
|
||||
v-model="row.ticketServiceTypeFk"
|
||||
:options="ticketServiceOptions"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
hide-selected
|
||||
>
|
||||
<template #form>
|
||||
<TicketCreateServiceType
|
||||
@on-data-saved="ticketServiceTypeFetchRef.fetch()"
|
||||
/>
|
||||
</template>
|
||||
</VnSelectDialog>
|
||||
<VnInput
|
||||
:label="t('service.quantity')"
|
||||
v-model="row.quantity"
|
||||
type="number"
|
||||
min="0"
|
||||
:info="t('service.quantityInfo')"
|
||||
/>
|
||||
<VnInput
|
||||
:label="t('service.price')"
|
||||
v-model="row.price"
|
||||
type="number"
|
||||
min="0"
|
||||
/>
|
||||
<QIcon
|
||||
name="delete"
|
||||
size="sm"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
@click="ticketServiceCrudRef.remove([row])"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('service.removeNote') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</div>
|
||||
<QIcon
|
||||
name="add_circle"
|
||||
class="fill-icon-on-hover q-ml-md"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click="ticketServiceCrudRef.insert()"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('service.addService') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</QCard>
|
||||
</template>
|
||||
</CrudModel>
|
||||
<pre>checkeds: {{ selectedServices }}</pre>
|
||||
</template>
|
||||
|
|
|
@ -6,3 +6,4 @@ service:
|
|||
removeService: Remove service
|
||||
newService: New service type
|
||||
addService: Add service
|
||||
quantityInfo: To create services with negative amounts mark the service on the source ticket and press the pay button.
|
||||
|
|
|
@ -6,5 +6,6 @@ service:
|
|||
removeService: Quitar servicio
|
||||
newService: Nuevo tipo de servicio
|
||||
addService: Añadir servicio
|
||||
quantityInfo: Para crear sevicios con cantidades negativas marcar servicio en el ticket origen y apretar el boton abonar.
|
||||
Search ticket: Buscar ticket
|
||||
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
|
||||
|
|
|
@ -12,11 +12,7 @@ export default {
|
|||
redirect: { name: 'TicketMain' },
|
||||
menus: {
|
||||
main: ['TicketList'],
|
||||
<<<<<<< Updated upstream
|
||||
card: ['TicketBoxing', 'TicketSms', 'TicketSale'],
|
||||
=======
|
||||
card: ['TicketBoxing', 'TicketSms', 'TicketSale', 'TicketDms', 'TicketService'],
|
||||
>>>>>>> Stashed changes
|
||||
card: ['TicketBoxing', 'TicketSms', 'TicketSale', 'TicketService'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
@ -97,17 +93,7 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketSms.vue'),
|
||||
},
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
{
|
||||
path: 'dms',
|
||||
name: 'TicketDms',
|
||||
meta: {
|
||||
title: 'dms',
|
||||
icon: 'cloud_upload',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketDms.vue'),
|
||||
},
|
||||
|
||||
{
|
||||
path: 'service',
|
||||
name: 'TicketService',
|
||||
|
@ -117,7 +103,6 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketService.vue'),
|
||||
},
|
||||
>>>>>>> Stashed changes
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue