PR-CUSTOMER #186

Merged
jsegarra merged 105 commits from :PR-CUSTOMER into dev 2024-04-19 15:55:53 +00:00
5 changed files with 71 additions and 32 deletions
Showing only changes of commit b12968f982 - Show all commits

View File

@ -1,5 +1,5 @@
<script setup>
import { ref } from 'vue';
import { onBeforeMount, ref, watch } from 'vue';
jsegarra marked this conversation as resolved
Review

Se que no aplica ni es este fichero, pero podemos eliminar
const route de CustomerCard??
Sale warning de consola

Se que no aplica ni es este fichero, pero podemos eliminar const route de CustomerCard?? Sale warning de consola
Review

Route eliminado

Commit: 3e124581c4

Route eliminado Commit: https://gitea.verdnatura.es/hyervoni/salix-front-mindshore/commit/3e124581c442ca84e1d1e8f003ff6af3daae9239
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
@ -47,9 +47,39 @@ const addressFilter = {
],
};
const setRows = (data) => {
addresses.value = data;
sortAddresses();
onBeforeMount(() => {
const { id } = route.params;
getAddressesData(id);
getClientData(id);
});
watch(
() => route.params.id,
(newValue) => {
getAddressesData(newValue);
getClientData(newValue);
}
);
const getAddressesData = async (id) => {
try {
const { data } = await axios.get(`Clients/${id}/addresses`, {
params: { filter: JSON.stringify(addressFilter) },
});
addresses.value = data;
sortAddresses();
} catch (error) {
return error;
}
};
const getClientData = async (id) => {
try {
const { data } = await axios.get(`Clients/${id}`);
client.value = data;
} catch (error) {
return error;
}
};
const setProvince = (provinceFk) => {
@ -97,17 +127,6 @@ const toCustomerAddressEdit = (addressId) => {
</script>
<template>
<FetchData
@on-fetch="setRows"
auto-load
:filter="addressFilter"
:url="`Clients/${route.params.id}/addresses`"
/>
<FetchData
@on-fetch="(data) => (client = data)"
auto-load
:url="`Clients/${route.params.id}`"
/>
<FetchData
@on-fetch="(data) => (provincesLocation = data)"
auto-load

View File

@ -72,11 +72,11 @@ const filterOptions = {
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput
:label="t('customer.basicData.socialName')"
:label="t('Comercial name')"
:rules="validate('client.socialName')"
autofocus
clearable
v-model="data.socialName"
v-model="data.name"
/>
</div>
<div class="col">
@ -210,4 +210,5 @@ const filterOptions = {
<i18n>
es:
In case of a company succession, specify the grantor company: En el caso de que haya habido una sucesión de empresa, indicar la empresa cedente
Comercial name: Nombre comercial
</i18n>

View File

@ -24,8 +24,9 @@ const filter = {
limit: 30,
};
const getBankEntities = () => {
const getBankEntities = (data, formData) => {
bankEntitiesRef.value.fetch();
formData.bankEntityFk = Number(data.id);
};
</script>
@ -89,7 +90,9 @@ const getBankEntities = () => {
v-model="data.bankEntityFk"
>
<template #form>
<CreateBankEntityForm @on-data-saved="getBankEntities()" />
<CreateBankEntityForm
@on-data-saved="getBankEntities($event, data)"
/>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -1,8 +1,10 @@
<script setup>
jsegarra marked this conversation as resolved
Review

Usar el cliente 1101

Usar el cliente 1101
Review

Corrección: 08e072100b

Corrección: 08e072100b
Review

Los iconos de la columna estado, al hacer hover cambia el cursor induciendo a error al usuario porque parece que se pueda hacer una acción.
El tooltip de icono de la ultima columna( mas a la derecha), no corresponde. en salix es "confirmar transaccion" y en la PR es Transacción confirmada"

Los iconos de la columna estado, al hacer hover cambia el cursor induciendo a error al usuario porque parece que se pueda hacer una acción. El tooltip de icono de la ultima columna( mas a la derecha), no corresponde. en salix es "confirmar transaccion" y en la PR es Transacción confirmada"
Review

Corregido: bb10714824

Corregido: bb10714824
Review

Revisar

Revisar
import { computed, ref } from 'vue';
import { computed, onBeforeMount, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import axios from 'axios';
import { toCurrency, toDateHourMinSec } from 'src/filters';
import FetchData from 'components/FetchData.vue';
@ -12,7 +14,6 @@ import CustomerCheckIconTooltip from '../components/CustomerCheckIconTooltip.vue
const { t } = useI18n();
const route = useRoute();
const clientsTransactionsRef = ref(null);
const rows = ref([]);
const filter = {
@ -20,7 +21,7 @@ const filter = {
{ relation: 'mandateType', scope: { fields: ['id', 'name'] } },
{ relation: 'company', scope: { fields: ['id', 'code'] } },
],
where: { clientFk: route.params.id },
where: { clientFk: null },
order: ['created DESC'],
limit: 20,
};
@ -90,20 +91,35 @@ const columns = computed(() => [
},
]);
onBeforeMount(() => {
getData(route.params.id);
});
watch(
() => route.params.id,
(newValue) => {
getData(newValue);
}
);
const getData = async (id) => {
filter.where.clientFk = id;
try {
const { data } = await axios.get('clients/transactions', {
params: { filter: JSON.stringify(filter) },
});
rows.value = data;
} catch (error) {
return error;
}
};
const refreshData = () => {
clientsTransactionsRef.value.fetch();
getData(route.params.id);
};
</script>
<template>
<FetchData
:filter="filter"
@on-fetch="(data) => (rows = data)"
auto-load
ref="clientsTransactionsRef"
url="clients/transactions"
/>
<div class="full-width flex justify-center">
<QPage class="card-width q-pa-lg">
<QTable

View File

@ -101,7 +101,7 @@ const setData = (entity) => {
</template>
<template #body="{ entity }">
<VnLv :label="t('worker.card.name')" :value="entity.user?.nickname" />
<VnLv :label="t('worker.card.emailxxx')" :value="entity.user?.email" copy />
<VnLv :label="t('worker.card.email')" :value="entity.user?.email" copy />
jsegarra marked this conversation as resolved Outdated

🚩

🚩

Corregido: b12968f982

Corregido: b12968f982
<VnLv
:label="t('worker.list.department')"
:value="entity.department ? entity.department.department.name : null"