#4988 - agencySection #293

Merged
pablone merged 22 commits from 4988-agencySection into dev 2024-04-26 07:19:08 +00:00
11 changed files with 274 additions and 45 deletions
Showing only changes of commit 6b4cb4ed12 - Show all commits

View File

@ -94,6 +94,7 @@ export default {
},
created: 'Created',
worker: 'Worker',
name: 'Name',
},
errors: {
statusUnauthorized: 'Access denied',
@ -1034,11 +1035,6 @@ export default {
},
},
},
agency: {
pageTitles: {
agency: 'Agency',
},
},
supplier: {
pageTitles: {
suppliers: 'Suppliers',
@ -1291,4 +1287,12 @@ export default {
},
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789',
},
agency: {
pageTitles: {
agency: 'Agency',
modes: 'Modes',
},
isOwn: 'Is own',
isAnyVolumeAllowed: 'Any volume allowed',
},
};

View File

@ -94,6 +94,7 @@ export default {
},
created: 'Fecha creación',
worker: 'Trabajador',
name: 'Nombre',
},
errors: {
statusUnauthorized: 'Acceso denegado',
@ -1284,4 +1285,12 @@ export default {
},
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789',
},
agency: {
pageTitles: {
agency: 'Agencia',
modes: 'Modos',
},
isOwn: 'Propia',
isAnyVolumeAllowed: 'Volumen libre',
},
};

View File

@ -5,10 +5,8 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const router = useRouter();
const stateStore = useStateStore();
function navigate(id) {
@ -68,12 +66,6 @@ function exprBuilder(param, value) {
@click.stop="navigate(row.id)"
outline
/>
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, CustomerSummary)"
color="primary"
style="margin-top: 15px"
/>
</template>
</CardList>
</template>

View File

@ -2,23 +2,18 @@
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnRow from 'components/ui/VnRow.vue';
import FormModel from 'components/FormModel.vue';
import FetchData from 'src/components/FetchData.vue';
import VnRow from 'components/ui/VnRow.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 routeId = 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
@ -28,7 +23,7 @@ const filter = {
auto-load
/>
<VnSubToolbar />
<FormModel :url="`Agencies/${id}`" model="agency" auto-load>
<FormModel :url="`Agencies/${routeId}`" model="agency" auto-load>
<template #form="{ data }">
<VnRow>
<VnInput v-model="data.name" :label="t('globals.name')" />
@ -38,7 +33,7 @@ const filter = {
v-model="data.sectorFk"
option-value="id"
option-label="name"
:label="t('parking.sector')"
:label="t('globals.warehouse')"
:options="warehouses"
use-input
input-debounce="0"
@ -46,11 +41,11 @@ const filter = {
/>
</VnRow>
pablone marked this conversation as resolved
Review

Me ixen en gris pero no deurien no???

Me ixen en gris pero no deurien no???
Review

Esa así en el resto de basic data

Esa así en el resto de basic data
<VnRow>
<QCheckbox :label="t('isOwn')" v-model="data.isOwn" />
<QCheckbox :label="t('agency.isOwn')" v-model="data.isOwn" />
</VnRow>
<VnRow>
<QCheckbox
:label="t('isAnyVolumeAllowed')"
:label="t('agency.isAnyVolumeAllowed')"
v-model="data.isAnyVolumeAllowed"
/>
</VnRow>

View File

@ -12,11 +12,6 @@ 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}`,
});

View File

@ -19,10 +19,7 @@ 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'] } }],
};
console.log('card: ', card);
pablone marked this conversation as resolved Outdated
Outdated
Review

mmm 2

mmm 2
</script>
<template>
<CardDescriptor
@ -30,7 +27,7 @@ const filter = {
data-key="Agency"
:url="`Agencies/${entityId}`"
:title="card?.name"
:subtitle="card?.id"
:subtitle="props.id"
>
<template #body="{ entity: agency }">
<VnLv :label="t('globals.name')" :value="agency.name" />

View File

@ -0,0 +1,84 @@
<script setup>
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardList from 'src/components/ui/CardList.vue';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import VnLv from 'src/components/ui/VnLv.vue';
const { t } = useI18n();
const router = useRouter();
const route = useRoute();
pablone marked this conversation as resolved
Review

mmm 3

mmm 3
console.log('route: ', route.path);
const routeId = route.params.id;
const toAgencyModeCreate = (consigneeId) => {
router.push({
name: 'AgencyMode',
params: {
id: route.params.id,
consigneeId,
},
});
};
</script>
<template>
<QPage class="column items-center q-pa-md">
<div class="vn-card-list">
<VnPaginate
data-key="AgencyModes"
:url="`AgencyModes`"
:filter="{ where: { agencyFk: routeId } }"
order="name"
auto-load
>
<template #body="{ rows }">
<CardList
:id="row.id"
:key="row.id"
:title="row.name"
v-for="row of rows"
>
<template #list-items>
<VnLv
:label="t('globals.description')"
:value="row?.description"
/>
<VnLv
:label="t('deliveryMethod')"
:value="row?.deliveryMethodFk"
/>
<VnLv label="m3" :value="row?.m3" />
<VnLv :label="t('inflation')" :value="row?.inflation" />
<VnLv :label="t('globals.code')" :value="row?.code" />
</template>
<template #actions>
<QBtn
:label="t('globals.edit')"
@click.stop="toAgencyModeCreate(row.id)"
color="primary"
icon="edit"
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
<QPageSticky :offset="[18, 18]">
<QBtn @click.stop="toAgencyModeCreate()" color="primary" fab icon="add" />
<QTooltip>
{{ t('New mode') }}
</QTooltip>
</QPageSticky>
</QPage>
</template>
<i18n>
es:
isOwn: Tiene propietario
isAnyVolumeAllowed: Permite cualquier volumen
Search agency: Buscar agencia
You can search by name: Puedes buscar por nombre
en:
isOwn: Has owner
isAnyVolumeAllowed: Allows any volume
</i18n>

View File

@ -2,8 +2,12 @@
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import FetchData from 'src/components/FetchData.vue';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
const $props = defineProps({
id: {
@ -28,15 +32,17 @@ const filter = {
<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>
<VnTitle
:url="`#/agency/${entityId}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.name')" :value="agency.name" />
<QCheckbox :label="t('agency.isOwn')" v-model="agency.isOwn" />
pablone marked this conversation as resolved Outdated
Outdated
Review

ficar el disable

ficar el disable
<QCheckbox
pablone marked this conversation as resolved Outdated
Outdated
Review

ficar el disable

ficar el disable
:label="t('agency.isAnyVolumeAllowed')"
v-model="agency.isAnyVolumeAllowed"
/>
</QCard>
</template>
</CardSummary>

View File

@ -0,0 +1,113 @@
<script setup>
import { ref, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import FetchData from 'src/components/FetchData.vue';
import FormModelPopup from 'src/components/FormModelPopup.vue';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
const { t } = useI18n();
const route = useRoute();
const paginate = ref();
const dialog = ref();
const routeId = computed(() => route.params.id);
const initialData = computed(() => {
return {
agencyFk: routeId.value,
workCenterFk: null,
};
});
</script>
<template>
<div class="centerCard">
<FetchData
url="workCenters"
sort-by="name"
@on-fetch="(data) => (warehouses = data)"
auto-load
/>
<VnPaginate
ref="paginate"
data-key="AgencyWorkCenters"
url="AgencyWorkCenters"
:filter="{ where: { agencyFk: routeId } }"
order="id"
auto-load
>
<template #body="{ rows }">
<QCard
flat
bordered
:key="row.id"
v-for="row of rows"
class="card q-pa-md q-mb-sm"
>
<QItem>
<QItemSection side-left>
<VnLv :value="row?.workCenter?.name" icon="delete" />
</QItemSection>
<QItemSection side>
<QBtn icon="delete" color="primary" round flat />
</QItemSection>
</QItem>
</QCard>
</template>
</VnPaginate>
</div>
<QPageSticky :offset="[18, 18]">
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add">
<QDialog ref="dialog">
<FormModelPopup
:title="t('Add work center')"
url-create="AgencyWorkCenters"
model="AgencyWorkCenter"
:form-initial-data="initialData"
@on-data-saved="paginate.fetch()"
>
<template #form-inputs="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<VnSelectFilter
v-model="data.workCenterFk"
option-value="id"
option-label="name"
:label="t('workCenter')"
:options="warehouses"
use-input
input-debounce="0"
:is-clearable="false"
/>
</VnRow>
</template>
</FormModelPopup>
</QDialog>
</QBtn>
<QTooltip>
{{ t('globals.new') }}
</QTooltip>
</QPageSticky>
</template>
<style lang="scss" scoped>
.centerCard {
padding: 5%;
width: 100%;
max-width: 50%;
margin: 0 auto;
}
</style>
<i18n>
es:
isOwn: Tiene propietario
isAnyVolumeAllowed: Permite cualquier volumen
Search agency: Buscar agencia
You can search by name: Puedes buscar por nombre
en:
isOwn: Has owner
isAnyVolumeAllowed: Allows any volume
</i18n>

View File

@ -12,7 +12,7 @@ export default {
redirect: { name: 'AgencyCard' },
menus: {
main: [],
card: ['AgencyBasicData', 'AgencyLog'],
card: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
},
children: [
{
@ -39,6 +39,40 @@ export default {
},
component: () => import('pages/Agency/Card/AgencyBasicData.vue'),
},
{
path: 'workCenter',
name: 'AgencyWorkCenterCard',
redirect: { name: 'AgencyWorkCenters' },
children: [
{
path: '',
name: 'AgencyWorkCenters',
meta: {
icon: 'apartment',
title: 'workCenters',
},
component: () =>
import('src/pages/Agency/Card/AgencyWorkcenter.vue'),
},
],
},
{
path: 'modes',
name: 'AgencyModesCard',
redirect: { name: 'AgencyModes' },
children: [
{
path: '',
name: 'AgencyModes',
meta: {
icon: 'format_list_bulleted',
title: 'modes',
},
component: () =>
import('src/pages/Agency/Card/AgencyModes.vue'),
},
],
},
{
name: 'AgencyLog',
path: 'log',

View File

@ -76,7 +76,7 @@ export default {
},
{
path: '/agency',
redirect: { name: 'agencyList' },
redirect: { name: 'AgencyList' },
children: [
{
path: 'list',