forked from verdnatura/salix-front
Changes
This commit is contained in:
parent
a57df459a6
commit
db4c3a6799
|
@ -441,7 +441,7 @@ ticket:
|
|||
sms: Sms
|
||||
notes: Notas
|
||||
sale: Lineas del pedido
|
||||
service: Servicios
|
||||
services: Servicios
|
||||
list:
|
||||
nickname: Alias
|
||||
state: Estado
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, watch, computed } from 'vue';
|
||||
import { ref, watch, computed, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
|
@ -26,6 +26,7 @@ const { store } = arrayData;
|
|||
const { notify } = useNotify();
|
||||
|
||||
const selectedServices = ref(new Set());
|
||||
const defaultTaxClass = ref(null);
|
||||
|
||||
const toggleCheckSelection = (id) => {
|
||||
if (selectedServices.value.has(id)) selectedServices.value.delete(id);
|
||||
|
@ -36,7 +37,10 @@ const crudModelFilter = computed(() => ({
|
|||
where: { ticketFk: route.params.id },
|
||||
}));
|
||||
|
||||
const crudModelRequiredData = computed(() => ({ ticketFk: route.params.id }));
|
||||
const crudModelRequiredData = computed(() => ({
|
||||
ticketFk: route.params.id,
|
||||
taxClassFk: defaultTaxClass.value?.id,
|
||||
}));
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
|
@ -68,6 +72,23 @@ const createRefund = async () => {
|
|||
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>
|
||||
|
||||
<template>
|
||||
|
@ -85,6 +106,7 @@ const createRefund = async () => {
|
|||
@click.stop="createRefund()"
|
||||
/>
|
||||
</Teleport>
|
||||
<div class="flex justify-center">
|
||||
<CrudModel
|
||||
ref="ticketServiceCrudRef"
|
||||
data-key="TicketService"
|
||||
|
@ -94,6 +116,7 @@ const createRefund = async () => {
|
|||
:data-required="crudModelRequiredData"
|
||||
:default-remove="false"
|
||||
auto-load
|
||||
style="max-width: 800px"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<QCard class="q-px-lg q-py-md">
|
||||
|
@ -124,14 +147,14 @@ const createRefund = async () => {
|
|||
</VnSelectDialog>
|
||||
<VnInput
|
||||
:label="t('service.quantity')"
|
||||
v-model="row.quantity"
|
||||
v-model.number="row.quantity"
|
||||
type="number"
|
||||
min="0"
|
||||
:info="t('service.quantityInfo')"
|
||||
/>
|
||||
<VnInput
|
||||
:label="t('service.price')"
|
||||
v-model="row.price"
|
||||
v-model.number="row.price"
|
||||
type="number"
|
||||
min="0"
|
||||
/>
|
||||
|
@ -161,4 +184,5 @@ const createRefund = async () => {
|
|||
</QCard>
|
||||
</template>
|
||||
</CrudModel>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -98,8 +98,8 @@ export default {
|
|||
path: 'service',
|
||||
name: 'TicketService',
|
||||
meta: {
|
||||
title: 'service',
|
||||
icon: 'cloud_upload',
|
||||
title: 'services',
|
||||
icon: 'vn:services',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketService.vue'),
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue