style: #6321Customer updatees
This commit is contained in:
parent
02e7177dee
commit
860370019e
|
@ -8,7 +8,7 @@ defineProps({
|
||||||
<template>
|
<template>
|
||||||
<div :class="$q.screen.gt.md ? 'q-pb-lg' : 'q-pb-md'">
|
<div :class="$q.screen.gt.md ? 'q-pb-lg' : 'q-pb-md'">
|
||||||
<div class="header-link" :style="{ cursor: url ? 'pointer' : 'default' }">
|
<div class="header-link" :style="{ cursor: url ? 'pointer' : 'default' }">
|
||||||
<a :href="url" :class="url ? 'link' : 'color-vn-text'">
|
<a :href="url" :class="url ? 'link' : 'color-vn-text'" v-bind="$attrs">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
<QIcon v-if="url" :name="icon" />
|
<QIcon v-if="url" :name="icon" />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<script setup>
|
||||||
|
defineProps({ email: { type: [String], default: null } });
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QBtn
|
||||||
|
v-if="email"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
icon="email"
|
||||||
|
size="sm"
|
||||||
|
color="primary"
|
||||||
|
padding="none"
|
||||||
|
:href="`mailto:${email}`"
|
||||||
|
@click.stop
|
||||||
|
/>
|
||||||
|
</template>
|
|
@ -2,6 +2,8 @@
|
||||||
defineProps({ phoneNumber: { type: [String, Number], default: null } });
|
defineProps({ phoneNumber: { type: [String, Number], default: null } });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<q-btn round color="secondary" name="add" />
|
||||||
|
<QIcon round color="primary" name="add_circle" />
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="phoneNumber"
|
v-if="phoneNumber"
|
||||||
flat
|
flat
|
||||||
|
|
|
@ -12,6 +12,7 @@ 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';
|
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
import { QIcon } from 'quasar';
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
|
||||||
const customer = computed(() => state.get('customer'));
|
const customer = computed(() => state.get('customer'));
|
||||||
|
@ -150,7 +151,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
<QCardActions class="flex justify-center">
|
<QCardActions class="flex justify-center" style="padding-inline: 0">
|
||||||
<QBtn
|
<QBtn
|
||||||
:to="{
|
:to="{
|
||||||
name: 'TicketList',
|
name: 'TicketList',
|
||||||
|
@ -168,6 +169,28 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Customer ticket list') }}</QTooltip>
|
<QTooltip>{{ t('Customer ticket list') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
target="_blank"
|
||||||
|
:to="{
|
||||||
|
name: 'TicketList',
|
||||||
|
query: { createForm: JSON.stringify({ clientFk: entity.id }) },
|
||||||
|
}"
|
||||||
|
size="md"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<template #default>
|
||||||
|
<QTooltip>{{ t('New order') }}</QTooltip>
|
||||||
|
<div class="icon-container">
|
||||||
|
<QIcon class="icon second-icon" name="vn:ticket" />
|
||||||
|
<QIcon
|
||||||
|
class="fill-icon icon first-icon"
|
||||||
|
round
|
||||||
|
size="xs"
|
||||||
|
name="add_circle"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
:to="{
|
:to="{
|
||||||
name: 'InvoiceOutList',
|
name: 'InvoiceOutList',
|
||||||
|
@ -179,6 +202,18 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Customer invoice out list') }}</QTooltip>
|
<QTooltip>{{ t('Customer invoice out list') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
:to="{
|
||||||
|
name: 'OrderList',
|
||||||
|
query: { createForm: JSON.stringify({ clientFk: entity.id }) },
|
||||||
|
}"
|
||||||
|
size="md"
|
||||||
|
target="_blank"
|
||||||
|
icon="vn:basketadd"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('New order') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
:to="{
|
:to="{
|
||||||
name: 'AccountSummary',
|
name: 'AccountSummary',
|
||||||
|
@ -215,6 +250,7 @@ es:
|
||||||
Go to module index: Ir al índice del módulo
|
Go to module index: Ir al índice del módulo
|
||||||
Customer ticket list: Listado de tickets del cliente
|
Customer ticket list: Listado de tickets del cliente
|
||||||
Customer invoice out list: Listado de facturas del cliente
|
Customer invoice out list: Listado de facturas del cliente
|
||||||
|
New order: Nuevo pedido
|
||||||
Go to user: Ir al usuario
|
Go to user: Ir al usuario
|
||||||
Go to supplier: Ir al proveedor
|
Go to supplier: Ir al proveedor
|
||||||
Customer unpaid: Cliente impago
|
Customer unpaid: Cliente impago
|
||||||
|
@ -222,3 +258,25 @@ es:
|
||||||
unpaidDated: 'Fecha {dated}'
|
unpaidDated: 'Fecha {dated}'
|
||||||
unpaidAmount: 'Importe {amount}'
|
unpaidAmount: 'Importe {amount}'
|
||||||
</i18n>
|
</i18n>
|
||||||
|
<style>
|
||||||
|
.icon-container {
|
||||||
|
position: relative;
|
||||||
|
width: 24px; /* Ajusta el ancho del contenedor según el tamaño de tus íconos */
|
||||||
|
height: 25px; /* Ajusta la altura del contenedor según el tamaño de tus íconos */
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
position: absolute;
|
||||||
|
/* font-size: 1.715em; */
|
||||||
|
/* zoom: 0.8; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.first-icon {
|
||||||
|
top: 12px;
|
||||||
|
left: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.second-icon {
|
||||||
|
right: 2px; /* Espacio a la izquierda del segundo ícono */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -55,7 +55,7 @@ const openOrderCreateForm = () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QItem v-ripple clickable @click="openTicketCreateForm()">
|
<!-- <QItem v-ripple clickable @click="openTicketCreateForm()">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('globals.pageTitles.createTicket') }}
|
{{ t('globals.pageTitles.createTicket') }}
|
||||||
<QDialog ref="ticketCreateFormDialog">
|
<QDialog ref="ticketCreateFormDialog">
|
||||||
|
@ -70,7 +70,7 @@ const openOrderCreateForm = () => {
|
||||||
<OrderCreateDialog :client-fk="customer.id" />
|
<OrderCreateDialog :client-fk="customer.id" />
|
||||||
</QDialog>
|
</QDialog>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem> -->
|
||||||
<QItem v-ripple clickable>
|
<QItem v-ripple clickable>
|
||||||
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
|
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { toCurrency, toPercentage, toDate } from 'src/filters';
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
|
import VnLinkMail from 'src/components/ui/VnLinkMail.vue';
|
||||||
import CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryTable.vue';
|
import CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryTable.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
@ -89,7 +90,11 @@ const sumRisk = ({ clientRisks }) => {
|
||||||
<VnLinkPhone :phone-number="entity.mobile" />
|
<VnLinkPhone :phone-number="entity.mobile" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('customer.summary.email')" :value="entity.email" copy />
|
<VnLv :value="entity.email" copy
|
||||||
|
><template #label>
|
||||||
|
{{ t('customer.summary.email') }}
|
||||||
|
<VnLinkMail email="entity.email"></VnLinkMail> </template
|
||||||
|
></VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('customer.summary.salesPerson')"
|
:label="t('customer.summary.salesPerson')"
|
||||||
:value="entity?.salesPersonUser?.name"
|
:value="entity?.salesPersonUser?.name"
|
||||||
|
@ -222,6 +227,7 @@ const sumRisk = ({ clientRisks }) => {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.account">
|
<QCard class="vn-one" v-if="entity.account">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
target="_blank"
|
||||||
:url="`${grafanaUrl}/d/adjlxzv5yjt34d/analisis-de-clientes-7c-crm?orgId=1&var-clientFk=${entityId}`"
|
:url="`${grafanaUrl}/d/adjlxzv5yjt34d/analisis-de-clientes-7c-crm?orgId=1&var-clientFk=${entityId}`"
|
||||||
:text="t('customer.summary.businessData')"
|
:text="t('customer.summary.businessData')"
|
||||||
icon="vn:grafana"
|
icon="vn:grafana"
|
||||||
|
@ -249,8 +255,9 @@ const sumRisk = ({ clientRisks }) => {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.account">
|
<QCard class="vn-one" v-if="entity.account">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
target="_blank"
|
||||||
:url="`${grafanaUrl}/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
:url="`${grafanaUrl}/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
||||||
:text="t('customer.summary.payMethodFk')"
|
:text="t('customer.summary.financialData')"
|
||||||
icon="vn:grafana"
|
icon="vn:grafana"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Handle Client list', () => {
|
||||||
|
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(7)';
|
||||||
|
const firstId = `${firstRow} > td:nth-child(1) span`;
|
||||||
|
const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
|
||||||
|
const summaryHeaders = '.summaryBody .header-link';
|
||||||
|
const dialogInputs = '.q-dialog input';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('/#/customer/list', { timeout: 5000 });
|
||||||
|
});
|
||||||
|
it('Client list create new client', () => {
|
||||||
|
const dialogInputs = '.q-dialog label input';
|
||||||
|
|
||||||
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
const data = {
|
||||||
|
Name: { val: 'Name 1' },
|
||||||
|
'Social name': { val: 'TEST 1' },
|
||||||
|
'Tax number': { val: '20852113Z' },
|
||||||
|
'Web user': { val: 'user_test_1' },
|
||||||
|
Street: { val: 'C/ STREET 1' },
|
||||||
|
Email: { val: 'user.test@1.com' },
|
||||||
|
'Business type': { val: 'Otros', type: 'select' },
|
||||||
|
'Sales person': { val: 'salesboss', type: 'select' },
|
||||||
|
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
|
||||||
|
};
|
||||||
|
cy.fillInForm(data);
|
||||||
|
// cy.get(dialogInputs).eq(0).type('NAME 1');
|
||||||
|
// cy.get(dialogInputs).eq(1).type('TEST 1');
|
||||||
|
// cy.get(dialogInputs).eq(2).type('20852113Z');
|
||||||
|
// cy.get(dialogInputs).eq(3).type('C/ STREET 1');
|
||||||
|
// cy.get(dialogInputs).eq(8).type('user_test_1');
|
||||||
|
// cy.get(dialogInputs).eq(9).type('user.test@1.com');
|
||||||
|
// cy.selectOption('.q-dialog input', 'Others');
|
||||||
|
// cy.get(
|
||||||
|
// '.q-field--float > .q-field__inner > .q-field__control > .q-field__control-container'
|
||||||
|
// ).click();
|
||||||
|
// cy.selectOption(
|
||||||
|
// '.q-dialog label input > :nth-child(5) > .q-select > .q-field__inner > .q-field__control ',
|
||||||
|
// 'salesBoss'
|
||||||
|
// );
|
||||||
|
// cy.get(
|
||||||
|
// '.q-dialog > .q-card> .grid-create >input>:nth-child(5) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
|
||||||
|
// ).click();
|
||||||
|
// cy.selectOption(
|
||||||
|
// '.q-dialog > .q-field__inner > .q-field__control > .q-field__control-container >:nth-child(6)',
|
||||||
|
// 'salesBoss'
|
||||||
|
// );
|
||||||
|
// cy.get(dialogInputs).eq(7).type('46000, Valencia(Province one), España');
|
||||||
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
|
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||||
|
cy.url().should('include', '/summary');
|
||||||
|
});
|
||||||
|
xit('should redirect on clicking a invoice', () => {
|
||||||
|
cy.get(firstId)
|
||||||
|
.invoke('text')
|
||||||
|
.then((content) => {
|
||||||
|
const id = content.replace(/\D/g, '');
|
||||||
|
cy.get(firstRow).click();
|
||||||
|
cy.url().should('include', `/invoice-in/${id}/summary`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
xit('should open the details', () => {
|
||||||
|
cy.get(firstDetailBtn).click();
|
||||||
|
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
||||||
|
cy.get(summaryHeaders).eq(4).contains('Vat');
|
||||||
|
});
|
||||||
|
xit('Create and go', function () {
|
||||||
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue