forked from verdnatura/salix-front
fix: refs #7354 fix VnTable filters and agency field
This commit is contained in:
parent
6a4161de66
commit
8913c6a31b
|
@ -11,6 +11,9 @@ import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import ZoneSummary from 'src/pages/Zone/Card/ZoneSummary.vue';
|
import ZoneSummary from 'src/pages/Zone/Card/ZoneSummary.vue';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -18,7 +21,9 @@ const { notify } = useNotify();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const tableFilter = ref({
|
const warehouseOptions = ref([]);
|
||||||
|
|
||||||
|
const tableFilter = {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'agencyMode',
|
relation: 'agencyMode',
|
||||||
|
@ -27,7 +32,7 @@ const tableFilter = ref({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
@ -44,21 +49,22 @@ const columns = computed(() => [
|
||||||
name: 'name',
|
name: 'name',
|
||||||
label: t('list.name'),
|
label: t('list.name'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
|
create: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'agencyModeFk',
|
name: 'agencyModeFk',
|
||||||
label: t('list.agency'),
|
label: t('list.agency'),
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
create: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'agencyModes',
|
url: 'AgencyModes',
|
||||||
fields: ['id', 'name'],
|
|
||||||
},
|
},
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
format: (row) => row?.agencyMode?.name,
|
format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -112,16 +118,42 @@ const handleClone = (id) => {
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="ZoneList"
|
data-key="ZoneList"
|
||||||
url="Zones"
|
url="Zones"
|
||||||
:filter="tableFilter"
|
:create="{
|
||||||
|
urlCreate: 'Zones',
|
||||||
|
title: t('list.createZone'),
|
||||||
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
|
formInitialData: {},
|
||||||
|
}"
|
||||||
|
:user-filter="tableFilter"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
redirect="zone"
|
redirect="zone"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
>
|
||||||
<QPageSticky position="bottom-right" :offset="[18, 18]" style="z-index: 2">
|
<template #more-create-dialog="{ data }">
|
||||||
<QBtn :to="{ path: `/zone/create` }" fab icon="add" color="primary">
|
<VnInput v-model="data.price" :label="t('list.price')" min="0" />
|
||||||
<QTooltip>{{ t('list.create') }}</QTooltip>
|
<VnInput v-model="data.bonus" :label="t('list.bonus')" min="0" />
|
||||||
</QBtn>
|
<VnInput
|
||||||
</QPageSticky>
|
v-model="data.travelingDays"
|
||||||
|
:label="t('list.travelingDays')"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
/>
|
||||||
|
<VnInputTime v-model="data.hour" :label="t('list.hour')" />
|
||||||
|
<VnSelect
|
||||||
|
url="Warehouses"
|
||||||
|
v-model="data.warehouseFK"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
:label="t('list.warehouse')"
|
||||||
|
:options="warehouseOptions"
|
||||||
|
/>
|
||||||
|
<QCheckbox
|
||||||
|
v-model="data.isVolumetric"
|
||||||
|
:label="t('list.isVolumetric')"
|
||||||
|
:toggle-indeterminate="false"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -63,13 +63,7 @@ onMounted(() => weekdayStore.initStore());
|
||||||
<span class="header">
|
<span class="header">
|
||||||
{{ getHeaderTitle(detail.shipped) }}
|
{{ getHeaderTitle(detail.shipped) }}
|
||||||
</span>
|
</span>
|
||||||
<QTable
|
<QTable flat :columns="columns" :rows="detail.lines" class="full-width" />
|
||||||
flat
|
|
||||||
:columns="columns"
|
|
||||||
:rows="detail.lines"
|
|
||||||
class="full-width"
|
|
||||||
style="text-align: center"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</QCard>
|
</QCard>
|
||||||
</QPage>
|
</QPage>
|
||||||
|
|
|
@ -21,6 +21,12 @@ list:
|
||||||
searchInfo: Search zone by id or name
|
searchInfo: Search zone by id or name
|
||||||
confirmCloneTitle: All it's properties will be copied
|
confirmCloneTitle: All it's properties will be copied
|
||||||
confirmCloneSubtitle: Do you want to clone this zone?
|
confirmCloneSubtitle: Do you want to clone this zone?
|
||||||
|
travelingDays: Traveling days
|
||||||
|
warehouse: Warehouse
|
||||||
|
bonus: Bonus
|
||||||
|
hour: Close
|
||||||
|
isVolumetric: Volumetric
|
||||||
|
createZone: Create zone
|
||||||
create:
|
create:
|
||||||
name: Name
|
name: Name
|
||||||
warehouse: Warehouse
|
warehouse: Warehouse
|
||||||
|
|
|
@ -21,6 +21,12 @@ list:
|
||||||
searchInfo: Buscar zonas por identificador o nombre
|
searchInfo: Buscar zonas por identificador o nombre
|
||||||
confirmCloneTitle: Todas sus propiedades serán copiadas
|
confirmCloneTitle: Todas sus propiedades serán copiadas
|
||||||
confirmCloneSubtitle: ¿Seguro que quieres clonar esta zona?
|
confirmCloneSubtitle: ¿Seguro que quieres clonar esta zona?
|
||||||
|
travelingDays: Días de viaje
|
||||||
|
warehouse: Almacén
|
||||||
|
bonus: Bonus
|
||||||
|
hour: Cierre
|
||||||
|
isVolumetric: Volumétrico
|
||||||
|
createZone: Crear zona
|
||||||
create:
|
create:
|
||||||
name: Nombre
|
name: Nombre
|
||||||
warehouse: Almacén
|
warehouse: Almacén
|
||||||
|
|
Loading…
Reference in New Issue