visual refactors

This commit is contained in:
William Buezas 2023-11-29 16:10:44 -03:00
parent 3bb4a75df7
commit 50d5e38130
7 changed files with 91 additions and 105 deletions

View File

@ -89,7 +89,12 @@ const value = computed({
ref="vnSelectRef" ref="vnSelectRef"
> >
<template v-if="isClearable" #append> <template v-if="isClearable" #append>
<QIcon name="close" @click.stop="value = null" class="cursor-pointer" /> <QIcon
name="close"
@click.stop="value = null"
class="cursor-pointer"
size="18px"
/>
</template> </template>
<template v-for="(_, slotName) in $slots" #[slotName]="slotData"> <template v-for="(_, slotName) in $slots" #[slotName]="slotData">
<slot :name="slotName" v-bind="slotData" /> <slot :name="slotName" v-bind="slotData" />

View File

@ -217,7 +217,7 @@ onMounted(async () => {
</template> </template>
<style scoped> <style scoped>
.form-container > * { .form-container * {
max-width: 100%; max-width: 100%;
} }
</style> </style>

View File

@ -5,7 +5,7 @@ import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorP
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import invoiceOutService from 'src/services/invoiceOut.service'; import invoiceOutService from 'src/services/invoiceOut.service';
import { toCurrency } from 'src/filters'; import { toCurrency } from 'src/filters';
import { QBadge, QBtn } from 'quasar'; import { QCheckbox, QBtn } from 'quasar';
import { useInvoiceOutGlobalStore } from 'src/stores/invoiceOutGlobal.js'; import { useInvoiceOutGlobalStore } from 'src/stores/invoiceOutGlobal.js';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
@ -39,57 +39,66 @@ const filter = ref({
const tableColumnComponents = { const tableColumnComponents = {
company: { company: {
component: 'span', component: 'span',
props: {}, props: () => {},
event: () => {}, event: () => {},
}, },
country: { country: {
component: 'span', component: 'span',
props: {}, props: () => {},
event: () => {}, event: () => {},
}, },
clientId: { clientId: {
component: QBtn, component: QBtn,
props: { flat: true, color: 'blue' }, props: () => ({ flat: true, color: 'blue' }),
event: (prop) => selectCustomerId(prop.value), event: (prop) => selectCustomerId(prop.value),
}, },
client: { client: {
component: 'span', component: 'span',
props: {}, props: () => {},
event: () => {}, event: () => {},
}, },
amount: { amount: {
component: 'span', component: 'span',
props: {}, props: () => {},
event: () => {}, event: () => {},
}, },
base: { base: {
component: 'span', component: 'span',
props: {}, props: () => {},
event: () => {}, event: () => {},
}, },
ticketId: { ticketId: {
component: 'span', component: 'span',
props: {}, props: () => {},
event: () => {}, event: () => {},
}, },
active: { active: {
component: 'span', component: QCheckbox,
props: { type: 'boolean' }, props: (prop) => ({
disable: true,
'model-value': Boolean(prop.value),
}),
event: () => {}, event: () => {},
}, },
hasToInvoice: { hasToInvoice: {
component: 'span', component: QCheckbox,
props: { type: 'boolean' }, props: (prop) => ({
disable: true,
'model-value': Boolean(prop.value),
}),
event: () => {}, event: () => {},
}, },
verifiedData: { verifiedData: {
component: 'span', component: QCheckbox,
props: { type: 'boolean' }, props: (prop) => ({
disable: true,
'model-value': Boolean(prop.value),
}),
event: () => {}, event: () => {},
}, },
comercial: { comercial: {
component: QBtn, component: QBtn,
props: { flat: true, color: 'blue' }, props: () => ({ flat: true, color: 'blue' }),
event: (prop) => selectWorkerId(prop.row.comercialId), event: (prop) => selectWorkerId(prop.row.comercialId),
}, },
}; };
@ -351,27 +360,17 @@ onMounted(async () => {
<component <component
:is="tableColumnComponents[props.col.name].component" :is="tableColumnComponents[props.col.name].component"
class="col-content" class="col-content"
v-bind="tableColumnComponents[props.col.name].props" v-bind="tableColumnComponents[props.col.name].props(props)"
@click="tableColumnComponents[props.col.name].event(props)" @click="tableColumnComponents[props.col.name].event(props)"
> >
<span <template
v-if=" v-if="
tableColumnComponents[props.col.name].props.type != props.col.name !== 'active' &&
'boolean' props.col.name !== 'hasToInvoice' &&
props.col.name !== 'verifiedData'
" "
>{{ props.value }}</template
> >
{{ props.value }}
</span>
<span v-else>
<QBadge v-if="props.value" color="grey">
<QIcon name="check" size="xs" />
</QBadge>
<QBadge v-else color="grey" outline>
<QIcon name="" size="xs" />
</QBadge>
</span>
<CustomerDescriptorProxy <CustomerDescriptorProxy
v-if="props.col.name === 'clientId'" v-if="props.col.name === 'clientId'"
:id="selectedCustomerId" :id="selectedCustomerId"

View File

@ -84,20 +84,31 @@ const isAdministrative = computed(() => {
<span> {{ supplier.note || '-' }} </span> <span> {{ supplier.note || '-' }} </span>
</template> </template>
</VnLv> </VnLv>
<QCheckbox <VnLv :label="t('supplier.summary.notes')" class="q-mb-xs">
v-model="supplier.isSerious" <template #value>
:label="t('verified')" <span> {{ supplier.note || '-' }} </span>
disable </template>
dense </VnLv>
class="full-width q-mb-xs" <VnLv :label="t('verified')" class="q-mb-xs">
/> <template #value>
<QCheckbox <QCheckbox
v-model="supplier.isActive" v-model="supplier.isSerious"
:label="t('isActive')" dense
disable disable
dense class="full-width q-mb-xs"
class="full-width q-mb-xs" />
/> </template>
</VnLv>
<VnLv :label="t('isActive')" class="q-mb-xs">
<template #value>
<QCheckbox
v-model="supplier.isActive"
dense
disable
class="full-width q-mb-xs"
/>
</template>
</VnLv>
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<a v-if="isAdministrative" class="header link" :href="supplierUrl"> <a v-if="isAdministrative" class="header link" :href="supplierUrl">
@ -169,21 +180,4 @@ const isAdministrative = computed(() => {
</template> </template>
</CardSummary> </CardSummary>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped></style>
.notes {
width: max-content;
}
.cardSummary .summaryBody > .q-card > .taxes {
border: 2px solid gray;
padding: 0;
> .vn-label-value {
text-align: right;
display: flex;
flex-direction: row;
margin-top: 5px;
justify-content: flex-end;
padding-right: 20px;
}
}
</style>

View File

@ -50,12 +50,11 @@ const viewSummary = (id) => {
<CardList2 <CardList2
v-for="row of rows" v-for="row of rows"
:key="row.id" :key="row.id"
:showCheckbox="true"
:title="row.socialName" :title="row.socialName"
:id="row.id"
@click="navigate(row.id)" @click="navigate(row.id)"
> >
<template #list-items> <template #list-items>
<VnLv label="ID" :value="row.id" />
<VnLv label="NIF/CIF" :value="row.nif" /> <VnLv label="NIF/CIF" :value="row.nif" />
<VnLv label="Alias" :value="row.nickname" /> <VnLv label="Alias" :value="row.nickname" />
<VnLv <VnLv
@ -77,11 +76,11 @@ const viewSummary = (id) => {
/> />
</template> </template>
<template #actions> <template #actions>
<QBtn flat icon="preview" @click.stop="viewSummary(row.id)"> <QBtn
<QTooltip> :label="t('components.smartCard.openSummary')"
{{ t('components.smartCard.openSummary') }} @click.stop="viewSummary(row.id)"
</QTooltip> color="primary"
</QBtn> />
</template> </template>
</CardList2> </CardList2>
</template> </template>

View File

@ -226,20 +226,27 @@ const openEntryDescriptor = () => {};
<VnLv label="m³" :value="travel.m3" /> <VnLv label="m³" :value="travel.m3" />
<VnLv :label="t('travel.shared.totalEntries')" :value="travel.m3" /> <VnLv :label="t('travel.shared.totalEntries')" :value="travel.m3" />
<QCheckbox
v-model="travel.isDelivered" <VnLv :label="t('travel.summary.delivered')" class="q-mb-xs">
:label="t('travel.summary.delivered')" <template #value>
disable <QCheckbox
dense v-model="travel.isDelivered"
class="full-width q-my-xs" disable
/> dense
<QCheckbox class="full-width q-my-xs"
v-model="travel.isReceived" />
:label="t('travel.summary.received')" </template>
disable </VnLv>
dense <VnLv :label="t('travel.summary.received')" class="q-mb-xs">
class="full-width q-mb-xs" <template #value>
/> <QCheckbox
v-model="travel.isReceived"
disable
dense
class="full-width q-mb-xs"
/>
</template>
</VnLv>
</QCard> </QCard>
<QCard class="vn-two" v-if="entriesTableRows.length > 0"> <QCard class="vn-two" v-if="entriesTableRows.length > 0">
<a class="header" :href="travelUrl + 'entry'"> <a class="header" :href="travelUrl + 'entry'">
@ -285,21 +292,4 @@ const openEntryDescriptor = () => {};
</template> </template>
</CardSummary> </CardSummary>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped></style>
.notes {
width: max-content;
}
.cardSummary .summaryBody > .q-card > .taxes {
border: 2px solid gray;
padding: 0;
> .vn-label-value {
text-align: right;
display: flex;
flex-direction: row;
margin-top: 5px;
justify-content: flex-end;
padding-right: 20px;
}
}
</style>

View File

@ -67,7 +67,6 @@ onMounted(async () => {
:key="row.id" :key="row.id"
:title="row.ref" :title="row.ref"
:id="row.id" :id="row.id"
:showCheckbox="true"
@click="navigateToTravelId(row.id)" @click="navigateToTravelId(row.id)"
> >
<template #list-items> <template #list-items>