fix: refs #4466 remove console log

This commit is contained in:
Jorge Penadés 2024-01-26 10:14:05 +01:00
parent 173049049a
commit 21dc1b4eea
7 changed files with 221 additions and 73 deletions

View File

@ -202,12 +202,10 @@ function getChanges() {
const pk = $props.primaryKey; const pk = $props.primaryKey;
for (const [i, row] of formData.value.entries()) { for (const [i, row] of formData.value.entries()) {
console.log(pk, row);
if (!row[pk]) { if (!row[pk]) {
creates.push(row); creates.push(row);
} else if (originalData.value) { } else if (originalData.value) {
const data = getDifferences(originalData.value[i], row); const data = getDifferences(originalData.value[i], row);
console.log(data);
if (!isEmpty(data)) { if (!isEmpty(data)) {
updates.push({ updates.push({
data, data,
@ -217,7 +215,6 @@ function getChanges() {
} }
} }
const changes = { updates, creates }; const changes = { updates, creates };
console.log('ddd', changes);
for (let prop in changes) { for (let prop in changes) {
if (changes[prop].length === 0) changes[prop] = undefined; if (changes[prop].length === 0) changes[prop] = undefined;
} }

View File

@ -31,7 +31,6 @@ onBeforeMount(async () => {
}, },
0 0
); );
console.log(balanceDueTotal.value);
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
}); });

View File

@ -485,7 +485,6 @@ const selectCustomerId = (id) => {
}; };
const selectSalesPersonId = (id) => { const selectSalesPersonId = (id) => {
console.log('selectedSalesPersonId:: ', selectedSalesPersonId.value);
selectedSalesPersonId.value = id; selectedSalesPersonId.value = id;
}; };
</script> </script>

View File

@ -44,7 +44,6 @@ const setData = (entity) => {
}; };
const removeDepartment = () => { const removeDepartment = () => {
console.log('entityId: ', entityId.value);
quasar quasar
.dialog({ .dialog({
title: 'Are you sure you want to delete it?', title: 'Are you sure you want to delete it?',

View File

@ -25,6 +25,7 @@ const columns = computed(() => [
name: 'origin', name: 'origin',
label: t('Original invoice'), label: t('Original invoice'),
field: (row) => row.correctedFk, field: (row) => row.correctedFk,
model: 'correctedFk',
sortable: true, sortable: true,
tabIndex: 1, tabIndex: 1,
align: 'left', align: 'left',
@ -48,7 +49,7 @@ const columns = computed(() => [
options: siiTypeInvoiceOuts.value, options: siiTypeInvoiceOuts.value,
model: 'siiTypeInvoiceOutFk', model: 'siiTypeInvoiceOutFk',
optionValue: 'id', optionValue: 'id',
optionLabel: 'id', optionLabel: 'code',
sortable: true, sortable: true,
tabIndex: 1, tabIndex: 1,
align: 'left', align: 'left',
@ -73,7 +74,7 @@ const rowsSelected = ref([]);
const requiredFieldRule = (val) => val || t('globals.requiredField'); const requiredFieldRule = (val) => val || t('globals.requiredField');
const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/summary`); const onSave = (data) => data?.deletes && router.push(`/invoice-in/${invoiceId}/summary`);
</script> </script>
<template> <template>
<FetchData <FetchData
@ -114,6 +115,11 @@ const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/s
:grid="$q.screen.lt.sm" :grid="$q.screen.lt.sm"
:pagination="{ rowsPerPage: 0 }" :pagination="{ rowsPerPage: 0 }"
> >
<template #body-cell-origin="{ row, col }">
<QTd>
<QInput v-model="row[col.model]" readonly />
</QTd>
</template>
<template #body-cell-type="{ row, col }"> <template #body-cell-type="{ row, col }">
<QTd> <QTd>
<VnSelectFilter <VnSelectFilter
@ -149,6 +155,91 @@ const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/s
/> />
</QTd> </QTd>
</template> </template>
<template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
<QCard bordered flat class="q-my-xs">
<QCardSection>
<QCheckbox v-model="props.selected" dense />
</QCardSection>
<QSeparator />
<QList>
<QItem>
<QInput
:label="t('Original invoice')"
v-model="props.row['correctedFk']"
readonly
/>
</QItem>
<!-- <QItem>
<QInput
:label="t('Taxable base')"
:class="{
'no-pointer-events': isNotEuro(
invoiceIn.currency.code
),
}"
class="full-width"
:disable="isNotEuro(invoiceIn.currency.code)"
clear-icon="close"
v-model="props.row.taxableBase"
clearable
>
<template #append>
<QIcon name="euro" size="xs" flat />
</template>
</QInput>
</QItem>
<QItem>
<VnSelectFilter
:label="t('Sage iva')"
class="full-width"
v-model="props.row['taxTypeSageFk']"
:options="sageTaxTypes"
option-value="id"
option-label="vat"
:filter-options="['id', 'vat']"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
scope.opt.vat
}}</QItemLabel>
<QItemLabel>
{{ `#${scope.opt.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</QItem>
<QItem>
<VnSelectFilter
class="full-width"
v-model="props.row['transactionTypeSageFk']"
:options="sageTransactionTypes"
option-value="id"
option-label="transaction"
:filter-options="['id', 'transaction']"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
scope.opt.transaction
}}</QItemLabel>
<QItemLabel>
{{ `#${scope.opt.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</QItem> -->
</QList>
</QCard>
</div>
</template>
</QTable> </QTable>
</template> </template>
</CrudModel> </CrudModel>

View File

@ -1,12 +1,10 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnSelectFilter from 'components/common/VnSelectFilter.vue'; import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue'; import { useFirstUpper } from 'src/composables/useFirstUpper';
import VnInputDate from 'components/common/VnInputDate.vue';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
@ -36,32 +34,40 @@ const suppliersRef = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="list q-gutter-y-sm q-mt-sm"> <QList dense>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput :label="t('Id or Supplier')" v-model="params.search">
:label="t('Id or Supplier')"
v-model="params.search"
is-outlined
>
<template #prepend> <template #prepend>
<QIcon name="badge" size="sm"></QIcon> <QIcon name="badge" size="sm"></QIcon>
</template> </template>
</VnInput> </QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput
:label="t('params.supplierRef')" :label="t('params.supplierRef')"
v-model="params.supplierRef" v-model="params.supplierRef"
is-outlined @input.
lazy-rules lazy-rules
> >
<template #prepend> <template #prepend>
<QIcon name="vn:client" size="sm"></QIcon> <QIcon name="vn:client" size="sm"></QIcon>
</template> </template>
</VnInput> </QInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QInput
:label="useFirstUpper(t('params.correctives'))"
v-model="params.correctedFk"
>
<template #prepend>
<QIcon name="attachment" size="sm" />
</template>
</QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
@ -73,67 +79,52 @@ const suppliersRef = ref();
option-value="id" option-value="id"
option-label="nickname" option-label="nickname"
@input-value="suppliersRef.fetch()" @input-value="suppliersRef.fetch()"
dense
outlined
rounded
> >
</VnSelectFilter> </VnSelectFilter>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput :label="t('params.fi')" v-model="params.fi" lazy-rules>
:label="t('params.fi')"
v-model="params.fi"
is-outlined
lazy-rules
>
<template #prepend> <template #prepend>
<QIcon name="badge" size="sm"></QIcon> <QIcon name="badge" size="sm"></QIcon>
</template> </template>
</VnInput> </QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput
:label="t('params.serialNumber')" :label="t('params.serialNumber')"
v-model="params.serialNumber" v-model="params.serialNumber"
is-outlined
lazy-rules lazy-rules
> >
<template #prepend> <template #prepend>
<QIcon name="badge" size="sm"></QIcon> <QIcon name="badge" size="sm"></QIcon>
</template> </template>
</VnInput> </QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput
:label="t('params.serial')" :label="t('params.serial')"
v-model="params.serial" v-model="params.serial"
is-outlined
lazy-rules lazy-rules
> >
<template #prepend> <template #prepend>
<QIcon name="badge" size="sm"></QIcon> <QIcon name="badge" size="sm"></QIcon>
</template> </template>
</VnInput> </QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput :label="t('Amount')" v-model="params.amount" lazy-rules>
:label="t('Amount')"
v-model="params.amount"
is-outlined
lazy-rules
>
<template #prepend> <template #prepend>
<QIcon name="euro" size="sm"></QIcon> <QIcon name="euro" size="sm"></QIcon>
</template> </template>
</VnInput> </QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-md"> <QItem class="q-mb-md">
@ -149,57 +140,137 @@ const suppliersRef = ref();
<QExpansionItem :label="t('More options')" expand-separator> <QExpansionItem :label="t('More options')" expand-separator>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput
:label="t('params.awb')" :label="t('params.awb')"
v-model="params.awbCode" v-model="params.awbCode"
is-outlined
lazy-rules lazy-rules
> >
<template #prepend> <template #prepend>
<QIcon name="badge" size="sm"></QIcon> <QIcon name="badge" size="sm"></QIcon>
</template> </template>
</VnInput> </QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <QInput
:label="t('params.account')" :label="t('params.account')"
v-model="params.account" v-model="params.account"
is-outlined
lazy-rules lazy-rules
> >
<template #prepend> <template #prepend>
<QIcon name="person" size="sm" /> <QIcon name="person" size="sm" />
</template> </template>
</VnInput> </QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInputDate <QInput :label="t('From')" v-model="params.from" mask="date">
:label="t('From')" <template #append>
v-model="params.from" <QIcon name="event" class="cursor-pointer">
is-outlined <QPopupProxy
/> cover
transition-show="scale"
transition-hide="scale"
>
<QDate v-model="params.from" landscape>
<div
class="row items-center justify-end q-gutter-sm"
>
<QBtn
:label="t('globals.cancel')"
color="primary"
flat
v-close-popup
/>
<QBtn
:label="t('globals.confirm')"
color="primary"
flat
@click="save"
v-close-popup
/>
</div>
</QDate>
</QPopupProxy>
</QIcon>
</template>
</QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInputDate <QInput :label="t('To')" v-model="params.to" mask="date">
:label="t('To')" <template #append>
v-model="params.to" <QIcon name="event" class="cursor-pointer">
is-outlined <QPopupProxy
/> cover
transition-show="scale"
transition-hide="scale"
>
<QDate v-model="params.to" landscape>
<div
class="row items-center justify-end q-gutter-sm"
>
<QBtn
:label="t('globals.cancel')"
color="primary"
flat
v-close-popup
/>
<QBtn
:label="t('globals.confirm')"
color="primary"
flat
@click="save"
v-close-popup
/>
</div>
</QDate>
</QPopupProxy>
</QIcon>
</template>
</QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInputDate <QInput
:label="t('Issued')" :label="t('Issued')"
v-model="params.issued" v-model="params.issued"
is-outlined mask="date"
/> >
<template #append>
<QIcon name="event" class="cursor-pointer">
<QPopupProxy
cover
transition-show="scale"
transition-hide="scale"
>
<QDate v-model="params.issued" landscape>
<div
class="row items-center justify-end q-gutter-sm"
>
<QBtn
:label="t('globals.cancel')"
color="primary"
flat
v-close-popup
/>
<QBtn
:label="t('globals.confirm')"
color="primary"
flat
@click="save"
v-close-popup
/>
</div>
</QDate>
</QPopupProxy>
</QIcon>
</template>
</QInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
</QExpansionItem> </QExpansionItem>
@ -208,15 +279,6 @@ const suppliersRef = ref();
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:
@ -233,6 +295,7 @@ en:
serial: Serial serial: Serial
account: Account account: Account
isBooked: is booked isBooked: is booked
correctives: correctives
es: es:
params: params:
search: Contiene search: Contiene
@ -249,6 +312,7 @@ es:
account: Cuenta account: Cuenta
created: Creada created: Creada
dued: Vencida dued: Vencida
correctives: rectificativas
From: Desde From: Desde
To: Hasta To: Hasta
Amount: Importe Amount: Importe

View File

@ -1,5 +1,4 @@
import { RouterView } from 'vue-router'; import { RouterView } from 'vue-router';
import axios from 'axios';
export default { export default {
path: '/invoice-in', path: '/invoice-in',