refactor: refs #7553 requested changes and added keyup.enter

This commit is contained in:
Jon Elias 2024-09-24 10:35:59 +02:00
parent b728b7c5bd
commit cd96003c0e
12 changed files with 28 additions and 15 deletions

View File

@ -433,13 +433,6 @@ function handleOnDataSaved(_) {
@click="stateStore.toggleRightDrawer()"
/>
</template>
<!--TODO: este slot se carga los botones de mostrar tabla/card y columnas visibles
por lo que no es viable para el uso que se le quiere dar-->
<!-- <template #top>
<div class="full-width-slot">
<slot name="before-header" />
</div>
</template> -->
<template #header-cell="{ col }">
<QTh v-if="col.visible ?? true">
<div

View File

@ -47,7 +47,6 @@ defineProps({ dataKey: { type: String, required: true } });
</QItemSection>
</QItem>
<QItem>
<!--It's required to include the relation category !! There's 413 records in production-->
<QItemSection>
<VnSelect
v-model="params.typeId"

View File

@ -249,7 +249,7 @@ watch(
@on-fetch="(data) => (orderSummary.vat = data)"
auto-load
/>
<QDrawer side="right" :width="270" v-model="stateStore.rightDrawer">
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<QCard
class="order-lines-summary q-pa-lg"
v-if="orderSummary.vat && orderSummary.total"

View File

@ -192,7 +192,7 @@ onMounted(() => {
:order="['landed DESC', 'clientFk ASC', 'id DESC']"
:create="{
urlCreate: 'Orders/new',
title: 'Create Order',
title: t('module.cerateOrder'),
onDataSaved: (url) => {
tableRef.redirect(url);
},

View File

@ -10,6 +10,7 @@ module:
total: Total
salesPerson: Sales Person
address: Address
cerateOrder: Create order
lines:
item: Item
warehouse: Warehouse

View File

@ -10,6 +10,7 @@ module:
total: Total
salesPerson: Comercial
address: Dirección
cerateOrder: Crear cesta
lines:
item: Artículo
warehouse: Almacén

View File

@ -144,7 +144,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@on-fetch="(data) => (ticketUpdateActions = data)"
auto-load
/>
<QDrawer side="right" :width="270" v-model="stateStore.rightDrawer">
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<QCard
class="q-pa-md q-mb-md q-ma-md color-vn-text"
bordered

View File

@ -192,7 +192,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@on-fetch="(data) => (components = data)"
auto-load
/>
<QDrawer side="right" :width="270" v-model="stateStore.rightDrawer">
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
<QCardSection horizontal>
<span class="text-weight-bold text-subtitle1 text-center full-width">

View File

@ -17,6 +17,7 @@ const ticketNotesCrudRef = ref(null);
const observationTypes = ref([]);
const arrayData = useArrayData('TicketNotes');
const { store } = arrayData;
const isSaving = ref(false);
const crudModelFilter = reactive({
where: { ticketFk: route.params.id },
@ -36,6 +37,14 @@ watch(
function handleDelete(row) {
ticketNotesCrudRef.value.remove([row]);
}
async function handleSave() {
if (!isSaving.value) {
isSaving.value = true;
await ticketNotesCrudRef.value?.saveChanges();
isSaving.value = false;
}
}
</script>
<template>
@ -76,6 +85,7 @@ function handleDelete(row) {
:label="t('ticketNotes.description')"
v-model="row.description"
class="col"
@keyup.enter="handleSave"
/>
<QIcon
name="delete"

View File

@ -585,7 +585,7 @@ watch(
</QBtnGroup>
</template>
</VnSubToolbar>
<QDrawer side="right" :width="270" v-model="stateStore.rightDrawer">
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<div
class="q-pa-md q-mb-md q-ma-md color-vn-text"
style="border: 2px solid black"

View File

@ -25,7 +25,7 @@ const { notify } = useNotify();
const selected = ref([]);
const defaultTaxClass = ref(null);
const isSaving = ref(false);
const crudModelFilter = computed(() => ({
where: { ticketFk: route.params.id },
}));
@ -121,6 +121,14 @@ async function deleteService(row) {
ticketServiceCrudRef.value.reload();
}
}
async function handleSave() {
if (!isSaving.value) {
isSaving.value = true;
await ticketServiceCrudRef.value?.saveChanges();
isSaving.value = false;
}
}
</script>
<template>
@ -195,6 +203,7 @@ async function deleteService(row) {
v-model.number="row.price"
type="number"
min="0"
@keyup.enter="handleSave"
/>
</QTd>
</template>

View File

@ -109,7 +109,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
<QDrawer
v-if="packingTypeVolume.length"
side="right"
:width="270"
:width="265"
v-model="stateStore.rightDrawer"
>
<QCard