Merge branch 'dev' into update_readme
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2025-03-25 13:40:28 +00:00
commit 77543ff690
20 changed files with 694 additions and 633 deletions

View File

@ -152,6 +152,10 @@ const value = computed({
}, },
}); });
const computedSortBy = computed(() => {
return $props.sortBy || $props.optionLabel + ' ASC';
});
watch(options, (newValue) => { watch(options, (newValue) => {
setOptions(newValue); setOptions(newValue);
}); });
@ -186,7 +190,7 @@ function findKeyInOptions() {
} }
function setOptions(data) { function setOptions(data) {
data = dataByOrder(data, $props.sortBy); data = dataByOrder(data, computedSortBy.value);
myOptions.value = JSON.parse(JSON.stringify(data)); myOptions.value = JSON.parse(JSON.stringify(data));
myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
emit('update:options', data); emit('update:options', data);
@ -216,7 +220,8 @@ function filter(val, options) {
async function fetchFilter(val) { async function fetchFilter(val) {
if (!$props.url) return; if (!$props.url) return;
const { fields, include, sortBy, limit } = $props; const { fields, include, limit } = $props;
const sortBy = computedSortBy.value;
const key = const key =
optionFilterValue.value ?? optionFilterValue.value ??
(new RegExp(/\d/g).test(val) (new RegExp(/\d/g).test(val)

View File

@ -201,6 +201,29 @@ async function fetch() {
} }
} }
} }
.vn-card-group {
display: flex;
flex-direction: column;
}
.vn-card-content {
display: flex;
flex-direction: column;
text-overflow: ellipsis;
> div {
max-height: 70px;
}
}
@media (min-width: 1010px) {
.vn-card-group {
flex-direction: row;
}
.vn-card-content {
flex: 1;
}
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.summaryHeader .vn-label-value { .summaryHeader .vn-label-value {

View File

@ -35,6 +35,7 @@ const val = computed(() => $props.value);
:label="label" :label="label"
disable disable
dense dense
size="sm"
/> />
<template v-else> <template v-else>
<div v-if="label || $slots.label" class="label"> <div v-if="label || $slots.label" class="label">
@ -44,7 +45,7 @@ const val = computed(() => $props.value);
</div> </div>
<div class="value"> <div class="value">
<slot name="value"> <slot name="value">
<span :title="value"> <span :title="value" style="text-overflow: ellipsis">
{{ dash ? dashIfEmpty(value) : value }} {{ dash ? dashIfEmpty(value) : value }}
</span> </span>
</slot> </slot>

View File

@ -214,109 +214,106 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
<InvoiceInDescriptorMenu :invoice="entity" /> <InvoiceInDescriptorMenu :invoice="entity" />
</template> </template>
<template #body="{ entity }"> <template #body="{ entity }">
<!--Basic Data--> <QCard class="max-width">
<QCard class="vn-one"> <VnTitle
<QCardSection class="q-pa-none"> :url="getLink('basic-data')"
<VnTitle :text="t('globals.pageTitles.basicData')"
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv
:label="t('invoiceIn.list.supplier')"
:value="entity.supplier?.name"
>
<template #value>
<span class="link" data-cy="invoiceInSummary_supplier">
{{ entity.supplier?.name }}
<SupplierDescriptorProxy :id="entity.supplierFk" />
</span>
</template>
</VnLv>
<VnLv :label="t('invoiceIn.supplierRef')" :value="entity.supplierRef" />
<VnLv
:label="t('invoiceIn.summary.currency')"
:value="entity.currency?.code"
/> />
<VnLv :label="t('invoiceIn.serial')" :value="`${entity.serial}`" /> <div class="vn-card-group">
<VnLv <div class="vn-card-content">
:label="t('globals.country')" <VnLv
:value="entity.supplier?.country?.code" :label="t('invoiceIn.list.supplier')"
/> :value="entity.supplier?.name"
</QCard> >
<QCard class="vn-one"> <template #value>
<QCardSection class="q-pa-none"> <span class="link" data-cy="invoiceInSummary_supplier">
<VnTitle {{ entity.supplier?.name }}
:url="getLink('basic-data')" <SupplierDescriptorProxy :id="entity.supplierFk" />
:text="t('globals.pageTitles.basicData')" </span>
/> </template>
</QCardSection> </VnLv>
<VnLv <VnLv
:ellipsis-value="false" :label="t('invoiceIn.supplierRef')"
:label="t('invoiceIn.summary.issued')" :value="entity.supplierRef"
:value="toDate(entity.issued)" />
/> <VnLv
<VnLv :label="t('invoiceIn.summary.currency')"
:label="t('invoiceIn.summary.operated')" :value="entity.currency?.code"
:value="toDate(entity.operated)" />
/> <VnLv
<VnLv :label="t('invoiceIn.serial')"
:label="t('invoiceIn.summary.bookEntried')" :value="`${entity.serial}`"
:value="toDate(entity.bookEntried)" />
/> <VnLv
<VnLv :label="t('globals.country')"
:label="t('invoiceIn.summary.bookedDate')" :value="entity.supplier?.country?.code"
:value="toDate(entity.booked)" />
/> </div>
<VnLv :label="t('globals.isVies')" :value="entity.supplier?.isVies" /> <div class="vn-card-content">
</QCard> <VnLv
<QCard class="vn-one"> :ellipsis-value="false"
<QCardSection class="q-pa-none"> :label="t('invoiceIn.summary.issued')"
<VnTitle :value="toDate(entity.issued)"
:url="getLink('basic-data')" />
:text="t('globals.pageTitles.basicData')" <VnLv
/> :label="t('invoiceIn.summary.operated')"
</QCardSection> :value="toDate(entity.operated)"
<VnLv />
:label="t('invoiceIn.summary.sage')" <VnLv
:value="entity.sageWithholding?.withholding" :label="t('invoiceIn.summary.bookEntried')"
/> :value="toDate(entity.bookEntried)"
<VnLv />
:label="t('invoiceIn.card.company')" <VnLv
:value="entity.company?.code" :label="t('invoiceIn.summary.bookedDate')"
/> :value="toDate(entity.booked)"
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" /> />
</QCard> <VnLv
<QCard class="vn-one"> :label="t('globals.isVies')"
<QCardSection class="q-pa-none"> :value="entity.supplier?.isVies"
<VnTitle />
:url="getLink('basic-data')" </div>
:text="t('globals.pageTitles.basicData')" <div class="vn-card-content">
/> <VnLv
</QCardSection> :label="t('invoiceIn.summary.sage')"
<QCardSection class="q-pa-none"> :value="entity.sageWithholding?.withholding"
<VnLv />
:label="t('invoiceIn.summary.taxableBase')" <VnLv
:value="toCurrency(entity.totals.totalTaxableBase)" :label="t('invoiceIn.summary.vat')"
/> :value="entity.expenseDeductible?.name"
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" /> />
<VnLv :label="t('invoiceIn.summary.dueTotal')"> <VnLv
<template #value> :label="t('invoiceIn.card.company')"
<QChip :value="entity.company?.code"
dense />
class="q-pa-xs" <VnLv
:color="amountsNotMatch ? 'negative' : 'transparent'" :label="t('invoiceIn.isBooked')"
:title=" :value="invoiceIn?.isBooked"
amountsNotMatch />
? t('invoiceIn.summary.noMatch') </div>
: t('invoiceIn.summary.dueTotal') <div class="vn-card-content">
" <VnLv
> :label="t('invoiceIn.summary.taxableBase')"
{{ toCurrency(entity.totals.totalDueDay) }} :value="toCurrency(entity.totals.totalTaxableBase)"
</QChip> />
</template> <VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
</VnLv> <VnLv :label="t('invoiceIn.summary.dueTotal')">
</QCardSection> <template #value>
<QChip
dense
class="q-pa-xs"
:color="amountsNotMatch ? 'negative' : 'transparent'"
:title="
amountsNotMatch
? t('invoiceIn.summary.noMatch')
: t('invoiceIn.summary.dueTotal')
"
>
{{ toCurrency(entity.totals.totalDueDay) }}
</QChip>
</template>
</VnLv>
</div>
</div>
</QCard> </QCard>
<!--Vat--> <!--Vat-->
<QCard v-if="entity.invoiceInTax.length" class="vat"> <QCard v-if="entity.invoiceInTax.length" class="vat">

View File

@ -119,7 +119,7 @@ const cols = computed(() => [
icon: 'preview', icon: 'preview',
type: 'submit', type: 'submit',
isPrimary: true, isPrimary: true,
action: (row) => viewSummary(row.id, InvoiceInSummary), action: (row) => viewSummary(row.id, InvoiceInSummary, 'lg-width'),
}, },
{ {
title: t('globals.download'), title: t('globals.download'),

View File

@ -71,180 +71,174 @@ async function handleConfirm() {
</script> </script>
<template> <template>
<div class="q-pa-md"> <CardSummary
<CardSummary ref="summary"
ref="summary" :url="`Orders/${entityId}/summary`"
:url="`Orders/${entityId}/summary`" data-key="OrderSummary"
data-key="OrderSummary" >
> <template #header="{ entity }">
<template #header="{ entity }"> {{ t('order.summary.basket') }} #{{ entity?.id }} -
{{ t('order.summary.basket') }} #{{ entity?.id }} - {{ entity?.client?.name }} ({{ entity?.clientFk }})
{{ entity?.client?.name }} ({{ entity?.clientFk }}) </template>
</template> <template #header-right>
<template #header-right> <QBtn
<QBtn flat
flat text-color="white"
text-color="white" :disabled="isConfirmed"
:disabled="isConfirmed" :label="t('order.summary.confirm')"
:label="t('order.summary.confirm')" @click="handleConfirm()"
@click="handleConfirm()" >
> <QTooltip>{{ t('order.summary.confirmLines') }}</QTooltip>
<QTooltip>{{ t('order.summary.confirmLines') }}</QTooltip> </QBtn>
</QBtn> </template>
</template> <template #menu="{ entity }">
<template #menu="{ entity }"> <OrderDescriptorMenu :order="entity" />
<OrderDescriptorMenu :order="entity" /> </template>
</template> <template #body="{ entity }">
<template #body="{ entity }"> <QCard class="vn-two">
<QCard class="vn-one"> <VnTitle
<VnTitle :url="`#/order/${entity.id}/basic-data`"
:url="`#/order/${entity.id}/basic-data`" :text="t('globals.pageTitles.basicData')"
:text="t('globals.pageTitles.basicData')" />
/> <div class="vn-card-group">
<VnLv label="ID" :value="entity.id" /> <div class="vn-card-content">
<VnLv :label="t('globals.alias')" dash> <VnLv label="ID" :value="entity.id" />
<template #value> <VnLv :label="t('globals.alias')" dash>
<span class="link"> <template #value>
{{ dashIfEmpty(entity?.address?.nickname) }} <span class="link">
<CustomerDescriptorProxy :id="entity?.clientFk" /> {{ dashIfEmpty(entity?.address?.nickname) }}
</span> <CustomerDescriptorProxy :id="entity?.clientFk" />
</template> </span>
</VnLv> </template>
<VnLv </VnLv>
:label="t('globals.company')" <VnLv
:value="entity?.address?.companyFk" :label="t('globals.company')"
/> :value="entity?.address?.companyFk"
<VnLv />
:label="t('globals.confirmed')" <VnLv
:value="Boolean(entity?.isConfirmed)" :label="t('globals.confirmed')"
/> :value="Boolean(entity?.isConfirmed)"
</QCard> />
<QCard class="vn-one"> </div>
<VnTitle <div class="vn-card-content">
:url="`#/order/${entity.id}/basic-data`" <VnLv
:text="t('globals.pageTitles.basicData')" :label="t('order.summary.created')"
/> :value="toDateHourMinSec(entity?.created)"
<VnLv />
:label="t('order.summary.created')" <VnLv
:value="toDateHourMinSec(entity?.created)" :label="t('globals.confirmed')"
/> :value="toDateHourMinSec(entity?.confirmed)"
<VnLv />
:label="t('globals.confirmed')" <VnLv
:value="toDateHourMinSec(entity?.confirmed)" :label="t('globals.landed')"
/> :value="toDateHourMinSec(entity?.landed)"
<VnLv />
:label="t('globals.landed')" <VnLv :label="t('globals.phone')">
:value="toDateHourMinSec(entity?.landed)" <template #value>
/> {{ dashIfEmpty(entity?.address?.phone) }}
<VnLv :label="t('globals.phone')"> <a
<template #value> v-if="entity?.address?.phone"
{{ dashIfEmpty(entity?.address?.phone) }} :href="`tel:${entity?.address?.phone}`"
<a class="text-primary"
v-if="entity?.address?.phone" >
:href="`tel:${entity?.address?.phone}`" <QIcon name="phone" />
class="text-primary" </a>
> </template>
<QIcon name="phone" /> </VnLv>
</a> <VnLv
</template> :label="t('order.summary.createdFrom')"
</VnLv> :value="entity?.sourceApp"
<VnLv />
:label="t('order.summary.createdFrom')" <VnLv
:value="entity?.sourceApp" :label="t('order.summary.address')"
/> :value="`${entity?.address?.street} - ${entity?.address?.city} (${entity?.address?.province?.name})`"
<VnLv class="order-summary-address"
:label="t('order.summary.address')" />
:value="`${entity?.address?.street} - ${entity?.address?.city} (${entity?.address?.province?.name})`" </div>
class="order-summary-address" </div>
/> </QCard>
</QCard> <QCard class="vn-one">
<QCard class="vn-one"> <VnTitle :text="t('globals.pageTitles.notes')" />
<VnTitle :text="t('globals.pageTitles.notes')" /> <p v-if="entity?.note" class="no-margin">
<p v-if="entity?.note" class="no-margin"> {{ entity?.note }}
{{ entity?.note }} </p>
</p> </QCard>
</QCard> <QCard class="vn-one">
<QCard class="vn-one"> <VnTitle :text="t('order.summary.total')" />
<VnTitle :text="t('order.summary.total')" /> <VnLv>
<VnLv> <template #label>
<template #label> <span class="text-h6">{{ t('globals.subtotal') }}</span>
<span class="text-h6">{{ t('globals.subtotal') }}</span> </template>
</template> <template #value>
<template #value> <span class="text-h6">{{ toCurrency(entity?.subTotal) }}</span>
<span class="text-h6">{{ </template>
toCurrency(entity?.subTotal) </VnLv>
}}</span> <VnLv>
</template> <template #label>
</VnLv> <span class="text-h6">{{ t('globals.vat') }}</span>
<VnLv> </template>
<template #label> <template #value>
<span class="text-h6">{{ t('globals.vat') }}</span> <span class="text-h6">{{ toCurrency(entity?.VAT) }}</span>
</template> </template>
<template #value> </VnLv>
<span class="text-h6">{{ toCurrency(entity?.VAT) }}</span> <VnLv>
</template> <template #label>
</VnLv> <span class="text-h6">{{ t('order.summary.total') }}</span>
<VnLv> </template>
<template #label> <template #value>
<span class="text-h6">{{ t('order.summary.total') }}</span> <span class="text-h6">{{ toCurrency(entity?.total) }}</span>
</template> </template>
<template #value> </VnLv>
<span class="text-h6">{{ toCurrency(entity?.total) }}</span> </QCard>
</template> <QCard>
</VnLv> <VnTitle :text="t('globals.details')" />
</QCard> <QTable :columns="detailsColumns" :rows="entity?.rows" flat>
<QCard> <template #header="props">
<VnTitle :text="t('globals.details')" /> <QTr :props="props">
<QTable :columns="detailsColumns" :rows="entity?.rows" flat> <QTh auto-width>{{ t('globals.item') }}</QTh>
<template #header="props"> <QTh>{{ t('globals.description') }}</QTh>
<QTr :props="props"> <QTh auto-width>{{ t('globals.quantity') }}</QTh>
<QTh auto-width>{{ t('globals.item') }}</QTh> <QTh auto-width>{{ t('globals.price') }}</QTh>
<QTh>{{ t('globals.description') }}</QTh> <QTh auto-width>{{ t('order.summary.amount') }}</QTh>
<QTh auto-width>{{ t('globals.quantity') }}</QTh> </QTr>
<QTh auto-width>{{ t('globals.price') }}</QTh> </template>
<QTh auto-width>{{ t('order.summary.amount') }}</QTh> <template #body="props">
</QTr> <QTr :props="props">
</template> <QTd key="item" :props="props" class="item">
<template #body="props"> <span class="link">
<QTr :props="props"> {{ props.row.item?.id }}
<QTd key="item" :props="props" class="item"> <ItemDescriptorProxy :id="props.row.item?.id" />
<span class="link"> </span>
{{ props.row.item?.id }} </QTd>
<ItemDescriptorProxy :id="props.row.item?.id" /> <QTd key="description" :props="props">
</span> <div class="description">
</QTd> <div class="name">
<QTd key="description" :props="props"> {{ props.row.item.name }}
<div class="description"> <span
<div class="name"> v-if="props.row.item.subName"
{{ props.row.item.name }} class="subName"
<span >
v-if="props.row.item.subName" {{ props.row.item.subName }}
class="subName" </span>
>
{{ props.row.item.subName }}
</span>
</div>
</div> </div>
<FetchedTags :item="props.row.item" :columns="3" /> </div>
</QTd> <FetchedTags :item="props.row.item" :columns="3" />
<QTd key="quantity" :props="props"> </QTd>
{{ props.row.quantity }} <QTd key="quantity" :props="props">
</QTd> {{ props.row.quantity }}
<QTd key="price" :props="props"> </QTd>
{{ toCurrency(props.row.price) }} <QTd key="price" :props="props">
</QTd> {{ toCurrency(props.row.price) }}
<QTd key="amount" :props="props"> </QTd>
{{ <QTd key="amount" :props="props">
toCurrency(props.row?.quantity * props.row?.price) {{ toCurrency(props.row?.quantity * props.row?.price) }}
}} </QTd>
</QTd> </QTr>
</QTr> </template>
</template> </QTable>
</QTable> </QCard>
</QCard> </template>
</template> </CardSummary>
</CardSummary>
</div>
</template> </template>
<style lang="scss"> <style lang="scss">
.cardSummary .summaryBody .vn-label-value.order-summary-address { .cardSummary .summaryBody .vn-label-value.order-summary-address {

View File

@ -141,7 +141,7 @@ const columns = computed(() => [
{ {
title: t('globals.pageTitles.summary'), title: t('globals.pageTitles.summary'),
icon: 'preview', icon: 'preview',
action: (row) => viewSummary(row.id, OrderSummary), action: (row) => viewSummary(row.id, OrderSummary, 'lg-width'),
isPrimary: true, isPrimary: true,
}, },
], ],

View File

@ -138,74 +138,79 @@ const ticketColumns = ref([
:url="`#/${route.meta.moduleName.toLowerCase()}/${entityId}/basic-data`" :url="`#/${route.meta.moduleName.toLowerCase()}/${entityId}/basic-data`"
:text="t('globals.pageTitles.basicData')" :text="t('globals.pageTitles.basicData')"
/> />
</QCard> <div class="vn-card-group">
<div class="vn-card-content">
<QCard class="vn-one"> <VnLv
<VnLv :label="t('route.summary.date')"
:label="t('route.summary.date')" :value="toDate(entity?.route.dated)"
:value="toDate(entity?.route.dated)" />
/> <VnLv
<VnLv :label="t('route.summary.agency')"
:label="t('route.summary.agency')" :value="entity?.route?.agencyMode?.name"
:value="entity?.route?.agencyMode?.name" />
/> <VnLv
<VnLv :label="t('route.summary.vehicle')"
:label="t('route.summary.vehicle')" :value="entity.route?.vehicle?.numberPlate"
:value="entity.route?.vehicle?.numberPlate" />
/> <VnLv :label="t('route.summary.driver')">
<VnLv :label="t('route.summary.driver')"> <template #value>
<template #value> <span class="link">
<span class="link"> {{
{{ dashIfEmpty(entity?.route?.worker?.user?.name) }} dashIfEmpty(entity?.route?.worker?.user?.name)
<WorkerDescriptorProxy :id="entity.route?.workerFk" /> }}
</span> <WorkerDescriptorProxy
</template> :id="entity.route?.workerFk"
</VnLv> />
<VnLv </span>
:label="t('route.summary.cost')" </template>
:value="toCurrency(entity.route?.cost)" </VnLv>
/> <VnLv
<VnLv :label="t('route.summary.cost')"
:label="t('route.summary.volume')" :value="toCurrency(entity.route?.cost)"
:value="`${dashIfEmpty(entity?.route?.m3)} / ${dashIfEmpty( />
entity?.route?.vehicle?.m3, <VnLv
)} `" :label="t('route.summary.volume')"
/> :value="`${dashIfEmpty(entity?.route?.m3)} / ${dashIfEmpty(
<VnLv entity?.route?.vehicle?.m3,
:label="t('route.summary.packages')" )} `"
:value="getTotalPackages(entity.tickets)" />
/> <VnLv
<QCheckbox :label="t('route.summary.packages')"
:label=" :value="getTotalPackages(entity.tickets)"
entity.route.isOk />
? t('route.summary.closed') <QCheckbox
: t('route.summary.open') :label="
" entity.route.isOk
v-model="entity.route.isOk" ? t('route.summary.closed')
:disable="true" : t('route.summary.open')
/> "
</QCard> v-model="entity.route.isOk"
<QCard class="vn-one"> :disable="true"
<VnLv />
:label="t('route.summary.started')" </div>
:value="toHour(entity?.route.started)" <div class="vn-card-content">
/> <VnLv
<VnLv :label="t('route.summary.started')"
:label="t('route.summary.finished')" :value="toHour(entity?.route.started)"
:value="toHour(entity?.route.finished)" />
/> <VnLv
<VnLv :label="t('route.summary.finished')"
:label="t('route.summary.kmStart')" :value="toHour(entity?.route.finished)"
:value="dashIfEmpty(entity?.route?.kmStart)" />
/> <VnLv
<VnLv :label="t('route.summary.kmStart')"
:label="t('route.summary.kmEnd')" :value="dashIfEmpty(entity?.route?.kmStart)"
:value="dashIfEmpty(entity?.route?.kmEnd)" />
/> <VnLv
<VnLv :label="t('route.summary.kmEnd')"
:label="t('globals.description')" :value="dashIfEmpty(entity?.route?.kmEnd)"
:value="dashIfEmpty(entity?.route?.description)" />
/> <VnLv
:label="t('globals.description')"
:value="dashIfEmpty(entity?.route?.description)"
/>
</div>
</div>
</QCard> </QCard>
<QCard class="vn-max"> <QCard class="vn-max">
<VnTitle <VnTitle

View File

@ -137,120 +137,132 @@ onMounted(async () => {
<TicketDescriptorMenu :ticket="entity" /> <TicketDescriptorMenu :ticket="entity" />
</template> </template>
<template #body="{ entity }"> <template #body="{ entity }">
<QCard class="vn-one"> <QCard class="vn-two">
<VnTitle <VnTitle
:url="toTicketUrl('basic-data')" :url="toTicketUrl('basic-data')"
:text="t('globals.summary.basicData')" :text="t('globals.summary.basicData')"
/> />
<VnLv v-if="entity.ticketState" :label="t('globals.state')"> <div class="vn-card-group">
<template #value> <div class="vn-card-content">
<QBadge <VnLv v-if="entity.ticketState" :label="t('globals.state')">
text-color="black" <template #value>
:color="entity.ticketState.state.classColor" <QBadge
text-color="black"
:color="entity.ticketState.state.classColor"
>
{{ entity.ticketState.state.name }}
</QBadge>
</template>
</VnLv>
<VnLv :label="t('customer.summary.team')">
<template #value>
<span class="link">
{{ entity?.client?.department?.name || '-' }}
<DepartmentDescriptorProxy
:id="entity?.client?.departmentFk"
/>
</span>
</template>
</VnLv>
<VnLv
:label="t('globals.agency')"
:value="entity.agencyMode?.name"
/>
<VnLv :label="t('ticket.summary.zone')">
<template #value>
<span class="link" @click.stop>
{{ entity?.zone?.name }}
<ZoneDescriptorProxy :id="entity.zoneFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('globals.warehouse')"
:value="entity.warehouse?.name"
/>
<VnLv
v-if="ticket?.ticketCollections?.length > 0"
:label="t('ticket.summary.collection')"
:value="ticket?.ticketCollections[0]?.collectionFk"
> >
{{ entity.ticketState.state.name }} <template #value>
</QBadge> <a
</template> :href="`${grafanaUrl}/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-collectionFk=${entity.ticketCollections[0]?.collectionFk}`"
</VnLv> target="_blank"
<VnLv :label="t('customer.summary.team')"> class="grafana"
<template #value> >
<span class="link"> {{ entity.ticketCollections[0]?.collectionFk }}
{{ entity?.client?.department?.name || '-' }} </a>
<DepartmentDescriptorProxy </template>
:id="entity?.client?.departmentFk" </VnLv>
/> <VnLv :label="t('ticket.summary.route')">
</span> <template #value>
</template> <span class="link">
</VnLv> {{ entity.routeFk }}
<VnLv :label="t('globals.agency')" :value="entity.agencyMode?.name" /> <RouteDescriptorProxy :id="entity.routeFk" />
<VnLv :label="t('ticket.summary.zone')"> </span>
<template #value> </template>
<span class="link" @click.stop> </VnLv>
{{ entity?.zone?.name }} <VnLv :label="t('ticket.summary.invoice')">
<ZoneDescriptorProxy :id="entity.zoneFk" /> <template #value>
</span> <span :class="{ link: entity.refFk }">
</template> {{ dashIfEmpty(entity.refFk) }}
</VnLv> <InvoiceOutDescriptorProxy
<VnLv :label="t('globals.warehouse')" :value="entity.warehouse?.name" /> :id="entity.invoiceOut.id"
<VnLv v-if="entity.refFk"
v-if="ticket?.ticketCollections?.length > 0" />
:label="t('ticket.summary.collection')" </span>
:value="ticket?.ticketCollections[0]?.collectionFk" </template>
> </VnLv>
<template #value> <VnLv
<a :label="t('globals.weight')"
:href="`${grafanaUrl}/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-collectionFk=${entity.ticketCollections[0]?.collectionFk}`" :value="dashIfEmpty(entity.weight)"
target="_blank" />
class="grafana" </div>
> <div class="vn-card-content">
{{ entity.ticketCollections[0]?.collectionFk }} <VnLv
</a> :label="t('ticket.summary.shipped')"
</template> :value="toDate(entity.shipped)"
</VnLv> />
<VnLv :label="t('ticket.summary.route')"> <VnLv
<template #value> :label="t('globals.landed')"
<span class="link"> :value="toDate(entity.landed)"
{{ entity.routeFk }} />
<RouteDescriptorProxy :id="entity.routeFk" /> <VnLv :label="t('globals.packages')" :value="entity.packages" />
</span> <VnLv :value="entity.address.phone">
</template> <template #label>
</VnLv> {{ t('ticket.summary.consigneePhone') }}
<VnLv :label="t('ticket.summary.invoice')"> <VnLinkPhone :phone-number="entity.address.phone" />
<template #value> </template>
<span :class="{ link: entity.refFk }"> </VnLv>
{{ dashIfEmpty(entity.refFk) }} <VnLv :value="entity.address.mobile">
<InvoiceOutDescriptorProxy <template #label>
:id="entity.invoiceOut.id" {{ t('ticket.summary.consigneeMobile') }}
v-if="entity.refFk" <VnLinkPhone :phone-number="entity.address.mobile" />
/> </template>
</span> </VnLv>
</template> <VnLv :value="entity.client.phone">
</VnLv> <template #label>
<VnLv :label="t('globals.weight')" :value="dashIfEmpty(entity.weight)" /> {{ t('ticket.summary.clientPhone') }}
</QCard> <VnLinkPhone :phone-number="entity.client.phone" />
<QCard class="vn-one"> </template>
<VnTitle </VnLv>
:url="toTicketUrl('basic-data')" <VnLv :value="entity.client.mobile">
:text="t('globals.summary.basicData')" <template #label>
/> {{ t('ticket.summary.clientMobile') }}
<VnLv <VnLinkPhone :phone-number="entity.client.mobile" />
:label="t('ticket.summary.shipped')" </template>
:value="toDate(entity.shipped)" </VnLv>
/> <VnLv
<VnLv :label="t('globals.landed')" :value="toDate(entity.landed)" /> :label="t('ticket.summary.consignee')"
<VnLv :label="t('globals.packages')" :value="entity.packages" /> :value="`${entity.address?.nickname} #${entity.address?.id}`"
<VnLv :value="entity.address.phone"> />
<template #label> <VnLv
{{ t('ticket.summary.consigneePhone') }} :label="t('ticket.summary.consigneeStreet')"
<VnLinkPhone :phone-number="entity.address.phone" /> :value="formattedAddress"
</template> />
</VnLv> </div>
<VnLv :value="entity.address.mobile"> </div>
<template #label>
{{ t('ticket.summary.consigneeMobile') }}
<VnLinkPhone :phone-number="entity.address.mobile" />
</template>
</VnLv>
<VnLv :value="entity.client.phone">
<template #label>
{{ t('ticket.summary.clientPhone') }}
<VnLinkPhone :phone-number="entity.client.phone" />
</template>
</VnLv>
<VnLv :value="entity.client.mobile">
<template #label>
{{ t('ticket.summary.clientMobile') }}
<VnLinkPhone :phone-number="entity.client.mobile" />
</template>
</VnLv>
<VnLv
:label="t('ticket.summary.consignee')"
:value="`${entity.address?.nickname} #${entity.address?.id}`"
/>
<VnLv
:label="t('ticket.summary.consigneeStreet')"
:value="formattedAddress"
/>
</QCard> </QCard>
<QCard class="vn-one" v-if="entity.notes.length"> <QCard class="vn-one" v-if="entity.notes.length">
<VnTitle <VnTitle

View File

@ -248,7 +248,7 @@ const columns = computed(() => [
name: 'TicketCard', name: 'TicketCard',
}).href; }).href;
window.open(url, '_blank'); window.open(url, '_blank');
} else viewSummary(row.id, TicketSummary); } else viewSummary(row.id, TicketSummary, 'lg-width');
}, },
}, },
], ],

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -7,8 +7,6 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue'; import VnTitle from 'src/components/common/VnTitle.vue';
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
import FetchData from 'src/components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import { toDate, toCurrency, toCelsius } from 'src/filters'; import { toDate, toCurrency, toCelsius } from 'src/filters';
import { toDateTimeFormat } from 'src/filters/date.js'; import { toDateTimeFormat } from 'src/filters/date.js';
import { dashIfEmpty } from 'src/filters'; import { dashIfEmpty } from 'src/filters';
@ -252,16 +250,16 @@ async function setTravelData(travelData) {
} }
const getLink = (param) => `#/travel/${entityId.value}/${param}`; const getLink = (param) => `#/travel/${entityId.value}/${param}`;
onMounted(async () => {
const { data } = await axios.get('Warehouses', {
params: { fields: ['id', 'name'] },
});
warehouses.value = data;
});
</script> </script>
<template> <template>
<FetchData
url="Warehouses"
:filter="{ fields: ['id', 'name'] }"
order="name"
@on-fetch="(data) => (warehouses = data)"
auto-load
/>
<CardSummary <CardSummary
ref="summaryRef" ref="summaryRef"
:url="`Travels/${entityId}/getTravel`" :url="`Travels/${entityId}/getTravel`"
@ -275,72 +273,68 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
<TravelDescriptorMenuItems :travel="entity" /> <TravelDescriptorMenuItems :travel="entity" />
</template> </template>
<template #body> <template #body>
<QCard class="vn-one"> <QCard class="full-width">
<QCardSection class="q-pa-none"> <VnTitle
<VnTitle :url="getLink('basic-data')"
:url="getLink('basic-data')" :text="t('globals.pageTitles.basicData')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.shipped')" :value="toDate(travel.shipped)" />
<VnLv
:label="t('globals.warehouseOut')"
:value="travel.warehouseOut?.name"
/>
<VnRow>
<QCheckbox
:label="t('travel.basicData.isRaid')"
v-model="travel.isRaid"
:disable="true"
/>
</VnRow>
<VnRow>
<QCheckbox
:label="t('travel.summary.delivered')"
v-model="travel.isDelivered"
:disable="true"
/>
</VnRow>
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.landed')" :value="toDate(travel.landed)" />
<VnLv
:label="t('globals.warehouseIn')"
:value="travel.warehouseIn?.name"
/>
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
<QCheckbox
:label="t('travel.summary.received')"
v-model="travel.isReceived"
:disable="true"
/>
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.agency')" :value="travel.agency?.name" />
<VnLv :label="t('globals.reference')" :value="travel.ref" />
<VnLv label="m³" :value="travel.m3" />
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
<VnLv
:label="t('travel.summary.availabled')"
:value="
dashIfEmpty(toDateTimeFormat(travel.availabled))
"
/> />
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv
:label="t('globals.shipped')"
:value="toDate(travel.shipped)"
/>
<VnLv
:label="t('globals.warehouseOut')"
:value="travel.warehouseOut?.name"
/>
<QCheckbox
:label="t('travel.basicData.isRaid')"
v-model="travel.isRaid"
:disable="true"
size="sm"
/>
<QCheckbox
:label="t('travel.summary.delivered')"
v-model="travel.isDelivered"
:disable="true"
size="sm"
/>
</div>
<div class="vn-card-content">
<VnLv
:label="t('globals.landed')"
:value="toDate(travel.landed)"
/>
<VnLv
:label="t('globals.warehouseIn')"
:value="travel.warehouseIn?.name"
/>
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
<QCheckbox
:label="t('travel.summary.received')"
v-model="travel.isReceived"
:disable="true"
size="sm"
/>
</div>
<div class="vn-card-content">
<VnLv :label="t('globals.agency')" :value="travel.agency?.name" />
<VnLv :label="t('globals.reference')" :value="travel.ref" />
<VnLv label="m³" :value="travel.m3" />
<VnLv
:label="t('globals.totalEntries')"
:value="travel.totalEntries"
/>
<VnLv
:label="t('travel.summary.availabled')"
:value="dashIfEmpty(toDateTimeFormat(travel.availabled))"
/>
</div>
</div>
</QCard> </QCard>
<QCard class="full-width"> <QCard class="full-width">
<VnTitle :text="t('travel.summary.entries')" /> <VnTitle :text="t('travel.summary.entries')" />

View File

@ -201,7 +201,7 @@ const columns = computed(() => [
{ {
title: t('components.smartCard.viewSummary'), title: t('components.smartCard.viewSummary'),
icon: 'preview', icon: 'preview',
action: (row) => viewSummary(row.id, TravelSummary), action: (row) => viewSummary(row.id, TravelSummary, 'lg-width'),
isPrimary: true, isPrimary: true,
}, },
], ],

View File

@ -48,77 +48,88 @@ onBeforeMount(async () => {
<WorkerDescriptorMenu :worker="entity" :is-excluded="workerExcluded" /> <WorkerDescriptorMenu :worker="entity" :is-excluded="workerExcluded" />
</template> </template>
<template #body="{ entity: worker }"> <template #body="{ entity: worker }">
<QCard class="vn-one"> <QCard class="vn-two">
<VnTitle :url="basicDataUrl" :text="t('globals.summary.basicData')" /> <VnTitle :url="basicDataUrl" :text="t('globals.summary.basicData')" />
<VnLv :label="t('globals.name')" :value="worker.user?.nickname" /> <div class="vn-card-group">
<VnLv :label="t('globals.department')"> <div class="vn-card-content">
<template #value> <VnLv :label="t('globals.name')" :value="worker.user?.nickname" />
<span class="link" v-text="worker.department?.department?.name" /> <VnLv :label="t('globals.department')">
<DepartmentDescriptorProxy <template #value>
:id="worker.department?.department?.id" <span
class="link"
v-text="worker.department?.department?.name"
/>
<DepartmentDescriptorProxy
:id="worker.department?.department?.id"
/>
</template>
</VnLv>
<VnLv :label="t('worker.summary.boss')" link>
<template #value>
<VnUserLink
v-if="worker.boss"
:name="dashIfEmpty(worker.boss?.name)"
:worker-id="worker.bossFk"
/>
</template>
</VnLv>
<VnLv :value="worker.mobileExtension">
<template #label>
{{ t('worker.summary.phoneExtension') }}
<VnLinkPhone :phone-number="worker.mobileExtension" />
</template>
</VnLv>
<VnLv :value="worker.phone">
<template #label>
{{ t('worker.summary.entPhone') }}
<VnLinkPhone :phone-number="worker.phone" />
</template>
</VnLv>
<VnLv :value="advancedSummary?.client?.phone">
<template #label>
{{ t('worker.summary.personalPhone') }}
<VnLinkPhone
:phone-number="advancedSummary?.client?.phone"
/>
</template>
</VnLv>
</div>
<div class="vn-card-content">
<VnLv
:label="t('worker.summary.fiDueDate')"
:value="toDate(advancedSummary.fiDueDate)"
/> />
</template> <VnLv :label="t('worker.summary.sex')" :value="worker.sex" />
</VnLv> <VnLv
<VnLv :label="t('worker.summary.boss')" link> :label="t('worker.summary.seniority')"
<template #value> :value="toDate(advancedSummary.seniority)"
<VnUserLink
v-if="worker.boss"
:name="dashIfEmpty(worker.boss?.name)"
:worker-id="worker.bossFk"
/> />
</template> <VnLv
</VnLv> :label="t('worker.summary.fi')"
<VnLv :value="worker.mobileExtension"> :value="advancedSummary.fi"
<template #label> />
{{ t('worker.summary.phoneExtension') }} <VnLv
<VnLinkPhone :phone-number="worker.mobileExtension" /> :label="t('worker.summary.birth')"
</template> :value="toDate(advancedSummary.birth)"
</VnLv> />
<VnLv :value="worker.phone"> <VnLv
<template #label> :label="t('worker.summary.isFreelance')"
{{ t('worker.summary.entPhone') }} :value="advancedSummary.isFreelance"
<VnLinkPhone :phone-number="worker.phone" /> />
</template> <VnLv
</VnLv> :label="t('worker.summary.isSsDiscounted')"
<VnLv :value="advancedSummary?.client?.phone"> :value="advancedSummary.isSsDiscounted"
<template #label> />
{{ t('worker.summary.personalPhone') }} <VnLv
<VnLinkPhone :phone-number="advancedSummary?.client?.phone" /> :label="t('worker.summary.hasMachineryAuthorized')"
</template> :value="advancedSummary.hasMachineryAuthorized"
</VnLv> />
</QCard> <VnLv
<QCard class="vn-one" v-if="advancedSummary"> :label="t('worker.summary.isDisable')"
<VnTitle :url="basicDataUrl" :text="t('globals.summary.basicData')" /> :value="advancedSummary.isDisable"
<VnLv />
:label="t('worker.summary.fiDueDate')" </div>
:value="toDate(advancedSummary.fiDueDate)" </div>
/>
<VnLv :label="t('worker.summary.sex')" :value="worker.sex" />
<VnLv
:label="t('worker.summary.seniority')"
:value="toDate(advancedSummary.seniority)"
/>
<VnLv :label="t('worker.summary.fi')" :value="advancedSummary.fi" />
<VnLv
:label="t('worker.summary.birth')"
:value="toDate(advancedSummary.birth)"
/>
<VnLv
:label="t('worker.summary.isFreelance')"
:value="advancedSummary.isFreelance"
/>
<VnLv
:label="t('worker.summary.isSsDiscounted')"
:value="advancedSummary.isSsDiscounted"
/>
<VnLv
:label="t('worker.summary.hasMachineryAuthorized')"
:value="advancedSummary.hasMachineryAuthorized"
/>
<VnLv
:label="t('worker.summary.isDisable')"
:value="advancedSummary.isDisable"
/>
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle :text="t('worker.summary.userData')" /> <VnTitle :text="t('worker.summary.userData')" />

View File

@ -105,7 +105,7 @@ const columns = computed(() => [
{ {
title: t('components.smartCard.viewSummary'), title: t('components.smartCard.viewSummary'),
icon: 'preview', icon: 'preview',
action: (row) => viewSummary(row.id, WorkerSummary), action: (row) => viewSummary(row.id, WorkerSummary, 'lg-width'),
isPrimary: true, isPrimary: true,
}, },
], ],

View File

@ -75,21 +75,30 @@ onMounted(async () => {
<template #body="{ entity: zone }"> <template #body="{ entity: zone }">
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle :url="zoneUrl + `basic-data`" :text="t('summary.basicData')" /> <VnTitle :url="zoneUrl + `basic-data`" :text="t('summary.basicData')" />
<VnLv :label="t('list.agency')" :value="zone.agencyMode?.name" /> <div class="card-group">
<VnLv :label="t('list.price')" :value="toCurrency(zone.price)" /> <div class="card-content">
<VnLv :label="t('zone.bonus')" :value="toCurrency(zone.bonus)" /> <VnLv :label="t('list.agency')" :value="zone.agencyMode?.name" />
<VnLv :label="t('list.price')" :value="toCurrency(zone.price)" />
<VnLv :label="t('zone.bonus')" :value="toCurrency(zone.bonus)" />
</div>
<div class="card-content">
<VnLv
:label="t('summary.closeHour')"
:value="toTimeFormat(zone.hour)"
/>
<VnLv
:label="t('zone.travelingDays')"
:value="zone.travelingDays"
/>
<QCheckbox
:label="t('zone.volumetric')"
v-model="zone.isVolumetric"
:disable="true"
/>
</div>
</div>
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle :url="zoneUrl + `basic-data`" :text="t('summary.basicData')" />
<VnLv :label="t('summary.closeHour')" :value="toTimeFormat(zone.hour)" />
<VnLv :label="t('zone.travelingDays')" :value="zone.travelingDays" />
<QCheckbox
:label="t('zone.volumetric')"
v-model="zone.isVolumetric"
:disable="true"
/>
</QCard>
<QCard class="full-width">
<VnTitle :url="zoneUrl + `warehouses`" :text="t('list.warehouse')" /> <VnTitle :url="zoneUrl + `warehouses`" :text="t('list.warehouse')" />
<QTable <QTable
:columns="columns" :columns="columns"
@ -100,3 +109,15 @@ onMounted(async () => {
</template> </template>
</CardSummary> </CardSummary>
</template> </template>
<style lang="scss" scoped>
.card-group {
display: flex;
flex-direction: column;
}
.card-content {
display: flex;
flex-direction: column;
}
</style>

View File

@ -4,7 +4,7 @@ describe('InvoiceInList', () => {
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)'; const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
const firstId = `${firstRow} > td:nth-child(2) span`; const firstId = `${firstRow} > td:nth-child(2) span`;
const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`; const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
const summaryHeaders = '.summaryBody .header-link'; const summaryHeaders = (opt) => `.summaryBody > .${opt} > .q-pb-lg > .header-link`;
const mockInvoiceRef = `createMockInvoice${Math.floor(Math.random() * 100)}`; const mockInvoiceRef = `createMockInvoice${Math.floor(Math.random() * 100)}`;
const mock = { const mock = {
vnSupplierSelect: { val: 'farmer king', type: 'select' }, vnSupplierSelect: { val: 'farmer king', type: 'select' },
@ -32,8 +32,8 @@ describe('InvoiceInList', () => {
it('should open the details', () => { it('should open the details', () => {
cy.get(firstDetailBtn).click(); cy.get(firstDetailBtn).click();
cy.get(summaryHeaders).eq(1).contains('Basic data'); cy.get(summaryHeaders('max-width')).contains('Basic data');
cy.get(summaryHeaders).eq(4).contains('Vat'); cy.get(summaryHeaders('vat')).contains('Vat');
}); });
it('should create a new Invoice', () => { it('should create a new Invoice', () => {

View File

@ -3,10 +3,10 @@ describe('Ticket descriptor', () => {
const listItem = '[role="menu"] .q-list .q-item'; const listItem = '[role="menu"] .q-list .q-item';
const toCloneOpt = 'To clone ticket'; const toCloneOpt = 'To clone ticket';
const setWeightOpt = 'Set weight'; const setWeightOpt = 'Set weight';
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span'; const warehouseValue = ':nth-child(1) > [data-cy="vnLvWarehouse"]';
const summaryHeader = '.summaryHeader > div'; const summaryHeader = '.summaryHeader > div';
const weight = 25; const weight = 25;
const weightValue = '.summaryBody.row :nth-child(1) > :nth-child(9) > .value > span'; const weightValue = '[data-cy="vnLvWeight"]';
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.viewport(1920, 1080); cy.viewport(1920, 1080);

View File

@ -39,11 +39,11 @@ describe('UserPanel', () => {
cy.get(userCompany).should('have.value', 'Warehouse One').click(); cy.get(userCompany).should('have.value', 'Warehouse One').click();
//Actualizo la opción //Actualizo la opción
cy.getOption(2); cy.getOption(3);
//Compruebo la notificación //Compruebo la notificación
cy.get('.q-notification').should('be.visible'); cy.get('.q-notification').should('be.visible');
cy.get(userCompany).should('have.value', 'Warehouse Two'); cy.get(userCompany).should('have.value', 'TestingWarehouse');
//Restauro el valor //Restauro el valor
cy.get(userCompany).click(); cy.get(userCompany).click();

View File

@ -20,7 +20,7 @@ describe('VnLog', () => {
it('should filter by entity', () => { it('should filter by entity', () => {
cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim'); cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim');
cy.get('.q-page').click(); cy.get('.q-page').click();
cy.validateContent(chips[0], 'Claim'); cy.validateContent(chips[0], 'Beginning');
}); });
it('should show claimDescriptor', () => { it('should show claimDescriptor', () => {

View File

@ -1,27 +1,25 @@
describe('WorkerSummary', () => { describe('WorkerSummary', () => {
const departmentDescriptor = ':nth-child(1) > :nth-child(3) > .value > .link'; const department = ':nth-child(1) > [data-cy="vnLvDepartment"] > .value';
const roleDescriptor = ':nth-child(3) > :nth-child(4) > .value > .link'; const role = '[data-cy="vnLvRole"] > .value';
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 and show the department', () => {
cy.waitForElement('.summaryHeader'); cy.waitForElement('.summaryHeader');
cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss'); cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss');
cy.get(':nth-child(1) > :nth-child(2) > .value > span').should( cy.get(department).should('have.text', 'VENTAS');
'have.text',
'salesBossNick',
);
}); });
it('should try descriptors', () => { it('should try descriptors', () => {
cy.waitForElement('.summaryHeader'); cy.waitForElement('.summaryHeader');
cy.get(departmentDescriptor).click(); cy.get(department).click();
cy.get('.descriptor').should('be.visible'); cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '43'); cy.get('.q-item > .q-item__label').should('include.text', '43');
cy.get(roleDescriptor).click(); cy.get('.summaryBody').click();
cy.get(role).click();
cy.get('.descriptor').should('be.visible'); cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '19'); cy.get('.q-item > .q-item__label').should('include.text', '19');
}); });