7336_devToTest #354
|
@ -30,6 +30,7 @@ watchEffect(() => {
|
|||
});
|
||||
|
||||
function getBreadcrumb(param) {
|
||||
console.log('param.meta.title: ', param.meta.title);
|
||||
const breadcrumb = {
|
||||
icon: param.meta.icon,
|
||||
path: param.path,
|
||||
|
|
|
@ -1003,9 +1003,10 @@ export default {
|
|||
},
|
||||
route: {
|
||||
pageTitles: {
|
||||
agency: 'Agency',
|
||||
routes: 'Routes',
|
||||
cmrsList: 'External CMRs list',
|
||||
agencyList: 'Agency',
|
||||
agencyList: 'Agency list',
|
||||
RouteList: 'List',
|
||||
create: 'Create',
|
||||
basicData: 'Basic Data',
|
||||
|
@ -1033,6 +1034,11 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
agency: {
|
||||
pageTitles: {
|
||||
agency: 'Agency',
|
||||
},
|
||||
},
|
||||
supplier: {
|
||||
pageTitles: {
|
||||
suppliers: 'Suppliers',
|
||||
|
|
|
@ -15,10 +15,11 @@ function navigate(id) {
|
|||
router.push({ path: `/agency/${id}` });
|
||||
}
|
||||
function exprBuilder(param, value) {
|
||||
switch (param) {
|
||||
case 'search':
|
||||
return { name: { like: `%${value}%` } };
|
||||
}
|
||||
if (param !== 'search') return;
|
||||
|
||||
if (!isNaN(value)) return { id: value };
|
||||
|
||||
return { name: { like: `%${value}%` } };
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
@ -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>
|
|
@ -1,39 +1,55 @@
|
|||
<script setup>
|
||||
import { onMounted, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useRoute } from 'vue-router';
|
||||
import CustomerDescriptor from './CustomerDescriptor.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import LeftMenu from 'components/LeftMenu.vue';
|
||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import useCardSize from 'src/composables/useCardSize';
|
||||
import AgencyDescriptor from 'pages/Agency/Card/AgencyDescriptor.vue';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const route = useRoute();
|
||||
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>
|
||||
<template>
|
||||
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
|
||||
<VnSearchbar
|
||||
data-key="CustomerList"
|
||||
url="Clients/filter"
|
||||
:label="t('Search customer')"
|
||||
:info="t('You can search by customer id or name')"
|
||||
:info="t('Agency.searchBar.info')"
|
||||
:label="t('Agency.searchBar.label')"
|
||||
data-key="Agency"
|
||||
/>
|
||||
</Teleport>
|
||||
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
||||
<QScrollArea class="fit">
|
||||
<CustomerDescriptor />
|
||||
<AgencyDescriptor />
|
||||
<QSeparator />
|
||||
<LeftMenu source="card" />
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<QPageContainer>
|
||||
<QPage>
|
||||
<VnSubToolbar />
|
||||
<div :class="useCardSize()">
|
||||
<RouterView></RouterView>
|
||||
</div>
|
||||
<RouterView></RouterView>
|
||||
</QPage>
|
||||
</QPageContainer>
|
||||
</template>
|
||||
|
|
|
@ -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>
|
|
@ -0,0 +1,6 @@
|
|||
<script setup>
|
||||
import VnLog from 'src/components/common/VnLog.vue';
|
||||
</script>
|
||||
<template>
|
||||
<VnLog model="Agency" url="/AgencyLogs" />
|
||||
</template>
|
|
@ -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>
|
|
@ -15,6 +15,7 @@ import Department from './department';
|
|||
import Entry from './entry';
|
||||
import roadmap from './roadmap';
|
||||
import Parking from './parking';
|
||||
import Agency from './agency';
|
||||
|
||||
export default [
|
||||
Item,
|
||||
|
@ -34,4 +35,5 @@ export default [
|
|||
Entry,
|
||||
roadmap,
|
||||
Parking,
|
||||
Agency,
|
||||
];
|
||||
|
|
|
@ -15,6 +15,7 @@ import order from 'src/router/modules/order';
|
|||
import entry from 'src/router/modules/entry';
|
||||
import roadmap from 'src/router/modules/roadmap';
|
||||
import parking from 'src/router/modules/parking';
|
||||
import agency from 'src/router/modules/agency';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
|
@ -71,6 +72,7 @@ const routes = [
|
|||
roadmap,
|
||||
entry,
|
||||
parking,
|
||||
agency,
|
||||
{
|
||||
path: '/:catchAll(.*)*',
|
||||
name: 'NotFound',
|
||||
|
|
Loading…
Reference in New Issue