Compare commits

...

28 Commits

Author SHA1 Message Date
Jorge Penadés 4bac67de38 refs 6105 VnNotes and ClaimNotes refactored
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-18 12:12:53 +02:00
Jorge Penadés 97180b8490 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6105-createClaimNotes 2023-08-18 12:07:29 +02:00
Alex Moreno c2b10ba271 Merge pull request '5987-fixCardListActions' (!84) from 5987-fixCardListActions into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #84
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2023-08-18 06:58:50 +00:00
Jorge Penadés 746bb8962d refs 5987 workerList test fixed
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-17 15:36:06 +02:00
Jorge Penadés 10efafaad8 refs 5987 cardList css refactored
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-17 14:48:05 +02:00
Jorge Penadés 59f2f1a414 ref 5987 cardLists actions click propagation fixed
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-17 13:38:21 +02:00
Jorge Penadés 822fdb75cb Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6105-createClaimNotes 2023-08-17 11:46:02 +02:00
Alex Moreno e8775a9585 Merge pull request 'refs 5987 index cards and light mode' (!79) from 5987-redisgnCards into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #79
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2023-08-17 08:41:56 +00:00
Alex Moreno 831dcfbf6d Merge branch 'dev' into 5987-redisgnCards
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-17 08:39:50 +00:00
Jorge Penadés e7fe7e1888 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6105-createClaimNotes 2023-08-17 10:34:35 +02:00
Jorge Penadés 76071240d1 refs 5987 var-colors fixed
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-17 10:32:24 +02:00
Alex Moreno ab2e1f4553 refs #5990 fix(ticket_descriptor_summary): client.salePersone null value
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-17 09:07:58 +02:00
Jorge Penadés b7e9aee1d5 refs 5987 var-colors
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-17 08:50:10 +02:00
Alex Moreno 07d1801b5e Merge pull request '5990-reStyle_summary' (!82) from 5990-reStyle_summary into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #82
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2023-08-17 05:44:48 +00:00
Alex Moreno 4f9cdd2112 refs #5990 feat(summarys): custom colors
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-16 07:35:29 +02:00
Alex Moreno e383615092 refs #5990 feat(summarys): cusom colors
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-16 07:28:47 +02:00
Jorge Penadés 96d0ba3e0a refs 5987 fix media queries
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-14 15:18:59 +02:00
Alex Moreno c64ae1ccee refs #5990 feat(summarys): redesigned
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-14 13:52:25 +02:00
Jorge Penadés 670882024a refs 6105 css refactoring
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-14 09:00:21 +02:00
Alex Moreno 342d218d98 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 5990-reStyle_summary 2023-08-14 07:28:02 +02:00
Jorge Penadés 787844a930 refs 5987 fixed cardList margin and breakpoint
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-11 14:49:34 +02:00
Jorge Penadés 3d4aca52f8 refs 5987 center card descriptor item-list
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-11 08:17:29 +02:00
Jorge Penadés 4318641bc6 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 5987-redisgnCards 2023-08-11 08:11:22 +02:00
Jorge Penadés cb52bfe171 refs 5987 fix title descriptor and card body
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-10 16:09:48 +02:00
Alex Moreno 63e15c96cb refs #5990 feat(cardSummary): add slot
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-10 15:38:31 +02:00
Jorge Penadés a194ec745b refs 5987 index cards and light mode
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-10 13:20:32 +02:00
Alex Moreno 396b6d0298 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 5990-reStyle_summary 2023-08-10 12:04:43 +02:00
Alex Moreno 5417c1691a refs #5990 refactor: cardSummary
gitea/salix-front/pipeline/head This commit looks good Details
2023-08-09 15:16:00 +02:00
28 changed files with 1402 additions and 2237 deletions

View File

@ -31,7 +31,7 @@ function findMatches(search, item) {
const matches = []; const matches = [];
function findRoute(search, item) { function findRoute(search, item) {
for (const child of item.children) { for (const child of item.children) {
if (search.indexOf(child.name) > -1) { if (search?.indexOf(child.name) > -1) {
matches.push(child); matches.push(child);
} else if (child.children) { } else if (child.children) {
findRoute(search, child); findRoute(search, child);

View File

@ -8,7 +8,7 @@ const session = useSession();
const token = session.getToken(); const token = session.getToken();
</script> </script>
<template> <template>
<div class="avatar-picture"> <div class="avatar-picture column items-center">
<QAvatar color="orange"> <QAvatar color="orange">
<QImg <QImg
:src="`/api/Images/user/160x160/${$props.worker}/download?access_token=${token}`" :src="`/api/Images/user/160x160/${$props.worker}/download?access_token=${token}`"
@ -24,13 +24,3 @@ const token = session.getToken();
</div> </div>
</div> </div>
</template> </template>
<style lang="scss" scoped>
.avatar-picture {
display: flex;
flex-direction: column;
align-items: center;
.description {
text-align: center;
}
}
</style>

View File

@ -111,25 +111,23 @@ watch($props, async () => {
<QList dense> <QList dense>
<QItemLabel header class="ellipsis text-h5" :lines="1"> <QItemLabel header class="ellipsis text-h5" :lines="1">
<div class="title"> <div class="title">
<span v-if="$props.title"> <span v-if="$props.title" :title="$props.title">
{{ $props.title }} {{ $props.title }}
<QTooltip>{{ $props.title }}</QTooltip>
</span> </span>
<slot v-else name="description" :entity="entity"> <slot v-else name="description" :entity="entity">
<span> <span :title="entity.name">
{{ entity.name }} {{ entity.name }}
<QTooltip>{{ entity.name }}</QTooltip>
</span> </span>
</slot> </slot>
</div> </div>
</QItemLabel> </QItemLabel>
<QItem dense> <QItem dense>
<QItemLabel class="subtitle text-white" caption> <QItemLabel class="subtitle" caption>
#{{ $props.subtitle ?? entity.id }} #{{ $props.subtitle ?? entity.id }}
</QItemLabel> </QItemLabel>
</QItem> </QItem>
</QList> </QList>
<div class="list-box"> <div class="list-box q-mt-xs">
<slot name="body" :entity="entity" /> <slot name="body" :entity="entity" />
</div> </div>
</div> </div>
@ -163,11 +161,12 @@ watch($props, async () => {
display: flex; display: flex;
padding: 2px 16px; padding: 2px 16px;
.label { .label {
color: $label-color; color: var(--vn-label);
font-size: 12px; font-size: 12px;
width: 47%; width: 47%;
} }
.value { .value {
color: var(--vn-text);
font-size: 14px; font-size: 14px;
margin-left: 12px; margin-left: 12px;
width: 47%; width: 47%;
@ -184,22 +183,26 @@ watch($props, async () => {
<style lang="scss" scoped> <style lang="scss" scoped>
.title { .title {
overflow: hidden;
text-overflow: ellipsis;
span { span {
color: $primary; color: $primary;
font-weight: bold; font-weight: bold;
} }
} }
.subtitle { .subtitle {
color: var(--vn-text);
font-size: 16px; font-size: 16px;
margin-bottom: 15px;
} }
.list-box { .list-box {
width: 90%; width: 90%;
background-color: rgba(87, 86, 86, 0.2); background-color: var(--vn-gray);
margin: 20px 10px 0 10px; margin: 10px auto;
padding: 10px 5px 10px 0px; padding: 10px 5px 10px 0px;
border-radius: 8px; border-radius: 8px;
.q-item__label { .q-item__label {
color: $label-color; color: var(--vn-label);
} }
} }
.descriptor { .descriptor {

View File

@ -0,0 +1,82 @@
<script setup>
const $props = defineProps({
id: { type: Number, default: null },
title: { type: String, default: null },
});
</script>
<template>
<QCard class="card q-mb-md cursor-pointer q-hoverable bg-white-7 q-pa-lg">
<div>
<slot name="title">
<div class="title text-primary text-weight-bold text-h5">
{{ $props.title ?? `#${$props.id}` }}
</div>
</slot>
<div class="card-list-body row">
<div class="list-items row flex-wrap-wrap q-mt-md">
<slot name="list-items" />
</div>
<div class="actions column justify-center">
<slot name="actions" />
</div>
</div>
</div>
</QCard>
</template>
<style lang="scss">
.card-list-body {
.vn-label-value {
display: flex;
justify-content: flex-start;
gap: 2%;
width: 50%;
.label {
width: 30%;
color: var(--vn-label);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.value {
width: 60%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.actions {
.q-btn {
width: 30px;
}
.q-icon {
color: $primary;
font-size: 25px;
}
}
@media (max-width: $breakpoint-xs) {
.card-list-body {
.vn-label-value {
width: 100%;
}
}
}
</style>
<style lang="scss" scoped>
.card {
transition: background-color 0.2s;
}
.card:hover {
background-color: var(--vn-gray);
}
.list-items {
width: 90%;
}
@media (max-width: $breakpoint-xs) {
.list-items {
width: 85%;
}
}
</style>

View File

@ -2,6 +2,8 @@
import { onMounted, ref, watch } from 'vue'; import { onMounted, ref, watch } from 'vue';
import axios from 'axios'; import axios from 'axios';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue'; import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
onMounted(() => fetch()); onMounted(() => fetch());
const entity = ref(); const entity = ref();
@ -41,15 +43,21 @@ watch(props, async () => {
<template> <template>
<div class="summary container"> <div class="summary container">
<QCard> <QCard class="cardSummary">
<SkeletonSummary v-if="!entity" /> <SkeletonSummary v-if="!entity" />
<template v-if="entity"> <template v-if="entity">
<div class="header bg-primary q-pa-sm q-mb-md"> <div class="summaryHeader bg-primary q-pa-md text-weight-bolder">
<slot name="header-left">
<span></span>
</slot>
<slot name="header" :entity="entity"> <slot name="header" :entity="entity">
{{ entity.id }} - {{ entity.name }} <VnLv :label="`${entity.id} -`" :value="entity.name" />
</slot>
<slot name="header-right">
<span></span>
</slot> </slot>
</div> </div>
<div class="body q-pa-md q-mb-md"> <div class="summaryBody row q-mb-md">
<slot name="body" :entity="entity" /> <slot name="body" :entity="entity" />
</div> </div>
</template> </template>
@ -63,57 +71,87 @@ watch(props, async () => {
justify-content: center; justify-content: center;
} }
.summary { .cardSummary {
.q-card { width: 100%;
width: 100%; .summaryHeader {
max-width: 1200px;
}
.negative {
color: red;
}
.q-list {
.q-item__label--header {
display: flex;
justify-content: space-between;
a {
color: $primary;
}
}
}
.body > .q-card__section.row {
flex-wrap: wrap;
& > .col {
min-width: 250px;
}
}
.header {
text-align: center; text-align: center;
font-size: 18px; font-size: 20px;
display: flex;
justify-content: space-between;
} }
.summaryBody {
display: flex;
flex-direction: row;
justify-content: space-evenly;
gap: 15px;
padding: 15px;
#slider-container { > .q-card.vn-one {
max-width: 80%; flex: 1;
margin: 0 auto; }
> .q-card.vn-two {
flex: 2;
}
> .q-card.vn-three {
flex: 3;
}
> .q-card.vn-max {
width: 100%;
}
.q-slider { > .q-card {
.q-slider__marker-labels:nth-child(1) { width: 100%;
transform: none; background-color: var(--vn-gray);
padding: 15px;
font-size: 16px;
min-width: 275px;
.vn-label-value {
display: flex;
flex-direction: row;
margin-top: 5px;
.label {
color: var(--vn-label);
width: 10em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 10px;
}
.value {
color: var(--vn-text);
width: max-content;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
.q-slider__marker-labels:nth-child(2) { .header {
transform: none; color: $primary;
left: auto !important; font-weight: bold;
right: 0%; margin-bottom: 25px;
font-size: 20px;
display: inline-block;
}
.header.link:hover {
color: lighten($primary, 20%);
} }
} }
} }
}
.q-dialog .summary { @media (max-width: $breakpoint-xs) {
max-width: 1200px; .summaryBody {
padding: 0;
}
}
}
</style>
<style lang="scss" scoped>
.summaryHeader .vn-label-value {
display: flex;
flex-direction: row;
}
.summaryHeader {
color: $white;
} }
</style> </style>

View File

@ -1,12 +1,14 @@
<script setup> <script setup>
import { computed } from 'vue'; import { computed } from 'vue';
import { dashIfEmpty } from 'src/filters';
const $props = defineProps({ const $props = defineProps({
label: { type: String, default: null }, label: { type: String, default: null },
value: { value: { type: [Number, String, Boolean], default: null },
type: [String, Boolean], titleLabel: { type: String, default: null },
default: null, titleValue: { type: [Number, String, Boolean], default: null },
},
info: { type: String, default: null }, info: { type: String, default: null },
dash: { type: Boolean, default: true },
}); });
const isBooleanValue = computed(() => typeof $props.value === 'boolean'); const isBooleanValue = computed(() => typeof $props.value === 'boolean');
</script> </script>
@ -14,18 +16,21 @@ const isBooleanValue = computed(() => typeof $props.value === 'boolean');
<div class="vn-label-value"> <div class="vn-label-value">
<div v-if="$props.label || $slots.label" class="label"> <div v-if="$props.label || $slots.label" class="label">
<slot name="label"> <slot name="label">
<span>{{ $props.label }}</span> <span :title="$props.titleLabel ?? $props.label">{{ $props.label }}</span>
</slot> </slot>
</div> </div>
<div v-if="$props.value || $slots.value" class="value"> <div class="value">
<span v-if="isBooleanValue"> <span v-if="isBooleanValue">
<QIcon <QIcon
:name="$props.value ? `check` : `close`" :name="$props.value ? `check` : `close`"
:color="$props.value ? `positive` : `negative`" :color="$props.value ? `positive` : `negative`"
size="sm"
/> />
</span> </span>
<slot v-else name="value"> <slot v-else name="value">
<span :title="$props.value">{{ $props.value }}</span> <span :title="$props.value">
{{ $props.dash ? dashIfEmpty($props.value) : $props.value }}
</span>
</slot> </slot>
</div> </div>
<div class="info" v-if="$props.info"> <div class="info" v-if="$props.info">

View File

@ -4,8 +4,8 @@ import AvatarPicture from 'src/components/ui/AvatarPicture.vue';
import { toDateHour } from 'src/filters'; import { toDateHour } from 'src/filters';
import { ref } from 'vue'; import { ref } from 'vue';
import axios from 'axios'; import axios from 'axios';
import FetchData from 'components/FetchData.vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnPaginate from './VnPaginate.vue';
const $props = defineProps({ const $props = defineProps({
id: { type: String, required: true }, id: { type: String, required: true },
@ -15,36 +15,75 @@ const $props = defineProps({
addNote: { type: Boolean, default: false }, addNote: { type: Boolean, default: false },
}); });
const { t } = useI18n(); const { t } = useI18n();
const notes = ref([]);
const noteModal = ref(false); const noteModal = ref(false);
const newNote = ref(''); const newNote = ref('');
const claimObservationRef = ref(); const vnPaginateRef = ref();
function setNotes(data) {
notes.value = data;
}
async function fetch() { async function fetch() {
const body = $props.body; const body = $props.body;
Object.assign(body, { text: newNote.value }); Object.assign(body, { text: newNote.value });
await axios.post($props.url, body); await axios.post($props.url, body);
claimObservationRef.value.fetch(); vnPaginateRef.value.fetch();
} }
</script> </script>
<template> <template>
<FetchData <div class="notes">
:url="$props.url" <VnPaginate
:filter="$props.filter" :data-key="$props.url"
@on-fetch="setNotes" :url="$props.url"
auto-load order="created DESC"
ref="claimObservationRef" :limit="20"
/> :filter="$props.filter"
<div class="notes" ref="notesContainer"> auto-load
ref="vnPaginateRef"
>
<template #body="{ rows }">
<QCard class="q-pa-md q-ma-md" v-for="(note, index) in rows" :key="index">
<div class="picture q-pa-sm">
<slot name="picture">
<AvatarPicture :worker="note.workerFk">
<template #description>
<span class="link">
{{
`${note.worker.firstName} ${note.worker.lastName}`
}}
</span>
<WorkerDescriptorProxy :id="note.worker.id" />
</template>
</AvatarPicture>
</slot>
</div>
<div class="text">
<slot name="text">
{{ note.text }}
</slot>
</div>
<div class="actions">
<slot name="actions">
<div>
{{ toDateHour(note.created) }}
</div>
</slot>
</div>
</QCard>
</template>
</VnPaginate>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn
v-if="addNote"
class="add-btn"
color="primary"
icon="add"
size="md"
round
@click="noteModal = true"
/>
</QPageSticky>
<QDialog v-model="noteModal" persistent> <QDialog v-model="noteModal" persistent>
<QCard class="note-dialog q-pa-sm"> <QCard class="note-dialog column q-pa-sm">
<QCardSection class="note-dialog__header"> <QCardSection class="note-dialog__header row self-start justify-between">
<div class="note-dialog__title"> <div class="note-dialog__title row items-center text-primary text-h6">
<QIcon name="draft" class="note-dialog__title-icon" /> <QIcon name="draft" class="note-dialog__title-icon q-mr-sm" />
<div class="text-h6 note-dialog__title-text"> <div class="text-h6 note-dialog__title-text">
{{ t('Add note') }} {{ t('Add note') }}
</div> </div>
@ -61,7 +100,7 @@ async function fetch() {
v-model="newNote" v-model="newNote"
></QInput> ></QInput>
</QCardSection> </QCardSection>
<QCardActions class="note-dialog__actions q-mr-md"> <QCardActions class="note-dialog__actions self-end q-mr-md">
<QBtn <QBtn
flat flat
:label="t('globals.close')" :label="t('globals.close')"
@ -77,76 +116,23 @@ async function fetch() {
</QCardActions> </QCardActions>
</QCard> </QCard>
</QDialog> </QDialog>
<QCard class="q-pa-md" v-for="(note, index) in notes" :key="index">
<div class="picture q-pa-sm">
<slot name="picture">
<AvatarPicture :worker="note.workerFk">
<template #description>
<span class="link">
{{ `${note.worker.firstName} ${note.worker.lastName}` }}
</span>
<WorkerDescriptorProxy :id="note.worker.id" />
</template>
</AvatarPicture>
</slot>
</div>
<div class="text">
<slot name="text">
{{ note.text }}
</slot>
</div>
<div class="actions">
<slot name="actions">
<div>
{{ toDateHour(note.created) }}
</div>
</slot>
</div>
</QCard>
<QBtn
v-if="addNote"
class="add-btn"
color="primary"
round
@click="noteModal = true"
>
<QIcon name="add" size="md"></QIcon>
</QBtn>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.q-card { .q-card {
min-width: 350px; min-width: 340px;
} }
.note-dialog { .note-dialog {
display: flex;
flex-direction: column;
.note-dialog__header { .note-dialog__header {
width: 100%; width: 100%;
align-self: flex-start;
display: flex;
justify-content: space-between;
}
.note-dialog__title {
display: flex;
align-items: center;
gap: 5px;
color: $primary;
font-size: large;
} }
.note-dialog__content { .note-dialog__content {
width: 95%; width: 95%;
} }
.note-dialog__actions {
align-self: flex-end;
}
} }
.add-btn { .add-btn {
width: 70px; width: 70px;
height: 70px; height: 70px;
position: sticky;
left: 95%;
bottom: 2%;
} }
</style> </style>
<i18n> <i18n>

View File

@ -49,6 +49,7 @@ const props = defineProps({
}); });
const emit = defineEmits(['onFetch', 'onPaginate']); const emit = defineEmits(['onFetch', 'onPaginate']);
defineExpose({ fetch });
const isLoading = ref(false); const isLoading = ref(false);
const pagination = ref({ const pagination = ref({
sortBy: props.order, sortBy: props.order,
@ -82,7 +83,6 @@ async function fetch() {
if (!arrayData.hasMoreData.value) { if (!arrayData.hasMoreData.value) {
isLoading.value = false; isLoading.value = false;
} }
emit('onFetch', store.data); emit('onFetch', store.data);
} }

View File

@ -26,13 +26,16 @@ select:-webkit-autofill {
body.body--light { body.body--light {
.q-header .q-toolbar { .q-header .q-toolbar {
background-color: white; background-color: $white;
color: #555; color: #555;
} }
--vn-text: #000000;
.summary { --vn-gray: #f5f5f5;
.header { --vn-label: #5f5f5f;
color: white; }
}
} body.body--dark {
--vn-text: #ffffff;
--vn-gray: #313131;
--vn-label: #a8a8a8;
} }

View File

@ -15,6 +15,7 @@
$primary: #ec8916; $primary: #ec8916;
$secondary: #26a69a; $secondary: #26a69a;
$accent: #9c27b0; $accent: #9c27b0;
$white: #fff;
$positive: #21ba45; $positive: #21ba45;
$negative: #c10015; $negative: #c10015;
@ -46,5 +47,3 @@ $dark-shadow-color: #000;
$dark: #292929; $dark: #292929;
$layout-shadow-dark: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0px 10px rgba(0, 0, 0, 0.24); $layout-shadow-dark: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0px 10px rgba(0, 0, 0, 0.24);
$spacing-md: 16px; $spacing-md: 16px;
$label-color: rgba(255, 255, 255, 0.6);

View File

@ -33,6 +33,9 @@ export default {
rowRemoved: 'Row removed', rowRemoved: 'Row removed',
pleaseWait: 'Please wait...', pleaseWait: 'Please wait...',
noPinnedModules: 'You have dont have any pinned modules', noPinnedModules: 'You have dont have any pinned modules',
summary: {
basicData: 'Basic data',
},
}, },
errors: { errors: {
statusUnauthorized: 'Access denied', statusUnauthorized: 'Access denied',
@ -154,6 +157,8 @@ export default {
balanceDue: 'Balance due', balanceDue: 'Balance due',
balanceDueInfo: 'Deviated invoices minus payments', balanceDueInfo: 'Deviated invoices minus payments',
recoverySince: 'Recovery since', recoverySince: 'Recovery since',
businessType: 'Business Type',
city: 'City',
}, },
basicData: { basicData: {
socialName: 'Fiscal name', socialName: 'Fiscal name',
@ -175,6 +180,7 @@ export default {
basicData: 'Basic Data', basicData: 'Basic Data',
boxing: 'Boxing', boxing: 'Boxing',
sms: 'Sms', sms: 'Sms',
notes: 'Notes',
}, },
list: { list: {
nickname: 'Nickname', nickname: 'Nickname',
@ -244,6 +250,7 @@ export default {
requester: 'Requester', requester: 'Requester',
atender: 'Atender', atender: 'Atender',
request: 'Request', request: 'Request',
weight: 'Weight',
goTo: 'Go to', goTo: 'Go to',
}, },
}, },
@ -340,11 +347,14 @@ export default {
list: { list: {
ref: 'Reference', ref: 'Reference',
issued: 'Issued', issued: 'Issued',
shortIssued: 'Issued',
amount: 'Amount', amount: 'Amount',
client: 'Client', client: 'Client',
created: 'Created', created: 'Created',
shortCreated: 'Created',
company: 'Company', company: 'Company',
dued: 'Due date', dued: 'Due date',
shortDued: 'Due date',
}, },
card: { card: {
issued: 'Issued', issued: 'Issued',
@ -411,6 +421,7 @@ export default {
userId: 'User ID', userId: 'User ID',
role: 'Role', role: 'Role',
sipExtension: 'Extension', sipExtension: 'Extension',
locker: 'Locker',
}, },
notificationsManager: { notificationsManager: {
activeNotifications: 'Active notifications', activeNotifications: 'Active notifications',

View File

@ -33,6 +33,9 @@ export default {
rowRemoved: 'Fila eliminada', rowRemoved: 'Fila eliminada',
pleaseWait: 'Por favor, espera...', pleaseWait: 'Por favor, espera...',
noPinnedModules: 'No has fijado ningún módulo', noPinnedModules: 'No has fijado ningún módulo',
summary: {
basicData: 'Datos básicos',
},
}, },
errors: { errors: {
statusUnauthorized: 'Acceso denegado', statusUnauthorized: 'Acceso denegado',
@ -119,7 +122,7 @@ export default {
province: 'Provincia', province: 'Provincia',
country: 'País', country: 'País',
street: 'Calle', street: 'Calle',
isEqualizated: 'Equalizado', isEqualizated: 'Recargo de equivalencia',
isActive: 'Activo', isActive: 'Activo',
invoiceByAddress: 'Facturar por consignatario', invoiceByAddress: 'Facturar por consignatario',
verifiedData: 'Datos verificados', verifiedData: 'Datos verificados',
@ -153,6 +156,8 @@ export default {
balanceDue: 'Saldo vencido', balanceDue: 'Saldo vencido',
balanceDueInfo: 'Facturas fuera de plazo menos recibos', balanceDueInfo: 'Facturas fuera de plazo menos recibos',
recoverySince: 'Recobro desde', recoverySince: 'Recobro desde',
businessType: 'Tipo de negocio',
city: 'Población',
}, },
basicData: { basicData: {
socialName: 'Nombre fiscal', socialName: 'Nombre fiscal',
@ -174,6 +179,7 @@ export default {
basicData: 'Datos básicos', basicData: 'Datos básicos',
boxing: 'Encajado', boxing: 'Encajado',
sms: 'Sms', sms: 'Sms',
notes: 'Notas',
}, },
list: { list: {
nickname: 'Alias', nickname: 'Alias',
@ -243,6 +249,7 @@ export default {
requester: 'Solicitante', requester: 'Solicitante',
atender: 'Comprador', atender: 'Comprador',
request: 'Petición de compra', request: 'Petición de compra',
weight: 'Peso',
goTo: 'Ir a', goTo: 'Ir a',
}, },
}, },
@ -340,11 +347,14 @@ export default {
list: { list: {
ref: 'Referencia', ref: 'Referencia',
issued: 'Fecha emisión', issued: 'Fecha emisión',
shortIssued: 'F. emisión',
amount: 'Importe', amount: 'Importe',
client: 'Cliente', client: 'Cliente',
created: 'Fecha creación', created: 'Fecha creación',
shortCreated: 'F. creación',
company: 'Empresa', company: 'Empresa',
dued: 'Fecha vencimineto', dued: 'Fecha vencimineto',
shortDued: 'F. vencimiento',
}, },
card: { card: {
issued: 'Fecha emisión', issued: 'Fecha emisión',
@ -411,6 +421,7 @@ export default {
userId: 'ID del usuario', userId: 'ID del usuario',
role: 'Rol', role: 'Rol',
sipExtension: 'Extensión', sipExtension: 'Extensión',
locker: 'Taquilla',
}, },
notificationsManager: { notificationsManager: {
activeNotifications: 'Notificaciones activas', activeNotifications: 'Notificaciones activas',

View File

@ -9,7 +9,6 @@ const user = state.getUser();
const id = route.params.id; const id = route.params.id;
const claimFilter = { const claimFilter = {
order: 'created DESC',
where: { claimFk: id }, where: { claimFk: id },
fields: ['created', 'workerFk', 'text'], fields: ['created', 'workerFk', 'text'],
include: { include: {
@ -38,7 +37,6 @@ const body = {
</template> </template>
<style lang="scss"> <style lang="scss">
.q-card { .q-card {
width: 100%;
max-width: 70em; max-width: 70em;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -50,36 +48,42 @@ const body = {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
> * {
margin: 10px;
}
.text { .text {
flex: 70%; width: 70%;
padding: 10px; padding: 10px;
} }
.picture { .picture {
flex: 15%; width: 15%;
.avatar-picture {
width: 70px;
}
} }
.actions { .actions {
flex: 15%; width: 15%;
align-self: baseline; align-self: baseline;
text-align: center; text-align: center;
} }
} }
} }
@media (max-width: 1150px) { @media (max-width: $breakpoint-md) {
.claim-notes { .claim-notes {
.text { .notes {
margin-top: 20px; .picture,
order: 3; .actions {
flex: 100%; width: 50%;
} }
.picture {
.avatar-picture {
width: 135px;
}
}
.text {
width: 90%;
margin: 0 auto;
order: 3;
}
.actions { .actions {
text-align: end; text-align: end;
}
} }
} }
} }

View File

@ -1,12 +1,14 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { onMounted, ref, computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { toDate, toCurrency } from 'src/filters'; import { toDate, toCurrency } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import { getUrl } from 'src/composables/getUrl';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
import VnLv from 'src/components/ui/VnLv.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -22,6 +24,14 @@ const $props = defineProps({
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const claimUrl = ref();
const salixUrl = ref();
onMounted(async () => {
salixUrl.value = await getUrl('');
claimUrl.value = salixUrl.value + `claim/${entityId.value}/`;
});
const detailsColumns = ref([ const detailsColumns = ref([
{ {
name: 'item', name: 'item',
@ -155,78 +165,52 @@ function openDialog(dmsId) {
<template #header="{ entity: { claim } }"> <template #header="{ entity: { claim } }">
{{ claim.id }} - {{ claim.client.name }} {{ claim.id }} - {{ claim.client.name }}
</template> </template>
<template #body="{ entity: { developments, observations, claim, salesClaimed } }"> <template #body="{ entity: { claim, salesClaimed, developments } }">
<QCardSection class="row q-pa-none q-col-gutter-md"> <QCard class="vn-one">
<div class="col"> <a class="header" :href="`#/claim/${entityId}/basic-data`">
<QList> {{ t('claim.pageTitles.basicData') }}
<QItem> <QIcon name="open_in_new" color="primary" />
<QItemSection> </a>
<QItemLabel caption> <VnLv
{{ t('claim.summary.created') }} :label="t('claim.summary.created')"
</QItemLabel> :value="toDate(claim.created)"
<QItemLabel>{{ toDate(claim.created) }}</QItemLabel> />
</QItemSection> <VnLv :label="t('claim.summary.state')">
<QItemSection v-if="claim.claimState"> <template #value>
<QItemLabel caption> <QChip :color="stateColor(claim.claimState.code)" dense>
{{ t('claim.summary.state') }} {{ claim.claimState.description }}
</QItemLabel> </QChip>
<QItemLabel> </template>
<QChip </VnLv>
:color="stateColor(claim.claimState.code)" <VnLv :label="t('claim.summary.assignedTo')">
dense <template #value>
> <span class="link">
{{ claim.claimState.description }} {{ claim.worker.user.nickname }}
</QChip> <WorkerDescriptorProxy :id="claim.workerFk" />
</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="claim.worker && claim.worker.user">
<QItemLabel caption>
{{ t('claim.summary.assignedTo') }}
</QItemLabel>
<QItemLabel>
<span class="link">
{{ claim.worker.user.nickname }}
<WorkerDescriptorProxy :id="claim.workerFk" />
</span>
</QItemLabel>
</QItemSection>
<QItemSection
v-if="claim.client && claim.client.salesPersonUser"
>
<QItemLabel caption>
{{ t('claim.summary.attendedBy') }}
</QItemLabel>
<QItemLabel>
<span class="link">
{{ claim.client.salesPersonUser.name }}
<WorkerDescriptorProxy
:id="claim.client.salesPersonFk"
/>
</span>
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
</QCardSection>
<QCardSection class="q-pa-md" v-if="observations.length > 0">
<h6>{{ t('claim.summary.notes') }}</h6>
<div class="note-list" v-for="note in observations" :key="note.id">
<div class="note-caption">
<span
>{{ note.worker.firstName }} {{ note.worker.lastName }}
</span> </span>
<span>{{ toDate(note.created) }}</span> </template>
</div> </VnLv>
<div class="note-text"> <VnLv :label="t('claim.summary.attendedBy')">
<span>{{ note.text }}</span> <template #value>
</div> <span class="link">
</div> {{ claim.client.salesPersonUser.name }}
</QCardSection> <WorkerDescriptorProxy :id="claim.client.salesPersonFk" />
<QCardSection class="q-pa-md" v-if="salesClaimed.length > 0"> </span>
<h6>{{ t('claim.summary.details') }}</h6> </template>
</VnLv>
</QCard>
<QCard class="vn-one">
<a class="header" :href="claimUrl + 'note/index'">
{{ t('claim.summary.notes') }}
<QIcon name="open_in_new" color="primary" />
</a>
<!-- Use VnNotes and maybe VirtualScroll-->
</QCard>
<QCard class="vn-max" v-if="salesClaimed.length > 0">
<a class="header" :href="claimUrl + 'note/index'">
{{ t('claim.summary.details') }}
<QIcon name="open_in_new" color="primary" />
</a>
<QTable :columns="detailsColumns" :rows="salesClaimed" flat> <QTable :columns="detailsColumns" :rows="salesClaimed" flat>
<template #header="props"> <template #header="props">
<QTr :props="props"> <QTr :props="props">
@ -236,16 +220,19 @@ function openDialog(dmsId) {
</QTr> </QTr>
</template> </template>
</QTable> </QTable>
</QCardSection> </QCard>
<QCardSection class="q-pa-md" v-if="claimDms.length > 0"> <QCard class="vn-max" v-if="claimDms.length > 0">
<h6>{{ t('claim.summary.photos') }}</h6> <a class="header" :href="`#/claim/${entityId}/photos`">
{{ t('claim.summary.photos') }}
<QIcon name="open_in_new" color="primary" />
</a>
<div class="container"> <div class="container">
<div class="multimediaParent bg-transparent"> <div
<div class="multimedia-container"
v-for="(media, index) of claimDms" v-for="(media, index) of claimDms"
:key="index" :key="index"
class="relative-position" >
> <div class="relative-position">
<QIcon <QIcon
name="play_circle" name="play_circle"
color="primary" color="primary"
@ -275,9 +262,12 @@ function openDialog(dmsId) {
</div> </div>
</div> </div>
</div> </div>
</QCardSection> </QCard>
<QCardSection class="q-pa-md" v-if="developments.length > 0"> <QCard class="vn-two" v-if="developments.length > 0">
<h6>{{ t('claim.summary.development') }}</h6> <a class="header" :href="claimUrl + 'development'">
{{ t('claim.summary.development') }}
<QIcon name="open_in_new" color="primary" />
</a>
<QTable :columns="developmentColumns" :rows="developments" flat> <QTable :columns="developmentColumns" :rows="developments" flat>
<template #header="props"> <template #header="props">
<QTr :props="props"> <QTr :props="props">
@ -287,11 +277,13 @@ function openDialog(dmsId) {
</QTr> </QTr>
</template> </template>
</QTable> </QTable>
</QCardSection> </QCard>
<QCardSection class="q-pa-md"> <QCard class="vn-max" v-if="developments.length > 0">
<h6>{{ t('claim.summary.actions') }}</h6> <a class="header" :href="claimUrl + 'action'">
<QSeparator /> {{ t('claim.summary.actions') }}
<div id="slider-container"> <QIcon name="open_in_new" color="primary" />
</a>
<div id="slider-container" class="q-px-xl q-py-md">
<QSlider <QSlider
v-model="claim.responsibility" v-model="claim.responsibility"
label label
@ -308,7 +300,21 @@ function openDialog(dmsId) {
readonly readonly
/> />
</div> </div>
</QCardSection> </QCard>
<!-- <QCardSection class="q-pa-md" v-if="observations.length > 0">
<h6>{{ t('claim.summary.notes') }}</h6>
<div class="note-list" v-for="note in observations" :key="note.id">
<div class="note-caption">
<span
>{{ note.worker.firstName }} {{ note.worker.lastName }}
</span>
<span>{{ toDate(note.created) }}</span>
</div>
<div class="note-text">
<span>{{ note.text }}</span>
</div>
</div>
</QCardSection> -->
<QDialog <QDialog
v-model="multimediaDialog" v-model="multimediaDialog"
transition-show="slide-up" transition-show="slide-up"
@ -352,22 +358,19 @@ function openDialog(dmsId) {
</CardSummary> </CardSummary>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.container {
min-width: 80%;
}
.q-dialog__inner--minimized > div { .q-dialog__inner--minimized > div {
max-width: 80%; max-width: 80%;
} }
.container {
.multimediaParent { display: flex;
display: grid; flex-direction: row;
grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); flex-wrap: wrap;
gap: 15px;
grid-auto-rows: auto; flex-basis: 30%;
}
grid-gap: 1rem; .multimedia-container {
flex: 1 0 21%;
} }
.multimedia { .multimedia {
transition: all 0.5s; transition: all 0.5s;
opacity: 1; opacity: 1;
@ -395,18 +398,4 @@ function openDialog(dmsId) {
.zindex { .zindex {
z-index: 1; z-index: 1;
} }
.note-list {
width: 100%;
border: 0.1rem solid $grey-7;
padding: 0.5rem;
margin-bottom: 0.5rem;
}
.note-caption {
display: flex;
justify-content: space-between;
margin-bottom: 0.5rem;
color: $grey-7;
}
</style> </style>

View File

@ -9,6 +9,8 @@ import ClaimSummaryDialog from './Card/ClaimSummaryDialog.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import ClaimFilter from './ClaimFilter.vue'; import ClaimFilter from './ClaimFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const router = useRouter(); const router = useRouter();
@ -74,116 +76,62 @@ function viewSummary(id) {
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard class="card q-mb-md" v-for="row of rows" :key="row.id"> <CardList
<QItem v-for="row of rows"
class="q-pa-none items-start cursor-pointer q-hoverable" :key="row.id"
v-ripple :title="row.clientName"
clickable @click="navigate(row.id)"
> >
<QItemSection class="q-pa-md" @click="navigate(row.id)"> <template #list-items>
<div class="text-h6 link"> <VnLv label="ID" :value="row.id" />
{{ row.clientName }} <VnLv
</div> :label="t('claim.list.customer')"
<QItemLabel caption>#{{ row.id }}</QItemLabel> :value="row.clientName"
<QList> />
<QItem class="q-pa-none"> <VnLv
<QItemSection> :label="t('claim.list.assignedTo')"
<QItemLabel caption> :value="row.workerName"
{{ t('claim.list.customer') }} />
</QItemLabel> <VnLv
<QItemLabel> :label="t('claim.list.created')"
{{ row.clientName }} :value="toDate(row.created)"
</QItemLabel> />
</QItemSection> <VnLv :label="t('claim.list.state')">
<QItemSection> <template #value>
<QItemLabel caption> <QBadge
{{ t('claim.list.assignedTo') }} :color="stateColor(row.stateCode)"
</QItemLabel> class="q-ma-none"
<QItemLabel> dense
{{ row.workerName }} >
</QItemLabel> {{ row.stateDescription }}
</QItemSection> </QBadge>
</QItem> </template>
<QItem class="q-pa-none"> </VnLv>
<QItemSection> </template>
<QItemLabel caption> <template #actions>
{{ t('claim.list.created') }} <QBtn
</QItemLabel> flat
<QItemLabel> icon="arrow_circle_right"
{{ toDate(row.created) }} @click.stop="navigate(row.id)"
</QItemLabel> >
</QItemSection> <QTooltip>
<QItemSection> {{ t('components.smartCard.openCard') }}
<QItemLabel caption> </QTooltip>
{{ t('claim.list.state') }} </QBtn>
</QItemLabel> <QBtn flat icon="preview" @click.stop="viewSummary(row.id)">
<QItemLabel> <QTooltip>
<QBadge {{ t('components.smartCard.openSummary') }}
:color="stateColor(row.stateCode)" </QTooltip>
class="q-ma-none" </QBtn>
dense <QBtn flat icon="vn:client" @click.stop>
> <QTooltip>
{{ row.stateDescription }} {{ t('components.smartCard.viewDescription') }}
</QBadge> </QTooltip>
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</QItemSection>
<QSeparator vertical />
<QCardActions vertical class="justify-between">
<!-- <QBtn color="grey-7" round flat icon="more_vert">
<QTooltip>{{ t('customer.list.moreOptions') }}</QTooltip>
<QMenu cover auto-close>
<QList>
<QItem clickable>
<QItemSection avatar>
<QIcon name="add" />
</QItemSection>
<QItemSection>Add a note</QItemSection>
</QItem>
<QItem clickable>
<QItemSection avatar>
<QIcon name="logs" />
</QItemSection>
<QItemSection>Display claim logs</QItemSection>
</QItem>
</QList>
</QMenu>
</QBtn> -->
<QBtn <CustomerDescriptorProxy :id="row.clientFk" />
flat </QBtn>
round </template>
color="orange" </CardList>
icon="arrow_circle_right"
@click="navigate(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
round
color="grey-7"
icon="preview"
@click="viewSummary(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openSummary') }}
</QTooltip>
</QBtn>
<QBtn flat round color="grey-7" icon="vn:client">
<QTooltip>
{{ t('components.smartCard.viewDescription') }}
</QTooltip>
<CustomerDescriptorProxy :id="row.clientFk" />
</QBtn>
</QCardActions>
</QItem>
</QCard>
</template> </template>
</VnPaginate> </VnPaginate>
</div> </div>

View File

@ -1,9 +1,11 @@
<script setup> <script setup>
import { computed, ref } from 'vue'; import { computed, ref, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { toCurrency, toPercentage, toDate } from 'src/filters'; import { toCurrency, toPercentage, toDate } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -16,8 +18,13 @@ const $props = defineProps({
}); });
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const summary = ref();
const customer = computed(() => summary.value.entity); const customer = computed(() => summary.value.entity);
const summary = ref();
const clientUrl = ref();
onMounted(async () => {
clientUrl.value = (await getUrl('client/')) + entityId.value + '/';
});
const balanceDue = computed(() => { const balanceDue = computed(() => {
return ( return (
@ -38,7 +45,7 @@ const priceIncreasingRate = computed(() => {
}); });
const debtWarning = computed(() => { const debtWarning = computed(() => {
return customer.value.debt.debt > customer.value.credit ? 'negative' : ''; return customer.value?.debt?.debt > customer.value.credit ? 'negative' : '';
}); });
const creditWarning = computed(() => { const creditWarning = computed(() => {
@ -53,478 +60,212 @@ const creditWarning = computed(() => {
<template> <template>
<CardSummary ref="summary" :url="`Clients/${entityId}/summary`"> <CardSummary ref="summary" :url="`Clients/${entityId}/summary`">
<template #body="{ entity }"> <template #body="{ entity }">
<QCardSection class="row q-pa-none QCol-gutter-md"> <QCard class="vn-one">
<div class="col"> <a class="header" :href="clientUrl + `basic-data`">
<QList dense> {{ t('customer.summary.basicData') }}
<QItemLabel header class="text-h6"> <QIcon name="open_in_new" color="primary" />
{{ t('customer.summary.basicData') }} </a>
<RouterLink <VnLv :label="t('customer.summary.customerId')" :value="entity.id" />
:to="{ <VnLv :label="t('customer.summary.name')" :value="entity.name" />
name: 'CustomerBasicData', <VnLv :label="t('customer.summary.contact')" :value="entity.contact" />
params: { id: entity.id }, <VnLv :label="t('customer.summary.phone')" :value="entity.phone" />
}" <VnLv :label="t('customer.summary.mobile')" :value="entity.mobile" />
target="_blank" <VnLv :label="t('customer.summary.email')" :value="entity.email" />
> <VnLv
<QIcon name="open_in_new" /> :label="t('customer.summary.salesPerson')"
</RouterLink> :value="entity?.salesPersonUser?.name"
</QItemLabel> />
<QSeparator class="q-mb-md" /> <VnLv
:label="t('customer.summary.contactChannel')"
:value="entity?.contactChannel?.name"
/>
<VnLv
:label="t('customer.summary.businessType')"
:value="entity.businessType.description"
/>
</QCard>
<QCard class="vn-one">
<a class="header" :href="clientUrl + `fiscal-data`">
{{ t('customer.summary.fiscalAddress') }}
<QIcon name="open_in_new" color="primary" />
</a>
<VnLv
:label="t('customer.summary.socialName')"
:value="entity.socialName"
/>
<VnLv :label="t('customer.summary.fiscalId')" :value="entity.fi" />
<VnLv :label="t('customer.summary.city')" :value="entity.city" />
<VnLv :label="t('customer.summary.postcode')" :value="entity.postcode" />
<QItem class="row col"> <VnLv
<QItemLabel class="col" caption> v-if="entity.province"
{{ t('customer.summary.customerId') }} :label="t('customer.summary.province')"
</QItemLabel> :value="entity.province.name"
<QItemLabel class="col q-ma-none"> />
{{ entity.id }} <VnLv
</QItemLabel> v-if="entity.country"
</QItem> :label="t('customer.summary.country')"
<QItem class="row col"> :value="entity.country.country"
<QItemLabel class="col" caption> />
{{ t('customer.summary.name') }} <VnLv :label="t('customer.summary.street')" :value="entity.street" />
</QItemLabel> </QCard>
<QItemLabel class="col q-ma-none"> <QCard class="vn-one">
{{ entity.name }} <a class="header link" :href="clientUrl + `fiscal-data`" link>
</QItemLabel> {{ t('customer.summary.fiscalAddress') }}
</QItem> <QIcon name="open_in_new" color="primary" />
<QItem class="row col"> </a>
<QItemLabel class="col" caption> <VnLv
{{ t('customer.summary.contact') }} :label="t('customer.summary.isEqualizated')"
</QItemLabel> :value="entity.isEqualizated"
<QItemLabel class="col q-ma-none"> />
{{ entity.contact }} <VnLv :label="t('customer.summary.isActive')" :value="entity.isActive" />
</QItemLabel> <VnLv
</QItem> :label="t('customer.summary.invoiceByAddress')"
:value="entity.hasToInvoiceByAddress"
/>
<VnLv
:label="t('customer.summary.verifiedData')"
:value="entity.isTaxDataChecked"
/>
<VnLv
:label="t('customer.summary.hasToInvoice')"
:value="entity.hasToInvoice"
/>
<VnLv
:label="t('customer.summary.notifyByEmail')"
:value="entity.isToBeMailed"
/>
<VnLv :label="t('customer.summary.vies')" :value="entity.isVies" />
</QCard>
<QCard class="vn-one">
<a class="header link" :href="clientUrl + `billing-data`" link>
{{ t('customer.summary.billingData') }}
<QIcon name="open_in_new" color="primary" />
</a>
<VnLv
:label="t('customer.summary.payMethod')"
:value="entity.payMethod.name"
/>
<VnLv :label="t('customer.summary.bankAccount')" :value="entity.iban" />
<VnLv :label="t('customer.summary.dueDay')" :value="entity.dueDay" />
<VnLv :label="t('customer.summary.hasLcr')" :value="entity.hasLcr" />
<VnLv
:label="t('customer.summary.hasCoreVnl')"
:value="entity.hasCoreVnl"
/>
<VnLv
:label="t('customer.summary.hasB2BVnl')"
:value="entity.hasSepaVnl"
/>
</QCard>
<QCard class="vn-one" v-if="entity.defaultAddress">
<a class="header link" :href="clientUrl + `address/index`" link>
{{ t('customer.summary.consignee') }}
<QIcon name="open_in_new" color="primary" />
</a>
<VnLv
:label="t('customer.summary.addressName')"
:value="entity.defaultAddress.nickname"
/>
<VnLv
:label="t('customer.summary.addressCity')"
:value="entity.defaultAddress.city"
/>
<VnLv
:label="t('customer.summary.addressStreet')"
:value="entity.defaultAddress.street"
/>
</QCard>
<QCard class="vn-one" v-if="entity.account">
<a class="header link" :href="clientUrl + `web-access`">
{{ t('customer.summary.webAccess') }}
<QIcon name="open_in_new" color="primary" />
</a>
<VnLv
:label="t('customer.summary.username')"
:value="entity.account.name"
/>
<VnLv
:label="t('customer.summary.webAccess')"
:value="entity.account.active"
/>
</QCard>
<QCard class="vn-one" v-if="entity.account">
<div class="header">
{{ t('customer.summary.businessData') }}
</div>
<VnLv
:label="t('customer.summary.totalGreuge')"
:value="toCurrency(entity.totalGreuge)"
/>
<VnLv
:label="t('customer.summary.mana')"
:value="toCurrency(entity?.mana?.mana)"
/>
<VnLv
v-if="entity.claimsRatio"
:label="t('customer.summary.priceIncreasingRate')"
:value="toPercentage(priceIncreasingRate)"
/>
<VnLv
:label="t('customer.summary.averageInvoiced')"
:value="toCurrency(entity?.averageInvoiced?.invoiced)"
/>
<VnLv
v-if="entity.claimsRatio"
:label="t('customer.summary.claimRate')"
:value="toPercentage(claimRate)"
/>
</QCard>
<QCard class="vn-one" v-if="entity.account">
<a
class="header link"
:href="`https://grafana.verdnatura.es/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
link
>
{{ t('customer.summary.financialData') }}
<QIcon name="vn:grafana" color="primary" />
</a>
<VnLv
:label="t('customer.summary.risk')"
:value="toCurrency(entity?.debt?.debt)"
:class="debtWarning"
:info="t('customer.summary.riskInfo')"
/>
<QItem v-if="entity.salesPersonUser" class="row col"> <VnLv
<QItemLabel class="col" caption> :label="t('customer.summary.credit')"
{{ t('customer.summary.salesPerson') }} :value="toCurrency(entity.credit)"
</QItemLabel> :class="creditWarning"
<QItemLabel class="col q-ma-none"> :info="t('customer.summary.creditInfo')"
{{ entity.salesPersonUser.name }} />
</QItemLabel>
</QItem>
<QItem class="row col"> <VnLv
<QItemLabel class="col" caption> v-if="entity.creditInsurance"
{{ t('customer.summary.phone') }} :label="t('customer.summary.securedCredit')"
</QItemLabel> :value="toCurrency(entity.creditInsurance)"
<QItemLabel class="col q-ma-none"> :info="t('customer.summary.securedCreditInfo')"
{{ entity.phone }} />
</QItemLabel>
</QItem>
<QItem class="row col"> <VnLv
<QItemLabel class="col" caption> :label="t('customer.summary.balance')"
{{ t('customer.summary.mobile') }} :value="toCurrency(entity.sumRisk) || toCurrency(0)"
</QItemLabel> :info="t('customer.summary.balanceInfo')"
<QItemLabel class="col q-ma-none">{{ />
entity.mobile
}}</QItemLabel>
</QItem>
<QItem v-if="entity.contactChannel" class="row col"> <VnLv
<QItemLabel class="col" caption> v-if="entity.defaulters"
{{ t('customer.summary.contactChannel') }} :label="t('customer.summary.balanceDue')"
</QItemLabel> :value="toCurrency(balanceDue)"
<QItemLabel class="col q-ma-none"> :class="balanceDueWarning"
{{ entity.contactChannel.name }} :info="t('customer.summary.balanceDueInfo')"
</QItemLabel> />
</QItem> <VnLv
v-if="entity.recovery"
<QItem> :label="t('customer.summary.recoverySince')"
<QItemSection> :value="toDate(entity.recovery.started)"
<QItemLabel caption> />
{{ t('customer.summary.email') }} </QCard>
</QItemLabel>
<QItemLabel>{{ entity.email }}</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
<div class="col">
<QList>
<QItemLabel header class="text-h6">
{{ t('customer.summary.fiscalAddress') }}
</QItemLabel>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.socialName') }}
</QItemLabel>
<QItemLabel>{{ entity.socialName }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.fiscalId') }}
</QItemLabel>
<QItemLabel>{{ entity.fi }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.postcode') }}
</QItemLabel>
<QItemLabel>{{ entity.postcode }}</QItemLabel>
</QItemSection>
</QItem>
<QItem v-if="entity.province">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.province') }}
</QItemLabel>
<QItemLabel>{{ entity.province.name }}</QItemLabel>
</QItemSection>
</QItem>
<QItem v-if="entity.country">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.country') }}
</QItemLabel>
<QItemLabel>{{ entity.country.country }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.street') }}
</QItemLabel>
<QItemLabel>{{ entity.street }}</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
<div class="col">
<QList>
<QItemLabel header class="text-h6">
{{ t('customer.summary.fiscalData') }}
</QItemLabel>
<QItem dense>
<QCheckbox
v-model="entity.isEqualizated"
:label="t('customer.summary.isEqualizated')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.isActive"
:label="t('customer.summary.isActive')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.hasToInvoiceByAddress"
:label="t('customer.summary.invoiceByAddress')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.isTaxDataChecked"
:label="t('customer.summary.verifiedData')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.hasToInvoice"
:label="t('customer.summary.hasToInvoice')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.isToBeMailed"
:label="t('customer.summary.notifyByEmail')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.isVies"
:label="t('customer.summary.vies')"
disable
/>
</QItem>
</QList>
</div>
<div class="col">
<QList>
<QItemLabel header class="text-h6">
{{ t('customer.summary.billingData') }}
</QItemLabel>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.payMethod') }}
</QItemLabel>
<QItemLabel>{{ entity.payMethod.name }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.bankAccount') }}
</QItemLabel>
<QItemLabel>{{ entity.iban }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.dueDay') }}
</QItemLabel>
<QItemLabel>{{ entity.dueDay }}</QItemLabel>
</QItemSection>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.hasLcr"
:label="t('customer.summary.hasLcr')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.hasCoreVnl"
:label="t('customer.summary.hasCoreVnl')"
disable
/>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.hasSepaVnl"
:label="t('customer.summary.hasB2BVnl')"
disable
/>
</QItem>
</QList>
</div>
<div class="col" v-if="entity.defaultAddress">
<QList>
<QItemLabel header class="text-h6">
{{ t('customer.summary.consignee') }}
</QItemLabel>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.addressName') }}
</QItemLabel>
<QItemLabel>
{{ entity.defaultAddress.nickname }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.addressCity') }}
</QItemLabel>
<QItemLabel>{{ entity.defaultAddress.city }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.addressStreet') }}
</QItemLabel>
<QItemLabel>
{{ entity.defaultAddress.street }}
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
<div class="col" v-if="entity.account">
<QList>
<QItemLabel header class="text-h6">
{{ t('customer.summary.webAccess') }}
</QItemLabel>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.username') }}
</QItemLabel>
<QItemLabel>{{ entity.account.name }}</QItemLabel>
</QItemSection>
</QItem>
<QItem dense>
<QCheckbox
v-model="entity.account.active"
:label="t('customer.summary.webAccess')"
disable
/>
</QItem>
</QList>
</div>
<div class="col">
<QList>
<QItemLabel header class="text-h6">
{{ t('customer.summary.businessData') }}
</QItemLabel>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.totalGreuge') }}
</QItemLabel>
<QItemLabel>
{{ toCurrency(entity.totalGreuge) }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem v-if="entity.mana">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.mana') }}
</QItemLabel>
<QItemLabel>
{{ toCurrency(entity.mana.mana) }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem v-if="entity.claimsRatio">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.priceIncreasingRate') }}
</QItemLabel>
<QItemLabel>
{{ toPercentage(priceIncreasingRate) }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem v-if="entity.averageInvoiced">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.averageInvoiced') }}
</QItemLabel>
<QItemLabel>
{{ toCurrency(entity.averageInvoiced.invoiced) }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem v-if="entity.claimsRatio">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.claimRate') }}
</QItemLabel>
<QItemLabel>{{ toPercentage(claimRate) }}</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
<div class="col">
<QList>
<QItemLabel header class="text-h6">
{{ t('customer.summary.financialData') }}
</QItemLabel>
<QItem v-if="entity.debt">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.risk') }}
</QItemLabel>
<QItemLabel :class="debtWarning">
{{ toCurrency(entity.debt.debt) }}
</QItemLabel>
</QItemSection>
<QItemSection side>
<QIcon name="vn:info">
<QTooltip>
{{ t('customer.summary.riskInfo') }}
</QTooltip>
</QIcon>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.credit') }}
</QItemLabel>
<QItemLabel :class="creditWarning">
{{ toCurrency(entity.credit) }}
</QItemLabel>
</QItemSection>
<QItemSection side>
<QIcon name="vn:info">
<QTooltip>
{{ t('customer.summary.creditInfo') }}
</QTooltip>
</QIcon>
</QItemSection>
</QItem>
<QItem v-if="entity.creditInsurance">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.securedCredit') }}
</QItemLabel>
<QItemLabel>
{{ toCurrency(entity.creditInsurance) }}
</QItemLabel>
</QItemSection>
<QItemSection side>
<QIcon name="vn:info">
<QTooltip>
{{ t('customer.summary.securedCreditInfo') }}
</QTooltip>
</QIcon>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.balance') }}
</QItemLabel>
<QItemLabel>
{{ toCurrency(entity.sumRisk) || toCurrency(0) }}
</QItemLabel>
</QItemSection>
<QItemSection side>
<QIcon name="vn:info">
<QTooltip>
{{ t('customer.summary.balanceInfo') }}
</QTooltip>
</QIcon>
</QItemSection>
</QItem>
<QItem v-if="entity.defaulters">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.balanceDue') }}
</QItemLabel>
<QItemLabel :class="balanceDueWarning">
{{ toCurrency(balanceDue) }}
</QItemLabel>
</QItemSection>
<QItemSection side>
<QIcon name="vn:info">
<QTooltip>
{{ t('customer.summary.balanceDueInfo') }}
</QTooltip>
</QIcon>
</QItemSection>
</QItem>
<QItem v-if="entity.recovery">
<QItemSection>
<QItemLabel caption>
{{ t('customer.summary.recoverySince') }}
</QItemLabel>
<QItemLabel>
{{ toDate(entity.recovery.started) }}
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
</QCardSection>
</template> </template>
</CardSummary> </CardSummary>
</template> </template>
<style lang="scss">
.q-item__label + .q-item__label {
margin: 0;
}
</style>

View File

@ -7,6 +7,8 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue';
import CustomerSummaryDialog from './Card/CustomerSummaryDialog.vue'; import CustomerSummaryDialog from './Card/CustomerSummaryDialog.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import CustomerFilter from './CustomerFilter.vue'; import CustomerFilter from './CustomerFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const router = useRouter(); const router = useRouter();
@ -66,85 +68,40 @@ function viewSummary(id) {
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard class="card q-mb-md" v-for="row of rows" :key="row.id"> <CardList
<QItem v-for="row of rows"
class="q-pa-none items-start cursor-pointer q-hoverable" :key="row.id"
v-ripple :title="row.name"
clickable @click="navigate(row.id)"
> >
<QItemSection class="q-pa-md" @click="navigate(row.id)"> <template #list-items>
<div class="text-h6">{{ row.name }}</div> <VnLv label="ID" :value="row.id" />
<QItemLabel caption>#{{ row.id }}</QItemLabel> <VnLv :label="t('customer.list.email')" :value="row.email" />
<VnLv :label="t('customer.list.phone')" :value="row.phone" />
<QList> </template>
<QItem class="q-pa-none"> <template #actions>
<QItemSection> <QBtn
<QItemLabel caption> flat
{{ t('customer.list.email') }} color="primary"
</QItemLabel> icon="arrow_circle_right"
<QItemLabel>{{ row.email }}</QItemLabel> @click.stop="navigate(row.id)"
</QItemSection> >
</QItem> <QTooltip>
<QItem class="q-pa-none"> {{ t('components.smartCard.openCard') }}
<QItemSection> </QTooltip>
<QItemLabel caption> </QBtn>
{{ t('customer.list.phone') }} <QBtn
</QItemLabel> flat
<QItemLabel>{{ row.phone }}</QItemLabel> color="grey-7"
</QItemSection> icon="preview"
</QItem> @click.stop="viewSummary(row.id)"
</QList> >
</QItemSection> <QTooltip>
<QSeparator vertical /> {{ t('components.smartCard.openSummary') }}
<QCardActions vertical class="justify-between"> </QTooltip>
<!-- <QBtn color="grey-7" round flat icon="more_vert"> </QBtn>
<QTooltip>{{ t('customer.list.moreOptions') }}</QTooltip> </template>
<QMenu cover auto-close> </CardList>
<QList>
<QItem clickable>
<QItemSection avatar>
<QIcon name="add" />
</QItemSection>
<QItemSection>Add a note</QItemSection>
</QItem>
<QItem clickable>
<QItemSection avatar>
<QIcon name="history" />
</QItemSection>
<QItemSection>Display customer history</QItemSection>
</QItem>
</QList>
</QMenu>
</QBtn> -->
<QBtn
flat
round
color="primary"
icon="arrow_circle_right"
@click="navigate(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
round
color="grey-7"
icon="preview"
@click="viewSummary(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openSummary') }}
</QTooltip>
</QBtn>
<!-- <QBtn flat round color="grey-7" icon="vn:ticket">
<QTooltip>{{ t('customer.list.customerOrders') }}</QTooltip>
</QBtn> -->
</QCardActions>
</QItem>
</QCard>
</template> </template>
</VnPaginate> </VnPaginate>
</div> </div>

View File

@ -4,8 +4,15 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import axios from 'axios'; import axios from 'axios';
import { toCurrency, toDate } from 'src/filters'; import { toCurrency, toDate } from 'src/filters';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
onMounted(() => fetch()); import VnLv from 'src/components/ui/VnLv.vue';
import { getUrl } from 'src/composables/getUrl';
onMounted(async () => {
fetch();
salixUrl.value = await getUrl('');
invoiceOutUrl.value = salixUrl.value + `invoiceOut/${entityId.value}/`;
});
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -19,20 +26,13 @@ const $props = defineProps({
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const invoiceOut = ref(null); const salixUrl = ref();
const tax = ref(null); const invoiceOutUrl = ref();
const tikets = ref(null); const tickets = ref(null);
function fetch() { function fetch() {
const id = entityId.value; axios.get(`InvoiceOuts/${entityId.value}/getTickets`).then(({ data }) => {
tickets.value = data;
axios.get(`InvoiceOuts/${id}/summary`).then(({ data }) => {
invoiceOut.value = data.invoiceOut;
tax.value = data.invoiceOut.taxesBreakdown;
});
axios.get(`InvoiceOuts/${id}/getTickets`).then(({ data }) => {
tikets.value = data;
}); });
} }
@ -95,124 +95,64 @@ const ticketsColumns = ref([
</script> </script>
<template> <template>
<div class="summary container"> <CardSummary ref="summary" :url="`InvoiceOuts/${entityId}/summary`">
<QCard> <template #header="{ entity: { invoiceOut } }">
<SkeletonSummary v-if="!invoiceOut" /> <div>{{ invoiceOut.ref }} - {{ invoiceOut.client?.socialName }}</div>
<template v-if="invoiceOut"> </template>
<div class="header bg-primary q-pa-sm q-mb-md"> <template #body="{ entity: { invoiceOut } }">
{{ invoiceOut.ref }} - {{ invoiceOut.client.socialName }} <QCard class="vn-one">
<div class="header">
{{ t('invoiceOut.pageTitles.basicData') }}
</div> </div>
<QList> <VnLv
<QItem> :label="t('invoiceOut.summary.issued')"
<QItemSection> :value="toDate(invoiceOut.issued)"
<QItemLabel caption>{{ />
t('invoiceOut.summary.issued') <VnLv
}}</QItemLabel> :label="t('invoiceOut.summary.dued')"
<QItemLabel>{{ toDate(invoiceOut.issued) }}</QItemLabel> :value="toDate(invoiceOut.dued)"
</QItemSection> />
<QItemSection> <VnLv
<QItemLabel caption>{{ :label="t('invoiceOut.summary.created')"
t('invoiceOut.summary.dued') :value="toDate(invoiceOut.created)"
}}</QItemLabel> />
<QItemLabel>{{ toDate(invoiceOut.dued) }}</QItemLabel> <VnLv
</QItemSection> :label="t('invoiceOut.summary.booked')"
</QItem> :value="toDate(invoiceOut.booked)"
<QItem> />
<QItemSection> <VnLv
<QItemLabel caption>{{ :label="t('invoiceOut.summary.company')"
t('invoiceOut.summary.created') :value="invoiceOut.company.code"
}}</QItemLabel> />
<QItemLabel>{{ toDate(invoiceOut.created) }}</QItemLabel> </QCard>
</QItemSection> <QCard class="vn-three">
<QItemSection> <div class="header">
<QItemLabel caption>{{ {{ t('invoiceOut.summary.taxBreakdown') }}
t('invoiceOut.summary.booked') </div>
}}</QItemLabel> <QTable :columns="taxColumns" :rows="invoiceOut.taxesBreakdown" flat>
<QItemLabel>{{ toDate(invoiceOut.booked) }}</QItemLabel> <template #header="props">
</QItemSection> <QTr :props="props">
</QItem> <QTh v-for="col in props.cols" :key="col.name" :props="props">
<QItem> {{ t(col.label) }}
<QItemSection> </QTh>
<QItemLabel caption>{{ </QTr>
t('invoiceOut.summary.company') </template>
}}</QItemLabel> </QTable>
<QItemLabel>{{ invoiceOut.company.code }}</QItemLabel> </QCard>
</QItemSection> <QCard class="vn-three">
</QItem> <div class="header">
</QList> {{ t('invoiceOut.summary.tickets') }}
<QCardSection class="q-pa-md"> </div>
<h6>{{ t('invoiceOut.summary.taxBreakdown') }}</h6> <QTable v-if="tickets" :columns="ticketsColumns" :rows="tickets" flat>
<QTable :columns="taxColumns" :rows="tax" flat> <template #header="props">
<template #header="props"> <QTr :props="props">
<QTr :props="props"> <QTh v-for="col in props.cols" :key="col.name" :props="props">
<QTh {{ t(col.label) }}
v-for="col in props.cols" </QTh>
:key="col.name" </QTr>
:props="props" </template>
> </QTable>
{{ t(col.label) }} </QCard>
</QTh> </template>
</QTr> </CardSummary>
</template>
</QTable>
</QCardSection>
<QCardSection class="q-pa-md">
<h6>{{ t('invoiceOut.summary.tickets') }}</h6>
<QTable :columns="ticketsColumns" :rows="tikets" flat>
<template #header="props">
<QTr :props="props">
<QTh
v-for="col in props.cols"
:key="col.name"
:props="props"
>
{{ t(col.label) }}
</QTh>
</QTr>
</template>
</QTable>
</QCardSection>
</template>
</QCard>
</div>
</template> </template>
<style lang="scss" scoped>
.container {
display: flex;
justify-content: center;
}
.q-card {
width: 100%;
min-width: 950px;
max-width: 950px;
}
.summary {
.header {
text-align: center;
font-size: 18px;
}
#slider-container {
max-width: 80%;
margin: 0 auto;
.q-slider {
.q-slider__marker-labels:nth-child(1) {
transform: none;
}
.q-slider__marker-labels:nth-child(2) {
transform: none;
left: auto !important;
right: 0%;
}
}
}
}
.q-dialog .summary {
max-width: 1200px;
}
</style>

View File

@ -9,6 +9,8 @@ import InvoiceOutSummaryDialog from './Card/InvoiceOutSummaryDialog.vue';
import { toDate, toCurrency } from 'src/filters/index'; import { toDate, toCurrency } from 'src/filters/index';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import InvoiceOutFilter from './InvoiceOutFilter.vue'; import InvoiceOutFilter from './InvoiceOutFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const router = useRouter(); const router = useRouter();
@ -71,97 +73,59 @@ function viewSummary(id) {
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard class="card q-mb-md" v-for="row of rows" :key="row.id"> <CardList
<QItem v-for="row of rows"
class="q-pa-none items-start cursor-pointer q-hoverable" :key="row.id"
v-ripple :title="row.ref"
clickable @click="navigate(row.id)"
> >
<QItemSection class="q-pa-md" @click="navigate(row.id)"> <template #list-items>
<div class="text-h6">{{ row.ref }}</div> <VnLv label="ID" :value="row.id" />
<QItemLabel caption>#{{ row.id }}</QItemLabel> <VnLv
<QList> :label="t('invoiceOut.list.shortIssued')"
<QItem class="q-pa-none"> :title-label="t('invoiceOut.list.issued')"
<QItemSection> :value="toDate(row.issued)"
<QItemLabel caption> />
{{ t('invoiceOut.list.issued') }} <VnLv
</QItemLabel> :label="t('invoiceOut.list.amount')"
<QItemLabel> :value="toCurrency(row.amount)"
{{ toDate(row.issued) }} />
</QItemLabel> <VnLv
</QItemSection> :label="t('invoiceOut.list.client')"
<QItemSection> :value="row.clientSocialName"
<QItemLabel caption> />
{{ t('invoiceOut.list.amount') }} <VnLv
</QItemLabel> :label="t('invoiceOut.list.shortCreated')"
<QItemLabel> :title-label="t('invoiceOut.list.created')"
{{ toCurrency(row.amount) }} :value="toDate(row.created)"
</QItemLabel> />
</QItemSection> <VnLv
</QItem> :label="t('invoiceOut.list.company')"
<QItem class="q-pa-none"> :value="row.companyCode"
<QItemSection> />
<QItemLabel caption> <VnLv
{{ t('invoiceOut.list.client') }} :label="t('invoiceOut.list.shortDued')"
</QItemLabel> :title-label="t('invoiceOut.list.dued')"
<QItemLabel> :value="toDate(row.dued)"
{{ row.clientSocialName }} />
</QItemLabel> </template>
</QItemSection> <template #actions>
<QItemSection> <QBtn
<QItemLabel caption> flat
{{ t('invoiceOut.list.created') }} icon="arrow_circle_right"
</QItemLabel> @click.stop="navigate(row.id)"
<QItemLabel> >
{{ toDate(row.created) }} <QTooltip>
</QItemLabel> {{ t('components.smartCard.openCard') }}
</QItemSection> </QTooltip>
</QItem> </QBtn>
<QItem class="q-pa-none"> <QBtn flat icon="preview" @click.stop="viewSummary(row.id)">
<QItemSection> <QTooltip>
<QItemLabel caption> {{ t('components.smartCard.openSummary') }}
{{ t('invoiceOut.list.company') }} </QTooltip>
</QItemLabel> </QBtn>
<QItemLabel>{{ row.companyCode }}</QItemLabel> </template>
</QItemSection> </CardList>
<QItemSection>
<QItemLabel caption>
{{ t('invoiceOut.list.dued') }}
</QItemLabel>
<QItemLabel>
{{ toDate(row.dued) }}
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</QItemSection>
<QSeparator vertical />
<QCardActions vertical class="justify-between">
<QBtn
flat
round
color="orange"
icon="arrow_circle_right"
@click="navigate(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
round
color="grey-7"
icon="preview"
@click="viewSummary(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openSummary') }}
</QTooltip>
</QBtn>
</QCardActions>
</QItem>
</QCard>
</template> </template>
</VnPaginate> </VnPaginate>
</div> </div>

View File

@ -88,7 +88,7 @@ const setData = (entity) =>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv v-if="entity.ticketState" :label="t('ticket.card.state')"> <VnLv v-if="entity.ticketState" :label="t('ticket.card.state')">
<template #value> <template #value>
<QBadge :color="entity.ticketState.state.classColor ?? 'dark'"> <QBadge :color="entity.ticketState.state.classColor">
{{ entity.ticketState.state.name }} {{ entity.ticketState.state.name }}
</QBadge> </QBadge>
</template> </template>
@ -102,16 +102,18 @@ const setData = (entity) =>
</span> </span>
</template> </template>
</VnLv> </VnLv>
<VnLv <VnLv :label="t('ticket.summary.salesPerson')">
v-if="entity.client && entity.client.salesPersonUser" <template #value>
:label="t('ticket.card.salesPerson')" <span class="link">
:value="entity.client.salesPersonUser.name" {{ entity.client.salesPersonUser.name }}
/> <WorkerDescriptorProxy
<VnLv :id="entity.client.salesPersonFk"
v-if="entity.warehouse" v-if="entity.client.salesPersonFk"
:label="t('ticket.card.warehouse')" />
:value="entity.warehouse.name" </span>
/> </template>
</VnLv>
<VnLv :label="t('ticket.card.warehouse')" :value="entity.warehouse?.name" />
<VnLv <VnLv
v-if="entity.agencyMode" v-if="entity.agencyMode"
:label="t('ticket.card.agency')" :label="t('ticket.card.agency')"

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,8 @@ import { toDate, toDateString, toCurrency } from 'src/filters/index';
import TicketSummaryDialog from './Card/TicketSummaryDialog.vue'; import TicketSummaryDialog from './Card/TicketSummaryDialog.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import TicketFilter from './TicketFilter.vue'; import TicketFilter from './TicketFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
const router = useRouter(); const router = useRouter();
const quasar = useQuasar(); const quasar = useQuasar();
@ -81,105 +83,50 @@ function viewSummary(id) {
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard class="card q-mb-md" v-for="row of rows" :key="row.id"> <CardList
<QItem v-for="row of rows"
class="q-pa-none items-start cursor-pointer q-hoverable" :key="row.id"
v-ripple :id="row.id"
clickable @click="navigate(row.id)"
> >
<QItemSection class="q-pa-md" @click="navigate(row.id)"> <template #list-items>
<div class="text-h6">{{ row.name }}</div> <VnLv
<QItemLabel caption>#{{ row.id }}</QItemLabel> :label="t('ticket.list.nickname')"
<QList> :value="row.nickname"
<QItem class="q-pa-none"> />
<QItemSection> <VnLv :label="t('ticket.list.state')">
<QItemLabel caption> <template #value>
{{ t('ticket.list.nickname') }} <QBadge
</QItemLabel> :color="row.classColor ?? 'orange'"
<QItemLabel> class="q-ma-none"
{{ row.nickname }} dense
</QItemLabel> >
</QItemSection> {{ row.state }}
<QItemSection> </QBadge>
<QItemLabel caption> </template>
{{ t('ticket.list.state') }} </VnLv>
</QItemLabel> <VnLv
<QItemLabel> :label="t('ticket.list.shipped')"
<QBadge :value="toDate(row.shipped)"
:color="row.classColor ?? 'dark'" />
class="q-ma-none" <VnLv :label="t('Zone')" :value="row.zoneName" />
dense <VnLv
> :label="t('ticket.list.salesPerson')"
{{ row.state }} :value="row.salesPerson"
</QBadge> />
</QItemLabel> <VnLv
</QItemSection> :label="t('ticket.list.total')"
</QItem> :value="toCurrency(row.totalWithVat)"
<QItem class="q-pa-none"> />
<QItemSection> </template>
<QItemLabel caption> <template #actions>
{{ t('ticket.list.shipped') }} <QBtn flat icon="preview" @click.stop="viewSummary(row.id)">
</QItemLabel> <QTooltip>
<QItemLabel> {{ t('components.smartCard.openSummary') }}
{{ toDate(row.shipped) }} </QTooltip>
</QItemLabel> </QBtn>
</QItemSection> </template>
<QItemSection> </CardList>
<QItemLabel caption>
{{ t('Zone') }}
</QItemLabel>
<QItemLabel>
{{ row.zoneName }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem class="q-pa-none">
<QItemSection>
<QItemLabel caption>
{{ t('ticket.list.salesPerson') }}
</QItemLabel>
<QItemLabel>
{{ row.salesPerson }}
</QItemLabel>
</QItemSection>
<QItemSection>
<QItemLabel caption>
{{ t('ticket.list.total') }}
</QItemLabel>
<QItemLabel>
{{ toCurrency(row.totalWithVat) }}
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</QItemSection>
<QSeparator vertical />
<QCardActions vertical class="justify-between">
<QBtn
flat
round
color="orange"
icon="arrow_circle_right"
@click="navigate(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
round
color="grey-7"
icon="preview"
@click="viewSummary(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openSummary') }}
</QTooltip>
</QBtn>
</QCardActions>
</QItem>
</QCard>
</template> </template>
</VnPaginate> </VnPaginate>
</div> </div>

View File

@ -63,6 +63,7 @@ const setData = (entity) =>
:url="`Workers/${entityId}`" :url="`Workers/${entityId}`"
:filter="filter" :filter="filter"
:title="data.title" :title="data.title"
:subtitle="data.subtitle"
@on-fetch=" @on-fetch="
(data) => { (data) => {
worker = data; worker = data;
@ -74,7 +75,7 @@ const setData = (entity) =>
<QImg :src="getWorkerAvatar()" class="photo"> <QImg :src="getWorkerAvatar()" class="photo">
<template #error> <template #error>
<div <div
class="absolute-full bg-grey-10 text-center q-pa-md flex flex-center" class="absolute-full picture text-center q-pa-md flex flex-center"
> >
<div> <div>
<div class="text-grey-5" style="opacity: 0.4; font-size: 5vh"> <div class="text-grey-5" style="opacity: 0.4; font-size: 5vh">

View File

@ -3,11 +3,11 @@ import axios from 'axios';
import { ref, onMounted, computed, onUpdated } from 'vue'; import { ref, onMounted, computed, onUpdated } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue';
import WorkerDescriptorProxy from './WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from './WorkerDescriptorProxy.vue';
import { dashIfEmpty } from 'src/filters';
onMounted(() => fetch());
onUpdated(() => fetch());
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -20,8 +20,11 @@ const $props = defineProps({
}); });
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const workerUrl = ref();
const worker = ref(null); onMounted(async () => {
workerUrl.value = (await getUrl('')) + `worker/${entityId.value}/`;
});
const filter = { const filter = {
include: [ include: [
@ -59,230 +62,59 @@ const filter = {
}, },
], ],
}; };
function fetch() {
const id = entityId.value;
axios.get(`/Workers/${id}`, { params: { filter } }).then((response) => {
worker.value = response.data;
});
}
function sipExtension() {
if (worker.value.sip) return worker.value.sip.extension;
return '-';
}
</script> </script>
<template> <template>
<div class="summary container"> <CardSummary ref="summary" :url="`Workers/${entityId}`" :filter="filter">
<QCard> <template #header="{ entity }">
<SkeletonSummary v-if="!worker" /> <div>{{ entity.id }} - {{ entity.firstName }} {{ entity.lastName }}</div>
<template v-if="worker"> </template>
<div class="header bg-primary q-pa-sm q-mb-md"> <template #body="{ entity: worker }">
{{ worker.id }} - {{ worker.firstName }} {{ worker.lastName }} <QCard class="vn-one">
</div> <a class="header" :href="workerUrl + `basic-data`">
<div class="row q-pa-md q-col-gutter-md q-mb-md"> {{ t('worker.summary.basicData') }}
<div class="col"> <QIcon name="open_in_new" color="primary" />
<QList> </a>
<QItemLabel header class="text-h6"> <VnLv :label="t('worker.card.name')" :value="worker.user.nickname" />
{{ t('worker.summary.basicData') }} <VnLv
</QItemLabel> :label="t('worker.list.department')"
<QItem> :value="worker.department.department.name"
<QItemSection> />
<QItemLabel caption> ID </QItemLabel> <VnLv :label="t('worker.list.email')" :value="worker.user.email" />
<QItemLabel>{{ worker.id }}</QItemLabel> <VnLv :label="t('worker.summary.boss')" link>
</QItemSection> <template #value>
</QItem> <span class="link">
<QItem> {{ dashIfEmpty(worker.boss?.name) }}
<QItemSection> <WorkerDescriptorProxy
<QItemLabel caption :id="worker.bossFk"
>{{ t('worker.card.name') }}
</QItemLabel>
<QItemLabel>
{{ worker.user.nickname }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption
>{{ t('worker.list.department') }}
</QItemLabel>
<QItemLabel>{{
worker.department.department.name
}}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption
>{{ t('worker.list.email') }}
</QItemLabel>
<QItemLabel>{{ worker.user.email }}</QItemLabel>
</QItemSection>
</QItem>
<QItem
class="items-start cursor-pointer q-hoverable"
v-if="worker.boss" v-if="worker.boss"
> />
<QItemSection> </span>
<QItemLabel caption> </template>
{{ t('worker.summary.boss') }} </VnLv>
</QItemLabel> <VnLv
<QItemLabel> :label="t('worker.summary.phoneExtension')"
<span class="link"> :value="worker.mobileExtension"
{{ worker.boss.name }} />
<WorkerDescriptorProxy :id="worker.bossFk" /> <VnLv :label="t('worker.summary.entPhone')" :value="worker.phone" />
</span> <VnLv
</QItemLabel> :label="t('worker.summary.personalPhone')"
</QItemSection> :value="worker.client.phone"
</QItem> />
<QItem> <VnLv :label="t('worker.summary.locker')" :value="worker.locker" />
<QItemSection> </QCard>
<QItemLabel caption <QCard class="vn-one">
>{{ t('worker.summary.phoneExtension') }} <div class="header">
</QItemLabel> {{ t('worker.summary.userData') }}
<QItemLabel>
{{
worker.mobileExtension == ''
? worker.mobileExtension
: '-'
}}
</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption
>{{ t('worker.summary.entPhone') }}
</QItemLabel>
<QItemLabel>{{
worker.phone == '' ? worker.phone : '-'
}}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption
>{{ t('worker.summary.personalPhone') }}
</QItemLabel>
<QItemLabel>{{
worker.client.phone == ''
? worker.client.phone
: '-'
}}</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
<div class="col">
<QList>
<QItemLabel header class="text-h6">
{{ t('worker.summary.userData') }}
</QItemLabel>
<QItem>
<QItemSection>
<QItemLabel caption>
{{ t('worker.summary.userId') }}
</QItemLabel>
<QItemLabel>{{ worker.user.id }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption
>{{ t('worker.card.name') }}
</QItemLabel>
<QItemLabel>{{ worker.user.nickname }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption
>{{ t('worker.summary.role') }}
</QItemLabel>
<QItemLabel>{{ worker.user.role.name }}</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QItemLabel caption
>{{ t('worker.summary.sipExtension') }}
</QItemLabel>
<QItemLabel>{{ sipExtension() }}</QItemLabel>
</QItemSection>
</QItem>
</QList>
</div>
</div> </div>
</template> <VnLv :label="t('worker.summary.userId')" :value="worker.user.id" />
</QCard> <VnLv :label="t('worker.card.name')" :value="worker.user.nickname" />
</div> <VnLv :label="t('worker.summary.role')" :value="worker.user.role.name" />
<VnLv
:label="t('worker.summary.sipExtension')"
:value="worker?.sip?.extension"
/>
</QCard>
</template>
</CardSummary>
</template> </template>
<style lang="scss" scoped>
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
margin-right: 10px;
}
.container {
display: flex;
justify-content: center;
}
.q-card {
width: 100%;
max-width: 1200px;
}
.negative {
color: red;
}
.summary {
.q-list {
.q-item__label--header {
display: flex;
justify-content: space-between;
a {
color: $primary;
}
}
}
.row {
flex-wrap: wrap;
.col {
min-width: 250px;
}
}
.header {
text-align: center;
font-size: 18px;
}
#slider-container {
max-width: 80%;
margin: 0 auto;
.q-slider {
.q-slider__marker-labels:nth-child(1) {
transform: none;
}
.q-slider__marker-labels:nth-child(2) {
transform: none;
left: auto !important;
right: 0%;
}
}
}
}
.q-dialog .summary {
max-width: 1200px;
}
</style>

View File

@ -7,6 +7,8 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue';
import WorkerSummaryDialog from './Card/WorkerSummaryDialog.vue'; import WorkerSummaryDialog from './Card/WorkerSummaryDialog.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import WorkerFilter from './WorkerFilter.vue'; import WorkerFilter from './WorkerFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const router = useRouter(); const router = useRouter();
@ -66,73 +68,38 @@ function viewSummary(id) {
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QCard class="card q-mb-md" v-for="row of rows" :key="row.id"> <CardList
<QItem v-for="row of rows"
class="q-pa-none items-start cursor-pointer q-hoverable" :key="row.id"
v-ripple @click="navigate(row.id)"
clickable :title="row.nickname"
> >
<QItemSection class="q-pa-md" @click="navigate(row.id)"> <template #list-items>
<QItemLabel class="text-h6"> <VnLv label="ID" :value="row.id" />
{{ row.nickname }} <VnLv :label="t('worker.list.name')" :value="row.userName" />
</QItemLabel> <VnLv :label="t('worker.list.email')" :value="row.email" />
<QItemLabel caption>#{{ row.id }}</QItemLabel> <VnLv
<QList> :label="t('worker.list.department')"
<QItem class="q-pa-none"> :value="row.department"
<QItemSection> />
<QItemLabel caption> </template>
{{ t('worker.list.name') }} <template #actions>
</QItemLabel> <QBtn
<QItemLabel>{{ row.userName }}</QItemLabel> flat
</QItemSection> icon="arrow_circle_right"
</QItem> @click.stop="navigate(row.id)"
<QItem class="q-pa-none"> >
<QItemSection> <QTooltip>
<QItemLabel caption> {{ t('components.smartCard.openCard') }}
{{ t('worker.list.email') }} </QTooltip>
</QItemLabel> </QBtn>
<QItemLabel>{{ row.email }}</QItemLabel> <QBtn flat icon="preview" @click.stop="viewSummary(row.id)">
</QItemSection> <QTooltip>
</QItem> {{ t('components.smartCard.openSummary') }}
<QItem class="q-pa-none"> </QTooltip>
<QItemSection> </QBtn>
<QItemLabel caption>{{ </template>
t('worker.list.department') </CardList>
}}</QItemLabel>
<QItemLabel>
{{ row.department }}
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</QItemSection>
<QSeparator vertical />
<QCardActions vertical class="justify-between">
<QBtn
flat
round
color="primary"
icon="arrow_circle_right"
@click="navigate(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openCard') }}
</QTooltip>
</QBtn>
<QBtn
flat
round
color="grey-7"
icon="preview"
@click="viewSummary(row.id)"
>
<QTooltip>
{{ t('components.smartCard.openSummary') }}
</QTooltip>
</QBtn>
</QCardActions>
</QItem>
</QCard>
</template> </template>
</VnPaginate> </VnPaginate>
</div> </div>

View File

@ -11,6 +11,6 @@ describe('ClaimNotes', () => {
cy.get('.add-btn').click(); cy.get('.add-btn').click();
cy.get('.note-dialog__content').type(message); cy.get('.note-dialog__content').type(message);
cy.get('.note-dialog__actions .q-btn:nth-child(2)').click(); cy.get('.note-dialog__actions .q-btn:nth-child(2)').click();
cy.get('.notes > :nth-child(1) > .text').should('have.text', message); cy.get('.notes .q-card .text').eq(0).should('have.text', message);
}); });
}); });

View File

@ -6,18 +6,21 @@ describe('WorkerList', () => {
}); });
it('should load workers', () => { it('should load workers', () => {
cy.get('div[class="q-item__label text-h6"]').eq(0).should('have.text', 'Jessica Jones'); cy.get('.list-items > .vn-label-value:nth-child(2) > .value')
cy.get('div[class="q-item__label text-h6"]').eq(1).should('have.text', 'Bruce Banner'); .eq(0)
cy.get('div[class="q-item__label text-h6"]').eq(2).should('have.text', 'Charles Xavier'); .should('have.text', 'JessicaJones');
cy.get('.list-items > .vn-label-value:nth-child(2) > .value')
.eq(1)
.should('have.text', 'BruceBanner');
cy.get('.list-items > .vn-label-value:nth-child(2) > .value')
.eq(2)
.should('have.text', 'CharlesXavier');
}); });
it('should open the worker summary', () => { it('should open the worker summary', () => {
cy.get('div.text-h6') cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(0).click();
.parentsUntil('div.q-card') cy.get('.summaryHeader div').should('have.text', '1110 - Jessica Jones');
.find('div.q-card__actions') cy.get('.summary .header').eq(0).invoke('text').should('include', 'Basic data');
.find('button').first().click(); cy.get('.summary .header').eq(1).should('have.text', 'User data');
cy.get('div[class="header bg-primary q-pa-sm q-mb-md"').should('have.text', '1110 - Jessica Jones');
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(0).should('have.text', 'Basic data');
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(1).should('have.text', 'User data');
}); });
}); });

View File

@ -1,15 +1,15 @@
describe('WorkerSummary', () => { describe('WorkerSummary', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720) cy.viewport(1280, 720);
cy.login('developer') cy.login('developer');
cy.visit('/#/worker/19/summary'); cy.visit('/#/worker/19/summary');
}); });
it('should load worker summary', () => { it('should load worker summary', () => {
cy.get('div[class="header bg-primary q-pa-sm q-mb-md"').should('have.text', '19 - salesBoss salesBoss'); cy.get('.summaryHeader > div').should('have.text', '19 - salesBoss salesBoss');
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(0).should('have.text', 'Basic data'); cy.get(':nth-child(1) > :nth-child(2) > .value > span').should(
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(1).should('have.text', 'User data'); 'have.text',
cy.get('div[class="q-item__section column q-item__section--main justify-center"]').eq(0).should('have.text', 'NamesalesBossNick'); 'salesBossNick'
);
}); });
}); });