forked from verdnatura/salix-front
Merge branch 'dev' into 6514-gestDocSupplier
This commit is contained in:
commit
181bff6c0c
|
@ -10,11 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- (Tickets) => Se añade la opción de clonar ticket. #6951
|
- (Tickets) => Se añade la opción de clonar ticket. #6951
|
||||||
|
- (Parking) => Se añade la sección Parking. #5186
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- (General) => Se corrige la redirección cuando hay 1 solo registro y cuando se aplica un filtro diferente al id al hacer una búsqueda general. #6893
|
||||||
|
|
||||||
## [2400.01] - 2024-01-04
|
## [2400.01] - 2024-01-04
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) {
|
||||||
// app boot file (/src/boot)
|
// app boot file (/src/boot)
|
||||||
// --> boot files are part of "main.js"
|
// --> boot files are part of "main.js"
|
||||||
// https://v2.quasar.dev/quasar-cli/boot-files
|
// https://v2.quasar.dev/quasar-cli/boot-files
|
||||||
boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar'],
|
boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar.defaults'],
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
||||||
css: ['app.scss'],
|
css: ['app.scss'],
|
||||||
|
@ -117,6 +117,7 @@ module.exports = configure(function (/* ctx */) {
|
||||||
secure: false,
|
secure: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
open: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { QTable } from 'quasar';
|
||||||
|
import setDefault from './setDefault';
|
||||||
|
|
||||||
|
setDefault(QTable, 'pagination', { rowsPerPage: 0 });
|
||||||
|
setDefault(QTable, 'hidePagination', true);
|
|
@ -0,0 +1,18 @@
|
||||||
|
export default function (component, key, value) {
|
||||||
|
const prop = component.props[key];
|
||||||
|
switch (typeof prop) {
|
||||||
|
case 'object':
|
||||||
|
prop.default = value;
|
||||||
|
break;
|
||||||
|
case 'function':
|
||||||
|
component.props[key] = {
|
||||||
|
type: prop,
|
||||||
|
default: value,
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case 'undefined':
|
||||||
|
throw new Error('unknown prop: ' + key);
|
||||||
|
default:
|
||||||
|
throw new Error('unhandled type: ' + typeof prop);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './defaults/qTable';
|
|
@ -202,7 +202,6 @@ const selectItem = ({ id }) => {
|
||||||
<QTable
|
<QTable
|
||||||
:columns="tableColumns"
|
:columns="tableColumns"
|
||||||
:rows="tableRows"
|
:rows="tableRows"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:hide-header="!tableRows || !tableRows.length > 0"
|
:hide-header="!tableRows || !tableRows.length > 0"
|
||||||
:no-data-label="t('Enter a new search')"
|
:no-data-label="t('Enter a new search')"
|
||||||
|
|
|
@ -200,7 +200,6 @@ const selectTravel = ({ id }) => {
|
||||||
<QTable
|
<QTable
|
||||||
:columns="tableColumns"
|
:columns="tableColumns"
|
||||||
:rows="tableRows"
|
:rows="tableRows"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:hide-header="!tableRows || !tableRows.length > 0"
|
:hide-header="!tableRows || !tableRows.length > 0"
|
||||||
:no-data-label="t('Enter a new search')"
|
:no-data-label="t('Enter a new search')"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t, te } = useI18n();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
|
@ -11,19 +11,30 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = computed(() => props.item); // eslint-disable-line vue/no-dupe-keys
|
const itemComputed = computed(() => {
|
||||||
|
const item = JSON.parse(JSON.stringify(props.item));
|
||||||
|
const [, , section] = item.title.split('.');
|
||||||
|
|
||||||
|
if (!te(item.title)) item.title = t(`globals.pageTitles.${section}`);
|
||||||
|
return item;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QItem active-class="text-primary" :to="{ name: item.name }" clickable v-ripple>
|
<QItem
|
||||||
<QItemSection avatar v-if="item.icon">
|
active-class="text-primary"
|
||||||
<QIcon :name="item.icon" />
|
:to="{ name: itemComputed.name }"
|
||||||
|
clickable
|
||||||
|
v-ripple
|
||||||
|
>
|
||||||
|
<QItemSection avatar v-if="itemComputed.icon">
|
||||||
|
<QIcon :name="itemComputed.icon" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection avatar v-if="!item.icon">
|
<QItemSection avatar v-if="!itemComputed.icon">
|
||||||
<QIcon name="disabled_by_default" />
|
<QIcon name="disabled_by_default" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>{{ t(item.title) }}</QItemSection>
|
<QItemSection>{{ t(itemComputed.title) }}</QItemSection>
|
||||||
<QItemSection side>
|
<QItemSection side>
|
||||||
<slot name="side" :item="item" />
|
<slot name="side" :item="itemComputed" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -5,16 +5,16 @@ import { useQuasar } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useCamelCase } from 'src/composables/useCamelCase';
|
import { useCamelCase } from 'src/composables/useCamelCase';
|
||||||
|
|
||||||
const router = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const quasar = useQuasar();
|
const { screen } = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t, te } = useI18n();
|
||||||
|
|
||||||
let matched = ref([]);
|
let matched = ref([]);
|
||||||
let breadcrumbs = ref([]);
|
let breadcrumbs = ref([]);
|
||||||
let root = ref(null);
|
let root = ref(null);
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
matched.value = router.currentRoute.value.matched.filter(
|
matched.value = currentRoute.value.matched.filter(
|
||||||
(matched) => Object.keys(matched.meta).length
|
(matched) => Object.keys(matched.meta).length
|
||||||
);
|
);
|
||||||
breadcrumbs.value.length = 0;
|
breadcrumbs.value.length = 0;
|
||||||
|
@ -34,13 +34,17 @@ function getBreadcrumb(param) {
|
||||||
icon: param.meta.icon,
|
icon: param.meta.icon,
|
||||||
path: param.path,
|
path: param.path,
|
||||||
root: root.value,
|
root: root.value,
|
||||||
|
locale: t(`globals.pageTitles.${param.meta.title}`),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (quasar.screen.gt.sm) {
|
if (screen.gt.sm) {
|
||||||
breadcrumb.name = param.name;
|
breadcrumb.name = param.name;
|
||||||
breadcrumb.title = useCamelCase(param.meta.title);
|
breadcrumb.title = useCamelCase(param.meta.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const moduleLocale = `${breadcrumb.root}.pageTitles.${breadcrumb.title}`;
|
||||||
|
if (te(moduleLocale)) breadcrumb.locale = t(moduleLocale);
|
||||||
|
|
||||||
return breadcrumb;
|
return breadcrumb;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -50,7 +54,7 @@ function getBreadcrumb(param) {
|
||||||
v-for="(breadcrumb, index) of breadcrumbs"
|
v-for="(breadcrumb, index) of breadcrumbs"
|
||||||
:key="index"
|
:key="index"
|
||||||
:icon="breadcrumb.icon"
|
:icon="breadcrumb.icon"
|
||||||
:label="t(`${breadcrumb.root}.pageTitles.${breadcrumb.title}`)"
|
:label="breadcrumb.locale"
|
||||||
:to="breadcrumb.path"
|
:to="breadcrumb.path"
|
||||||
/>
|
/>
|
||||||
</QBreadcrumbs>
|
</QBreadcrumbs>
|
||||||
|
|
|
@ -218,7 +218,6 @@ function parseDms(data) {
|
||||||
/>
|
/>
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
hide-bottom
|
hide-bottom
|
||||||
|
|
|
@ -403,7 +403,7 @@ setLogTree();
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="column items-center logs origin-log"
|
class="column items-center logs origin-log q-mt-md"
|
||||||
v-for="(originLog, originLogIndex) in logTree"
|
v-for="(originLog, originLogIndex) in logTree"
|
||||||
:key="originLogIndex"
|
:key="originLogIndex"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, useSlots, watch, computed, ref } from 'vue';
|
import { onBeforeMount, useSlots, watch, computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
@ -41,29 +41,28 @@ const state = useState();
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const entity = computed(() => useArrayData($props.dataKey).store.data);
|
const arrayData = useArrayData($props.dataKey || $props.module, {
|
||||||
|
url: $props.url,
|
||||||
|
filter: $props.filter,
|
||||||
|
skip: 0,
|
||||||
|
});
|
||||||
|
const { store } = arrayData;
|
||||||
|
const entity = computed(() => store.data);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
getData,
|
getData,
|
||||||
});
|
});
|
||||||
onMounted(async () => {
|
onBeforeMount(async () => {
|
||||||
await getData();
|
await getData();
|
||||||
watch(
|
watch(
|
||||||
() => $props.url,
|
() => $props.url,
|
||||||
async (newUrl, lastUrl) => {
|
async () => await getData()
|
||||||
if (newUrl == lastUrl) return;
|
|
||||||
await getData();
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
const arrayData = useArrayData($props.dataKey, {
|
store.url = $props.url;
|
||||||
url: $props.url,
|
|
||||||
filter: $props.filter,
|
|
||||||
skip: 0,
|
|
||||||
});
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { ref, computed, watch, onBeforeMount } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import axios from 'axios';
|
|
||||||
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
const entity = ref();
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -19,43 +18,48 @@ const props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const isSummary = ref();
|
const isSummary = ref();
|
||||||
|
const arrayData = useArrayData(props.dataKey || route.meta.moduleName, {
|
||||||
|
url: props.url,
|
||||||
|
filter: props.filter,
|
||||||
|
skip: 0,
|
||||||
|
});
|
||||||
|
const { store } = arrayData;
|
||||||
|
const entity = computed(() => store.data);
|
||||||
|
const isLoading = ref(false);
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
entity,
|
entity,
|
||||||
fetch,
|
fetch,
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onBeforeMount(async () => {
|
||||||
isSummary.value = String(route.path).endsWith('/summary');
|
isSummary.value = String(route.path).endsWith('/summary');
|
||||||
fetch();
|
await fetch();
|
||||||
|
watch(props, async () => await fetch());
|
||||||
});
|
});
|
||||||
|
|
||||||
async function fetch() {
|
async function fetch() {
|
||||||
const params = {};
|
store.url = props.url;
|
||||||
|
isLoading.value = true;
|
||||||
if (props.filter) params.filter = JSON.stringify(props.filter);
|
const { data } = await arrayData.fetch({ append: false, updateRouter: false });
|
||||||
|
|
||||||
const { data } = await axios.get(props.url, { params });
|
|
||||||
entity.value = data;
|
|
||||||
|
|
||||||
emit('onFetch', data);
|
emit('onFetch', data);
|
||||||
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(props, async () => {
|
|
||||||
entity.value = null;
|
|
||||||
fetch();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="summary container">
|
<div class="summary container">
|
||||||
<QCard class="cardSummary">
|
<QCard class="cardSummary">
|
||||||
<SkeletonSummary v-if="!entity" />
|
<SkeletonSummary v-if="!entity || isLoading" />
|
||||||
<template v-if="entity">
|
<template v-if="entity && !isLoading">
|
||||||
<div class="summaryHeader bg-primary q-pa-sm text-weight-bolder">
|
<div class="summaryHeader bg-primary q-pa-sm text-weight-bolder">
|
||||||
<slot name="header-left">
|
<slot name="header-left">
|
||||||
<router-link
|
<router-link
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useRouter, useRoute } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
|
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
|
||||||
|
@ -68,9 +66,8 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
|
||||||
const arrayData = useArrayData(props.dataKey, { ...props });
|
const arrayData = useArrayData(props.dataKey, { ...props });
|
||||||
const store = arrayData.store;
|
const { store } = arrayData;
|
||||||
const searchText = ref('');
|
const searchText = ref('');
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -92,18 +89,26 @@ async function search() {
|
||||||
});
|
});
|
||||||
if (!props.redirect) return;
|
if (!props.redirect) return;
|
||||||
|
|
||||||
if (props.customRouteRedirectName) {
|
if (props.customRouteRedirectName)
|
||||||
router.push({
|
return router.push({
|
||||||
name: props.customRouteRedirectName,
|
name: props.customRouteRedirectName,
|
||||||
params: { id: searchText.value },
|
params: { id: searchText.value },
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { matched: matches } = route;
|
const { matched: matches } = router.currentRoute.value;
|
||||||
const { path } = matches[matches.length - 1];
|
const { path } = matches.at(-1);
|
||||||
const newRoute = path.replace(':id', searchText.value);
|
const [, moduleName] = path.split('/');
|
||||||
await router.push(newRoute);
|
|
||||||
|
if (!store.data.length || store.data.length > 1)
|
||||||
|
return router.push({ path: `/${moduleName}/list` });
|
||||||
|
|
||||||
|
const targetId = store.data[0].id;
|
||||||
|
let targetUrl;
|
||||||
|
|
||||||
|
if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`);
|
||||||
|
else if (path.includes(':id')) targetUrl = path.replace(':id', targetId);
|
||||||
|
|
||||||
|
await router.push({ path: targetUrl });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
export function usePrintService() {
|
export function usePrintService() {
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const { getToken } = useSession();
|
const { getTokenMultimedia } = useSession();
|
||||||
|
|
||||||
function sendEmail(path, params) {
|
function sendEmail(path, params) {
|
||||||
return axios.post(path, params).then(() =>
|
return axios.post(path, params).then(() =>
|
||||||
|
@ -19,7 +19,7 @@ export function usePrintService() {
|
||||||
function openReport(path, params) {
|
function openReport(path, params) {
|
||||||
params = Object.assign(
|
params = Object.assign(
|
||||||
{
|
{
|
||||||
access_token: getToken(),
|
access_token: getTokenMultimedia(),
|
||||||
},
|
},
|
||||||
params
|
params
|
||||||
);
|
);
|
||||||
|
|
|
@ -130,4 +130,4 @@ input::-webkit-inner-spin-button {
|
||||||
appearance: none;
|
appearance: none;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
}
|
}
|
|
@ -85,6 +85,13 @@ export default {
|
||||||
selectFile: 'Select a file',
|
selectFile: 'Select a file',
|
||||||
copyClipboard: 'Copy on clipboard',
|
copyClipboard: 'Copy on clipboard',
|
||||||
salesPerson: 'SalesPerson',
|
salesPerson: 'SalesPerson',
|
||||||
|
code: 'Code',
|
||||||
|
pageTitles: {
|
||||||
|
summary: 'Summary',
|
||||||
|
basicData: 'Basic data',
|
||||||
|
log: 'Logs',
|
||||||
|
parkingList: 'Parkings list',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
statusUnauthorized: 'Access denied',
|
statusUnauthorized: 'Access denied',
|
||||||
|
@ -492,6 +499,7 @@ export default {
|
||||||
request: 'Request',
|
request: 'Request',
|
||||||
weight: 'Weight',
|
weight: 'Weight',
|
||||||
goTo: 'Go to',
|
goTo: 'Go to',
|
||||||
|
summaryAmount: 'Summary',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
|
@ -686,6 +694,19 @@ export default {
|
||||||
recyclable: 'Recyclable',
|
recyclable: 'Recyclable',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
parking: {
|
||||||
|
pickingOrder: 'Picking order',
|
||||||
|
sector: 'Sector',
|
||||||
|
row: 'Row',
|
||||||
|
column: 'Column',
|
||||||
|
pageTitles: {
|
||||||
|
parking: 'Parking',
|
||||||
|
},
|
||||||
|
searchBar: {
|
||||||
|
info: 'You can search by parking code',
|
||||||
|
label: 'Search parking...',
|
||||||
|
},
|
||||||
|
},
|
||||||
invoiceIn: {
|
invoiceIn: {
|
||||||
pageTitles: {
|
pageTitles: {
|
||||||
invoiceIns: 'Invoices In',
|
invoiceIns: 'Invoices In',
|
||||||
|
|
|
@ -85,6 +85,13 @@ export default {
|
||||||
selectFile: 'Seleccione un fichero',
|
selectFile: 'Seleccione un fichero',
|
||||||
copyClipboard: 'Copiar en portapapeles',
|
copyClipboard: 'Copiar en portapapeles',
|
||||||
salesPerson: 'Comercial',
|
salesPerson: 'Comercial',
|
||||||
|
code: 'Código',
|
||||||
|
pageTitles: {
|
||||||
|
summary: 'Resumen',
|
||||||
|
basicData: 'Datos básicos',
|
||||||
|
log: 'Historial',
|
||||||
|
parkingList: 'Listado de parkings',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
statusUnauthorized: 'Acceso denegado',
|
statusUnauthorized: 'Acceso denegado',
|
||||||
|
@ -491,6 +498,7 @@ export default {
|
||||||
request: 'Petición de compra',
|
request: 'Petición de compra',
|
||||||
weight: 'Peso',
|
weight: 'Peso',
|
||||||
goTo: 'Ir a',
|
goTo: 'Ir a',
|
||||||
|
summaryAmount: 'Resumen',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
|
@ -744,6 +752,18 @@ export default {
|
||||||
recyclable: 'Reciclable',
|
recyclable: 'Reciclable',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
parking: {
|
||||||
|
pickingOrder: 'Orden de recogida',
|
||||||
|
row: 'Fila',
|
||||||
|
column: 'Columna',
|
||||||
|
pageTitles: {
|
||||||
|
parking: 'Parking',
|
||||||
|
},
|
||||||
|
searchBar: {
|
||||||
|
info: 'Puedes buscar por código de parking',
|
||||||
|
label: 'Buscar parking...',
|
||||||
|
},
|
||||||
|
},
|
||||||
invoiceIn: {
|
invoiceIn: {
|
||||||
pageTitles: {
|
pageTitles: {
|
||||||
invoiceIns: 'Fact. recibidas',
|
invoiceIns: 'Fact. recibidas',
|
||||||
|
|
|
@ -291,8 +291,6 @@ async function importToNewRefundTicket() {
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
:grid="$q.screen.lt.md"
|
:grid="$q.screen.lt.md"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:hide-bottom="true"
|
|
||||||
>
|
>
|
||||||
<template #body-cell-ticket="{ value }">
|
<template #body-cell-ticket="{ value }">
|
||||||
<QTd align="center">
|
<QTd align="center">
|
||||||
|
|
|
@ -150,10 +150,8 @@ const columns = computed(() => [
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
row-key="$index"
|
row-key="$index"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
hide-pagination
|
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
:grid="$q.screen.lt.md"
|
:grid="$q.screen.lt.md"
|
||||||
table-header-class="text-left"
|
table-header-class="text-left"
|
||||||
|
|
|
@ -201,11 +201,9 @@ function showImportDialog() {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:dense="$q.screen.lt.md"
|
:dense="$q.screen.lt.md"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
hide-pagination
|
|
||||||
:grid="$q.screen.lt.md"
|
:grid="$q.screen.lt.md"
|
||||||
>
|
>
|
||||||
<template #body-cell-claimed="{ row, value }">
|
<template #body-cell-claimed="{ row, value }">
|
||||||
|
|
|
@ -121,7 +121,6 @@ function cancel() {
|
||||||
class="my-sticky-header-table"
|
class="my-sticky-header-table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="claimableSales"
|
:rows="claimableSales"
|
||||||
:pagination="{ rowsPerPage: 10 }"
|
|
||||||
row-key="saleFk"
|
row-key="saleFk"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
|
|
@ -198,7 +198,6 @@ const updateCompanyId = (id) => {
|
||||||
|
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
|
|
@ -97,13 +97,7 @@ const toCustomerCreditCreate = () => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<QTable :columns="columns" :rows="rows" class="full-width q-mt-md" row-key="id">
|
||||||
:columns="columns"
|
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
|
||||||
:rows="rows"
|
|
||||||
class="full-width q-mt-md"
|
|
||||||
row-key="id"
|
|
||||||
>
|
|
||||||
<template #body-cell="props">
|
<template #body-cell="props">
|
||||||
<QTd :props="props">
|
<QTd :props="props">
|
||||||
<QTr :props="props" class="cursor-pointer">
|
<QTr :props="props" class="cursor-pointer">
|
||||||
|
|
|
@ -140,7 +140,6 @@ const toCustomerGreugeCreate = () => {
|
||||||
|
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
|
|
@ -97,7 +97,6 @@ const toCustomerRecoverieCreate = () => {
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
|
|
@ -224,10 +224,8 @@ const refreshData = () => {
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
hide-bottom
|
|
||||||
row-key="clientFk"
|
row-key="clientFk"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
|
|
@ -510,7 +510,6 @@ const selectSalesPersonId = (id) => (selectedSalesPersonId.value = id);
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
|
|
|
@ -108,10 +108,8 @@ const selectCustomerId = (id) => {
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center q-pa-md">
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
hide-bottom
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
|
|
@ -151,10 +151,8 @@ function stateColor(row) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
:grid="grid || $q.screen.lt.sm"
|
:grid="grid || $q.screen.lt.sm"
|
||||||
class="q-mt-xs custom-table"
|
class="q-mt-xs custom-table"
|
||||||
hide-pagination
|
|
||||||
>
|
>
|
||||||
<template #body-cell-actions="{ row }">
|
<template #body-cell-actions="{ row }">
|
||||||
<QTd auto-width class="text-center">
|
<QTd auto-width class="text-center">
|
||||||
|
|
|
@ -238,12 +238,7 @@ const redirectToBuysView = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QTable
|
<QTable :columns="columns" :rows="importData.buys">
|
||||||
:columns="columns"
|
|
||||||
:rows="importData.buys"
|
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
hide-pagination
|
|
||||||
>
|
|
||||||
<template #body-cell-item="{ row, col }">
|
<template #body-cell-item="{ row, col }">
|
||||||
<QTd auto-width>
|
<QTd auto-width>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
|
|
|
@ -659,7 +659,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:selected="rowsSelected"
|
v-model:selected="rowsSelected"
|
||||||
|
|
|
@ -111,7 +111,6 @@ const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/s
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
row-key="$index"
|
row-key="$index"
|
||||||
selection="single"
|
selection="single"
|
||||||
hide-pagination
|
|
||||||
:grid="$q.screen.lt.sm"
|
:grid="$q.screen.lt.sm"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
:pagination="{ rowsPerPage: 0 }"
|
||||||
>
|
>
|
||||||
|
|
|
@ -99,7 +99,6 @@ async function insert() {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
row-key="$index"
|
row-key="$index"
|
||||||
hide-pagination
|
|
||||||
:grid="$q.screen.lt.sm"
|
:grid="$q.screen.lt.sm"
|
||||||
>
|
>
|
||||||
<template #body-cell-duedate="{ row }">
|
<template #body-cell-duedate="{ row }">
|
||||||
|
|
|
@ -134,7 +134,6 @@ function getTotal(type) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
row-key="$index"
|
row-key="$index"
|
||||||
hide-pagination
|
|
||||||
:grid="$q.screen.lt.sm"
|
:grid="$q.screen.lt.sm"
|
||||||
>
|
>
|
||||||
<template #body-cell="{ row, col }">
|
<template #body-cell="{ row, col }">
|
||||||
|
|
|
@ -199,7 +199,7 @@ function getLink(param) {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardSummary
|
<CardSummary
|
||||||
ref="summary"
|
data-key="InvoiceInSummary"
|
||||||
:url="`InvoiceIns/${entityId}/summary`"
|
:url="`InvoiceIns/${entityId}/summary`"
|
||||||
@on-fetch="(data) => setData(data)"
|
@on-fetch="(data) => setData(data)"
|
||||||
>
|
>
|
||||||
|
@ -356,7 +356,6 @@ function getLink(param) {
|
||||||
:columns="dueDayColumns"
|
:columns="dueDayColumns"
|
||||||
:rows="invoiceIn.invoiceInDueDay"
|
:rows="invoiceIn.invoiceInDueDay"
|
||||||
flat
|
flat
|
||||||
hide-pagination
|
|
||||||
>
|
>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props" class="bg">
|
<QTr :props="props" class="bg">
|
||||||
|
@ -385,7 +384,6 @@ function getLink(param) {
|
||||||
:columns="intrastatColumns"
|
:columns="intrastatColumns"
|
||||||
:rows="invoiceIn.invoiceInIntrastat"
|
:rows="invoiceIn.invoiceInIntrastat"
|
||||||
flat
|
flat
|
||||||
hide-pagination
|
|
||||||
>
|
>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props" class="bg">
|
<QTr :props="props" class="bg">
|
||||||
|
|
|
@ -184,10 +184,8 @@ async function addExpense() {
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
row-key="$index"
|
row-key="$index"
|
||||||
hide-pagination
|
|
||||||
:grid="$q.screen.lt.sm"
|
:grid="$q.screen.lt.sm"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
>
|
>
|
||||||
<template #body-cell-expense="{ row, col }">
|
<template #body-cell-expense="{ row, col }">
|
||||||
<QTd auto-width>
|
<QTd auto-width>
|
||||||
|
|
|
@ -133,9 +133,7 @@ onUnmounted(() => {
|
||||||
v-if="rows.length > 0"
|
v-if="rows.length > 0"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
hide-bottom
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
>
|
>
|
||||||
<template #body-cell="props">
|
<template #body-cell="props">
|
||||||
|
|
|
@ -22,7 +22,7 @@ const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const token = session.getToken();
|
const tokenMultimedia = session.getTokenMultimedia();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
|
||||||
const manualInvoiceDialogRef = ref(null);
|
const manualInvoiceDialogRef = ref(null);
|
||||||
|
@ -66,7 +66,7 @@ const openPdf = () => {
|
||||||
|
|
||||||
if (selectedCards.value.size === 1) {
|
if (selectedCards.value.size === 1) {
|
||||||
const [invoiceOut] = selectedCardsArray;
|
const [invoiceOut] = selectedCardsArray;
|
||||||
const url = `api/InvoiceOuts/${invoiceOut.id}/download?access_token=${token}`;
|
const url = `api/InvoiceOuts/${invoiceOut.id}/download?access_token=${tokenMultimedia}`;
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
} else {
|
} else {
|
||||||
const invoiceOutIdsArray = selectedCardsArray.map(
|
const invoiceOutIdsArray = selectedCardsArray.map(
|
||||||
|
@ -75,7 +75,7 @@ const openPdf = () => {
|
||||||
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
||||||
|
|
||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
access_token: token,
|
access_token: tokenMultimedia,
|
||||||
ids: invoiceOutIds,
|
ids: invoiceOutIds,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -166,9 +166,7 @@ const downloadCSV = async () => {
|
||||||
<QTable
|
<QTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
hide-bottom
|
|
||||||
row-key="clientId"
|
row-key="clientId"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
>
|
>
|
||||||
<template #body-cell-clientId="{ row }">
|
<template #body-cell-clientId="{ row }">
|
||||||
|
|
|
@ -162,7 +162,6 @@ const detailsColumns = ref([
|
||||||
:columns="detailsColumns"
|
:columns="detailsColumns"
|
||||||
:rows="entity?.rows"
|
:rows="entity?.rows"
|
||||||
flat
|
flat
|
||||||
hide-pagination
|
|
||||||
>
|
>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<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 parkingId = route.params?.id || null;
|
||||||
|
const sectors = ref([]);
|
||||||
|
const sectorFilter = { fields: ['id', 'description'] };
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
fields: ['sectorFk', 'code', 'pickingOrder', 'row', 'column'],
|
||||||
|
include: [{ relation: 'sector', scope: sectorFilter }],
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="Sectors"
|
||||||
|
:filter="sectorFilter"
|
||||||
|
sort-by="description"
|
||||||
|
@on-fetch="(data) => (sectors = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<VnSubToolbar />
|
||||||
|
<FormModel :url="`Parkings/${parkingId}`" model="parking" :filter="filter" auto-load>
|
||||||
|
<template #form="{ data }">
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.code" :label="t('globals.code')" />
|
||||||
|
<VnInput v-model="data.pickingOrder" :label="t('parking.pickingOrder')" />
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.row" :label="t('parking.row')" />
|
||||||
|
<VnInput v-model="data.column" :label="t('parking.column')" />
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelectFilter
|
||||||
|
v-model="data.sectorFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
:label="t('parking.sector')"
|
||||||
|
:options="sectors"
|
||||||
|
use-input
|
||||||
|
input-debounce="0"
|
||||||
|
:is-clearable="false"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</FormModel>
|
||||||
|
</template>
|
|
@ -0,0 +1,57 @@
|
||||||
|
<script setup>
|
||||||
|
import { onMounted, watch } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
import ParkingDescriptor from 'pages/Parking/Card/ParkingDescriptor.vue';
|
||||||
|
|
||||||
|
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('Parking', {
|
||||||
|
url: `Parkings/${route.params.id}`,
|
||||||
|
filter,
|
||||||
|
});
|
||||||
|
const { store } = arrayData;
|
||||||
|
onMounted(async () => await arrayData.fetch({ append: false }));
|
||||||
|
watch(
|
||||||
|
() => route.params.id,
|
||||||
|
async (newId) => {
|
||||||
|
if (newId) {
|
||||||
|
store.url = `Parkings/${newId}`;
|
||||||
|
store.filter = filter;
|
||||||
|
await arrayData.fetch({ append: false });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">
|
||||||
|
<VnSearchbar
|
||||||
|
:info="t('parking.searchBar.info')"
|
||||||
|
:label="t('parking.searchBar.label')"
|
||||||
|
data-key="Parking"
|
||||||
|
/>
|
||||||
|
</Teleport>
|
||||||
|
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
||||||
|
<QScrollArea class="fit">
|
||||||
|
<ParkingDescriptor />
|
||||||
|
<QSeparator />
|
||||||
|
<LeftMenu source="card" />
|
||||||
|
</QScrollArea>
|
||||||
|
</QDrawer>
|
||||||
|
<QPageContainer>
|
||||||
|
<QPage>
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</QPage>
|
||||||
|
</QPageContainer>
|
||||||
|
</template>
|
|
@ -0,0 +1,42 @@
|
||||||
|
<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="Parking"
|
||||||
|
data-key="Parking"
|
||||||
|
:url="`Parkings/${entityId}`"
|
||||||
|
:title="card?.code"
|
||||||
|
:subtitle="card?.id"
|
||||||
|
:filter="filter"
|
||||||
|
>
|
||||||
|
<template #body="{ entity: parking }">
|
||||||
|
<VnLv :label="t('globals.code')" :value="parking.code" />
|
||||||
|
<VnLv :label="t('parking.pickingOrder')" :value="parking.pickingOrder" />
|
||||||
|
<VnLv :label="t('parking.sector')" :value="parking.sector?.description" />
|
||||||
|
</template>
|
||||||
|
</CardDescriptor>
|
||||||
|
</template>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<script setup>
|
||||||
|
import VnLog from 'src/components/common/VnLog.vue';
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnLog model="Parking" url="/ParkingLogs" />
|
||||||
|
</template>
|
|
@ -0,0 +1,54 @@
|
||||||
|
<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="`Parkings/${entityId}`" :filter="filter">
|
||||||
|
<template #header="{ entity: parking }">{{ parking.code }}</template>
|
||||||
|
<template #body="{ entity: parking }">
|
||||||
|
<QCard class="vn-one">
|
||||||
|
<QCardSection class="q-pa-none">
|
||||||
|
<a
|
||||||
|
class="header header-link"
|
||||||
|
:href="`#/parking/${entityId}/basic-data`"
|
||||||
|
>
|
||||||
|
{{ t('globals.pageTitles.basicData') }}
|
||||||
|
<QIcon name="open_in_new" />
|
||||||
|
</a>
|
||||||
|
</QCardSection>
|
||||||
|
<VnLv :label="t('globals.code')" :value="parking.code" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('parking.pickingOrder')"
|
||||||
|
:value="parking.pickingOrder"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('parking.sector')"
|
||||||
|
:value="parking.sector?.description"
|
||||||
|
/>
|
||||||
|
<VnLv :label="t('parking.row')" :value="parking.row" />
|
||||||
|
<VnLv :label="t('parking.column')" :value="parking.column" />
|
||||||
|
</QCard>
|
||||||
|
</template>
|
||||||
|
</CardSummary>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -0,0 +1,77 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const sectors = ref([]);
|
||||||
|
const emit = defineEmits(['search']);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="Sectors"
|
||||||
|
:filter="{ fields: ['id', 'description'] }"
|
||||||
|
sort-by="description"
|
||||||
|
@on-fetch="(data) => (sectors = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
|
<VnFilterPanel :data-key="dataKey" :search-button="true" @search="emit('search')">
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params }">
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.code')"
|
||||||
|
v-model="params.code"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelectFilter
|
||||||
|
v-model="params.sectorFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
:label="t('params.sectorFk')"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
:options="sectors"
|
||||||
|
use-input
|
||||||
|
input-debounce="0"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
code: Code
|
||||||
|
sectorFk: Sector
|
||||||
|
search: General Search
|
||||||
|
es:
|
||||||
|
params:
|
||||||
|
code: Código
|
||||||
|
search: Búsqueda general
|
||||||
|
|
||||||
|
</i18n>
|
|
@ -0,0 +1,112 @@
|
||||||
|
<script setup>
|
||||||
|
import { onMounted, onUnmounted } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
|
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
|
import CardList from 'components/ui/CardList.vue';
|
||||||
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
|
import ParkingFilter from './ParkingFilter.vue';
|
||||||
|
import ParkingSummary from './Card/ParkingSummary.vue';
|
||||||
|
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
const { push } = useRouter();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
|
||||||
|
onMounted(() => (stateStore.rightDrawer = true));
|
||||||
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
|
const filter = {
|
||||||
|
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
|
||||||
|
include: [{ relation: 'sector', scope: { fields: ['id', 'description'] } }],
|
||||||
|
};
|
||||||
|
|
||||||
|
function exprBuilder(param, value) {
|
||||||
|
switch (param) {
|
||||||
|
case 'code':
|
||||||
|
return { [param]: { like: `%${value}%` } };
|
||||||
|
case 'sectorFk':
|
||||||
|
return { [param]: value };
|
||||||
|
case 'search':
|
||||||
|
return { or: [{ code: { like: `%${value}%` } }, { id: value }] };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<template v-if="stateStore.isHeaderMounted()">
|
||||||
|
<Teleport to="#searchbar">
|
||||||
|
<VnSearchbar
|
||||||
|
data-key="ParkingList"
|
||||||
|
:label="t('Search parking')"
|
||||||
|
:info="t('You can search by parking code')"
|
||||||
|
/>
|
||||||
|
</Teleport>
|
||||||
|
<Teleport to="#actions-append">
|
||||||
|
<div class="row q-gutter-x-sm">
|
||||||
|
<QBtn
|
||||||
|
flat
|
||||||
|
@click="stateStore.toggleRightDrawer()"
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="menu"
|
||||||
|
>
|
||||||
|
<QTooltip bottom anchor="bottom right">
|
||||||
|
{{ t('globals.collapseMenu') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</div>
|
||||||
|
</Teleport>
|
||||||
|
</template>
|
||||||
|
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||||
|
<QScrollArea class="fit text-grey-8">
|
||||||
|
<ParkingFilter data-key="ParkingList" />
|
||||||
|
</QScrollArea>
|
||||||
|
</QDrawer>
|
||||||
|
<QPage class="column items-center q-pa-md">
|
||||||
|
<div class="vn-card-list">
|
||||||
|
<VnPaginate
|
||||||
|
data-key="ParkingList"
|
||||||
|
url="Parkings"
|
||||||
|
:filter="filter"
|
||||||
|
:expr-builder="exprBuilder"
|
||||||
|
:limit="20"
|
||||||
|
auto-load
|
||||||
|
order="code"
|
||||||
|
>
|
||||||
|
<template #body="{ rows }">
|
||||||
|
<CardList
|
||||||
|
v-for="row of rows"
|
||||||
|
:key="row.id"
|
||||||
|
:id="row.id"
|
||||||
|
:title="row.code"
|
||||||
|
@click="push({ path: `/parking/${row.id}` })"
|
||||||
|
>
|
||||||
|
<template #list-items>
|
||||||
|
<VnLv label="Sector" :value="row.sector?.description" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('parking.pickingOrder')"
|
||||||
|
:value="row.pickingOrder"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #actions>
|
||||||
|
<QBtn
|
||||||
|
:label="t('components.smartCard.openSummary')"
|
||||||
|
@click.stop="viewSummary(row.id, ParkingSummary)"
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</CardList>
|
||||||
|
</template>
|
||||||
|
</VnPaginate>
|
||||||
|
</div>
|
||||||
|
</QPage>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Search parking: Buscar parking
|
||||||
|
You can search by parking code: Puede buscar por el código del parking
|
||||||
|
</i18n>
|
|
@ -205,10 +205,8 @@ const ticketColumns = ref([
|
||||||
<QTable
|
<QTable
|
||||||
:columns="ticketColumns"
|
:columns="ticketColumns"
|
||||||
:rows="entity?.tickets"
|
:rows="entity?.tickets"
|
||||||
:rows-per-page-options="[0]"
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
hide-pagination
|
|
||||||
>
|
>
|
||||||
<template #body-cell-city="{ value, row }">
|
<template #body-cell-city="{ value, row }">
|
||||||
<QTd auto-width>
|
<QTd auto-width>
|
||||||
|
|
|
@ -123,8 +123,6 @@ function downloadPdfs() {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:dense="$q.screen.lt.md"
|
:dense="$q.screen.lt.md"
|
||||||
:pagination="{ rowsPerPage: null }"
|
|
||||||
hide-pagination
|
|
||||||
row-key="cmrFk"
|
row-key="cmrFk"
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
|
|
@ -151,7 +151,6 @@ onMounted(async () => {
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
hide-header
|
hide-header
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
:no-data-label="t('No results')"
|
:no-data-label="t('No results')"
|
||||||
>
|
>
|
||||||
|
|
|
@ -131,22 +131,6 @@ async function changeState(value) {
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-max">
|
|
||||||
<div class="taxes">
|
|
||||||
<VnLv
|
|
||||||
:label="t('ticket.summary.subtotal')"
|
|
||||||
:value="toCurrency(ticket.totalWithoutVat)"
|
|
||||||
/>
|
|
||||||
<VnLv
|
|
||||||
:label="t('ticket.summary.vat')"
|
|
||||||
:value="toCurrency(ticket.totalWithVat - ticket.totalWithoutVat)"
|
|
||||||
/>
|
|
||||||
<VnLv
|
|
||||||
:label="t('ticket.summary.total')"
|
|
||||||
:value="toCurrency(ticket.totalWithVat)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</QCard>
|
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="ticketUrl + 'basic-data/step-one'"
|
:url="ticketUrl + 'basic-data/step-one'"
|
||||||
|
@ -236,7 +220,7 @@ async function changeState(value) {
|
||||||
:value="formattedAddress()"
|
:value="formattedAddress()"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one" v-if="ticket.notes.length">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="ticketUrl + 'observation'"
|
:url="ticketUrl + 'observation'"
|
||||||
:text="t('ticket.pageTitles.notes')"
|
:text="t('ticket.pageTitles.notes')"
|
||||||
|
@ -258,6 +242,23 @@ async function changeState(value) {
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
<QCard class="vn-one">
|
||||||
|
<VnTitle :text="t('ticket.summary.summaryAmount')" />
|
||||||
|
<div class="bodyCard">
|
||||||
|
<VnLv
|
||||||
|
:label="t('ticket.summary.subtotal')"
|
||||||
|
:value="toCurrency(ticket.totalWithoutVat)"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('ticket.summary.vat')"
|
||||||
|
:value="toCurrency(ticket.totalWithVat - ticket.totalWithoutVat)"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('ticket.summary.total')"
|
||||||
|
:value="toCurrency(ticket.totalWithVat)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QCard>
|
||||||
<QCard class="vn-max">
|
<QCard class="vn-max">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="ticketUrl + 'sale'"
|
:url="ticketUrl + 'sale'"
|
||||||
|
@ -448,21 +449,10 @@ async function changeState(value) {
|
||||||
.notes {
|
.notes {
|
||||||
width: max-content;
|
width: max-content;
|
||||||
}
|
}
|
||||||
.cardSummary .summaryBody > .q-card > .taxes {
|
|
||||||
border: 2px solid gray;
|
.q-card.q-card--dark.q-dark.vn-one {
|
||||||
padding: 0;
|
& > .bodyCard {
|
||||||
> .vn-label-value {
|
padding: 1%;
|
||||||
text-align: right;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
margin-top: 5px;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding-right: 20px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardSummary .summaryBody > .q-card:has(.taxes) {
|
|
||||||
margin-top: 2px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -289,7 +289,6 @@ async function setTravelData(travelData) {
|
||||||
<QTable
|
<QTable
|
||||||
:rows="entriesTableRows"
|
:rows="entriesTableRows"
|
||||||
:columns="entriesTableColumns"
|
:columns="entriesTableColumns"
|
||||||
hide-bottom
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
>
|
>
|
||||||
|
@ -354,7 +353,6 @@ async function setTravelData(travelData) {
|
||||||
<QTable
|
<QTable
|
||||||
:rows="thermographs"
|
:rows="thermographs"
|
||||||
:columns="thermographsTableColumns"
|
:columns="thermographsTableColumns"
|
||||||
hide-bottom
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -145,7 +145,6 @@ const removeThermograph = async (id) => {
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="TableColumns"
|
:columns="TableColumns"
|
||||||
:no-data-label="t('No results')"
|
:no-data-label="t('No results')"
|
||||||
:rows-per-page-options="[0]"
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
class="full-width q-mt-md"
|
class="full-width q-mt-md"
|
||||||
>
|
>
|
||||||
|
|
|
@ -453,9 +453,7 @@ const handleDragScroll = (event) => {
|
||||||
<QTable
|
<QTable
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
hide-bottom
|
|
||||||
row-key="clientId"
|
row-key="clientId"
|
||||||
:pagination="{ rowsPerPage: 0 }"
|
|
||||||
class="full-width"
|
class="full-width"
|
||||||
table-style="user-select: none;"
|
table-style="user-select: none;"
|
||||||
@drag="handleDragScroll($event)"
|
@drag="handleDragScroll($event)"
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { toLowerCamel } from 'src/filters';
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const { t } = i18n.global;
|
const { t, te } = i18n.global;
|
||||||
|
|
||||||
const createHistory = process.env.SERVER
|
const createHistory = process.env.SERVER
|
||||||
? createMemoryHistory
|
? createMemoryHistory
|
||||||
|
@ -90,7 +90,10 @@ export default route(function (/* { store, ssrContext } */) {
|
||||||
if (childPageTitle && matches.length > 2) {
|
if (childPageTitle && matches.length > 2) {
|
||||||
if (title != '') title += ': ';
|
if (title != '') title += ': ';
|
||||||
|
|
||||||
const pageTitle = t(`${moduleName}.pageTitles.${childPageTitle}`);
|
const moduleLocale = `${moduleName}.pageTitles.${childPageTitle}`;
|
||||||
|
const pageTitle = te(moduleLocale)
|
||||||
|
? t(moduleLocale)
|
||||||
|
: t(`globals.pageTitles.${childPageTitle}`);
|
||||||
const idParam = to.params && to.params.id;
|
const idParam = to.params && to.params.id;
|
||||||
const idPageTitle = `${idParam} - ${pageTitle}`;
|
const idPageTitle = `${idParam} - ${pageTitle}`;
|
||||||
const builtTitle = idParam ? idPageTitle : pageTitle;
|
const builtTitle = idParam ? idPageTitle : pageTitle;
|
||||||
|
|
|
@ -13,7 +13,8 @@ import Travel from './travel';
|
||||||
import Order from './order';
|
import Order from './order';
|
||||||
import Department from './department';
|
import Department from './department';
|
||||||
import Entry from './entry';
|
import Entry from './entry';
|
||||||
import roadmap from "./roadmap";
|
import roadmap from './roadmap';
|
||||||
|
import Parking from './parking';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
Item,
|
Item,
|
||||||
|
@ -31,5 +32,6 @@ export default [
|
||||||
invoiceIn,
|
invoiceIn,
|
||||||
Department,
|
Department,
|
||||||
Entry,
|
Entry,
|
||||||
roadmap
|
roadmap,
|
||||||
|
Parking,
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: '/parking',
|
||||||
|
name: 'Parking',
|
||||||
|
meta: {
|
||||||
|
title: 'parking',
|
||||||
|
icon: 'garage_home',
|
||||||
|
moduleName: 'Parking',
|
||||||
|
},
|
||||||
|
component: RouterView,
|
||||||
|
redirect: { name: 'ParkingCard' },
|
||||||
|
menus: {
|
||||||
|
main: [],
|
||||||
|
card: ['ParkingBasicData', 'ParkingLog'],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '/parking/:id',
|
||||||
|
name: 'ParkingCard',
|
||||||
|
component: () => import('src/pages/Parking/Card/ParkingCard.vue'),
|
||||||
|
redirect: { name: 'ParkingSummary' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'ParkingSummary',
|
||||||
|
path: 'summary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Parking/Card/ParkingSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ParkingBasicData',
|
||||||
|
path: 'basic-data',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Parking/Card/ParkingBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ParkingLog',
|
||||||
|
path: 'log',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'history',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Parking/Card/ParkingLog.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
|
@ -11,7 +11,7 @@ export default {
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'ShelvingMain' },
|
redirect: { name: 'ShelvingMain' },
|
||||||
menus: {
|
menus: {
|
||||||
main: ['ShelvingList'],
|
main: ['ShelvingList', 'ParkingList'],
|
||||||
card: ['ShelvingBasicData', 'ShelvingLog'],
|
card: ['ShelvingBasicData', 'ShelvingLog'],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
@ -38,6 +38,21 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
|
component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/parking',
|
||||||
|
redirect: { name: 'ParkingList' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
name: 'ParkingList',
|
||||||
|
meta: {
|
||||||
|
title: 'parkingList',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Parking/ParkingList.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,8 @@ import department from './modules/department';
|
||||||
import shelving from 'src/router/modules/shelving';
|
import shelving from 'src/router/modules/shelving';
|
||||||
import order from 'src/router/modules/order';
|
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';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
@ -69,6 +70,7 @@ const routes = [
|
||||||
department,
|
department,
|
||||||
roadmap,
|
roadmap,
|
||||||
entry,
|
entry,
|
||||||
|
parking,
|
||||||
{
|
{
|
||||||
path: '/:catchAll(.*)*',
|
path: '/:catchAll(.*)*',
|
||||||
name: 'NotFound',
|
name: 'NotFound',
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('ParkingBasicData', () => {
|
||||||
|
const codeInput = 'form .q-card .q-input input';
|
||||||
|
const sectorSelect = 'form .q-card .q-select input';
|
||||||
|
const sectorOpt = '.q-menu .q-item';
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/parking/1/basic-data`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should edit the code and sector', () => {
|
||||||
|
cy.get(sectorSelect).type('Second');
|
||||||
|
cy.get(sectorOpt).click();
|
||||||
|
|
||||||
|
cy.get(codeInput).eq(0).clear();
|
||||||
|
cy.get(codeInput).eq(0).type(123);
|
||||||
|
|
||||||
|
cy.saveCard();
|
||||||
|
|
||||||
|
cy.get(sectorSelect).should('have.value', 'Second sector');
|
||||||
|
cy.get(codeInput).should('have.value', 123);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,30 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('ParkingList', () => {
|
||||||
|
const firstCard = '.q-card:nth-child(1)';
|
||||||
|
const firstChipId =
|
||||||
|
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
||||||
|
const firstDetailBtn =
|
||||||
|
':nth-child(1) > :nth-child(1) > .card-list-body > .actions > .q-btn';
|
||||||
|
const summaryHeader = '.summaryBody .header';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/parking/list`);
|
||||||
|
cy.closeSideMenu();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should redirect on clicking a parking', () => {
|
||||||
|
cy.get(firstChipId)
|
||||||
|
.invoke('text')
|
||||||
|
.then((content) => {
|
||||||
|
const id = content.substring(4);
|
||||||
|
cy.get(firstCard).click();
|
||||||
|
cy.url().should('include', `/parking/${id}/summary`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open the details', () => {
|
||||||
|
cy.get(firstDetailBtn).click();
|
||||||
|
cy.get(summaryHeader).contains('Basic data');
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,19 +1,42 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('VnSearchBar', () => {
|
describe('VnSearchBar', () => {
|
||||||
|
const employeeId = ' #1';
|
||||||
|
const salesPersonId = ' #18';
|
||||||
|
const idGap = '.q-item > .q-item__label';
|
||||||
|
const cardList = '.vn-card-list';
|
||||||
|
|
||||||
|
let url;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('/');
|
cy.visit('#/customer/list');
|
||||||
|
cy.url().then((currentUrl) => (url = currentUrl));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should redirect to new customer', () => {
|
it('should redirect to customer summary page', () => {
|
||||||
cy.visit('#/customer/1112/basic-data')
|
searchAndCheck('1', employeeId);
|
||||||
cy.openLeftMenu();
|
searchAndCheck('salesPerson', salesPersonId);
|
||||||
cy.get('.q-item > .q-item__label').should('have.text',' #1112')
|
});
|
||||||
cy.closeLeftMenu();
|
|
||||||
cy.clearSearchbar();
|
it('should stay on the list page if there are several results or none', () => {
|
||||||
cy.writeSearchbar('1{enter}');
|
cy.writeSearchbar('salesA{enter}');
|
||||||
cy.openLeftMenu();
|
checkCardListAndUrl(2);
|
||||||
cy.get('.q-item > .q-item__label').should('have.text',' #1')
|
|
||||||
cy.closeLeftMenu();
|
cy.clearSearchbar();
|
||||||
|
|
||||||
|
cy.writeSearchbar('0{enter}');
|
||||||
|
checkCardListAndUrl(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
const searchAndCheck = (searchTerm, expectedText) => {
|
||||||
|
cy.clearSearchbar();
|
||||||
|
cy.writeSearchbar(`${searchTerm}{enter}`);
|
||||||
|
cy.get(idGap).should('have.text', expectedText);
|
||||||
|
};
|
||||||
|
|
||||||
|
const checkCardListAndUrl = (expectedLength) => {
|
||||||
|
cy.get(cardList).then(($cardList) => {
|
||||||
|
expect($cardList.find('.q-card').length).to.equal(expectedLength);
|
||||||
|
cy.url().then((currentUrl) => expect(currentUrl).to.equal(url));
|
||||||
});
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -52,16 +52,18 @@ Cypress.Commands.add('getValue', (selector) => {
|
||||||
}
|
}
|
||||||
// Si es un QSelect
|
// Si es un QSelect
|
||||||
if ($el.find('.q-select__dropdown-icon').length) {
|
if ($el.find('.q-select__dropdown-icon').length) {
|
||||||
return cy.get(
|
return cy
|
||||||
selector +
|
.get(
|
||||||
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input'
|
selector +
|
||||||
).invoke('val')
|
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input'
|
||||||
|
)
|
||||||
|
.invoke('val');
|
||||||
}
|
}
|
||||||
// Si es un QSelect
|
// Si es un QSelect
|
||||||
if ($el.find('span').length) {
|
if ($el.find('span').length) {
|
||||||
return cy.get(
|
return cy.get(selector + ' span').then(($span) => {
|
||||||
selector + ' span'
|
return $span[0].innerText;
|
||||||
).then(($span) => { return $span[0].innerText })
|
});
|
||||||
}
|
}
|
||||||
// Puedes añadir un log o lanzar un error si el elemento no es reconocido
|
// Puedes añadir un log o lanzar un error si el elemento no es reconocido
|
||||||
cy.log('Elemento no soportado');
|
cy.log('Elemento no soportado');
|
||||||
|
@ -132,13 +134,13 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => {
|
||||||
cy.get(rowSelector).within(() => {
|
cy.get(rowSelector).within(() => {
|
||||||
for (const [index, value] of expectedValues.entries()) {
|
for (const [index, value] of expectedValues.entries()) {
|
||||||
cy.log('CHECKING ', index, value);
|
cy.log('CHECKING ', index, value);
|
||||||
if(value === undefined) continue
|
if (value === undefined) continue;
|
||||||
if (typeof value == 'boolean') {
|
if (typeof value == 'boolean') {
|
||||||
const prefix = value ? '' : 'not.';
|
const prefix = value ? '' : 'not.';
|
||||||
cy.getValue(`:nth-child(${index + 1})`).should(`${prefix}be.checked`);
|
cy.getValue(`:nth-child(${index + 1})`).should(`${prefix}be.checked`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cy.getValue(`:nth-child(${index + 1})`).should('equal', value)
|
cy.getValue(`:nth-child(${index + 1})`).should('equal', value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -174,9 +176,9 @@ Cypress.Commands.add('openLeftMenu', (element) => {
|
||||||
if (element) cy.waitForElement(element);
|
if (element) cy.waitForElement(element);
|
||||||
cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();
|
cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();
|
||||||
});
|
});
|
||||||
Cypress.Commands.add('closeLeftMenu', (element) => {
|
Cypress.Commands.add('closeSideMenu', (element) => {
|
||||||
if (element) cy.waitForElement(element);
|
if (element) cy.waitForElement(element);
|
||||||
cy.get('.fullscreen').click();
|
cy.get('.fullscreen.q-drawer__backdrop:not(.hidden)').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('clearSearchbar', (element) => {
|
Cypress.Commands.add('clearSearchbar', (element) => {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { vi, describe, expect, it, beforeAll, beforeEach, afterEach } from 'vitest';
|
import { vi, describe, expect, it, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||||
import { createWrapper, axios } from 'app/test/vitest/helper';
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
|
// Probar a importar como plugin vue-router en archivo helper
|
||||||
|
|
||||||
describe('VnSearchBar', () => {
|
describe('VnSearchBar', () => {
|
||||||
let vm;
|
let vm;
|
||||||
let wrapper;
|
let wrapper;
|
||||||
|
let pushSpy;
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
wrapper = createWrapper(VnSearchbar, {
|
wrapper = createWrapper(VnSearchbar, {
|
||||||
|
@ -16,7 +16,7 @@ describe('VnSearchBar', () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
vm = wrapper.vm;
|
vm = wrapper.vm;
|
||||||
vm.route.matched = [
|
vm.router.currentRoute.value.matched = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
},
|
},
|
||||||
|
@ -30,24 +30,33 @@ describe('VnSearchBar', () => {
|
||||||
path: '/customer/:id/basic-data',
|
path: '/customer/:id/basic-data',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
pushSpy = vi.spyOn(vm.router, 'push');
|
||||||
|
vi.spyOn(vm.arrayData, 'applyFilter');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
beforeEach(() => (vm.store.data = [{ id: 1112, name: 'Trash' }]));
|
||||||
vi.clearAllMocks();
|
afterEach(() => vi.clearAllMocks());
|
||||||
});
|
|
||||||
it('should be defined', async () => {
|
it('should be defined', async () => {
|
||||||
expect(vm.searchText).toBeDefined();
|
expect(vm.searchText).toBeDefined();
|
||||||
expect(vm.searchText).toEqual('');
|
expect(vm.searchText).toEqual('');
|
||||||
});
|
});
|
||||||
it('should redirect', async () => {
|
|
||||||
vi.spyOn(vm.router,'push');
|
it('should redirect to list page if there are several results', async () => {
|
||||||
vm.searchText = '1';
|
vm.store.data.push({ id: 1, name: 'employee' });
|
||||||
await vm.search();
|
await vm.search();
|
||||||
expect(vm.router.push).toHaveBeenCalledWith('/customer/1/basic-data');
|
expect(pushSpy).toHaveBeenCalledWith({ path: '/customer/list' });
|
||||||
vm.searchText = '1112';
|
});
|
||||||
expect(vm.searchText).toEqual('1112');
|
|
||||||
vi.spyOn(vm.router,'push');
|
it('should redirect to list page if there is no results', async () => {
|
||||||
|
vm.store.data.pop();
|
||||||
await vm.search();
|
await vm.search();
|
||||||
expect(vm.router.push).toHaveBeenCalledWith('/customer/1112/basic-data');
|
expect(pushSpy).toHaveBeenCalledWith({ path: '/customer/list' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should redirect to basic-data page if there is only one result', async () => {
|
||||||
|
await vm.search();
|
||||||
|
expect(pushSpy).toHaveBeenCalledWith({ path: '/customer/1112/basic-data' });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue