forked from verdnatura/salix-front
chore: refs #7353 fix warnings
This commit is contained in:
parent
fdacdf1a12
commit
1bbc6c1840
|
@ -1,5 +1,5 @@
|
|||
<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 { useRoute, useRouter } from 'vue-router';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -109,6 +109,7 @@ const showForm = ref(false);
|
|||
const splittedColumns = ref({ columns: [] });
|
||||
const columnsVisibilitySkiped = ref();
|
||||
const createForm = ref();
|
||||
const defaultClass = useAttrs().class ?? 'q-px-md';
|
||||
|
||||
const tableModes = [
|
||||
{
|
||||
|
@ -332,9 +333,8 @@ defineExpose({
|
|||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<!-- class in div to fix warn-->
|
||||
<div class="q-px-md">
|
||||
<CrudModel
|
||||
v-bind="$attrs"
|
||||
v-bind="{ ...$attrs, ...{ class: defaultClass } }"
|
||||
:limit="20"
|
||||
ref="CrudModelRef"
|
||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
||||
|
@ -344,11 +344,7 @@ defineExpose({
|
|||
:has-sub-toolbar="$attrs['hasSubToolbar'] ?? isEditable"
|
||||
:auto-load="hasParams || $attrs['auto-load']"
|
||||
>
|
||||
<template
|
||||
v-for="(_, slotName) in $slots"
|
||||
#[slotName]="slotData"
|
||||
:key="slotName"
|
||||
>
|
||||
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
<template #body="{ rows }">
|
||||
|
@ -404,10 +400,7 @@ defineExpose({
|
|||
:class="`text-${col?.align ?? 'left'}`"
|
||||
:style="$props.columnSearch ? 'height: 75px' : ''"
|
||||
>
|
||||
<div
|
||||
class="row items-center no-wrap"
|
||||
style="height: 30px"
|
||||
>
|
||||
<div class="row items-center no-wrap" style="height: 30px">
|
||||
<VnTableOrder
|
||||
v-model="orders[col.orderBy ?? col.name]"
|
||||
:name="col.orderBy ?? col.name"
|
||||
|
@ -433,10 +426,7 @@ defineExpose({
|
|||
</template>
|
||||
<template #body-cell-tableStatus="{ col, row }">
|
||||
<QTd auto-width :class="getColAlign(col)">
|
||||
<VnTableChip
|
||||
:columns="splittedColumns.columnChips"
|
||||
:row="row"
|
||||
>
|
||||
<VnTableChip :columns="splittedColumns.columnChips" :row="row">
|
||||
<template #afterChip>
|
||||
<slot name="afterChip" :row="row"></slot>
|
||||
</template>
|
||||
|
@ -452,8 +442,7 @@ defineExpose({
|
|||
v-if="col.visible ?? true"
|
||||
@click.ctrl="
|
||||
($event) =>
|
||||
rowCtrlClickFunction &&
|
||||
rowCtrlClickFunction($event, row)
|
||||
rowCtrlClickFunction && rowCtrlClickFunction($event, row)
|
||||
"
|
||||
>
|
||||
<slot
|
||||
|
@ -487,14 +476,10 @@ defineExpose({
|
|||
class="q-px-sm"
|
||||
flat
|
||||
:class="
|
||||
btn.isPrimary
|
||||
? 'text-primary-light'
|
||||
: 'color-vn-text '
|
||||
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
||||
"
|
||||
:style="`visibility: ${
|
||||
(btn.show && btn.show(row)) ?? true
|
||||
? 'visible'
|
||||
: 'hidden'
|
||||
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
|
||||
}`"
|
||||
@click="btn.action(row)"
|
||||
/>
|
||||
|
@ -568,9 +553,7 @@ defineExpose({
|
|||
>
|
||||
<template #value>
|
||||
<span
|
||||
@click="
|
||||
stopEventPropagation($event)
|
||||
"
|
||||
@click="stopEventPropagation($event)"
|
||||
>
|
||||
<slot
|
||||
:name="`column-${col.name}`"
|
||||
|
@ -621,7 +604,6 @@ defineExpose({
|
|||
</QTable>
|
||||
</template>
|
||||
</CrudModel>
|
||||
</div>
|
||||
<QPageSticky v-if="create" :offset="[20, 20]" style="z-index: 2">
|
||||
<QBtn @click="showForm = !showForm" color="primary" fab icon="add" />
|
||||
<QTooltip>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { onMounted, watch, computed, ref } from 'vue';
|
|||
import { date } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const model = defineModel({ type: String });
|
||||
const model = defineModel({ type: [String, Date] });
|
||||
const $props = defineProps({
|
||||
isOutlined: {
|
||||
type: Boolean,
|
||||
|
|
|
@ -10,6 +10,10 @@ const props = defineProps({
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
class: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
autoLoad: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
@ -215,7 +219,7 @@ defineExpose({ fetch, addFilter, paginate });
|
|||
v-if="store.data"
|
||||
@load="onLoad"
|
||||
:offset="offset"
|
||||
class="full-width"
|
||||
:class="['full-width', props.class]"
|
||||
:disable="disableInfiniteScroll || !store.hasMoreData"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
|
|
|
@ -121,30 +121,25 @@ const columns = computed(() => [
|
|||
default-mode="table"
|
||||
:disable-option="{ card: true }"
|
||||
dense
|
||||
class="q-px-none"
|
||||
>
|
||||
<template #top-left>
|
||||
<VnRow>
|
||||
<VnInputDate v-model="from" label="From" dense style="flex: 0.3" />
|
||||
<VnInputDate v-model="to" label="To" 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.4" />
|
||||
</VnRow>
|
||||
</template>
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<QTd>
|
||||
<span class="link">{{ row.salesPerson }}</span>
|
||||
<span class="link" :title="row.salesPerson" v-text="row.salesPerson" />
|
||||
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
|
||||
</QTd>
|
||||
</template>
|
||||
<template #column-clientFk="{ row }">
|
||||
<QTd>
|
||||
<span class="link">{{ row.clientName }}</span>
|
||||
<span class="link" :title="row.clientName" v-text="row.clientName" />
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</QTd>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
td {
|
||||
max-width: 120px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -8,14 +8,14 @@ import VnRow from 'src/components/ui/VnRow.vue';
|
|||
class="q-pa-md"
|
||||
:style="{ 'flex-direction': $q.screen.lt.lg ? 'column' : 'row', gap: '0px' }"
|
||||
>
|
||||
<div style="flex: 0.25">
|
||||
<div style="flex: 0.3">
|
||||
<span
|
||||
class="q-ml-md text-body1"
|
||||
v-text="$t('salesMonitor.clientsOnWebsite')"
|
||||
/>
|
||||
<SalesClientTable />
|
||||
</div>
|
||||
<div style="flex: 0.75">
|
||||
<div style="flex: 0.7">
|
||||
<span
|
||||
class="q-ml-md text-body1"
|
||||
v-text="$t('salesMonitor.recentOrderActions')"
|
||||
|
|
|
@ -56,6 +56,12 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('salesOrdersTable.agency'),
|
||||
name: 'agencyName',
|
||||
align: 'left',
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
label: t('salesOrdersTable.salesPerson'),
|
||||
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) => {
|
||||
|
@ -167,25 +181,14 @@ const openTab = (id) =>
|
|||
|
||||
<template #column-clientFk="{ row }">
|
||||
<QTd>
|
||||
<div class="q-mb-sm">
|
||||
<span class="link" v-text="row.clientName" />
|
||||
<span class="link" v-text="row.clientName" :title="row.clientName" />
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</div>
|
||||
<span
|
||||
:title="$q.screen.lt.xl ? row.agencyName : ''"
|
||||
v-text="row.agencyName"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<QTd>
|
||||
<div class="q-mb-md">
|
||||
<span class="link" v-text="row.salesPerson" />
|
||||
<WorkerDescriptorProxy :id="row.salesPersonFk" dense />
|
||||
</div>
|
||||
<span v-text="toCurrency(row.import)" />
|
||||
</QTd>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
|
|
@ -17,6 +17,7 @@ salesOrdersTable:
|
|||
salesPerson: Salesperson
|
||||
deleteConfirmTitle: Delete selected elements
|
||||
deleteConfirmMessage: All the selected elements will be deleted. Are you sure you want to continue?
|
||||
agency: Agency
|
||||
salesTicketsTable:
|
||||
autoRefresh: Auto-refresh
|
||||
problems: Problems
|
||||
|
|
|
@ -17,6 +17,7 @@ salesOrdersTable:
|
|||
salesPerson: Comercial
|
||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||
deleteConfirmMessage: Todos los elementos seleccionados serán eliminados. ¿Seguro que quieres continuar?
|
||||
agency: Agencia
|
||||
salesTicketsTable:
|
||||
autoRefresh: Auto-refresco
|
||||
problems: Problemas
|
||||
|
|
Loading…
Reference in New Issue