0
0
Fork 0
This commit is contained in:
William Buezas 2024-06-27 11:46:31 -03:00
parent a57df459a6
commit db4c3a6799
3 changed files with 97 additions and 73 deletions

View File

@ -441,7 +441,7 @@ ticket:
sms: Sms sms: Sms
notes: Notas notes: Notas
sale: Lineas del pedido sale: Lineas del pedido
service: Servicios services: Servicios
list: list:
nickname: Alias nickname: Alias
state: Estado state: Estado

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, watch, computed } from 'vue'; import { ref, watch, computed, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -26,6 +26,7 @@ const { store } = arrayData;
const { notify } = useNotify(); const { notify } = useNotify();
const selectedServices = ref(new Set()); const selectedServices = ref(new Set());
const defaultTaxClass = ref(null);
const toggleCheckSelection = (id) => { const toggleCheckSelection = (id) => {
if (selectedServices.value.has(id)) selectedServices.value.delete(id); if (selectedServices.value.has(id)) selectedServices.value.delete(id);
@ -36,7 +37,10 @@ const crudModelFilter = computed(() => ({
where: { ticketFk: route.params.id }, where: { ticketFk: route.params.id },
})); }));
const crudModelRequiredData = computed(() => ({ ticketFk: route.params.id })); const crudModelRequiredData = computed(() => ({
ticketFk: route.params.id,
taxClassFk: defaultTaxClass.value?.id,
}));
watch( watch(
() => route.params.id, () => route.params.id,
@ -68,6 +72,23 @@ const createRefund = async () => {
console.error(error); console.error(error);
} }
}; };
const getDefaultTaxClass = async () => {
try {
let filter = {
where: { code: 'G' },
};
const { data } = await axios.get('TaxClasses/findOne', {
params: { filter: JSON.stringify(filter) },
});
defaultTaxClass.value = data;
console.log('defaultTaxClass', defaultTaxClass.value);
} catch (error) {
console.error(error);
}
};
onMounted(async () => await getDefaultTaxClass());
</script> </script>
<template> <template>
@ -85,6 +106,7 @@ const createRefund = async () => {
@click.stop="createRefund()" @click.stop="createRefund()"
/> />
</Teleport> </Teleport>
<div class="flex justify-center">
<CrudModel <CrudModel
ref="ticketServiceCrudRef" ref="ticketServiceCrudRef"
data-key="TicketService" data-key="TicketService"
@ -94,6 +116,7 @@ const createRefund = async () => {
:data-required="crudModelRequiredData" :data-required="crudModelRequiredData"
:default-remove="false" :default-remove="false"
auto-load auto-load
style="max-width: 800px"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard class="q-px-lg q-py-md"> <QCard class="q-px-lg q-py-md">
@ -124,14 +147,14 @@ const createRefund = async () => {
</VnSelectDialog> </VnSelectDialog>
<VnInput <VnInput
:label="t('service.quantity')" :label="t('service.quantity')"
v-model="row.quantity" v-model.number="row.quantity"
type="number" type="number"
min="0" min="0"
:info="t('service.quantityInfo')" :info="t('service.quantityInfo')"
/> />
<VnInput <VnInput
:label="t('service.price')" :label="t('service.price')"
v-model="row.price" v-model.number="row.price"
type="number" type="number"
min="0" min="0"
/> />
@ -161,4 +184,5 @@ const createRefund = async () => {
</QCard> </QCard>
</template> </template>
</CrudModel> </CrudModel>
</div>
</template> </template>

View File

@ -98,8 +98,8 @@ export default {
path: 'service', path: 'service',
name: 'TicketService', name: 'TicketService',
meta: { meta: {
title: 'service', title: 'services',
icon: 'cloud_upload', icon: 'vn:services',
}, },
component: () => import('src/pages/Ticket/Card/TicketService.vue'), component: () => import('src/pages/Ticket/Card/TicketService.vue'),
}, },