7336_devToTest #354

Merged
alexm merged 359 commits from 7336_devToTest into test 2024-05-07 06:34:00 +00:00
10 changed files with 196 additions and 20 deletions
Showing only changes of commit c65c09c39c - Show all commits

View File

@ -30,6 +30,7 @@ watchEffect(() => {
}); });
function getBreadcrumb(param) { function getBreadcrumb(param) {
console.log('param.meta.title: ', param.meta.title);
const breadcrumb = { const breadcrumb = {
icon: param.meta.icon, icon: param.meta.icon,
path: param.path, path: param.path,

View File

@ -1003,9 +1003,10 @@ export default {
}, },
route: { route: {
pageTitles: { pageTitles: {
agency: 'Agency',
routes: 'Routes', routes: 'Routes',
cmrsList: 'External CMRs list', cmrsList: 'External CMRs list',
agencyList: 'Agency', agencyList: 'Agency list',
RouteList: 'List', RouteList: 'List',
create: 'Create', create: 'Create',
basicData: 'Basic Data', basicData: 'Basic Data',
@ -1033,6 +1034,11 @@ export default {
}, },
}, },
}, },
agency: {
pageTitles: {
agency: 'Agency',
},
},
supplier: { supplier: {
pageTitles: { pageTitles: {
suppliers: 'Suppliers', suppliers: 'Suppliers',

View File

@ -15,10 +15,11 @@ function navigate(id) {
router.push({ path: `/agency/${id}` }); router.push({ path: `/agency/${id}` });
} }
function exprBuilder(param, value) { function exprBuilder(param, value) {
switch (param) { if (param !== 'search') return;
case 'search':
return { name: { like: `%${value}%` } }; if (!isNaN(value)) return { id: value };
}
return { name: { like: `%${value}%` } };
} }
</script> </script>
<template> <template>

View File

@ -0,0 +1,59 @@
<script setup>
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'src/components/FetchData.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FormModel from 'components/FormModel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
const { t } = useI18n();
const route = useRoute();
const id = route.params?.id || null;
const warehouses = ref([]);
const sectorFilter = { fields: ['id', 'description'] };
const filter = {
fields: ['sectorFk', 'code', 'pickingOrder', 'row', 'column'],
include: [{ relation: 'sector', scope: sectorFilter }],
};
</script>
<template>
<FetchData
url="warehouses"
sort-by="name"
@on-fetch="(data) => (warehouses = data)"
auto-load
/>
<VnSubToolbar />
<FormModel :url="`Agencies/${id}`" model="agency" auto-load>
<template #form="{ data }">
<VnRow>
<VnInput v-model="data.name" :label="t('globals.name')" />
</VnRow>
<VnRow>
<VnSelectFilter
v-model="data.sectorFk"
option-value="id"
option-label="name"
:label="t('parking.sector')"
:options="warehouses"
use-input
input-debounce="0"
:is-clearable="false"
/>
</VnRow>
<VnRow>
<QCheckbox :label="t('isOwn')" v-model="data.isOwn" />
</VnRow>
<VnRow>
<QCheckbox
:label="t('isAnyVolumeAllowed')"
v-model="data.isAnyVolumeAllowed"
/>
</VnRow>
</template>
</FormModel>
</template>

View File

@ -1,39 +1,55 @@
<script setup> <script setup>
import { onMounted, watch } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useRoute } from 'vue-router'; import { useArrayData } from 'src/composables/useArrayData';
import CustomerDescriptor from './CustomerDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue'; import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import AgencyDescriptor from 'pages/Agency/Card/AgencyDescriptor.vue';
import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute();
const stateStore = useStateStore();
const filter = {
fields: ['id', 'sectorFk', 'code', 'pickingOrder', 'row', 'column'],
include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
};
const arrayData = useArrayData('Agency', {
url: `Agencies/${route.params.id}`,
});
const { store } = arrayData;
onMounted(async () => await arrayData.fetch({ append: false }));
watch(
() => route.params.id,
async (newId) => {
if (newId) {
store.url = `Agencies/${newId}`;
await arrayData.fetch({ append: false });
}
}
);
</script> </script>
<template> <template>
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
<VnSearchbar <VnSearchbar
data-key="CustomerList" :info="t('Agency.searchBar.info')"
url="Clients/filter" :label="t('Agency.searchBar.label')"
:label="t('Search customer')" data-key="Agency"
:info="t('You can search by customer id or name')"
/> />
</Teleport> </Teleport>
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256"> <QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
<QScrollArea class="fit"> <QScrollArea class="fit">
<CustomerDescriptor /> <AgencyDescriptor />
<QSeparator /> <QSeparator />
<LeftMenu source="card" /> <LeftMenu source="card" />
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPageContainer> <QPageContainer>
<QPage> <QPage>
<VnSubToolbar /> <RouterView></RouterView>
<div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage> </QPage>
</QPageContainer> </QPageContainer>
</template> </template>

View File

@ -0,0 +1,39 @@
<script setup>
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useArrayData } from 'src/composables/useArrayData';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'components/ui/VnLv.vue';
const props = defineProps({
id: {
type: Number,
required: false,
default: null,
},
});
const { t } = useI18n();
const { params } = useRoute();
const entityId = computed(() => props.id || params.id);
const { store } = useArrayData('Parking');
const card = computed(() => store.data);
const filter = {
fields: ['id', 'sectorFk', 'code', 'pickingOrder', 'row', 'column'],
include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
};
</script>
<template>
<CardDescriptor
module="Agency"
data-key="Agency"
:url="`Agencies/${entityId}`"
:title="card?.name"
:subtitle="card?.id"
>
<template #body="{ entity: agency }">
<VnLv :label="t('globals.name')" :value="agency.name" />
</template>
</CardDescriptor>
</template>

View File

@ -0,0 +1,6 @@
<script setup>
import VnLog from 'src/components/common/VnLog.vue';
</script>
<template>
<VnLog model="Agency" url="/AgencyLogs" />
</template>

View File

@ -0,0 +1,44 @@
<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'components/ui/VnLv.vue';
const $props = defineProps({
id: {
type: Number,
default: 0,
},
});
const { params } = useRoute();
const { t } = useI18n();
const entityId = computed(() => $props.id || params.id);
const filter = {
fields: ['id', 'sectorFk', 'code', 'pickingOrder', 'row', 'column'],
include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
};
</script>
<template>
<div class="q-pa-md">
<CardSummary :url="`Agencies/${entityId}`">
<template #header="{ entity: agency }">{{ agency.name }}</template>
<template #body="{ entity: agency }">
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<a
class="header header-link"
:href="`#/agency/${entityId}/basic-data`"
>
{{ t('globals.pageTitles.basicData') }}
<QIcon name="open_in_new" />
</a>
</QCardSection>
<VnLv :label="t('globals.name')" :value="agency.name" />
</QCard>
</template>
</CardSummary>
</div>
</template>

View File

@ -15,6 +15,7 @@ import Department from './department';
import Entry from './entry'; import Entry from './entry';
import roadmap from './roadmap'; import roadmap from './roadmap';
import Parking from './parking'; import Parking from './parking';
import Agency from './agency';
export default [ export default [
Item, Item,
@ -34,4 +35,5 @@ export default [
Entry, Entry,
roadmap, roadmap,
Parking, Parking,
Agency,
]; ];

View File

@ -15,6 +15,7 @@ import order from 'src/router/modules/order';
import entry from 'src/router/modules/entry'; import entry from 'src/router/modules/entry';
import roadmap from 'src/router/modules/roadmap'; import roadmap from 'src/router/modules/roadmap';
import parking from 'src/router/modules/parking'; import parking from 'src/router/modules/parking';
import agency from 'src/router/modules/agency';
const routes = [ const routes = [
{ {
@ -71,6 +72,7 @@ const routes = [
roadmap, roadmap,
entry, entry,
parking, parking,
agency,
{ {
path: '/:catchAll(.*)*', path: '/:catchAll(.*)*',
name: 'NotFound', name: 'NotFound',