0
0
Fork 0

Solucion a comentarios 14

This commit is contained in:
carlosfonseca 2024-02-19 11:27:24 -05:00
parent bb10714824
commit 86199d8197
17 changed files with 96 additions and 59 deletions

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import VnAvatar from 'src/components/ui/VnAvatar.vue'; import VnAvatar from 'src/components/ui/VnAvatar.vue';
import { toDateHour } from 'src/filters'; import { toDateHourMinSec } from 'src/filters';
import { ref } from 'vue'; import { ref } from 'vue';
import axios from 'axios'; import axios from 'axios';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -51,7 +51,7 @@ async function insert() {
/> />
<slot name="actions"> <slot name="actions">
{{ toDateHour(note.created) }} {{ toDateHourMinSec(note.created) }}
</slot> </slot>
</QItem> </QItem>
</QCardSection> </QCardSection>

View File

@ -1,7 +1,8 @@
import toLowerCase from './toLowerCase'; import toLowerCase from './toLowerCase';
import toDate from './toDate'; import toDate from './toDate';
import toDateString from './toDateString'; import toDateString from './toDateString';
import toDateHour from './toDateHour'; import toDateHourMin from './toDateHourMin';
import toDateHourMinSec from './toDateHourMinSec';
import toRelativeDate from './toRelativeDate'; import toRelativeDate from './toRelativeDate';
import toCurrency from './toCurrency'; import toCurrency from './toCurrency';
import toPercentage from './toPercentage'; import toPercentage from './toPercentage';
@ -16,7 +17,8 @@ export {
toDate, toDate,
toHour, toHour,
toDateString, toDateString,
toDateHour, toDateHourMin,
toDateHourMinSec,
toRelativeDate, toRelativeDate,
toCurrency, toCurrency,
toPercentage, toPercentage,

View File

@ -0,0 +1,11 @@
export default function toDateHourMin(date) {
const dateHour = new Date(date).toLocaleDateString('es-ES', {
timeZone: 'Europe/Madrid',
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
});
return dateHour;
}

View File

@ -1,4 +1,4 @@
export default function toDateHour(date) { export default function toDateHourMinSec(date) {
const dateHour = new Date(date).toLocaleDateString('es-ES', { const dateHour = new Date(date).toLocaleDateString('es-ES', {
timeZone: 'Europe/Madrid', timeZone: 'Europe/Madrid',
year: 'numeric', year: 'numeric',

View File

@ -10,6 +10,7 @@ const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const client = ref(null);
const provincesLocation = ref([]); const provincesLocation = ref([]);
const addressFilter = { const addressFilter = {
@ -51,6 +52,10 @@ const setProvince = (provinceFk) => {
return result[0]?.name || ''; return result[0]?.name || '';
}; };
const isDefaultAddress = (address) => {
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
};
const toCustomerAddressCreate = () => { const toCustomerAddressCreate = () => {
router.push({ name: 'CustomerAddressCreate' }); router.push({ name: 'CustomerAddressCreate' });
}; };
@ -67,6 +72,11 @@ const toCustomerAddressEdit = (addressId) => {
</script> </script>
<template> <template>
<FetchData
@on-fetch="(data) => (client = data)"
auto-load
:url="`Clients/${route.params.id}`"
/>
<FetchData <FetchData
@on-fetch="(data) => (provincesLocation = data)" @on-fetch="(data) => (provincesLocation = data)"
auto-load auto-load
@ -88,11 +98,21 @@ const toCustomerAddressEdit = (addressId) => {
:class="{ :class="{
'address-card': true, 'address-card': true,
'q-mb-md': index < rows.length - 1, 'q-mb-md': index < rows.length - 1,
'item-disabled': !item.isActive,
}" }"
@click="toCustomerAddressEdit(item.id)" @click="toCustomerAddressEdit(item.id)"
> >
<div class="q-ml-xs q-mr-md flex items-center"> <div class="q-ml-xs q-mr-md flex items-center">
<QIcon name="star" size="md" color="primary" /> <QIcon
:style="{
'font-variation-settings': `'FILL' ${isDefaultAddress(
item
)}`,
}"
color="primary"
name="star"
size="md"
/>
</div> </div>
<div> <div>
<div class="text-weight-bold q-mb-sm"> <div class="text-weight-bold q-mb-sm">
@ -161,6 +181,10 @@ const toCustomerAddressEdit = (addressId) => {
background-color: var(--vn-light-gray); background-color: var(--vn-light-gray);
} }
} }
.item-disabled {
opacity: 0.6;
}
</style> </style>
<i18n> <i18n>

View File

@ -6,7 +6,7 @@ import { useRoute } from 'vue-router';
import axios from 'axios'; import axios from 'axios';
import { QCheckbox, QBtn, useQuasar, QField, QPopupEdit } from 'quasar'; import { QCheckbox, QBtn, useQuasar, QField, QPopupEdit } from 'quasar';
import { toCurrency, toDate, toDateHour } from 'src/filters'; import { toCurrency, toDate, toDateHourMinSec } from 'src/filters';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useValidator } from 'src/composables/useValidator'; import { useValidator } from 'src/composables/useValidator';
@ -106,7 +106,7 @@ const columns = computed(() => [
{ {
align: 'left', align: 'left',
field: 'created', field: 'created',
format: (value) => toDateHour(value), format: (value) => toDateHourMinSec(value),
label: t('Creation date'), label: t('Creation date'),
name: 'creationDate', name: 'creationDate',
}, },
@ -256,13 +256,13 @@ const saveFieldValue = async (event) => {
</div> </div>
<div v-else> <div v-else>
<QBtn <QField dense readonly>
:label="props.value" <template #control>
flat <div class="self-center full-width no-outline">
rounded {{ props.row.description }}
class="dotted-border-btn" </div>
no-caps </template>
/> </QField>
<QPopupEdit <QPopupEdit
:key="props.col.name" :key="props.col.name"
label-cancel="Close" label-cancel="Close"

View File

@ -5,7 +5,7 @@ import { useRoute, useRouter } from 'vue-router';
import { QBtn } from 'quasar'; import { QBtn } from 'quasar';
import { toCurrency, toDateHour } from 'src/filters'; import { toCurrency, toDateHourMin } from 'src/filters';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
@ -55,7 +55,7 @@ const columns = computed(() => [
field: 'created', field: 'created',
label: t('Since'), label: t('Since'),
name: 'created', name: 'created',
format: (value) => toDateHour(value), format: (value) => toDateHourMin(value),
}, },
{ {
align: 'left', align: 'left',

View File

@ -57,20 +57,15 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
/> />
</template> </template>
</VnLv> </VnLv>
<VnLv <VnLv :label="t('customer.card.credit')" :value="toCurrency(entity.credit)" />
:label="t('customer.card.credit')"
:value="toCurrency(entity.credit)"
class="col-11"
/>
<VnLv <VnLv
:label="t('customer.card.risk')" :label="t('customer.card.risk')"
:value="toCurrency(entity.debt)" :value="toCurrency(entity.debt)"
class="col-11" :info="t('customer.summary.descriptorInfo')"
/> />
<VnLv <VnLv
:label="t('customer.card.securedCredit')" :label="t('customer.card.securedCredit')"
:value="toCurrency(entity.creditInsurance)" :value="toCurrency(entity.creditInsurance)"
:info="t('customer.summary.descriptorInfo')"
/> />
<VnLv :label="t('customer.card.payMethod')" :value="entity.payMethod.name" /> <VnLv :label="t('customer.card.payMethod')" :value="entity.payMethod.name" />
<VnLv :label="t('customer.card.debt')" :value="toCurrency(entity.debt)" /> <VnLv :label="t('customer.card.debt')" :value="toCurrency(entity.debt)" />

View File

@ -6,7 +6,7 @@ import { useRoute, useRouter } from 'vue-router';
import { QBadge, QBtn, QCheckbox } from 'quasar'; import { QBadge, QBtn, QCheckbox } from 'quasar';
import { downloadFile } from 'src/composables/downloadFile'; import { downloadFile } from 'src/composables/downloadFile';
import { toDateHour } from 'src/filters'; import { toDateHourMinSec } from 'src/filters';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
@ -163,7 +163,7 @@ const columns = computed(() => [
field: (value) => value.dms.created, field: (value) => value.dms.created,
label: t('Created'), label: t('Created'),
name: 'created', name: 'created',
format: (value) => toDateHour(value), format: (value) => toDateHourMinSec(value),
}, },
{ {
align: 'right', align: 'right',

View File

@ -80,9 +80,7 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
> >
<template #append> <template #append>
<QIcon name="info" class="cursor-info"> <QIcon name="info" class="cursor-info">
<QTooltip>{{ <QTooltip>{{ t('onlyLetters') }}</QTooltip>
t('Only letters, numbers and spaces can be used')
}}</QTooltip>
</QIcon> </QIcon>
</template> </template>
</VnInput> </VnInput>
@ -117,7 +115,18 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
option-label="vat" option-label="vat"
option-value="id" option-value="id"
v-model="data.sageTransactionTypeFk" v-model="data.sageTransactionTypeFk"
/> >
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt.name }}</QItemLabel>
<QItemLabel caption>
{{ `${scope.opt.id}: ${scope.opt.transaction}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div> </div>
</VnRow> </VnRow>
@ -234,11 +243,7 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
<QCheckbox :label="t('Vies')" v-model="data.isVies" /> <QCheckbox :label="t('Vies')" v-model="data.isVies" />
<QIcon name="info" class="cursor-info q-ml-sm" size="sm"> <QIcon name="info" class="cursor-info q-ml-sm" size="sm">
<QTooltip> <QTooltip>
{{ {{ t('whenActivatingIt') }}
t(
'When activating it, do not enter the country code in the ID field'
)
}}
</QTooltip> </QTooltip>
</QIcon> </QIcon>
</div> </div>
@ -267,11 +272,7 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
/> />
<QIcon class="cursor-info q-ml-sm" name="info" size="sm"> <QIcon class="cursor-info q-ml-sm" name="info" size="sm">
<QTooltip> <QTooltip>
{{ {{ t('inOrderToInvoice') }}
t(
"In order to invoice, this field is not contulted, but the consignee's ET. When modifiying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not"
)
}}
</QTooltip> </QTooltip>
</QIcon> </QIcon>
</div> </div>
@ -304,7 +305,6 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
<i18n> <i18n>
es: es:
Social name: Razón social Social name: Razón social
Only letters, numbers and spaces can be used: Sólo se pueden usar letras, números y espacios
Tax number: NIF / CIF Tax number: NIF / CIF
Street: Dirección fiscal Street: Dirección fiscal
Sage tax type: Tipo de impuesto Sage Sage tax type: Tipo de impuesto Sage
@ -317,12 +317,17 @@ es:
Frozen: Congelado Frozen: Congelado
Has to invoice: Factura Has to invoice: Factura
Vies: Vies Vies: Vies
When activating it, do not enter the country code in the ID field: Al activarlo, no informar el código del país en el campo nif.
Notify by email: Notificar vía e-mail Notify by email: Notificar vía e-mail
Invoice by address: Facturar por consignatario Invoice by address: Facturar por consignatario
Is equalizated: Recargo de equivalencia Is equalizated: Recargo de equivalencia
In order to invoice, this field is not contulted, but the consignee's ET. When modifiying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not: Para facturar no se consulta este campo, sino el RE de consignatario. Al modificar este campo si no esta marcada la casilla Facturar por consignatario, se propagará automaticamente el cambio a todos lo consignatarios, en caso contrario preguntará al usuario si quiere o no propagar.
Verified data: Datos comprobados Verified data: Datos comprobados
Incoterms authorization: Autorización incoterms Incoterms authorization: Autorización incoterms
Electronic invoice: Factura electrónica Electronic invoice: Factura electrónica
onlyLetters: Sólo se pueden usar letras, números y espacios
whenActivatingIt: Al activarlo, no informar el código del país en el campo nif
inOrderToInvoice: Para facturar no se consulta este campo, sino el RE de consignatario. Al modificar este campo si no esta marcada la casilla Facturar por consignatario, se propagará automaticamente el cambio a todos lo consignatarios, en caso contrario preguntará al usuario si quiere o no propagar
en:
onlyLetters: Only letters, numbers and spaces can be used
whenActivatingIt: When activating it, do not enter the country code in the ID field
inOrderToInvoice: In order to invoice, this field is not contulted, but the consignee's ET. When modifiying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not
</i18n> </i18n>

View File

@ -5,7 +5,7 @@ import { useRoute, useRouter } from 'vue-router';
import { date, QBtn } from 'quasar'; import { date, QBtn } from 'quasar';
import { toCurrency, toDateHour } from 'src/filters'; import { toCurrency, toDateHourMinSec } from 'src/filters';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
@ -73,7 +73,7 @@ const columns = computed(() => [
field: 'shipped', field: 'shipped',
label: t('Date'), label: t('Date'),
name: 'date', name: 'date',
format: (value) => toDateHour(value), format: (value) => toDateHourMinSec(value),
}, },
{ {
align: 'left', align: 'left',

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { toDateHour } from 'src/filters'; import { toDateHourMinSec } from 'src/filters';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
@ -74,14 +74,14 @@ const columns = computed(() => [
field: 'created', field: 'created',
label: t('Register date'), label: t('Register date'),
name: 'registerDate', name: 'registerDate',
format: (value) => toDateHour(value), format: (value) => toDateHourMinSec(value),
}, },
{ {
align: 'left', align: 'left',
field: 'finished', field: 'finished',
label: t('End date'), label: t('End date'),
name: 'endDate', name: 'endDate',
format: (value) => (value ? toDateHour(value) : '-'), format: (value) => (value ? toDateHourMinSec(value) : '-'),
}, },
]); ]);
</script> </script>

View File

@ -7,7 +7,7 @@ import { QBtn } from 'quasar';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { toDateHour } from 'src/filters'; import { toDateHourMinSec } from 'src/filters';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
@ -55,7 +55,7 @@ const columns = computed(() => [
field: 'created', field: 'created',
label: t('Sent'), label: t('Sent'),
name: 'sent', name: 'sent',
format: (value) => toDateHour(value), format: (value) => toDateHourMinSec(value),
}, },
{ {
align: 'left', align: 'left',

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { toCurrency, toDateHour } from 'src/filters'; import { toCurrency, toDateHourMinSec } from 'src/filters';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import CustomerCloseIconTooltip from '../components/CustomerCloseIconTooltip.vue'; import CustomerCloseIconTooltip from '../components/CustomerCloseIconTooltip.vue';
@ -74,7 +74,7 @@ const columns = computed(() => [
field: 'created', field: 'created',
label: t('Date'), label: t('Date'),
name: 'date', name: 'date',
format: (value) => toDateHour(value), format: (value) => toDateHourMinSec(value),
}, },
{ {
align: 'left', align: 'left',

View File

@ -32,7 +32,7 @@ const setClientsConfirmTransaction = async () => {
<QIcon <QIcon
@click.stop="setClientsConfirmTransaction" @click.stop="setClientsConfirmTransaction"
color="primary" color="primary"
name="check" name="done_all"
size="sm" size="sm"
> >
<QTooltip>{{ t('Confirm transaction') }}</QTooltip> <QTooltip>{{ t('Confirm transaction') }}</QTooltip>

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { toCurrency, toDateHour } from 'src/filters'; import { toCurrency, toDateHourMinSec } from 'src/filters';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
@ -41,7 +41,7 @@ const columns = computed(() => [
{ {
align: 'left', align: 'left',
field: 'created', field: 'created',
format: (value) => toDateHour(value), format: (value) => toDateHourMinSec(value),
label: t('Created'), label: t('Created'),
name: 'created', name: 'created',
}, },

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { dashIfEmpty, toCurrency, toDateHour } from 'src/filters'; import { dashIfEmpty, toCurrency, toDateHourMinSec } from 'src/filters';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import CardSummary from 'components/ui/CardSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
@ -86,15 +86,15 @@ const detailsColumns = ref([
<QCard class="vn-one"> <QCard class="vn-one">
<VnLv <VnLv
:label="t('order.summary.created')" :label="t('order.summary.created')"
:value="toDateHour(entity?.created)" :value="toDateHourMinSec(entity?.created)"
/> />
<VnLv <VnLv
:label="t('order.summary.confirmed')" :label="t('order.summary.confirmed')"
:value="toDateHour(entity?.confirmed)" :value="toDateHourMinSec(entity?.confirmed)"
/> />
<VnLv <VnLv
:label="t('order.summary.landed')" :label="t('order.summary.landed')"
:value="toDateHour(entity?.landed)" :value="toDateHourMinSec(entity?.landed)"
/> />
<VnLv :label="t('order.summary.phone')"> <VnLv :label="t('order.summary.phone')">
<template #value> <template #value>