0
0
Fork 0

feat: refs #7271 basicData and Log

This commit is contained in:
Jon Elias 2024-05-13 12:46:25 +02:00
parent 0ed3cafcab
commit 14910c5899
3 changed files with 29 additions and 46 deletions

View File

@ -1,34 +1,23 @@
<script setup>
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import FetchData from 'components/FetchData.vue';
import FormModel from 'src/components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import { QCheckbox } from 'quasar';
import VnInputTime from 'src/components/common/VnInputTime.vue';
const route = useRoute();
const { t } = useI18n();
const zoneFilter = {
include: [
{
relation: 'agency',
scope: {
fields: ['name'],
include: { relation: 'agencyModeFk', scope: { fields: ['id'] } },
},
},
{ relation: 'sip', scope: { fields: ['extension', 'secret'] } },
{ relation: 'department', scope: { include: { relation: 'department' } } },
{ relation: 'client', scope: { fields: ['phone'] } },
],
};
const agencyFilter = {
fields: ['id', 'name'],
order: 'name ASC',
limit: 30,
};
const agencyOptions = ref([]);
</script>
<template>
@ -36,53 +25,38 @@ const agencyFilter = {
:filter="agencyFilter"
@on-fetch="(data) => (agencyOptions = data)"
auto-load
url="agencies"
/>
<FetchData
:filter="zoneFilter"
@on-fetch="(data) => (zoneOptions = data)"
auto-load
url="zones"
url="AgencyModes"
/>
<FormModel
:filter="zoneFilter"
:url="`zone/${route.params.id}/basic-data`"
auto-load
model="Zone"
>
<FormModel :url="`Zones/${route.params.id}`" auto-load model="zone">
<template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<VnInput :label="t('Name')" clearable v-model="data.zone.name" />
<VnInput :label="t('Name')" clearable v-model="data.name" />
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<VnInput v-model="data.agency.name" :label="t('Agency')" clearable />
<VnInput v-model="data.zone.itemMaxSize" :label="t('Max m³')" clearable />
<VnInput v-model="data.zone.m3Max" :label="t('Maximum m³')" clearable />
<VnInput v-model="data.agencyModeFk" :label="t('Agency')" clearable />
<VnInput v-model="data.itemMaxSize" :label="t('Max m³')" clearable />
<VnInput v-model="data.m3Max" :label="t('Maximum m³')" clearable />
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<VnInput
v-model="data.zone.travelingDays"
v-model="data.travelingDays"
:label="t('Traveling days')"
clearable
/>
<VnInput v-model="data.zone.hour" :label="t('Closing')" clearable />
<VnInputTime v-model="data.hour" :label="t('Closing')" clearable />
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<VnInput v-model="data.zone.price" :label="t('Price')" clearable />
<VnInput v-model="data.zone.bonus" :label="t('Bonus')" clearable />
<VnInput v-model="data.price" :label="t('Price')" clearable />
<VnInput v-model="data.bonus" :label="t('Bonus')" clearable />
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<VnInput
v-model="data.zone.inflation"
:label="t('Inflation')"
clearable
/>
<QCheckbox v-model="data.zone.isVolumetric" :label="t('Volumetric')" />
<VnInput v-model="data.inflation" :label="t('Inflation')" clearable />
<QCheckbox v-model="data.isVolumetric" :label="t('Volumetric')" />
</VnRow>
</template>
</FormModel>

View File

@ -9,6 +9,7 @@ import { toTimeFormat } from 'src/filters/date';
import { toCurrency } from 'filters/index';
import useCardDescription from 'src/composables/useCardDescription';
import ZoneDescriptorMenuItems from './ZoneDescriptorMenuItems.vue';
const $props = defineProps({
id: {
@ -69,11 +70,10 @@ const setData = (entity) => {
</QTooltip>
</QBtn>
</template>
<!-- <template #menu="{ entity }">
<template #menu="{ entity }">
<ZoneDescriptorMenuItems :zone="entity" />
</template> -->
</template>
<template #body="{ entity }">
{{ console.log('entity', entity) }}
<VnLv :label="t('summary.agency')" :value="entity.agencyMode.name" />
<VnLv :label="t('summary.closeHour')" :value="toTimeFormat(entity.hour)" />
<VnLv :label="t('summary.travelingDays')" :value="entity.travelingDays" />

View File

@ -12,7 +12,7 @@ export default {
redirect: { name: 'ZoneMain' },
menus: {
main: ['ZoneList', 'ZoneDeliveryList', 'ZoneUpcomingList'],
card: ['ZoneBasicData'],
card: ['ZoneBasicData', 'ZoneHistory'],
},
children: [
{
@ -83,6 +83,15 @@ export default {
},
component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'),
},
{
name: 'ZoneHistory',
path: 'history',
meta: {
title: 'log',
icon: 'history',
},
component: () => import('src/pages/Zone/Card/ZoneLog.vue'),
},
// {
// path: '/zone/delivery',
// name: 'ZoneDeliveryMain',