forked from verdnatura/salix-front
feat: refs #7271 basicData and Log
This commit is contained in:
parent
0ed3cafcab
commit
14910c5899
|
@ -1,34 +1,23 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { ref } from 'vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'src/components/FormModel.vue';
|
import FormModel from 'src/components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import { QCheckbox } from 'quasar';
|
import { QCheckbox } from 'quasar';
|
||||||
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
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 = {
|
const agencyFilter = {
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
order: 'name ASC',
|
order: 'name ASC',
|
||||||
limit: 30,
|
limit: 30,
|
||||||
};
|
};
|
||||||
|
const agencyOptions = ref([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -36,53 +25,38 @@ const agencyFilter = {
|
||||||
:filter="agencyFilter"
|
:filter="agencyFilter"
|
||||||
@on-fetch="(data) => (agencyOptions = data)"
|
@on-fetch="(data) => (agencyOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
url="agencies"
|
url="AgencyModes"
|
||||||
/>
|
|
||||||
<FetchData
|
|
||||||
:filter="zoneFilter"
|
|
||||||
@on-fetch="(data) => (zoneOptions = data)"
|
|
||||||
auto-load
|
|
||||||
url="zones"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormModel
|
<FormModel :url="`Zones/${route.params.id}`" auto-load model="zone">
|
||||||
:filter="zoneFilter"
|
|
||||||
:url="`zone/${route.params.id}/basic-data`"
|
|
||||||
auto-load
|
|
||||||
model="Zone"
|
|
||||||
>
|
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<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>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<VnInput v-model="data.agency.name" :label="t('Agency')" clearable />
|
<VnInput v-model="data.agencyModeFk" :label="t('Agency')" clearable />
|
||||||
<VnInput v-model="data.zone.itemMaxSize" :label="t('Max m³')" clearable />
|
<VnInput v-model="data.itemMaxSize" :label="t('Max m³')" clearable />
|
||||||
<VnInput v-model="data.zone.m3Max" :label="t('Maximum m³')" clearable />
|
<VnInput v-model="data.m3Max" :label="t('Maximum m³')" clearable />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.zone.travelingDays"
|
v-model="data.travelingDays"
|
||||||
:label="t('Traveling days')"
|
:label="t('Traveling days')"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
<VnInput v-model="data.zone.hour" :label="t('Closing')" clearable />
|
<VnInputTime v-model="data.hour" :label="t('Closing')" clearable />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<VnInput v-model="data.zone.price" :label="t('Price')" clearable />
|
<VnInput v-model="data.price" :label="t('Price')" clearable />
|
||||||
<VnInput v-model="data.zone.bonus" :label="t('Bonus')" clearable />
|
<VnInput v-model="data.bonus" :label="t('Bonus')" clearable />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow class="row q-gutter-md q-mb-md">
|
||||||
<VnInput
|
<VnInput v-model="data.inflation" :label="t('Inflation')" clearable />
|
||||||
v-model="data.zone.inflation"
|
<QCheckbox v-model="data.isVolumetric" :label="t('Volumetric')" />
|
||||||
:label="t('Inflation')"
|
|
||||||
clearable
|
|
||||||
/>
|
|
||||||
<QCheckbox v-model="data.zone.isVolumetric" :label="t('Volumetric')" />
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
|
|
@ -9,6 +9,7 @@ import { toTimeFormat } from 'src/filters/date';
|
||||||
import { toCurrency } from 'filters/index';
|
import { toCurrency } from 'filters/index';
|
||||||
|
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
|
import ZoneDescriptorMenuItems from './ZoneDescriptorMenuItems.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -69,11 +70,10 @@ const setData = (entity) => {
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
<!-- <template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<ZoneDescriptorMenuItems :zone="entity" />
|
<ZoneDescriptorMenuItems :zone="entity" />
|
||||||
</template> -->
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
{{ console.log('entity', entity) }}
|
|
||||||
<VnLv :label="t('summary.agency')" :value="entity.agencyMode.name" />
|
<VnLv :label="t('summary.agency')" :value="entity.agencyMode.name" />
|
||||||
<VnLv :label="t('summary.closeHour')" :value="toTimeFormat(entity.hour)" />
|
<VnLv :label="t('summary.closeHour')" :value="toTimeFormat(entity.hour)" />
|
||||||
<VnLv :label="t('summary.travelingDays')" :value="entity.travelingDays" />
|
<VnLv :label="t('summary.travelingDays')" :value="entity.travelingDays" />
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
redirect: { name: 'ZoneMain' },
|
redirect: { name: 'ZoneMain' },
|
||||||
menus: {
|
menus: {
|
||||||
main: ['ZoneList', 'ZoneDeliveryList', 'ZoneUpcomingList'],
|
main: ['ZoneList', 'ZoneDeliveryList', 'ZoneUpcomingList'],
|
||||||
card: ['ZoneBasicData'],
|
card: ['ZoneBasicData', 'ZoneHistory'],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -83,6 +83,15 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'),
|
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',
|
// path: '/zone/delivery',
|
||||||
// name: 'ZoneDeliveryMain',
|
// name: 'ZoneDeliveryMain',
|
||||||
|
|
Loading…
Reference in New Issue