Solucion a comentarios 8
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
carlosfonseca 2024-02-14 12:21:00 -05:00
parent 08e072100b
commit ab20ec1738
14 changed files with 133 additions and 82 deletions

View File

@ -21,7 +21,7 @@ const props = defineProps({
}, },
template: { template: {
type: String, type: String,
required: true, required: false,
}, },
locale: { locale: {
type: String, type: String,
@ -49,7 +49,7 @@ updateMessage();
function updateMessage() { function updateMessage() {
const params = props.data; const params = props.data;
const key = `templates['${props.template}']`; const key = props.template ? `templates['${props.template}']` : '';
message.value = t(key, params, { locale: locale.value }); message.value = t(key, params, { locale: locale.value });
} }
@ -188,7 +188,7 @@ en:
templates: templates:
pendingPayment: 'Your order is pending of payment. pendingPayment: 'Your order is pending of payment.
Please, enter the website and make the payment with a credit card. Thank you.' Please, enter the website and make the payment with a credit card. Thank you.'
minAmount: 'A minimum amount of 50 (VAT excluded) is required for your order minAmount: 'A minimum amount of 50 (VAT excluded) is required for your order
{ orderId } of { shipped } to receive it without additional shipping costs.' { orderId } of { shipped } to receive it without additional shipping costs.'
orderChanges: 'Order {orderId} of { shipped }: { changes }' orderChanges: 'Order {orderId} of { shipped }: { changes }'
en: English en: English
@ -205,7 +205,7 @@ es:
templates: templates:
pendingPayment: 'Su pedido está pendiente de pago. pendingPayment: 'Su pedido está pendiente de pago.
Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias.' Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias.'
minAmount: 'Es necesario un importe mínimo de 50 (Sin IVA) en su pedido minAmount: 'Es necesario un importe mínimo de 50 (Sin IVA) en su pedido
{ orderId } del día { shipped } para recibirlo sin portes adicionales.' { orderId } del día { shipped } para recibirlo sin portes adicionales.'
orderChanges: 'Pedido {orderId} día { shipped }: { changes }' orderChanges: 'Pedido {orderId} día { shipped }: { changes }'
en: Inglés en: Inglés
@ -222,7 +222,7 @@ fr:
templates: templates:
pendingPayment: 'Votre commande est en attente de paiement. pendingPayment: 'Votre commande est en attente de paiement.
Veuillez vous connecter sur le site web et effectuer le paiement par carte. Merci beaucoup.' Veuillez vous connecter sur le site web et effectuer le paiement par carte. Merci beaucoup.'
minAmount: 'Un montant minimum de 50 (TVA non incluse) est requis pour votre commande minAmount: 'Un montant minimum de 50 (TVA non incluse) est requis pour votre commande
{ orderId } du { shipped } afin de la recevoir sans frais de port supplémentaires.' { orderId } du { shipped } afin de la recevoir sans frais de port supplémentaires.'
orderChanges: 'Commande { orderId } du { shipped }: { changes }' orderChanges: 'Commande { orderId } du { shipped }: { changes }'
en: Anglais en: Anglais
@ -239,7 +239,7 @@ pt:
templates: templates:
pendingPayment: 'Seu pedido está pendente de pagamento. pendingPayment: 'Seu pedido está pendente de pagamento.
Por favor, acesse o site e faça o pagamento com cartão. Muito obrigado.' Por favor, acesse o site e faça o pagamento com cartão. Muito obrigado.'
minAmount: 'É necessário um valor mínimo de 50 (sem IVA) em seu pedido minAmount: 'É necessário um valor mínimo de 50 (sem IVA) em seu pedido
{ orderId } do dia { shipped } para recebê-lo sem custos de envio adicionais.' { orderId } do dia { shipped } para recebê-lo sem custos de envio adicionais.'
orderChanges: 'Pedido { orderId } dia { shipped }: { changes }' orderChanges: 'Pedido { orderId } dia { shipped }: { changes }'
en: Inglês en: Inglês

View File

@ -64,6 +64,7 @@ export default {
markAll: 'Mark all', markAll: 'Mark all',
noResults: 'No results', noResults: 'No results',
system: 'System', system: 'System',
notificationSent: 'Notification sent',
}, },
errors: { errors: {
statusUnauthorized: 'Access denied', statusUnauthorized: 'Access denied',
@ -158,6 +159,7 @@ export default {
debt: 'Debt', debt: 'Debt',
isDisabled: 'Customer is disabled', isDisabled: 'Customer is disabled',
isFrozen: 'Customer is frozen', isFrozen: 'Customer is frozen',
webAccountInactive: 'Web account inactive',
hasDebt: 'Customer has debt', hasDebt: 'Customer has debt',
notChecked: 'Customer not checked', notChecked: 'Customer not checked',
noWebAccess: 'Web access is disabled', noWebAccess: 'Web access is disabled',

View File

@ -64,6 +64,7 @@ export default {
markAll: 'Marcar todo', markAll: 'Marcar todo',
noResults: 'Sin resultados', noResults: 'Sin resultados',
system: 'Sistema', system: 'Sistema',
notificationSent: 'Notificación enviada',
}, },
errors: { errors: {
statusUnauthorized: 'Acceso denegado', statusUnauthorized: 'Acceso denegado',
@ -157,6 +158,7 @@ export default {
debt: 'Riesgo', debt: 'Riesgo',
isDisabled: 'El cliente está desactivado', isDisabled: 'El cliente está desactivado',
isFrozen: 'El cliente está congelado', isFrozen: 'El cliente está congelado',
webAccountInactive: 'Sin acceso web',
hasDebt: 'El cliente tiene riesgo', hasDebt: 'El cliente tiene riesgo',
notChecked: 'El cliente no está comprobado', notChecked: 'El cliente no está comprobado',
noWebAccess: 'El acceso web está desactivado', noWebAccess: 'El acceso web está desactivado',

View File

@ -12,7 +12,7 @@ const router = useRouter();
const provincesLocation = ref([]); const provincesLocation = ref([]);
const consigneeFilter = { const addressFilter = {
fields: [ fields: [
'id', 'id',
'isDefaultAddress', 'isDefaultAddress',
@ -51,16 +51,16 @@ const setProvince = (provinceFk) => {
return result[0]?.name || ''; return result[0]?.name || '';
}; };
const toCustomerConsigneeCreate = () => { const toCustomerAddressCreate = () => {
router.push({ name: 'CustomerConsigneeCreate' }); router.push({ name: 'CustomerAddressCreate' });
}; };
const toCustomerConsigneeEdit = (consigneeId) => { const toCustomerAddressEdit = (addressId) => {
router.push({ router.push({
name: 'CustomerConsigneeEdit', name: 'CustomerAddressEdit',
params: { params: {
id: route.params.id, id: route.params.id,
consigneeId, addressId,
}, },
}); });
}; };
@ -75,21 +75,21 @@ const toCustomerConsigneeEdit = (consigneeId) => {
<QCard class="q-pa-lg"> <QCard class="q-pa-lg">
<VnPaginate <VnPaginate
data-key="CustomerConsignees" data-key="CustomerAddress"
:url="`Clients/${route.params.id}/addresses`" :url="`Clients/${route.params.id}/addresses`"
order="id" order="id"
auto-load auto-load
:filter="consigneeFilter" :filter="addressFilter"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard <QCard
v-for="(item, index) in rows" v-for="(item, index) in rows"
:key="index" :key="index"
:class="{ :class="{
'consignees-card': true, 'address-card': true,
'q-mb-md': index < rows.length - 1, 'q-mb-md': index < rows.length - 1,
}" }"
@click="toCustomerConsigneeEdit(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 name="star" size="md" color="primary" />
@ -142,7 +142,7 @@ const toCustomerConsigneeEdit = (consigneeId) => {
</QCard> </QCard>
<QPageSticky :offset="[18, 18]"> <QPageSticky :offset="[18, 18]">
<QBtn @click.stop="toCustomerConsigneeCreate()" color="primary" fab icon="add" /> <QBtn @click.stop="toCustomerAddressCreate()" color="primary" fab icon="add" />
<QTooltip> <QTooltip>
{{ t('New consignee') }} {{ t('New consignee') }}
</QTooltip> </QTooltip>
@ -150,7 +150,7 @@ const toCustomerConsigneeEdit = (consigneeId) => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.consignees-card { .address-card {
border: 2px solid var(--vn-light-gray); border: 2px solid var(--vn-light-gray);
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;

View File

@ -66,6 +66,7 @@ const onSubmit = async () => {
try { try {
await axios.post('ClientContacts/crud', payload); await axios.post('ClientContacts/crud', payload);
notes = []; notes = [];
notify('globals.dataCreated', 'positive');
await getData(); await getData();
} catch (error) { } catch (error) {
notify('errors.create', 'negative'); notify('errors.create', 'negative');
@ -89,7 +90,12 @@ const onSubmit = async () => {
</div> </div>
<div class="col"> <div class="col">
<VnInput :label="t('Phone')" clearable v-model="note.phone" /> <VnInput
:label="t('Phone')"
clearable
type="number"
v-model="note.phone"
/>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">

View File

@ -10,6 +10,7 @@ import useCardDescription from 'src/composables/useCardDescription';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue';
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -44,6 +45,9 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
:summary="$props.summary" :summary="$props.summary"
data-key="customerData" data-key="customerData"
> >
<template #menu="{ entity }">
<CustomerDescriptorMenu :customer="entity" />
</template>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')"> <VnLv v-if="entity.salesPersonUser" :label="t('customer.card.salesPerson')">
<template #value> <template #value>
@ -79,6 +83,14 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
> >
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip> <QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
</QIcon> </QIcon>
<QIcon
color="primary"
name="vn:noweb"
size="sm"
v-if="entity.account.active == false"
>
<QTooltip>{{ t('customer.card.webAccountInactive') }}</QTooltip>
</QIcon>
<QIcon <QIcon
v-if="entity.debt > entity.credit" v-if="entity.debt > entity.credit"
name="vn:risk" name="vn:risk"
@ -98,9 +110,6 @@ const setData = (entity) => (data.value = useCardDescription(entity.name, entity
</QCardActions> </QCardActions>
</template> </template>
<template #actions="{ entity }"> <template #actions="{ entity }">
<div class="flex justify-center q-mb-md">
<QIcon color="primary" name="vn:noweb" size="sm" />
</div>
<QCardActions class="flex justify-center"> <QCardActions class="flex justify-center">
<QBtn <QBtn
:to="{ :to="{

View File

@ -0,0 +1,63 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import axios from 'axios';
import { useQuasar } from 'quasar';
import useNotify from 'src/composables/useNotify';
import VnSmsDialog from 'src/components/common/VnSmsDialog.vue';
const $props = defineProps({
customer: {
type: Object,
required: true,
},
});
const { notify } = useNotify();
const { t } = useI18n();
const quasar = useQuasar();
const route = useRoute();
const showSmsDialog = () => {
console.log('showSmsDialog()');
quasar.dialog({
component: VnSmsDialog,
componentProps: {
phone: $props.customer.phone,
promise: sendSms,
},
});
};
const sendSms = async (payload) => {
payload.destinationFk = route.params.id;
try {
await axios.post(`Clients/${route.params.id}/sendSms`, payload);
notify('globals.notificationSent', 'positive');
} catch (error) {
notify(error.message, 'positive');
}
};
</script>
<template>
<QItem v-ripple clickable>
<QItemSection>
<RouterLink :to="{ name: 'TicketCreate' }" class="color-vn-text">
{{ t('Simple ticket') }}
</RouterLink>
</QItemSection>
</QItem>
<QItem v-ripple clickable>
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
</QItem>
</template>
<i18n>
es:
Simple ticket: Ticket simple
Send SMS: Enviar SMS
</i18n>

View File

@ -162,14 +162,6 @@ const toCustomerGreugeCreate = () => {
</QPageSticky> </QPageSticky>
</template> </template>
<style lang="scss">
.consignees-card {
border: 2px solid var(--vn-light-gray);
border-radius: 10px;
padding: 10px;
}
</style>
<i18n> <i18n>
es: es:
Total: Total Total: Total

View File

@ -59,18 +59,6 @@ const toCustomerNoteCreate = () => {
{{ t('globals.noResults') }} {{ t('globals.noResults') }}
</h5> </h5>
</div> </div>
<QPageSticky :offset="[18, 18]">
<QBtn
@click.stop="toCustomerNoteCreate()"
color="primary"
fab
icon="add"
/>
<QTooltip>
{{ t('New consignee') }}
</QTooltip>
</QPageSticky>
</template> </template>
</VnPaginate> </VnPaginate>
</QCard> </QCard>
@ -78,7 +66,7 @@ const toCustomerNoteCreate = () => {
<QPageSticky :offset="[18, 18]"> <QPageSticky :offset="[18, 18]">
<QBtn @click.stop="toCustomerNoteCreate()" color="primary" fab icon="add" /> <QBtn @click.stop="toCustomerNoteCreate()" color="primary" fab icon="add" />
<QTooltip> <QTooltip>
{{ t('New consignee') }} {{ t('New note') }}
</QTooltip> </QTooltip>
</QPageSticky> </QPageSticky>
</template> </template>
@ -90,3 +78,8 @@ const toCustomerNoteCreate = () => {
padding: 10px; padding: 10px;
} }
</style> </style>
<i18n>
es:
New note: Nueva nota
</i18n>

View File

@ -118,14 +118,6 @@ const toCustomerRecoverieCreate = () => {
</QPageSticky> </QPageSticky>
</template> </template>
<style lang="scss">
.consignees-card {
border: 2px solid var(--vn-light-gray);
border-radius: 10px;
padding: 10px;
}
</style>
<i18n> <i18n>
es: es:
Since: Desde Since: Desde

View File

@ -128,14 +128,6 @@ const toCustomerSamplesCreate = () => {
</QPageSticky> </QPageSticky>
</template> </template>
<style lang="scss">
.consignees-card {
border: 2px solid var(--vn-light-gray);
border-radius: 10px;
padding: 10px;
}
</style>
<i18n> <i18n>
es: es:
Sent: Enviado Sent: Enviado

View File

@ -53,9 +53,9 @@ const refreshData = () => {
getCustomsAgents(); getCustomsAgents();
}; };
const toCustomerConsignees = () => { const toCustomerAddress = () => {
router.push({ router.push({
name: 'CustomerConsignees', name: 'CustomerAddress',
params: { params: {
id: route.params.id, id: route.params.id,
}, },
@ -92,7 +92,7 @@ const toCustomerConsignees = () => {
:form-initial-data="formInitialData" :form-initial-data="formInitialData"
:observe-form-changes="false" :observe-form-changes="false"
:url-create="urlCreate" :url-create="urlCreate"
@on-data-saved="toCustomerConsignees()" @on-data-saved="toCustomerAddress()"
model="client" model="client"
> >
<template #form="{ data, validate }"> <template #form="{ data, validate }">

View File

@ -31,7 +31,7 @@ const observationTypes = ref([]);
const notes = ref([]); const notes = ref([]);
onBeforeMount(() => { onBeforeMount(() => {
urlUpdate.value = `Clients/${route.params.id}/updateAddress/${route.params.consigneeId}`; urlUpdate.value = `Clients/${route.params.id}/updateAddress/${route.params.addressId}`;
}); });
const onPostcodeCreated = async ({ code, provinceFk, townFk }, formData) => { const onPostcodeCreated = async ({ code, provinceFk, townFk }, formData) => {
@ -48,7 +48,7 @@ const getData = async (observations) => {
if (observationTypes.value.length) { if (observationTypes.value.length) {
const filter = { const filter = {
fields: ['id', 'addressFk', 'observationTypeFk', 'description'], fields: ['id', 'addressFk', 'observationTypeFk', 'description'],
where: { addressFk: `${route.params.consigneeId}` }, where: { addressFk: `${route.params.addressId}` },
}; };
const { data } = await axios.get('AddressObservations', { const { data } = await axios.get('AddressObservations', {
params: { filter: JSON.stringify(filter) }, params: { filter: JSON.stringify(filter) },
@ -65,7 +65,7 @@ const getData = async (observations) => {
$isNew: false, $isNew: false,
$oldData: null, $oldData: null,
$orgIndex: null, $orgIndex: null,
addressFk: `${route.params.consigneeId}`, addressFk: `${route.params.addressId}`,
description: observation.description, description: observation.description,
observationTypeFk: type.id, observationTypeFk: type.id,
} }
@ -81,7 +81,7 @@ const addNote = () => {
$isNew: true, $isNew: true,
$oldData: null, $oldData: null,
$orgIndex: null, $orgIndex: null,
addressFk: `${route.params.consigneeId}`, addressFk: `${route.params.addressId}`,
description: '', description: '',
observationTypeFk: '', observationTypeFk: '',
}); });
@ -133,7 +133,7 @@ const onDataSaved = () => {
<FormModel <FormModel
:observe-form-changes="false" :observe-form-changes="false"
:url-update="urlUpdate" :url-update="urlUpdate"
:url="`Addresses/${route.params.consigneeId}`" :url="`Addresses/${route.params.addressId}`"
@on-data-saved="onDataSaved()" @on-data-saved="onDataSaved()"
auto-load auto-load
model="client" model="client"

View File

@ -21,7 +21,7 @@ export default {
'CustomerBasicData', 'CustomerBasicData',
'CustomerFiscalData', 'CustomerFiscalData',
'CustomerBillingData', 'CustomerBillingData',
'CustomerConsignees', 'CustomerAddress',
'CustomerNotes', 'CustomerNotes',
'CustomerCredits', 'CustomerCredits',
'CustomerGreuges', 'CustomerGreuges',
@ -151,45 +151,45 @@ export default {
import('src/pages/Customer/Card/CustomerBillingData.vue'), import('src/pages/Customer/Card/CustomerBillingData.vue'),
}, },
{ {
path: 'consignees', path: 'address',
name: 'ConsigneesCard', name: 'AddressCard',
redirect: { name: 'CustomerConsignees' }, redirect: { name: 'CustomerAddress' },
children: [ children: [
{ {
path: '', path: '',
name: 'CustomerConsignees', name: 'CustomerAddress',
meta: { meta: {
icon: 'vn:delivery', icon: 'vn:delivery',
title: 'consignees', title: 'consignees',
}, },
component: () => component: () =>
import('src/pages/Customer/Card/CustomerConsignees.vue'), import('src/pages/Customer/Card/CustomerAddress.vue'),
}, },
{ {
path: 'create', path: 'create',
name: 'CustomerConsigneeCreate', name: 'CustomerAddressCreate',
meta: { meta: {
title: 'consignee-create', title: 'address-create',
}, },
component: () => component: () =>
import( import(
'src/pages/Customer/components/CustomerConsigneeCreate.vue' 'src/pages/Customer/components/CustomerAddressCreate.vue'
), ),
}, },
{ {
path: ':consigneeId', path: ':addressId',
name: 'CustomerConsigneeEditCard', name: 'CustomerAddressEditCard',
redirect: { name: 'CustomerConsigneeEdit' }, redirect: { name: 'CustomerAddressEdit' },
children: [ children: [
{ {
path: 'edit', path: 'edit',
name: 'CustomerConsigneeEdit', name: 'CustomerAddressEdit',
meta: { meta: {
title: 'consignee-edit', title: 'address-edit',
}, },
component: () => component: () =>
import( import(
'src/pages/Customer/components/CustomerConsigneeEdit.vue' 'src/pages/Customer/components/CustomerAddressEdit.vue'
), ),
}, },
], ],