0
0
Fork 0

chore: refs #7353 fix warnings

This commit is contained in:
Jorge Penadés 2024-08-23 15:55:56 +02:00
parent fdacdf1a12
commit 1bbc6c1840
8 changed files with 288 additions and 302 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, onBeforeMount, onMounted, computed, watch } from 'vue'; import { ref, onBeforeMount, onMounted, computed, watch, useAttrs } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
@ -109,6 +109,7 @@ const showForm = ref(false);
const splittedColumns = ref({ columns: [] }); const splittedColumns = ref({ columns: [] });
const columnsVisibilitySkiped = ref(); const columnsVisibilitySkiped = ref();
const createForm = ref(); const createForm = ref();
const defaultClass = useAttrs().class ?? 'q-px-md';
const tableModes = [ const tableModes = [
{ {
@ -332,9 +333,8 @@ defineExpose({
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<!-- class in div to fix warn--> <!-- class in div to fix warn-->
<div class="q-px-md">
<CrudModel <CrudModel
v-bind="$attrs" v-bind="{ ...$attrs, ...{ class: defaultClass } }"
:limit="20" :limit="20"
ref="CrudModelRef" ref="CrudModelRef"
@on-fetch="(...args) => emit('onFetch', ...args)" @on-fetch="(...args) => emit('onFetch', ...args)"
@ -344,11 +344,7 @@ defineExpose({
:has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable" :has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable"
:auto-load="hasParams || $attrs['auto-load']" :auto-load="hasParams || $attrs['auto-load']"
> >
<template <template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
v-for="(_, slotName) in $slots"
#[slotName]="slotData"
:key="slotName"
>
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" /> <slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
</template> </template>
<template #body="{ rows }"> <template #body="{ rows }">
@ -404,10 +400,7 @@ defineExpose({
:class="`text-${col?.align ?? 'left'}`" :class="`text-${col?.align ?? 'left'}`"
:style="$props.columnSearch ? 'height: 75px' : ''" :style="$props.columnSearch ? 'height: 75px' : ''"
> >
<div <div class="row items-center no-wrap" style="height: 30px">
class="row items-center no-wrap"
style="height: 30px"
>
<VnTableOrder <VnTableOrder
v-model="orders[col.orderBy ?? col.name]" v-model="orders[col.orderBy ?? col.name]"
:name="col.orderBy ?? col.name" :name="col.orderBy ?? col.name"
@ -433,10 +426,7 @@ defineExpose({
</template> </template>
<template #body-cell-tableStatus="{ col, row }"> <template #body-cell-tableStatus="{ col, row }">
<QTd auto-width :class="getColAlign(col)"> <QTd auto-width :class="getColAlign(col)">
<VnTableChip <VnTableChip :columns="splittedColumns.columnChips" :row="row">
:columns="splittedColumns.columnChips"
:row="row"
>
<template #afterChip> <template #afterChip>
<slot name="afterChip" :row="row"></slot> <slot name="afterChip" :row="row"></slot>
</template> </template>
@ -452,8 +442,7 @@ defineExpose({
v-if="col.visible ?? true" v-if="col.visible ?? true"
@click.ctrl=" @click.ctrl="
($event) => ($event) =>
rowCtrlClickFunction && rowCtrlClickFunction && rowCtrlClickFunction($event, row)
rowCtrlClickFunction($event, row)
" "
> >
<slot <slot
@ -487,14 +476,10 @@ defineExpose({
class="q-px-sm" class="q-px-sm"
flat flat
:class=" :class="
btn.isPrimary btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
? 'text-primary-light'
: 'color-vn-text '
" "
:style="`visibility: ${ :style="`visibility: ${
(btn.show && btn.show(row)) ?? true (btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
? 'visible'
: 'hidden'
}`" }`"
@click="btn.action(row)" @click="btn.action(row)"
/> />
@ -568,9 +553,7 @@ defineExpose({
> >
<template #value> <template #value>
<span <span
@click=" @click="stopEventPropagation($event)"
stopEventPropagation($event)
"
> >
<slot <slot
:name="`column-${col.name}`" :name="`column-${col.name}`"
@ -621,7 +604,6 @@ defineExpose({
</QTable> </QTable>
</template> </template>
</CrudModel> </CrudModel>
</div>
<QPageSticky v-if="create" :offset="[20, 20]" style="z-index: 2"> <QPageSticky v-if="create" :offset="[20, 20]" style="z-index: 2">
<QBtn @click="showForm = !showForm" color="primary" fab icon="add" /> <QBtn @click="showForm = !showForm" color="primary" fab icon="add" />
<QTooltip> <QTooltip>

View File

@ -3,7 +3,7 @@ import { onMounted, watch, computed, ref } from 'vue';
import { date } from 'quasar'; import { date } from 'quasar';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
const model = defineModel({ type: String }); const model = defineModel({ type: [String, Date] });
const $props = defineProps({ const $props = defineProps({
isOutlined: { isOutlined: {
type: Boolean, type: Boolean,

View File

@ -10,6 +10,10 @@ const props = defineProps({
type: String, type: String,
required: true, required: true,
}, },
class: {
type: String,
default: '',
},
autoLoad: { autoLoad: {
type: Boolean, type: Boolean,
default: false, default: false,
@ -215,7 +219,7 @@ defineExpose({ fetch, addFilter, paginate });
v-if="store.data" v-if="store.data"
@load="onLoad" @load="onLoad"
:offset="offset" :offset="offset"
class="full-width" :class="['full-width', props.class]"
:disable="disableInfiniteScroll || !store.hasMoreData" :disable="disableInfiniteScroll || !store.hasMoreData"
v-bind="$attrs" v-bind="$attrs"
> >

View File

@ -121,30 +121,25 @@ const columns = computed(() => [
default-mode="table" default-mode="table"
:disable-option="{ card: true }" :disable-option="{ card: true }"
dense dense
class="q-px-none"
> >
<template #top-left> <template #top-left>
<VnRow> <VnRow>
<VnInputDate v-model="from" label="From" dense style="flex: 0.3" /> <VnInputDate v-model="from" label="From" dense style="flex: 0.4" />
<VnInputDate v-model="to" label="To" dense style="flex: 0.3" /> <VnInputDate v-model="to" label="To" dense style="flex: 0.4" />
</VnRow> </VnRow>
</template> </template>
<template #column-salesPersonFk="{ row }"> <template #column-salesPersonFk="{ row }">
<QTd> <QTd>
<span class="link">{{ row.salesPerson }}</span> <span class="link" :title="row.salesPerson" v-text="row.salesPerson" />
<WorkerDescriptorProxy :id="row.salesPersonFk" dense /> <WorkerDescriptorProxy :id="row.salesPersonFk" dense />
</QTd> </QTd>
</template> </template>
<template #column-clientFk="{ row }"> <template #column-clientFk="{ row }">
<QTd> <QTd>
<span class="link">{{ row.clientName }}</span> <span class="link" :title="row.clientName" v-text="row.clientName" />
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.clientFk" />
</QTd> </QTd>
</template> </template>
</VnTable> </VnTable>
</template> </template>
<style lang="scss" scoped>
td {
max-width: 120px;
}
</style>

View File

@ -8,14 +8,14 @@ import VnRow from 'src/components/ui/VnRow.vue';
class="q-pa-md" class="q-pa-md"
:style="{ 'flex-direction': $q.screen.lt.lg ? 'column' : 'row', gap: '0px' }" :style="{ 'flex-direction': $q.screen.lt.lg ? 'column' : 'row', gap: '0px' }"
> >
<div style="flex: 0.25"> <div style="flex: 0.3">
<span <span
class="q-ml-md text-body1" class="q-ml-md text-body1"
v-text="$t('salesMonitor.clientsOnWebsite')" v-text="$t('salesMonitor.clientsOnWebsite')"
/> />
<SalesClientTable /> <SalesClientTable />
</div> </div>
<div style="flex: 0.75"> <div style="flex: 0.7">
<span <span
class="q-ml-md text-body1" class="q-ml-md text-body1"
v-text="$t('salesMonitor.recentOrderActions')" v-text="$t('salesMonitor.recentOrderActions')"

View File

@ -56,6 +56,12 @@ const columns = computed(() => [
}, },
}, },
}, },
{
label: t('salesOrdersTable.agency'),
name: 'agencyName',
align: 'left',
columnFilter: false,
},
{ {
label: t('salesOrdersTable.salesPerson'), label: t('salesOrdersTable.salesPerson'),
name: 'salesPersonFk', name: 'salesPersonFk',
@ -72,6 +78,14 @@ const columns = computed(() => [
}, },
}, },
}, },
{
label: t('salesOrdersTable.import'),
name: 'import',
field: 'import',
align: 'left',
columnFilter: false,
format: (row) => toCurrency(row.import),
},
]); ]);
const getBadgeColor = (date) => { const getBadgeColor = (date) => {
@ -167,25 +181,14 @@ const openTab = (id) =>
<template #column-clientFk="{ row }"> <template #column-clientFk="{ row }">
<QTd> <QTd>
<div class="q-mb-sm"> <span class="link" v-text="row.clientName" :title="row.clientName" />
<span class="link" v-text="row.clientName" />
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.clientFk" />
</div>
<span
:title="$q.screen.lt.xl ? row.agencyName : ''"
v-text="row.agencyName"
/>
</QTd> </QTd>
</template> </template>
<template #column-salesPersonFk="{ row }"> <template #column-salesPersonFk="{ row }">
<QTd>
<div class="q-mb-md">
<span class="link" v-text="row.salesPerson" /> <span class="link" v-text="row.salesPerson" />
<WorkerDescriptorProxy :id="row.salesPersonFk" dense /> <WorkerDescriptorProxy :id="row.salesPersonFk" dense />
</div>
<span v-text="toCurrency(row.import)" />
</QTd>
</template> </template>
</VnTable> </VnTable>
</template> </template>

View File

@ -17,6 +17,7 @@ salesOrdersTable:
salesPerson: Salesperson salesPerson: Salesperson
deleteConfirmTitle: Delete selected elements deleteConfirmTitle: Delete selected elements
deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue? deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue?
agency: Agency
salesTicketsTable: salesTicketsTable:
autoRefresh: Auto-refresh autoRefresh: Auto-refresh
problems: Problems problems: Problems

View File

@ -17,6 +17,7 @@ salesOrdersTable:
salesPerson: Comercial salesPerson: Comercial
deleteConfirmTitle: Eliminar los elementos seleccionados deleteConfirmTitle: Eliminar los elementos seleccionados
deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar? deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar?
agency: Agencia
salesTicketsTable: salesTicketsTable:
autoRefresh: Auto-refresco autoRefresh: Auto-refresco
problems: Problemas problems: Problemas