#7354 end Zone migration #539
|
@ -52,7 +52,6 @@ const setData = (entity) => {
|
|||
:filter="filter"
|
||||
@on-fetch="setData"
|
||||
data-key="zoneData"
|
||||
:summary="$attrs"
|
||||
>
|
||||
<template #menu="{ entity }">
|
||||
<ZoneDescriptorMenuItems :zone="entity" />
|
||||
|
|
|
@ -40,7 +40,7 @@ const actions = {
|
|||
},
|
||||
remove: async () => {
|
||||
try {
|
||||
await axios.post(`Zones/${zoneId}/setDeleted`);
|
||||
await axios.delete(`Zones/${zoneId}`);
|
||||
jgallego marked this conversation as resolved
Outdated
|
||||
|
||||
notify({ message: t('Zone deleted'), type: 'positive' });
|
||||
notify({
|
||||
|
|
|
@ -116,6 +116,7 @@ const closeForm = () => emit('closeForm');
|
|||
const refetchEvents = async () => {
|
||||
await arrayData.refresh({ append: false });
|
||||
closeForm();
|
||||
// window.location.reload();
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
? ?
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
@ -13,8 +13,8 @@ import { reactive } from 'vue';
|
|||
const { t } = useI18n();
|
||||
const stateStore = useStateStore();
|
||||
|
||||
const firstDay = ref(null);
|
||||
const lastDay = ref(null);
|
||||
const firstDay = ref();
|
||||
const lastDay = ref();
|
||||
|
||||
const events = ref([]);
|
||||
const formModeName = ref('include');
|
||||
|
|
|
@ -113,13 +113,7 @@ onMounted(async () => {
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
:label="
|
||||
t(
|
||||
deliveryMethodFk === 'delivery'
|
||||
? 'deliveryPanel.agency'
|
||||
: 'deliveryPanel.warehouse'
|
||||
)
|
||||
"
|
||||
:label="t('deliveryPanel.agency')"
|
||||
v-model="formData.agencyModeFk"
|
||||
url="AgencyModes/isActive"
|
||||
:fields="['id', 'name']"
|
||||
|
|
|
@ -1,73 +1,95 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { onMounted, computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import axios from 'axios';
|
||||
|
||||
import { toCurrency } from 'src/filters';
|
||||
|
||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||
import ZoneSummary from 'src/pages/Zone/Card/ZoneSummary.vue';
|
||||
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { toTimeFormat } from 'src/filters/date';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import axios from 'axios';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import ZoneFilterPanel from './ZoneFilterPanel.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import ZoneSummary from 'src/pages/Zone/Card/ZoneSummary.vue';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const { notify } = useNotify();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const redirectToZoneSummary = (event, { id }) => {
|
||||
router.push({ name: 'ZoneSummary', params: { id } });
|
||||
};
|
||||
const tableRef = ref();
|
||||
const tableFilter = ref({
|
||||
include: [
|
||||
{
|
||||
relation: 'agencyMode',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
name: 'ID',
|
||||
label: t('list.id'),
|
||||
field: (row) => row.id,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('list.id'),
|
||||
chip: {
|
||||
condition: () => true,
|
||||
},
|
||||
isId: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'name',
|
||||
label: t('list.name'),
|
||||
field: (row) => row.name,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
isTitle: true,
|
||||
},
|
||||
{
|
||||
name: 'agency',
|
||||
align: 'left',
|
||||
name: 'agencyModeFk',
|
||||
label: t('list.agency'),
|
||||
field: (row) => row?.agencyMode?.name,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
cardVisible: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'agencyModes',
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row) => row?.agencyMode?.name,
|
||||
},
|
||||
{
|
||||
name: 'close',
|
||||
align: 'left',
|
||||
name: 'hour',
|
||||
label: t('list.close'),
|
||||
field: (row) => (row?.hour ? toTimeFormat(row?.hour) : '-'),
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
cardVisible: true,
|
||||
format: (row) => toTimeFormat(row.hour),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'price',
|
||||
label: t('list.price'),
|
||||
field: (row) => (row?.price ? toCurrency(row.price) : '-'),
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
cardVisible: true,
|
||||
format: (row) => toCurrency(row.price),
|
||||
},
|
||||
{
|
||||
name: 'actions',
|
||||
label: '',
|
||||
sortable: false,
|
||||
align: 'right',
|
||||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('ZoneSummary'),
|
||||
icon: 'preview',
|
||||
action: (row) => viewSummary(row.id, ZoneSummary),
|
||||
},
|
||||
{
|
||||
title: t('globals.clone'),
|
||||
icon: 'vn:clone',
|
||||
action: (row) => handleClone(row.id),
|
||||
isPrimary: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
|
@ -83,88 +105,23 @@ const handleClone = (id) => {
|
|||
() => clone(id)
|
||||
);
|
||||
};
|
||||
onMounted(() => (stateStore.rightDrawer = true));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<ZoneFilterPanel data-key="ZoneList" :expr-builder="exprBuilder" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<div class="vn-card-list">
|
||||
<VnPaginate
|
||||
data-key="ZoneList"
|
||||
url="Zones"
|
||||
:filter="{
|
||||
include: { relation: 'agencyMode', scope: { fields: ['name'] } },
|
||||
}"
|
||||
:limit="20"
|
||||
auto-load
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<div class="q-pa-md">
|
||||
<QTable
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
row-key="clientId"
|
||||
class="full-width"
|
||||
@row-click="redirectToZoneSummary"
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props" class="bg">
|
||||
<QTh
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
{{ t(col.label) }}
|
||||
<QTooltip v-if="col.tooltip">{{
|
||||
col.tooltip
|
||||
}}</QTooltip>
|
||||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
|
||||
<template #body-cell="props">
|
||||
<QTd :props="props">
|
||||
<QTr :props="props" class="cursor-pointer">
|
||||
{{ props.value }}
|
||||
</QTr>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-actions="props">
|
||||
<QTd :props="props" class="q-gutter-x-sm">
|
||||
<QIcon
|
||||
name="vn:clone"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click.stop="handleClone(props.row.id)"
|
||||
>
|
||||
<QTooltip>{{ t('globals.clone') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
name="preview"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click.stop="
|
||||
viewSummary(props.row.id, ZoneSummary)
|
||||
"
|
||||
>
|
||||
<QTooltip>{{ t('Preview') }}</QTooltip>
|
||||
</QIcon>
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
</div>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
</div>
|
||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||
<QBtn :to="{ path: `/zone/create` }" fab icon="add" color="primary">
|
||||
<QTooltip>{{ t('list.create') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QPageSticky>
|
||||
</QPage>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="ZoneList"
|
||||
url="Zones"
|
||||
:filter="tableFilter"
|
||||
:columns="columns"
|
||||
default-mode="table"
|
||||
redirect="zone"
|
||||
:use-model="true"
|
||||
auto-load
|
||||
/>
|
||||
<QPageSticky position="bottom-right" :offset="[18, 18]" style="z-index: 2">
|
||||
<QBtn :to="{ path: `/zone/create` }" fab icon="add" color="primary">
|
||||
<QTooltip>{{ t('list.create') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QPageSticky>
|
||||
</template>
|
||||
|
|
|
@ -39,7 +39,7 @@ const exprBuilder = (param, value) => {
|
|||
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="ZoneList"
|
||||
data-key="Zones"
|
||||
url="Zones"
|
||||
:filter="{
|
||||
include: { relation: 'agencyMode', scope: { fields: ['name'] } },
|
||||
|
|
|
@ -63,7 +63,13 @@ onMounted(() => weekdayStore.initStore());
|
|||
<span class="header">
|
||||
{{ getHeaderTitle(detail.shipped) }}
|
||||
</span>
|
||||
<QTable flat :columns="columns" :rows="detail.lines" class="full-width" />
|
||||
<QTable
|
||||
flat
|
||||
:columns="columns"
|
||||
:rows="detail.lines"
|
||||
class="full-width"
|
||||
style="text-align: center"
|
||||
/>
|
||||
</div>
|
||||
</QCard>
|
||||
</QPage>
|
||||
|
|
|
@ -30,6 +30,8 @@ create:
|
|||
price: Price
|
||||
bonus: Bonus
|
||||
volumetric: Volumetric
|
||||
itemMaxSize: Max m³
|
||||
inflation: Inflation
|
||||
summary:
|
||||
agency: Agency
|
||||
price: Price
|
||||
|
|
|
@ -30,6 +30,8 @@ create:
|
|||
price: Precio
|
||||
bonus: Bonificación
|
||||
volumetric: Volumétrico
|
||||
itemMaxSize: Medida máxima
|
||||
inflation: Inflación
|
||||
summary:
|
||||
agency: Agencia
|
||||
price: Precio
|
||||
|
|
Loading…
Reference in New Issue
el antiguo zones setDeleted donde estaba?
lo que hay es tickets/{id}/setDeleted, pero para zones no existe como tal zones/id/setDeleted