0
0
Fork 0

Merge branch 'dev' into features/ms_164_file_management_card

This commit is contained in:
Carlos Fonseca 2024-02-06 16:06:14 +00:00
commit f2a877557f
94 changed files with 4314 additions and 3062 deletions

6
package-lock.json generated
View File

@ -12,6 +12,7 @@
"@quasar/extras": "^1.16.4", "@quasar/extras": "^1.16.4",
"axios": "^1.4.0", "axios": "^1.4.0",
"chromium": "^3.0.3", "chromium": "^3.0.3",
"croppie": "^2.6.5",
"pinia": "^2.1.3", "pinia": "^2.1.3",
"quasar": "^2.12.0", "quasar": "^2.12.0",
"validator": "^13.9.0", "validator": "^13.9.0",
@ -3169,6 +3170,11 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/croppie": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/croppie/-/croppie-2.6.5.tgz",
"integrity": "sha512-IlChnVUGG5T3w2gRZIaQgBtlvyuYnlUWs2YZIXXR3H9KrlO1PtBT3j+ykxvy9eZIWhk+V5SpBmhCQz5UXKrEKQ=="
},
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
"version": "7.0.3", "version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-front", "name": "salix-front",
"version": "24.02.01", "version": "24.8.0",
"description": "Salix frontend", "description": "Salix frontend",
"productName": "Salix", "productName": "Salix",
"author": "Verdnatura", "author": "Verdnatura",
@ -19,6 +19,7 @@
"@quasar/extras": "^1.16.4", "@quasar/extras": "^1.16.4",
"axios": "^1.4.0", "axios": "^1.4.0",
"chromium": "^3.0.3", "chromium": "^3.0.3",
"croppie": "^2.6.5",
"pinia": "^2.1.3", "pinia": "^2.1.3",
"quasar": "^2.12.0", "quasar": "^2.12.0",
"validator": "^13.9.0", "validator": "^13.9.0",

View File

@ -1,6 +1,7 @@
<script setup> <script setup>
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
@ -54,16 +55,18 @@ const onDataSaved = (data) => {
<template #form-inputs="{ data, validate }"> <template #form-inputs="{ data, validate }">
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<QInput <VnInput
:label="t('name')" :label="t('name')"
v-model="data.name" v-model="data.name"
:required="true"
:rules="validate('bankEntity.name')" :rules="validate('bankEntity.name')"
/> />
</div> </div>
<div class="col"> <div class="col">
<QInput <VnInput
:label="t('swift')" :label="t('swift')"
v-model="data.bic" v-model="data.bic"
:required="true"
:rules="validate('bankEntity.bic')" :rules="validate('bankEntity.bic')"
/> />
</div> </div>
@ -77,11 +80,17 @@ const onDataSaved = (data) => {
option-value="id" option-value="id"
option-label="country" option-label="country"
hide-selected hide-selected
:required="true"
:rules="validate('bankEntity.countryFk')" :rules="validate('bankEntity.countryFk')"
/> />
</div> </div>
<div v-if="showEntityField" class="col"> <div v-if="showEntityField" class="col">
<QInput :label="t('id')" v-model="data.id" /> <VnInput
:label="t('id')"
v-model="data.id"
:required="true"
:rules="validate('city.name')"
/>
</div> </div>
</VnRow> </VnRow>
</template> </template>
@ -92,15 +101,15 @@ const onDataSaved = (data) => {
en: en:
title: New bank entity title: New bank entity
subtitle: Please, ensure you put the correct data! subtitle: Please, ensure you put the correct data!
name: Name * name: Name
swift: Swift * swift: Swift
country: Country country: Country
id: Entity code id: Entity code
es: es:
title: Nueva entidad bancaria title: Nueva entidad bancaria
subtitle: ¡Por favor, asegúrate de poner los datos correctos! subtitle: ¡Por favor, asegúrate de poner los datos correctos!
name: Nombre * name: Nombre
swift: Swift * swift: Swift
country: País country: País
id: Código de la entidad id: Código de la entidad
</i18n> </i18n>

View File

@ -0,0 +1,363 @@
<script setup>
import { reactive, computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import Croppie from 'croppie/croppie';
import 'croppie/croppie.css';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
const emit = defineEmits(['closeForm', 'onPhotoUploaded']);
const props = defineProps({
id: {
type: String,
default: '',
},
collection: {
type: String,
default: '',
},
});
const { t } = useI18n();
const { notify } = useNotify();
const uploadMethodsOptions = [
{ label: t('Select from computer'), value: 'computer' },
{ label: t('Import from external URL'), value: 'URL' },
];
const viewportTypes = [
{
code: 'normal',
description: t('Normal'),
viewport: {
width: 400,
height: 400,
},
output: {
width: 1200,
height: 1200,
},
},
{
code: 'panoramic',
description: t('Panoramic'),
viewport: {
width: 675,
height: 450,
},
output: {
width: 1350,
height: 900,
},
},
{
code: 'vertical',
description: t('Vertical'),
viewport: {
width: 306.66,
height: 533.33,
},
output: {
width: 460,
height: 800,
},
},
];
const uploadMethodSelected = ref('computer');
const viewPortTypeSelected = ref(viewportTypes[0]);
const inputFileRef = ref(null);
const allowedContentTypes = ref('');
const photoContainerRef = ref(null);
const editor = ref(null);
const newPhoto = reactive({
id: props.id,
collection: props.collection,
file: null,
url: null,
blob: null,
});
const openInputFile = () => {
inputFileRef.value.pickFiles();
};
const displayEditor = () => {
const viewportType = viewPortTypeSelected.value;
const viewport = viewportType.viewport;
const boundaryWidth = viewport.width + 200;
const boundaryHeight = viewport.height + 200;
if (editor.value) editor.value.destroy();
editor.value = new Croppie(photoContainerRef.value, {
viewport: { width: viewport.width, height: viewport.height },
boundary: { width: boundaryWidth, height: boundaryHeight },
enableOrientation: true,
showZoomer: true,
});
};
const viewportSelection = computed({
get() {
return viewPortTypeSelected.value;
},
set(val) {
viewPortTypeSelected.value = val;
const hasFile = newPhoto.files || newPhoto.url;
if (!val || !hasFile) return;
let file;
if (uploadMethodSelected.value == 'computer') file = newPhoto.files;
else if (uploadMethodSelected.value == 'URL') file = newPhoto.url;
updatePhotoPreview(file);
},
});
const updatePhotoPreview = (value) => {
if (value) {
displayEditor();
if (uploadMethodSelected.value == 'computer') {
newPhoto.files = value;
const reader = new FileReader();
reader.onload = (e) => editor.value.bind({ url: e.target.result });
reader.readAsDataURL(value);
} else if (uploadMethodSelected.value == 'URL') {
newPhoto.url = value;
const img = new Image();
img.crossOrigin = 'Anonymous';
img.src = value;
img.onload = () => editor.value.bind({ url: value });
img.onerror = () => {
notify(
t("This photo provider doesn't allow remote downloads"),
'negative'
);
};
}
}
};
const rotateLeft = () => {
editor.value.rotate(90);
};
const rotateRight = () => {
editor.value.rotate(-90);
};
const onUploadAccept = () => {
try {
if (!newPhoto.files && !newPhoto.url) {
notify(t('Select an image'), 'negative');
return;
}
const options = {
type: 'blob',
};
editor.value
.result(options)
.then((result) => {
const file = new File([result], newPhoto.files?.name || '');
newPhoto.blob = file;
})
.then(() => makeRequest());
} catch (err) {
console.error('Error uploading image');
}
};
const makeRequest = async () => {
const formData = new FormData();
const now = Date.vnNew();
const timestamp = now.getTime();
const fileName = `${newPhoto.files?.name}_${timestamp}`;
formData.append('blob', newPhoto.blob, fileName);
await axios.post('Images/upload', formData, {
params: newPhoto,
headers: {
'Content-Type': 'multipart/form-data',
},
});
emit('closeForm');
emit('onPhotoUploaded');
notify(t('globals.dataSaved'), 'positive');
};
</script>
<template>
<FetchData
ref="allowTypesRef"
url="ImageContainers/allowedContentTypes"
@on-fetch="(data) => (allowedContentTypes = data.join(', '))"
auto-load
/>
<QForm @submit="onUploadAccept()" class="all-pointer-events">
<QCard class="q-pa-lg">
<span ref="closeButton" class="close-icon" v-close-popup>
<QIcon name="close" size="sm" />
</span>
<h1 class="title">{{ t('Edit photo') }}</h1>
<div class="row q-gutter-lg">
<div
v-show="newPhoto.files || newPhoto.url"
class="row q-gutter-lg items-center"
>
<QIcon
name="rotate_left"
size="sm"
color="primary"
class="cursor-pointer"
@click="rotateLeft()"
>
<!-- <QTooltip class="no-pointer-events">
{{ t('Rotate left') }}
</QTooltip> -->
</QIcon>
<div>
<div ref="photoContainerRef" />
</div>
<QIcon
name="rotate_right"
size="sm"
color="primary"
class="cursor-pointer"
@click="rotateRight()"
>
<!-- <QTooltip class="no-pointer-events">
{{ t('Rotate right') }}
</QTooltip> -->
</QIcon>
</div>
<div class="column">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QOptionGroup
:options="uploadMethodsOptions"
type="radio"
v-model="uploadMethodSelected"
/>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QFile
v-if="uploadMethodSelected === 'computer'"
ref="inputFileRef"
:label="t('File')"
:multiple="false"
v-model="newPhoto.files"
@update:model-value="updatePhotoPreview($event)"
:accept="allowedContentTypes"
class="required cursor-pointer"
>
<template #append>
<QIcon
name="vn:attach"
class="cursor-pointer q-mr-sm"
@click="openInputFile()"
>
<!-- <QTooltip>{{ t('Select a file') }}</QTooltip> -->
</QIcon>
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{
t(
'components.editPictureForm.allowedFilesText',
{
allowedContentTypes:
allowedContentTypes,
}
)
}}</QTooltip>
</QIcon>
</template>
</QFile>
<VnInput
v-if="uploadMethodSelected === 'URL'"
v-model="newPhoto.url"
@update:model-value="updatePhotoPreview($event)"
placeholder="https://"
/>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Orientation')"
:options="viewportTypes"
hide-selected
option-label="description"
v-model="viewportSelection"
/>
</div>
</VnRow>
<div class="q-mt-lg row justify-end">
<QBtn
:label="t('globals.save')"
type="submit"
color="primary"
:disabled="isLoading"
:loading="isLoading"
/>
<QBtn
:label="t('globals.cancel')"
type="reset"
color="primary"
flat
class="q-ml-sm"
:disabled="isLoading"
:loading="isLoading"
v-close-popup
/>
</div>
</div>
</div>
</QCard>
</QForm>
</template>
<style lang="scss" scoped>
.title {
font-size: 17px;
font-weight: bold;
line-height: 20px;
}
.close-icon {
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
}
</style>
<i18n>
es:
Edit photo: Editar foto
Select from computer: Seleccionar desde ordenador
Import from external URL: Importar desde URL externa
Vertical: Vertical
Normal: Normal
Panoramic: Panorámica
Orientation: Orientación
File: Fichero
This photo provider doesn't allow remote downloads: Este proveedor de fotos no permite descargas remotas
Rotate left: Girar a la izquierda
Rotate right: Girar a la derecha
Select an image: Selecciona una imagen
</i18n>

View File

@ -45,7 +45,7 @@ onMounted(async () => {
async function fetch(fetchFilter = {}) { async function fetch(fetchFilter = {}) {
try { try {
const filter = Object.assign(fetchFilter, $props.filter); // eslint-disable-line vue/no-dupe-keys const filter = Object.assign(fetchFilter, $props.filter); // eslint-disable-line vue/no-dupe-keys
if ($props.where) filter.where = $props.where; if ($props.where && !fetchFilter.where) filter.where = $props.where;
if ($props.sortBy) filter.order = $props.sortBy; if ($props.sortBy) filter.order = $props.sortBy;
if ($props.limit) filter.limit = $props.limit; if ($props.limit) filter.limit = $props.limit;
@ -54,6 +54,7 @@ async function fetch(fetchFilter = {}) {
}); });
emit('onFetch', data); emit('onFetch', data);
return data;
} catch (e) { } catch (e) {
// //
} }

View File

@ -75,9 +75,12 @@ onMounted(async () => {
await fetch(); await fetch();
} }
// Disparamos el watcher del form después de que se haya cargado la data inicial, si así se desea // Si así se desea disparamos el watcher del form después de 100ms, asi darle tiempo de que se haya cargado la data inicial
// para evitar que detecte cambios cuando es data inicial default
if ($props.observeFormChanges) { if ($props.observeFormChanges) {
startFormWatcher(); setTimeout(() => {
startFormWatcher();
}, 100);
} }
}); });

View File

@ -0,0 +1,81 @@
<script setup>
import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import FormModelPopup from './FormModelPopup.vue';
const emit = defineEmits(['onDataSaved']);
const props = defineProps({
itemFk: {
type: Number,
default: null,
},
warehouseFk: {
type: Boolean,
default: null,
},
});
const { t } = useI18n();
const regularizeFormData = reactive({
itemFk: props.itemFk,
warehouseFk: props.warehouseFk,
quantity: null,
});
const warehousesOptions = ref([]);
const onDataSaved = (data) => {
emit('onDataSaved', data);
};
</script>
<template>
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
auto-load
/>
<FormModelPopup
url-create="Items/regularize"
model="Items"
:title="t('Regularize stock')"
:form-initial-data="regularizeFormData"
@on-data-saved="onDataSaved($event)"
>
<template #form-inputs="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QInput
:label="t('Type the visible quantity')"
v-model.number="data.quantity"
/>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Warehouse')"
v-model="data.warehouseFk"
:options="warehousesOptions"
option-value="id"
option-label="name"
hide-selected
/>
</div>
</VnRow>
</template>
</FormModelPopup>
</template>
<i18n>
es:
Warehouse: Almacén
Type the visible quantity: Introduce la cantidad visible
Regularize stock: Regularizar stock
</i18n>

View File

@ -1,8 +1,8 @@
<script setup> <script setup>
import {computed, ref} from 'vue'; import { computed, ref } from 'vue';
import { toHour} from 'src/filters'; import { toHour } from 'src/filters';
import {useI18n} from "vue-i18n"; import { useI18n } from 'vue-i18n';
import isValidDate from "filters/isValidDate"; import isValidDate from 'filters/isValidDate';
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
@ -25,9 +25,14 @@ const value = computed({
return props.modelValue; return props.modelValue;
}, },
set(value) { set(value) {
const [hours, minutes] = value.split(':') const [hours, minutes] = value.split(':');
const date = new Date() const date = new Date();
date.setUTCHours(Number.parseInt(hours) || 0, Number.parseInt(minutes) || 0, 0, 0) date.setUTCHours(
Number.parseInt(hours) || 0,
Number.parseInt(minutes) || 0,
0,
0
);
emit('update:modelValue', value ? date.toISOString() : null); emit('update:modelValue', value ? date.toISOString() : null);
}, },
}); });
@ -40,14 +45,18 @@ const save = () => {
value.value = internalValue.value; value.value = internalValue.value;
}; };
const formatTime = (dateString) => { const formatTime = (dateString) => {
if (!isValidDate(dateString)){ if (!isValidDate(dateString)) {
return '' return '';
} }
const date = new Date(dateString || ''); const date = new Date(dateString || '');
return `${date.getUTCHours().toString().padStart(2, '0')}:${date.getUTCMinutes().toString().padStart(2, '0')}`; return date.toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
});
}; };
const internalValue = ref(formatTime(value)) const internalValue = ref(formatTime(value));
const styleAttrs = computed(() => { const styleAttrs = computed(() => {
return props.isOutlined return props.isOutlined
@ -82,8 +91,19 @@ const styleAttrs = computed(() => {
@update:model-value="onDateUpdate" @update:model-value="onDateUpdate"
> >
<div class="row items-center justify-end q-gutter-sm"> <div class="row items-center justify-end q-gutter-sm">
<QBtn :label="t('Cancel')" color="primary" flat v-close-popup /> <QBtn
<QBtn label="Ok" color="primary" flat @click="save" v-close-popup /> :label="t('Cancel')"
color="primary"
flat
v-close-popup
/>
<QBtn
label="Ok"
color="primary"
flat
@click="save"
v-close-popup
/>
</div> </div>
</QTime> </QTime>
</QPopupProxy> </QPopupProxy>

View File

@ -94,7 +94,7 @@ function handleFetch( data) {
:options="postcodesOptions" :options="postcodesOptions"
:label="t('Location')" :label="t('Location')"
:option-label="showLabel" :option-label="showLabel"
:placeholder="t('Search by postalCode, town, province or country')" :placeholder="t('search_by_postalcode')"
@input-value="locationFilter" @input-value="locationFilter"
:default-filter="false" :default-filter="false"
:input-debounce="300" :input-debounce="300"
@ -129,7 +129,9 @@ function handleFetch( data) {
</style> </style>
<i18n> <i18n>
en:
search_by_postalcode: Search by postalcode, town, province or country
es: es:
Location: Ubicación Location: Ubicación
Search by postalcode, town, province or country: Buscar por código postal, ciudad o país search_by_postalcode: Buscar por código postal, ciudad o país
</i18n> </i18n>

View File

@ -664,6 +664,7 @@ setLogTree();
:label="t('globals.entity')" :label="t('globals.entity')"
v-model="selectedFilters.changedModel" v-model="selectedFilters.changedModel"
option-label="locale" option-label="locale"
option-value="value"
:options="actions" :options="actions"
@update:model-value="selectFilter('action')" @update:model-value="selectFilter('action')"
hide-selected hide-selected

View File

@ -38,28 +38,26 @@ const workers = ref();
minimal minimal
> >
</QDate> </QDate>
<QList dense> <QSeparator />
<QSeparator /> <QItem>
<QItem> <QItemSection v-if="!workers">
<QItemSection v-if="!workers"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="workers">
<QItemSection v-if="workers"> <QSelect
<QSelect :label="t('User')"
:label="t('User')" v-model="params.userFk"
v-model="params.userFk" @update:model-value="searchFn()"
@update:model-value="searchFn()" :options="workers"
:options="workers" option-value="id"
option-value="id" option-label="name"
option-label="name" emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -1,4 +1,6 @@
<script setup> <script setup>
import FetchData from 'src/components/FetchData.vue';
import { onMounted } from 'vue';
import { ref, toRefs, computed, watch } from 'vue'; import { ref, toRefs, computed, watch } from 'vue';
const emit = defineEmits(['update:modelValue', 'update:options']); const emit = defineEmits(['update:modelValue', 'update:options']);
@ -15,6 +17,14 @@ const $props = defineProps({
type: [String], type: [String],
default: '', default: '',
}, },
optionValue: {
type: String,
default: '',
},
url: {
type: String,
default: '',
},
filterOptions: { filterOptions: {
type: [Array], type: [Array],
default: () => [], default: () => [],
@ -27,12 +37,29 @@ const $props = defineProps({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
fields: {
type: Array,
default: null,
},
where: {
type: Object,
default: null,
},
sortBy: {
type: String,
default: null,
},
limit: {
type: Number,
default: 30,
},
}); });
const { optionLabel, options } = toRefs($props); const { optionLabel, optionValue, options, modelValue } = toRefs($props);
const myOptions = ref([]); const myOptions = ref([]);
const myOptionsOriginal = ref([]); const myOptionsOriginal = ref([]);
const vnSelectRef = ref(); const vnSelectRef = ref();
const dataRef = ref();
const value = computed({ const value = computed({
get() { get() {
@ -47,9 +74,12 @@ function setOptions(data) {
myOptions.value = JSON.parse(JSON.stringify(data)); myOptions.value = JSON.parse(JSON.stringify(data));
myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
} }
onMounted(() => {
setOptions(options.value);
if ($props.url && $props.modelValue) fetchFilter($props.modelValue);
});
setOptions(options.value); async function filter(val, options) {
const filter = (val, options) => {
const search = val.toString().toLowerCase(); const search = val.toString().toLowerCase();
if (!search) return options; if (!search) return options;
@ -67,13 +97,29 @@ const filter = (val, options) => {
return id == search || optionLabel.includes(search); return id == search || optionLabel.includes(search);
}); });
}; }
const filterHandler = (val, update) => { async function fetchFilter(val) {
if (!$props.url || !dataRef.value) return;
const { fields, sortBy, limit } = $props;
let key = optionLabel.value;
if (new RegExp(/\d/g).test(val)) key = optionValue.value;
const where = { [key]: { like: `%${val}%` } };
return dataRef.value.fetch({ fields, where, order: sortBy, limit });
}
async function filterHandler(val, update) {
update( update(
() => { async () => {
if ($props.defaultFilter) if (!$props.defaultFilter) return;
myOptions.value = filter(val, myOptionsOriginal.value); if ($props.url) {
myOptions.value = await fetchFilter(val);
return;
}
myOptions.value = await filter(val, myOptionsOriginal.value);
}, },
(ref) => { (ref) => {
if (val !== '' && ref.options.length > 0) { if (val !== '' && ref.options.length > 0) {
@ -82,18 +128,33 @@ const filterHandler = (val, update) => {
} }
} }
); );
}; }
watch(options, (newValue) => { watch(options, (newValue) => {
setOptions(newValue); setOptions(newValue);
}); });
watch(modelValue, (newValue) => {
if (!myOptions.value.some((option) => option[optionValue.value] == newValue))
fetchFilter(newValue);
});
</script> </script>
<template> <template>
<FetchData
ref="dataRef"
:url="$props.url"
@on-fetch="(data) => setOptions(data)"
:where="where || { [optionValue]: value }"
:limit="limit"
:order-by="orderBy"
:fields="fields"
/>
<QSelect <QSelect
v-model="value" v-model="value"
:options="myOptions" :options="myOptions"
:option-label="optionLabel" :option-label="optionLabel"
:option-value="optionValue"
v-bind="$attrs" v-bind="$attrs"
emit-value emit-value
map-options map-options
@ -117,3 +178,9 @@ watch(options, (newValue) => {
</template> </template>
</QSelect> </QSelect>
</template> </template>
<style scoped lang="scss">
.q-field--outlined {
max-width: 100%;
}
</style>

View File

@ -49,7 +49,6 @@ onMounted(async () => {
() => $props.url, () => $props.url,
async (newUrl, lastUrl) => { async (newUrl, lastUrl) => {
if (newUrl == lastUrl) return; if (newUrl == lastUrl) return;
entity.value = null;
await getData(); await getData();
} }
); );
@ -62,7 +61,6 @@ async function getData() {
skip: 0, skip: 0,
}); });
const { data } = await arrayData.fetch({ append: false, updateRouter: false }); const { data } = await arrayData.fetch({ append: false, updateRouter: false });
entity.value = data;
emit('onFetch', data); emit('onFetch', data);
} }
const emit = defineEmits(['onFetch']); const emit = defineEmits(['onFetch']);

View File

@ -220,7 +220,9 @@ function formatValue(value) {
</QItem> </QItem>
<QSeparator /> <QSeparator />
</QList> </QList>
<slot name="body" :params="userParams" :search-fn="search"></slot> <QList dense class="list q-gutter-y-sm q-mt-sm">
<slot name="body" :params="userParams" :search-fn="search"></slot>
</QList>
<template v-if="props.searchButton"> <template v-if="props.searchButton">
<QItem> <QItem>
<QItemSection class="q-py-sm"> <QItemSection class="q-py-sm">
@ -246,6 +248,12 @@ function formatValue(value) {
/> />
</template> </template>
<style scoped lang="scss">
.list {
width: 256px;
}
</style>
<i18n> <i18n>
es: es:
No filters applied: No se han aplicado filtros No filters applied: No se han aplicado filtros

View File

@ -1,6 +1,7 @@
<script setup> <script setup>
import { onMounted, onUnmounted, ref } from 'vue'; import { onMounted, onUnmounted } from 'vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
const stateStore = useStateStore(); const stateStore = useStateStore();
onMounted(() => { onMounted(() => {
@ -13,9 +14,25 @@ onUnmounted(() => {
</script> </script>
<template> <template>
<QToolbar class="bg-vn-dark justify-end"> <QToolbar class="bg-vn-dark justify-end sticky">
<div id="st-data"></div> <slot name="st-data">
<div id="st-data"></div>
</slot>
<QSpace /> <QSpace />
<div id="st-actions"></div> <slot name="st-actions">
<div id="st-actions"></div>
</slot>
</QToolbar> </QToolbar>
</template> </template>
<style lang="scss" scoped>
.sticky {
position: sticky;
top: 61px;
z-index: 1;
}
@media (max-width: $breakpoint-sm) {
.sticky {
top: 90px;
}
}
</style>

View File

@ -4,5 +4,5 @@ import { useI18n } from 'vue-i18n';
export function tMobile(...args) { export function tMobile(...args) {
const quasar = useQuasar(); const quasar = useQuasar();
const { t } = useI18n(); const { t } = useI18n();
if (!quasar.platform.is.mobile) return t(...args); if (!quasar.screen.xs) return t(...args);
} }

View File

@ -56,12 +56,21 @@ body.body--dark {
color: var(--vn-text); color: var(--vn-text);
} }
.color-vn-white {
color: $white;
}
.vn-card { .vn-card {
background-color: var(--vn-gray); background-color: var(--vn-gray);
color: var(--vn-text); color: var(--vn-text);
border-radius: 8px; border-radius: 8px;
} }
.vn-card-list {
width: 100%;
max-width: 60em;
}
/* Estilo para el asterisco en campos requeridos */ /* Estilo para el asterisco en campos requeridos */
.q-field.required .q-field__label:after { .q-field.required .q-field__label:after {
content: ' *'; content: ' *';

View File

@ -4,13 +4,8 @@ export default function toHour(date) {
if (!isValidDate(date)) { if (!isValidDate(date)) {
return '--:--'; return '--:--';
} }
const dateHour = new Date(date); return (new Date(date || '')).toLocaleTimeString([], {
let hours = dateHour.getUTCHours(); hour: '2-digit',
hours = hours % 12; minute: '2-digit',
hours = hours ? hours : 12; });
let minutes = dateHour.getUTCMinutes();
minutes = minutes < 10 ? minutes.toString().padStart(2, '0') : minutes;
return `${hours}:${minutes} ${dateHour.getUTCHours() >= 12 ? 'PM' : 'AM'}`;
} }

View File

@ -1096,7 +1096,25 @@ export default {
description: 'Description', description: 'Description',
}, },
}, },
item: {
pageTitles: {
items: 'Items',
list: 'List',
diary: 'Diary',
tags: 'Tags',
},
descriptor: {
item: 'Item',
buyer: 'Buyer',
color: 'Color',
category: 'Category',
stems: 'Stems',
visible: 'Visible',
available: 'Available',
warehouseText: 'Calculated on the warehouse of { warehouseName }',
itemDiary: 'Item diary',
},
},
components: { components: {
topbar: {}, topbar: {},
userPanel: { userPanel: {
@ -1120,8 +1138,12 @@ export default {
addToPinned: 'Add to pinned', addToPinned: 'Add to pinned',
removeFromPinned: 'Remove from pinned', removeFromPinned: 'Remove from pinned',
}, },
editPictureForm: {
allowedFilesText: 'Allowed file types: { allowedContentTypes }',
},
VnLv: { VnLv: {
copyText: '{copyValue} has been copied to the clipboard', copyText: '{copyValue} has been copied to the clipboard',
}, },
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789',
}, },
}; };

View File

@ -1096,6 +1096,25 @@ export default {
description: 'Descripción', description: 'Descripción',
}, },
}, },
item: {
pageTitles: {
items: 'Artículos',
list: 'Listado',
diary: 'Histórico',
tags: 'Etiquetas',
},
descriptor: {
item: 'Artículo',
buyer: 'Comprador',
color: 'Color',
category: 'Categoría',
stems: 'Tallos',
visible: 'Visible',
available: 'Disponible',
warehouseText: 'Calculado sobre el almacén de { warehouseName }',
itemDiary: 'Registro de compra-venta',
},
},
components: { components: {
topbar: {}, topbar: {},
userPanel: { userPanel: {
@ -1119,8 +1138,12 @@ export default {
addToPinned: 'Añadir a fijados', addToPinned: 'Añadir a fijados',
removeFromPinned: 'Eliminar de fijados', removeFromPinned: 'Eliminar de fijados',
}, },
editPictureForm: {
allowedFilesText: 'Tipos de archivo permitidos: { allowedContentTypes }',
},
VnLv: { VnLv: {
copyText: '{copyValue} se ha copiado al portapepeles', copyText: '{copyValue} se ha copiado al portapepeles',
}, },
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789',
}, },
}; };

View File

@ -1,27 +1,13 @@
<script setup> <script setup>
import LeftMenu from 'components/LeftMenu.vue'; import LeftMenu from 'components/LeftMenu.vue';
import { getUrl } from 'composables/getUrl';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import ClaimDescriptor from './ClaimDescriptor.vue'; import ClaimDescriptor from './ClaimDescriptor.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute();
const $props = defineProps({
id: {
type: Number,
required: false,
default: null,
},
});
const entityId = computed(() => {
return $props.id || route.params.id;
});
</script> </script>
<template> <template>
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()">

View File

@ -4,12 +4,11 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useArrayData } from 'composables/useArrayData';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useArrayData } from 'composables/useArrayData';
import { toDate, toCurrency, toPercentage } from 'filters/index';
import CrudModel from 'components/CrudModel.vue'; import CrudModel from 'components/CrudModel.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import { toDate, toCurrency, toPercentage } from 'filters/index';
import VnDiscount from 'components/common/vnDiscount.vue'; import VnDiscount from 'components/common/vnDiscount.vue';
import ClaimLinesImport from './ClaimLinesImport.vue'; import ClaimLinesImport from './ClaimLinesImport.vue';
@ -158,23 +157,21 @@ function showImportDialog() {
</script> </script>
<template> <template>
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> <Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()">
<QToolbar> <div class="row q-gutter-md">
<div class="row q-gutter-md"> <div>
<div> {{ t('Amount') }}
{{ t('Amount') }} <QChip :dense="$q.screen.lt.sm">
<QChip :dense="$q.screen.lt.sm"> {{ toCurrency(amount) }}
{{ toCurrency(amount) }} </QChip>
</QChip>
</div>
<QSeparator dark vertical />
<div>
{{ t('Amount Claimed') }}
<QChip color="positive" :dense="$q.screen.lt.sm">
{{ toCurrency(amountClaimed) }}
</QChip>
</div>
</div> </div>
</QToolbar> <QSeparator dark vertical />
<div>
{{ t('Amount Claimed') }}
<QChip color="positive" :dense="$q.screen.lt.sm">
{{ toCurrency(amountClaimed) }}
</QChip>
</div>
</div>
</Teleport> </Teleport>
<FetchData <FetchData

View File

@ -36,123 +36,122 @@ const states = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="list"> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('Customer ID')"
:label="t('Customer ID')" v-model="params.clientFk"
v-model="params.clientFk" lazy-rules
lazy-rules is-outlined
is-outlined >
> <template #prepend>
<template #prepend> <QIcon name="badge" size="xs"></QIcon> </template
<QIcon name="badge" size="xs"></QIcon> </template ></VnInput>
></VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-mb-sm">
<QItem class="q-mb-sm"> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('Client Name')"
:label="t('Client Name')" v-model="params.clientName"
v-model="params.clientName" lazy-rules
lazy-rules is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-mb-sm">
<QItem class="q-mb-sm"> <QItemSection v-if="!workers">
<QItemSection v-if="!workers"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="workers">
<QItemSection v-if="workers"> <VnSelectFilter
<VnSelectFilter :label="t('Salesperson')"
:label="t('Salesperson')" v-model="params.salesPersonFk"
v-model="params.salesPersonFk" @update:model-value="searchFn()"
@update:model-value="searchFn()" :options="workers"
:options="workers" option-value="id"
option-value="id" option-label="name"
option-label="name" emit-value
emit-value map-options
map-options use-input
use-input hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-mb-sm">
<QItem class="q-mb-sm"> <QItemSection v-if="!workers">
<QItemSection v-if="!workers"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="workers">
<QItemSection v-if="workers"> <VnSelectFilter
<VnSelectFilter :label="t('Attender')"
:label="t('Attender')" v-model="params.attenderFk"
v-model="params.attenderFk" @update:model-value="searchFn()"
@update:model-value="searchFn()" :options="workers"
:options="workers" option-value="id"
option-value="id" option-label="name"
option-label="name" emit-value
emit-value map-options
map-options use-input
use-input hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-mb-sm">
<QItem class="q-mb-sm"> <QItemSection v-if="!workers">
<QItemSection v-if="!workers"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="workers">
<QItemSection v-if="workers"> <VnSelectFilter
<VnSelectFilter :label="t('Responsible')"
:label="t('Responsible')" v-model="params.claimResponsibleFk"
v-model="params.claimResponsibleFk" @update:model-value="searchFn()"
@update:model-value="searchFn()" :options="workers"
:options="workers" option-value="id"
option-value="id" option-label="name"
option-label="name" emit-value
emit-value map-options
map-options use-input
use-input hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-mb-sm">
<QItem class="q-mb-sm"> <QItemSection v-if="!states">
<QItemSection v-if="!states"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="states">
<QItemSection v-if="states"> <VnSelectFilter
<VnSelectFilter :label="t('State')"
:label="t('State')" v-model="params.claimStateFk"
v-model="params.claimStateFk" @update:model-value="searchFn()"
@update:model-value="searchFn()" :options="states"
:options="states" option-value="id"
option-value="id" option-label="description"
option-label="description" emit-value
emit-value map-options
map-options hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QSeparator />
<QSeparator /> <QExpansionItem :label="t('More options')" expand-separator>
<QExpansionItem :label="t('More options')" expand-separator> <!-- <QItem>
<!-- <QItem>
<QItemSection> <QItemSection>
<qSelect <qSelect
:label="t('Item')" :label="t('Item')"
@ -168,30 +167,20 @@ const states = ref();
/> />
</QItemSection> </QItemSection>
</QItem> --> </QItem> -->
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInputDate <VnInputDate
v-model="params.created" v-model="params.created"
:label="t('Created')" :label="t('Created')"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
</QExpansionItem> </QExpansionItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -71,7 +71,7 @@ function viewSummary(id) {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="ClaimList" data-key="ClaimList"
url="Claims/filter" url="Claims/filter"
@ -147,13 +147,6 @@ function viewSummary(id) {
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
es: es:
Search claim: Buscar reclamación Search claim: Buscar reclamación

View File

@ -84,7 +84,7 @@ async function remove({ id }) {
</QForm> </QForm>
</QCard> </QCard>
</QPageSticky> </QPageSticky>
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="ClaimRmaList" data-key="ClaimRmaList"
url="ClaimRmas" url="ClaimRmas"
@ -160,7 +160,6 @@ async function remove({ id }) {
padding-top: 156px; padding-top: 156px;
} }
.card-list,
.card { .card {
width: 100%; width: 100%;
max-width: 60em; max-width: 60em;

View File

@ -68,7 +68,13 @@ const getBankEntities = () => {
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnInput :label="t('IBAN')" v-model="data.iban" /> <VnInput :label="t('IBAN')" v-model="data.iban">
<template #append>
<QIcon name="info" class="cursor-info">
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
</QIcon>
</template>
</VnInput>
</div> </div>
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectCreate

View File

@ -37,153 +37,134 @@ const zones = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="list"> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection>
<VnInput :label="t('FI')" v-model="params.fi" is-outlined>
<template #prepend>
<QIcon name="badge" size="xs" />
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection>
<VnInput :label="t('Name')" v-model="params.name" is-outlined />
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection>
<VnInput
:label="t('Social Name')"
v-model="params.socialName"
is-outlined
/>
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection v-if="!workers">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="workers">
<VnSelectFilter
:label="t('Salesperson')"
v-model="params.salesPersonFk"
@update:model-value="searchFn()"
:options="workers"
option-value="id"
option-label="name"
emit-value
map-options
use-input
hide-selected
dense
outlined
rounded
:input-debounce="0"
/>
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection v-if="!provinces">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="provinces">
<VnSelectFilter
:label="t('Province')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provinces"
option-value="id"
option-label="name"
emit-value
map-options
hide-selected
dense
outlined
rounded
:input-debounce="0"
/>
</QItemSection>
</QItem>
<QItem class="q-mb-md">
<QItemSection>
<VnInput :label="t('City')" v-model="params.city" is-outlined />
</QItemSection>
</QItem>
<QSeparator />
<QExpansionItem :label="t('More options')" expand-separator>
<QItem>
<QItemSection> <QItemSection>
<VnInput :label="t('FI')" v-model="params.fi" is-outlined> <VnInput :label="t('Phone')" v-model="params.phone" is-outlined>
<template #prepend> <template #prepend>
<QIcon name="badge" size="xs" /> <QIcon name="phone" size="xs" />
</template> </template>
</VnInput> </VnInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem>
<QItemSection> <QItemSection>
<VnInput :label="t('Name')" v-model="params.name" is-outlined /> <VnInput :label="t('Email')" v-model="params.email" is-outlined>
<template #prepend>
<QIcon name="email" size="sm" />
</template>
</VnInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem>
<QItemSection v-if="!zones">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="zones">
<VnSelectFilter
:label="t('Zone')"
v-model="params.zoneFk"
@update:model-value="searchFn()"
:options="zones"
option-value="id"
option-label="name"
emit-value
map-options
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('Social Name')" :label="t('Postcode')"
v-model="params.socialName" v-model="params.postcode"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> </QExpansionItem>
<QItemSection v-if="!workers">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="workers">
<VnSelectFilter
:label="t('Salesperson')"
v-model="params.salesPersonFk"
@update:model-value="searchFn()"
:options="workers"
option-value="id"
option-label="name"
emit-value
map-options
use-input
hide-selected
dense
outlined
rounded
:input-debounce="0"
/>
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection v-if="!provinces">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="provinces">
<VnSelectFilter
:label="t('Province')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provinces"
option-value="id"
option-label="name"
emit-value
map-options
hide-selected
dense
outlined
rounded
:input-debounce="0"
/>
</QItemSection>
</QItem>
<QItem class="q-mb-md">
<QItemSection>
<VnInput :label="t('City')" v-model="params.city" is-outlined />
</QItemSection>
</QItem>
<QSeparator />
<QExpansionItem :label="t('More options')" expand-separator>
<QItem>
<QItemSection>
<VnInput
:label="t('Phone')"
v-model="params.phone"
is-outlined
>
<template #prepend>
<QIcon name="phone" size="xs" />
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('Email')"
v-model="params.email"
is-outlined
>
<template #prepend>
<QIcon name="email" size="sm" />
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!zones">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="zones">
<VnSelectFilter
:label="t('Zone')"
v-model="params.zoneFk"
@update:model-value="searchFn()"
:options="zones"
option-value="id"
option-label="name"
emit-value
map-options
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('Postcode')"
v-model="params.postcode"
is-outlined
/>
</QItemSection>
</QItem>
</QExpansionItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -65,7 +65,7 @@ const redirectToCreateView = () => {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
auto-load auto-load
data-key="CustomerList" data-key="CustomerList"
@ -116,13 +116,6 @@ const redirectToCreateView = () => {
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
es: es:
Search customer: Buscar cliente Search customer: Buscar cliente

View File

@ -11,6 +11,7 @@ import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue';
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue'; import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue'; import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
const { t } = useI18n(); const { t } = useI18n();
@ -186,8 +187,8 @@ const refreshData = () => {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QToolbar class="bg-vn-dark"> <VnSubToolbar class="bg-vn-dark">
<div id="st-data" class="row"> <template #st-data>
<CustomerBalanceDueTotal :amount="balanceDueTotal" /> <CustomerBalanceDueTotal :amount="balanceDueTotal" />
<div class="flex items-center q-ml-lg"> <div class="flex items-center q-ml-lg">
<QBtn <QBtn
@ -197,8 +198,8 @@ const refreshData = () => {
@click.stop="viewAddObservation(selected)" @click.stop="viewAddObservation(selected)"
/> />
</div> </div>
</div> </template>
</QToolbar> </VnSubToolbar>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable

View File

@ -46,163 +46,148 @@ const authors = ref();
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense class="list"> <QItem class="q-mb-sm q-mt-sm">
<QItem class="q-mb-sm q-mt-sm"> <QItemSection v-if="clients">
<QItemSection v-if="clients"> <VnSelectFilter
<VnSelectFilter :input-debounce="0"
:input-debounce="0" :label="t('Client')"
:label="t('Client')" :options="clients"
:options="clients" dense
dense emit-value
emit-value hide-selected
hide-selected map-options
map-options option-label="name"
option-label="name" option-value="clientTypeFk"
option-value="clientTypeFk" outlined
outlined rounded
rounded use-input
use-input v-model="params.clientFk"
v-model="params.clientFk" />
/> </QItemSection>
</QItemSection> <QItemSection v-else>
<QItemSection v-else> <QSkeleton class="full-width" type="QInput" />
<QSkeleton class="full-width" type="QInput" /> </QItemSection>
</QItemSection> </QItem>
</QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection v-if="salespersons"> <QItemSection v-if="salespersons">
<VnSelectFilter <VnSelectFilter
:input-debounce="0" :input-debounce="0"
:label="t('Salesperson')" :label="t('Salesperson')"
:options="salespersons" :options="salespersons"
dense dense
emit-value emit-value
hide-selected hide-selected
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"
outlined outlined
rounded rounded
use-input use-input
v-model="params.salesPersonFk" v-model="params.salesPersonFk"
/> />
</QItemSection> </QItemSection>
<QItemSection v-else> <QItemSection v-else>
<QSkeleton class="full-width" type="QInput" /> <QSkeleton class="full-width" type="QInput" />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection v-if="countries"> <QItemSection v-if="countries">
<VnSelectFilter <VnSelectFilter
:input-debounce="0" :input-debounce="0"
:label="t('Country')" :label="t('Country')"
:options="countries" :options="countries"
dense dense
emit-value emit-value
hide-selected hide-selected
map-options map-options
option-label="country" option-label="country"
option-value="id" option-value="id"
outlined outlined
rounded rounded
use-input use-input
v-model="params.countryFk" v-model="params.countryFk"
/> />
</QItemSection> </QItemSection>
<QItemSection v-else> <QItemSection v-else>
<QSkeleton class="full-width" type="QInput" /> <QSkeleton class="full-width" type="QInput" />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('P. Method')" :label="t('P. Method')"
is-outlined is-outlined
v-model="params.paymentMethod" v-model="params.paymentMethod"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('Balance D.')" :label="t('Balance D.')"
is-outlined is-outlined
v-model="params.balance" v-model="params.balance"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection v-if="authors"> <QItemSection v-if="authors">
<VnSelectFilter <VnSelectFilter
:input-debounce="0" :input-debounce="0"
:label="t('Author')" :label="t('Author')"
:options="authors" :options="authors"
dense dense
emit-value emit-value
hide-selected hide-selected
map-options map-options
option-label="name" option-label="name"
option-value="id" option-value="id"
outlined outlined
rounded rounded
use-input use-input
v-model="params.workerFk" v-model="params.workerFk"
/> />
</QItemSection> </QItemSection>
<QItemSection v-else> <QItemSection v-else>
<QSkeleton class="full-width" type="QInput" /> <QSkeleton class="full-width" type="QInput" />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection> <QItemSection>
<VnInput <VnInput :label="t('L. O. Date')" is-outlined v-model="params.date" />
:label="t('L. O. Date')" </QItemSection>
is-outlined </QItem>
v-model="params.date"
/>
</QItemSection>
</QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('Credit I.')" :label="t('Credit I.')"
is-outlined is-outlined
v-model="params.credit" v-model="params.credit"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection> <QItemSection>
<VnInputDate <VnInputDate
:label="t('From')" :label="t('From')"
is-outlined is-outlined
v-model="params.defaulterSinced" v-model="params.defaulterSinced"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QSeparator /> <QSeparator />
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -14,6 +14,7 @@ import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorP
import CustomerExtendedListActions from './CustomerExtendedListActions.vue'; import CustomerExtendedListActions from './CustomerExtendedListActions.vue';
import CustomerExtendedListFilter from './CustomerExtendedListFilter.vue'; import CustomerExtendedListFilter from './CustomerExtendedListFilter.vue';
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue'; import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
@ -495,9 +496,8 @@ const selectSalesPersonId = (id) => {
/> />
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<VnSubToolbar>
<QToolbar class="bg-vn-dark"> <template #st-actions>
<div id="st-data">
<TableVisibleColumns <TableVisibleColumns
:all-columns="allColumnNames" :all-columns="allColumnNames"
table-code="clientsDetail" table-code="clientsDetail"
@ -506,10 +506,8 @@ const selectSalesPersonId = (id) => {
visibleColumns = ['customerStatus', ...$event, 'actions'] visibleColumns = ['customerStatus', ...$event, 'actions']
" "
/> />
</div> </template>
<QSpace /> </VnSubToolbar>
<div id="st-actions"></div>
</QToolbar>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable

View File

@ -145,27 +145,26 @@ const shouldRenderColumn = (colName) => {
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="list q-gutter-y-sm q-mt-sm"> <QItem v-if="shouldRenderColumn('id')">
<QItem v-if="shouldRenderColumn('id')"> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('customer.extendedList.tableVisibleColumns.id')"
:label="t('customer.extendedList.tableVisibleColumns.id')" v-model="params.id"
v-model="params.id" is-outlined
is-outlined clearable
clearable />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem v-if="shouldRenderColumn('name')">
<QItem v-if="shouldRenderColumn('name')"> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('customer.extendedList.tableVisibleColumns.name')"
:label="t('customer.extendedList.tableVisibleColumns.name')" v-model="params.name"
v-model="params.name" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <!-- <QItem class="q-mb-sm">
<!-- <QItem class="q-mb-sm">
<QItemSection v-if="!clients"> <QItemSection v-if="!clients">
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
@ -188,429 +187,384 @@ const shouldRenderColumn = (colName) => {
/> />
</QItemSection> </QItemSection>
</QItem> --> </QItem> -->
<QItem v-if="shouldRenderColumn('fi')"> <QItem v-if="shouldRenderColumn('fi')">
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('customer.extendedList.tableVisibleColumns.fi')" :label="t('customer.extendedList.tableVisibleColumns.fi')"
v-model="params.fi" v-model="params.fi"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem v-if="shouldRenderColumn('salesPersonFk')"> <QItem v-if="shouldRenderColumn('salesPersonFk')">
<QItemSection v-if="!workers"> <QItemSection v-if="!workers">
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="workers"> <QItemSection v-if="workers">
<VnSelectFilter <VnSelectFilter
:label=" :label="
t( t('customer.extendedList.tableVisibleColumns.salesPersonFk')
'customer.extendedList.tableVisibleColumns.salesPersonFk' "
) v-model="params.salesPersonFk"
" @update:model-value="searchFn()"
v-model="params.salesPersonFk" :options="workers"
@update:model-value="searchFn()" option-value="id"
:options="workers" option-label="name"
option-value="id" emit-value
option-label="name" map-options
emit-value use-input
map-options hide-selected
use-input dense
hide-selected outlined
dense rounded
outlined :input-debounce="0"
rounded />
:input-debounce="0" </QItemSection>
/> </QItem>
</QItemSection> <QItem v-if="shouldRenderColumn('credit')">
</QItem> <QItemSection>
<QItem v-if="shouldRenderColumn('credit')"> <VnInput
<QItemSection> :label="t('customer.extendedList.tableVisibleColumns.credit')"
<VnInput v-model="params.credit"
:label="t('customer.extendedList.tableVisibleColumns.credit')" is-outlined
v-model="params.credit" />
is-outlined </QItemSection>
/> </QItem>
</QItemSection> <QItem v-if="shouldRenderColumn('creditInsurance')">
</QItem> <QItemSection>
<QItem v-if="shouldRenderColumn('creditInsurance')"> <VnInput
<QItemSection> :label="
<VnInput t('customer.extendedList.tableVisibleColumns.creditInsurance')
:label=" "
t( v-model="params.creditInsurance"
'customer.extendedList.tableVisibleColumns.creditInsurance' is-outlined
) />
" </QItemSection>
v-model="params.creditInsurance" </QItem>
is-outlined <QItem v-if="shouldRenderColumn('phone')">
/> <QItemSection>
</QItemSection> <VnInput
</QItem> :label="t('customer.extendedList.tableVisibleColumns.phone')"
<QItem v-if="shouldRenderColumn('phone')"> v-model="params.phone"
<QItemSection> is-outlined
<VnInput />
:label="t('customer.extendedList.tableVisibleColumns.phone')" </QItemSection>
v-model="params.phone" </QItem>
is-outlined <QItem v-if="shouldRenderColumn('mobile')">
/> <QItemSection>
</QItemSection> <VnInput
</QItem> :label="t('customer.extendedList.tableVisibleColumns.mobile')"
<QItem v-if="shouldRenderColumn('mobile')"> v-model="params.mobile"
<QItemSection> is-outlined
<VnInput />
:label="t('customer.extendedList.tableVisibleColumns.mobile')" </QItemSection>
v-model="params.mobile" </QItem>
is-outlined <QItem v-if="shouldRenderColumn('street')">
/> <QItemSection>
</QItemSection> <VnInput
</QItem> :label="t('customer.extendedList.tableVisibleColumns.street')"
<QItem v-if="shouldRenderColumn('street')"> v-model="params.street"
<QItemSection> is-outlined
<VnInput />
:label="t('customer.extendedList.tableVisibleColumns.street')" </QItemSection>
v-model="params.street" </QItem>
is-outlined <QItem v-if="shouldRenderColumn('countryFk')">
/> <QItemSection>
</QItemSection> <VnSelectFilter
</QItem> :label="t('customer.extendedList.tableVisibleColumns.countryFk')"
<QItem v-if="shouldRenderColumn('countryFk')"> v-model="params.countryFk"
<QItemSection> @update:model-value="searchFn()"
<VnSelectFilter :options="countriesOptions"
:label=" option-value="id"
t('customer.extendedList.tableVisibleColumns.countryFk') option-label="country"
" map-options
v-model="params.countryFk" hide-selected
@update:model-value="searchFn()" dense
:options="countriesOptions" outlined
option-value="id" rounded
option-label="country" />
map-options </QItemSection>
hide-selected </QItem>
dense <QItem v-if="shouldRenderColumn('provinceFk')">
outlined <QItemSection>
rounded <VnSelectFilter
/> :label="t('customer.extendedList.tableVisibleColumns.provinceFk')"
</QItemSection> v-model="params.provinceFk"
</QItem> @update:model-value="searchFn()"
<QItem v-if="shouldRenderColumn('provinceFk')"> :options="provincesOptions"
<QItemSection> option-value="id"
<VnSelectFilter option-label="name"
:label=" map-options
t('customer.extendedList.tableVisibleColumns.provinceFk') hide-selected
" dense
v-model="params.provinceFk" outlined
@update:model-value="searchFn()" rounded
:options="provincesOptions" />
option-value="id" </QItemSection>
option-label="name" </QItem>
map-options <QItem v-if="shouldRenderColumn('city')">
hide-selected <QItemSection>
dense <VnInput
outlined :label="t('customer.extendedList.tableVisibleColumns.city')"
rounded v-model="params.city"
/> is-outlined
</QItemSection> />
</QItem> </QItemSection>
<QItem v-if="shouldRenderColumn('city')"> </QItem>
<QItemSection> <QItem v-if="shouldRenderColumn('postcode')">
<VnInput <QItemSection>
:label="t('customer.extendedList.tableVisibleColumns.city')" <VnInput
v-model="params.city" :label="t('customer.extendedList.tableVisibleColumns.postcode')"
is-outlined v-model="params.postcode"
/> is-outlined
</QItemSection> />
</QItem> </QItemSection>
<QItem v-if="shouldRenderColumn('postcode')"> </QItem>
<QItemSection> <QItem v-if="shouldRenderColumn('email')">
<VnInput <QItemSection>
:label=" <VnInput
t('customer.extendedList.tableVisibleColumns.postcode') :label="t('customer.extendedList.tableVisibleColumns.email')"
" v-model="params.email"
v-model="params.postcode" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
<QItem v-if="shouldRenderColumn('email')">
<QItemSection>
<VnInput
:label="t('customer.extendedList.tableVisibleColumns.email')"
v-model="params.email"
is-outlined
/>
</QItemSection>
</QItem>
<QItem v-if="shouldRenderColumn('created')"> <QItem v-if="shouldRenderColumn('created')">
<QItemSection> <QItemSection>
<VnInputDate <VnInputDate
v-model="params.created" v-model="params.created"
:label=" :label="t('customer.extendedList.tableVisibleColumns.created')"
t('customer.extendedList.tableVisibleColumns.created') @update:model-value="searchFn()"
" is-outlined
@update:model-value="searchFn()" />
is-outlined </QItemSection>
/> </QItem>
</QItemSection> <QItem v-if="shouldRenderColumn('businessTypeFk')">
</QItem> <QItemSection>
<QItem v-if="shouldRenderColumn('businessTypeFk')"> <VnSelectFilter
<QItemSection> :label="
<VnSelectFilter t('customer.extendedList.tableVisibleColumns.businessTypeFk')
:label=" "
t( v-model="params.businessTypeFk"
'customer.extendedList.tableVisibleColumns.businessTypeFk' :options="businessTypesOptions"
) @update:model-value="searchFn()"
" option-value="code"
v-model="params.businessTypeFk" option-label="description"
:options="businessTypesOptions" map-options
@update:model-value="searchFn()" hide-selected
option-value="code" dense
option-label="description" outlined
map-options rounded
hide-selected />
dense </QItemSection>
outlined </QItem>
rounded <QItem v-if="shouldRenderColumn('payMethodFk')">
/> <QItemSection>
</QItemSection> <VnSelectFilter
</QItem> :label="
<QItem v-if="shouldRenderColumn('payMethodFk')"> t('customer.extendedList.tableVisibleColumns.payMethodFk')
<QItemSection> "
<VnSelectFilter v-model="params.payMethodFk"
:label=" :options="paymethodsOptions"
t('customer.extendedList.tableVisibleColumns.payMethodFk') @update:model-value="searchFn()"
" option-value="id"
v-model="params.payMethodFk" option-label="name"
:options="paymethodsOptions" map-options
@update:model-value="searchFn()" hide-selected
option-value="id" dense
option-label="name" outlined
map-options rounded
hide-selected />
dense </QItemSection>
outlined </QItem>
rounded <QItem v-if="shouldRenderColumn('sageTaxTypeFk')">
/> <QItemSection>
</QItemSection> <VnSelectFilter
</QItem> :label="
<QItem v-if="shouldRenderColumn('sageTaxTypeFk')"> t('customer.extendedList.tableVisibleColumns.sageTaxTypeFk')
<QItemSection> "
<VnSelectFilter v-model="params.sageTaxTypeFk"
:label=" @update:model-value="searchFn()"
t( :options="sageTaxTypesOptions"
'customer.extendedList.tableVisibleColumns.sageTaxTypeFk' option-value="id"
) option-label="vat"
" map-options
v-model="params.sageTaxTypeFk" hide-selected
@update:model-value="searchFn()" dense
:options="sageTaxTypesOptions" outlined
option-value="id" rounded
option-label="vat" />
map-options </QItemSection>
hide-selected </QItem>
dense <QItem v-if="shouldRenderColumn('sageTransactionTypeFk')">
outlined <QItemSection>
rounded <VnSelectFilter
/> :label="
</QItemSection> t(
</QItem> 'customer.extendedList.tableVisibleColumns.sageTransactionTypeFk'
<QItem v-if="shouldRenderColumn('sageTransactionTypeFk')"> )
<QItemSection> "
<VnSelectFilter v-model="params.sageTransactionTypeFk"
:label=" @update:model-value="searchFn()"
t( :options="sageTransactionTypesOptions"
'customer.extendedList.tableVisibleColumns.sageTransactionTypeFk' option-value="id"
) option-label="transaction"
" map-options
v-model="params.sageTransactionTypeFk" hide-selected
@update:model-value="searchFn()" dense
:options="sageTransactionTypesOptions" outlined
option-value="id" rounded
option-label="transaction" />
map-options </QItemSection>
hide-selected </QItem>
dense <QItem v-if="shouldRenderColumn('isActive') || shouldRenderColumn('isVies')">
outlined <QItemSection v-if="shouldRenderColumn('isActive')">
rounded <QCheckbox
/> v-model="params.isActive"
</QItemSection> @update:model-value="searchFn()"
</QItem> :label="t('customer.extendedList.tableVisibleColumns.isActive')"
<QItem toggle-indeterminate
v-if="shouldRenderColumn('isActive') || shouldRenderColumn('isVies')" :false-value="undefined"
> />
<QItemSection v-if="shouldRenderColumn('isActive')"> </QItemSection>
<QCheckbox <QItemSection v-if="shouldRenderColumn('isVies')">
v-model="params.isActive" <QCheckbox
@update:model-value="searchFn()" v-model="params.isVies"
:label=" @update:model-value="searchFn()"
t('customer.extendedList.tableVisibleColumns.isActive') :label="t('customer.extendedList.tableVisibleColumns.isVies')"
" toggle-indeterminate
toggle-indeterminate :false-value="undefined"
:false-value="undefined" />
/> </QItemSection>
</QItemSection> </QItem>
<QItemSection v-if="shouldRenderColumn('isVies')"> <QItem
<QCheckbox v-if="
v-model="params.isVies" shouldRenderColumn('isEqualizated') ||
@update:model-value="searchFn()" shouldRenderColumn('isTaxDataChecked')
:label="t('customer.extendedList.tableVisibleColumns.isVies')" "
toggle-indeterminate >
:false-value="undefined" <QItemSection v-if="shouldRenderColumn('isTaxDataChecked')">
/> <QCheckbox
</QItemSection> v-model="params.isTaxDataChecked"
</QItem> @update:model-value="searchFn()"
<QItem :label="
v-if=" t(
shouldRenderColumn('isEqualizated') || 'customer.extendedList.tableVisibleColumns.isTaxDataChecked'
shouldRenderColumn('isTaxDataChecked') )
" "
> toggle-indeterminate
<QItemSection v-if="shouldRenderColumn('isTaxDataChecked')"> :false-value="undefined"
<QCheckbox />
v-model="params.isTaxDataChecked" </QItemSection>
@update:model-value="searchFn()" <QItemSection v-if="shouldRenderColumn('isEqualizated')">
:label=" <QCheckbox
t( v-model="params.isEqualizated"
'customer.extendedList.tableVisibleColumns.isTaxDataChecked' @update:model-value="searchFn()"
) :label="
" t('customer.extendedList.tableVisibleColumns.isEqualizated')
toggle-indeterminate "
:false-value="undefined" toggle-indeterminate
/> :false-value="undefined"
</QItemSection> />
<QItemSection v-if="shouldRenderColumn('isEqualizated')"> </QItemSection>
<QCheckbox </QItem>
v-model="params.isEqualizated" <QItem
@update:model-value="searchFn()" v-if="
:label=" shouldRenderColumn('hasToInvoice') || shouldRenderColumn('isFreezed')
t( "
'customer.extendedList.tableVisibleColumns.isEqualizated' >
) <QItemSection v-if="shouldRenderColumn('isFreezed')">
" <QCheckbox
toggle-indeterminate v-model="params.isFreezed"
:false-value="undefined" @update:model-value="searchFn()"
/> :label="t('customer.extendedList.tableVisibleColumns.isFreezed')"
</QItemSection> toggle-indeterminate
</QItem> :false-value="undefined"
<QItem />
v-if=" </QItemSection>
shouldRenderColumn('hasToInvoice') || <QItemSection v-if="shouldRenderColumn('hasToInvoice')">
shouldRenderColumn('isFreezed') <QCheckbox
" v-model="params.hasToInvoice"
> @update:model-value="searchFn()"
<QItemSection v-if="shouldRenderColumn('isFreezed')"> :label="
<QCheckbox t('customer.extendedList.tableVisibleColumns.hasToInvoice')
v-model="params.isFreezed" "
@update:model-value="searchFn()" toggle-indeterminate
:label=" :false-value="undefined"
t('customer.extendedList.tableVisibleColumns.isFreezed') />
" </QItemSection>
toggle-indeterminate </QItem>
:false-value="undefined" <QItem
/> v-if="
</QItemSection> shouldRenderColumn('isToBeMailed') ||
<QItemSection v-if="shouldRenderColumn('hasToInvoice')"> shouldRenderColumn('hasToInvoiceByAddress')
<QCheckbox "
v-model="params.hasToInvoice" >
@update:model-value="searchFn()" <QItemSection v-if="shouldRenderColumn('hasToInvoiceByAddress')">
:label=" <QCheckbox
t( v-model="params.hasToInvoiceByAddress"
'customer.extendedList.tableVisibleColumns.hasToInvoice' @update:model-value="searchFn()"
) :label="
" t(
toggle-indeterminate 'customer.extendedList.tableVisibleColumns.hasToInvoiceByAddress'
:false-value="undefined" )
/> "
</QItemSection> toggle-indeterminate
</QItem> :false-value="undefined"
<QItem />
v-if=" </QItemSection>
shouldRenderColumn('isToBeMailed') || <QItemSection v-if="shouldRenderColumn('isToBeMailed')">
shouldRenderColumn('hasToInvoiceByAddress') <QCheckbox
" v-model="params.isToBeMailed"
> @update:model-value="searchFn()"
<QItemSection v-if="shouldRenderColumn('hasToInvoiceByAddress')"> :label="
<QCheckbox t('customer.extendedList.tableVisibleColumns.isToBeMailed')
v-model="params.hasToInvoiceByAddress" "
@update:model-value="searchFn()" toggle-indeterminate
:label=" :false-value="undefined"
t( />
'customer.extendedList.tableVisibleColumns.hasToInvoiceByAddress' </QItemSection>
) </QItem>
" <QItem
toggle-indeterminate v-if="shouldRenderColumn('hasLcr') || shouldRenderColumn('hasCoreVnl')"
:false-value="undefined" >
/> <QItemSection v-if="shouldRenderColumn('hasLcr')">
</QItemSection> <QCheckbox
<QItemSection v-if="shouldRenderColumn('isToBeMailed')"> v-model="params.hasLcr"
<QCheckbox @update:model-value="searchFn()"
v-model="params.isToBeMailed" :label="t('customer.extendedList.tableVisibleColumns.hasLcr')"
@update:model-value="searchFn()" toggle-indeterminate
:label=" :false-value="undefined"
t( />
'customer.extendedList.tableVisibleColumns.isToBeMailed' </QItemSection>
) <QItemSection v-if="shouldRenderColumn('hasCoreVnl')">
" <QCheckbox
toggle-indeterminate v-model="params.hasCoreVnl"
:false-value="undefined" @update:model-value="searchFn()"
/> :label="t('customer.extendedList.tableVisibleColumns.hasCoreVnl')"
</QItemSection> toggle-indeterminate
</QItem> :false-value="undefined"
<QItem />
v-if=" </QItemSection>
shouldRenderColumn('hasLcr') || shouldRenderColumn('hasCoreVnl') </QItem>
" <QItem v-if="shouldRenderColumn('hasSepaVnl')">
> <QItemSection>
<QItemSection v-if="shouldRenderColumn('hasLcr')"> <QCheckbox
<QCheckbox v-model="params.hasSepaVnl"
v-model="params.hasLcr" @update:model-value="searchFn()"
@update:model-value="searchFn()" :label="t('customer.extendedList.tableVisibleColumns.hasSepaVnl')"
:label="t('customer.extendedList.tableVisibleColumns.hasLcr')" toggle-indeterminate
toggle-indeterminate :false-value="undefined"
:false-value="undefined" />
/> </QItemSection>
</QItemSection> </QItem>
<QItemSection v-if="shouldRenderColumn('hasCoreVnl')">
<QCheckbox
v-model="params.hasCoreVnl"
@update:model-value="searchFn()"
:label="
t('customer.extendedList.tableVisibleColumns.hasCoreVnl')
"
toggle-indeterminate
:false-value="undefined"
/>
</QItemSection>
</QItem>
<QItem v-if="shouldRenderColumn('hasSepaVnl')">
<QItemSection>
<QCheckbox
v-model="params.hasSepaVnl"
@update:model-value="searchFn()"
:label="
t('customer.extendedList.tableVisibleColumns.hasSepaVnl')
"
toggle-indeterminate
:false-value="undefined"
/>
</QItemSection>
</QItem>
<QSeparator /> <QSeparator />
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
es: es:
Social name: Razón social Social name: Razón social

View File

@ -36,91 +36,80 @@ const clients = ref();
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="list"> <QItem class="q-mb-sm q-mt-sm">
<QItem class="q-mb-sm q-mt-sm"> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('Identifier')"
:label="t('Identifier')" is-outlined
is-outlined v-model="params.identifier"
v-model="params.identifier" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection v-if="!clients"> <QItemSection v-if="!clients">
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="clients"> <QItemSection v-if="clients">
<VnSelectFilter <VnSelectFilter
:input-debounce="0" :input-debounce="0"
:label="t('Social name')" :label="t('Social name')"
:options="clients" :options="clients"
@update:model-value="searchFn()" @update:model-value="searchFn()"
dense dense
emit-value emit-value
hide-selected hide-selected
map-options map-options
option-label="socialName" option-label="socialName"
option-value="socialName" option-value="socialName"
outlined outlined
rounded rounded
use-input use-input
v-model="params.socialName" v-model="params.socialName"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection v-if="!cities"> <QItemSection v-if="!cities">
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="cities"> <QItemSection v-if="cities">
<VnSelectFilter <VnSelectFilter
:input-debounce="0" :input-debounce="0"
:label="t('City')" :label="t('City')"
:options="cities" :options="cities"
@update:model-value="searchFn()" @update:model-value="searchFn()"
dense dense
emit-value emit-value
hide-selected hide-selected
map-options map-options
option-label="name" option-label="name"
option-value="name" option-value="name"
outlined outlined
rounded rounded
use-input use-input
v-model="params.city" v-model="params.city"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection> <QItemSection>
<VnInput :label="t('Phone')" is-outlined v-model="params.phone" /> <VnInput :label="t('Phone')" is-outlined v-model="params.phone" />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection> <QItemSection>
<VnInput :label="t('Email')" is-outlined v-model="params.email" /> <VnInput :label="t('Email')" is-outlined v-model="params.email" />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QSeparator /> <QSeparator />
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -122,7 +122,7 @@ function stateColor(row) {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md customer-payments"> <QPage class="column items-center q-pa-md customer-payments">
<div class="card-list"> <div class="vn-card-list">
<QToolbar class="q-pa-none justify-end"> <QToolbar class="q-pa-none justify-end">
<QBtn <QBtn
@click="arrayData.refresh()" @click="arrayData.refresh()"
@ -278,18 +278,13 @@ function stateColor(row) {
<style lang="scss"> <style lang="scss">
.customer-payments { .customer-payments {
.card-list { .q-table--dense .q-table th:first-child {
width: 100%; padding-left: 0;
max-width: 60em; }
td {
.q-table--dense .q-table th:first-child { max-width: 130px;
padding-left: 0; overflow: hidden;
} text-overflow: ellipsis;
td {
max-width: 130px;
overflow: hidden;
text-overflow: ellipsis;
}
} }
} }
</style> </style>

View File

@ -27,71 +27,60 @@ function isValidNumber(value) {
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense class="q-gutter-y-sm q-mt-sm"> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput :label="t('Order ID')" v-model="params.orderFk" is-outlined>
<VnInput <template #prepend>
:label="t('Order ID')" <QIcon name="vn:basket" size="xs" />
v-model="params.orderFk" </template>
is-outlined </VnInput>
> </QItemSection>
<template #prepend> </QItem>
<QIcon name="vn:basket" size="xs" /> <QItem>
</template> <QItemSection>
</VnInput> <VnInput
</QItemSection> :label="t('Customer ID')"
</QItem> v-model="params.clientFk"
<QItem> is-outlined
<QItemSection> >
<VnInput <template #prepend>
:label="t('Customer ID')" <QIcon name="vn:client" size="xs" />
v-model="params.clientFk" </template>
is-outlined </VnInput>
> </QItemSection>
<template #prepend> </QItem>
<QIcon name="vn:client" size="xs" /> <QItem>
</template> <QItemSection>
</VnInput> <VnInput
</QItemSection> :label="t('Amount')"
</QItem> v-model="params.amount"
<QItem> is-outlined
<QItemSection> @update:model-value="
<VnInput (value) => {
:label="t('Amount')" if (value.includes(','))
v-model="params.amount" params.amount = params.amount.replace(',', '.');
is-outlined }
@update:model-value=" "
(value) => { :rules="[
if (value.includes(',')) (val) => isValidNumber(val) || !val || 'Please type a number',
params.amount = params.amount.replace(',', '.'); ]"
} lazy-rules
" >
:rules="[ <template #prepend>
(val) => <QIcon name="euro" size="sm" />
isValidNumber(val) || !val || 'Please type a number', </template>
]" </VnInput>
lazy-rules </QItemSection>
> </QItem>
<template #prepend>
<QIcon name="euro" size="sm" />
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInputDate <VnInputDate v-model="params.from" :label="t('From')" is-outlined />
v-model="params.from" </QItemSection>
:label="t('From')" <QItemSection>
is-outlined <VnInputDate v-model="params.to" :label="t('To')" is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
<QItemSection>
<VnInputDate v-model="params.to" :label="t('To')" is-outlined />
</QItemSection>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -54,164 +54,153 @@ const suppliersOptions = ref([]);
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense class="list q-gutter-y-sm q-mt-sm"> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.search"
v-model="params.search" :label="t('params.search')"
:label="t('params.search')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.reference"
v-model="params.reference" :label="t('params.reference')"
:label="t('params.reference')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.invoiceNumber"
v-model="params.invoiceNumber" :label="t('params.invoiceNumber')"
:label="t('params.invoiceNumber')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.travelFk"
v-model="params.travelFk" :label="t('params.travelFk')"
:label="t('params.travelFk')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.companyFk')"
:label="t('params.companyFk')" v-model="params.companyFk"
v-model="params.companyFk" :options="companiesOptions"
:options="companiesOptions" option-value="id"
option-value="id" option-label="code"
option-label="code" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.currencyFk')"
:label="t('params.currencyFk')" v-model="params.currencyFk"
v-model="params.currencyFk" :options="currenciesOptions"
:options="currenciesOptions" option-value="id"
option-value="id" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.supplierFk')"
:label="t('params.supplierFk')" v-model="params.supplierFk"
v-model="params.supplierFk" :options="suppliersOptions"
:options="suppliersOptions" option-value="id"
option-value="id" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded >
> <template #option="scope">
<template #option="scope"> <QItem v-bind="scope.itemProps">
<QItem v-bind="scope.itemProps"> <QItemSection>
<QItemSection> <QItemLabel>{{
<QItemLabel>{{ scope.opt?.name + ': ' + scope.opt?.nickname
scope.opt?.name + ': ' + scope.opt?.nickname }}</QItemLabel>
}}</QItemLabel> </QItemSection>
</QItemSection> </QItem>
</QItem> </template>
</template> </VnSelectFilter>
</VnSelectFilter> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate :label="t('params.created')"
:label="t('params.created')" is-outlined
is-outlined v-model="params.created"
v-model="params.created" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate :label="t('params.from')"
:label="t('params.from')" is-outlined
is-outlined v-model="params.from"
v-model="params.from" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate :label="t('params.to')"
:label="t('params.to')" is-outlined
is-outlined v-model="params.to"
v-model="params.to" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QCheckbox
<QCheckbox :label="t('params.isBooked')"
:label="t('params.isBooked')" v-model="params.isBooked"
v-model="params.isBooked" toggle-indeterminate
toggle-indeterminate />
/> </QItemSection>
</QItemSection> <QItemSection>
<QItemSection> <QCheckbox
<QCheckbox :label="t('params.isConfirmed')"
:label="t('params.isConfirmed')" v-model="params.isConfirmed"
v-model="params.isConfirmed" toggle-indeterminate
toggle-indeterminate />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QCheckbox
<QCheckbox :label="t('params.isOrdered')"
:label="t('params.isOrdered')" v-model="params.isOrdered"
v-model="params.isOrdered" toggle-indeterminate
toggle-indeterminate />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -47,7 +47,7 @@ onMounted(async () => {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="EntryList" data-key="EntryList"
url="Entries/filter" url="Entries/filter"
@ -128,13 +128,6 @@ onMounted(async () => {
</QPageSticky> </QPageSticky>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
es: es:
Search entries: Buscar entradas Search entries: Buscar entradas

View File

@ -4,11 +4,12 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import { downloadFile } from 'src/composables/downloadFile'; import { downloadFile } from 'src/composables/downloadFile';
import FetchData from 'src/components/FetchData.vue';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import FetchData from 'src/components/FetchData.vue';
import axios from 'axios'; import axios from 'axios';
const quasar = useQuasar(); const quasar = useQuasar();
@ -21,9 +22,6 @@ const arrayData = useArrayData('InvoiceIn');
const invoiceIn = computed(() => arrayData.store.data); const invoiceIn = computed(() => arrayData.store.data);
const userConfig = ref(null); const userConfig = ref(null);
const suppliers = ref([]);
const suppliersRef = ref();
const suppliersRefFilter = ref({ fields: ['id', 'nickname'], limit: 30 });
const currencies = ref([]); const currencies = ref([]);
const currenciesRef = ref(); const currenciesRef = ref();
const companies = ref([]); const companies = ref([]);
@ -131,31 +129,13 @@ async function upsert() {
}); });
} }
} }
function supplierRefFilter(val) {
let where = { limit: 30 };
let params = {};
let key = 'nickname';
if (new RegExp(/\d/g).test(val)) {
key = 'id';
}
params = { [key]: { like: `%${val}%` } };
where = Object.assign(where, params);
suppliersRef.value.fetch({ where });
}
</script> </script>
<template> <template>
<FetchData
ref="suppliersRef"
url="Suppliers"
@on-fetch="(data) => (suppliers = data)"
/>
<FetchData <FetchData
ref="currenciesRef" ref="currenciesRef"
url="Currencies" url="Currencies"
:filter="{ fields: ['id', 'code'] }" :filter="{ fields: ['id', 'code'] }"
order="code" sort-by="code"
@on-fetch="(data) => (currencies = data)" @on-fetch="(data) => (currencies = data)"
auto-load auto-load
/> />
@ -163,7 +143,7 @@ function supplierRefFilter(val) {
ref="companiesRef" ref="companiesRef"
url="Companies" url="Companies"
:filter="{ fields: ['id', 'code'] }" :filter="{ fields: ['id', 'code'] }"
order="code" sort-by="code"
@on-fetch="(data) => (companies = data)" @on-fetch="(data) => (companies = data)"
auto-load auto-load
/> />
@ -171,7 +151,7 @@ function supplierRefFilter(val) {
ref="dmsTypesRef" ref="dmsTypesRef"
url="DmsTypes" url="DmsTypes"
:filter="{ fields: ['id', 'name'] }" :filter="{ fields: ['id', 'name'] }"
order="name" sort-by="name"
@on-fetch="(data) => (dmsTypes = data)" @on-fetch="(data) => (dmsTypes = data)"
auto-load auto-load
/> />
@ -179,7 +159,7 @@ function supplierRefFilter(val) {
ref="warehousesRef" ref="warehousesRef"
url="Warehouses" url="Warehouses"
:filter="{ fields: ['id', 'name'] }" :filter="{ fields: ['id', 'name'] }"
order="name" sort-by="name"
@on-fetch="(data) => (warehouses = data)" @on-fetch="(data) => (warehouses = data)"
auto-load auto-load
/> />
@ -199,15 +179,13 @@ function supplierRefFilter(val) {
<div class="row q-gutter-md q-mb-md"> <div class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnSelectFilter <VnSelectFilter
v-if="suppliersRef"
:label="t('supplierFk')" :label="t('supplierFk')"
v-model="data.supplierFk" v-model="data.supplierFk"
:options="suppliers"
option-value="id" option-value="id"
option-label="nickname" option-label="nickname"
:input-debounce="100" url="Suppliers"
@input-value="supplierRefFilter" :fields="['id', 'nickname']"
:default-filter="false" sort-by="nickname"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
@ -418,7 +396,6 @@ function supplierRefFilter(val) {
<div class="row q-gutter-md q-mb-md"> <div class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnSelectFilter <VnSelectFilter
v-if="currenciesRef"
:label="t('Currency')" :label="t('Currency')"
v-model="data.currencyFk" v-model="data.currencyFk"
:options="currencies" :options="currencies"

View File

@ -36,55 +36,121 @@ const suppliersRef = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="list q-gutter-y-sm q-mt-sm"> <QItem>
<QItemSection>
<VnInput
:label="t('Id or Supplier')"
v-model="params.search"
is-outlined
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.supplierRef')"
v-model="params.supplierRef"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="vn:client" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.supplierFk')"
v-model="params.supplierFk"
:options="suppliers"
option-value="id"
option-label="nickname"
@input-value="suppliersRef.fetch()"
dense
outlined
rounded
>
</VnSelectFilter>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.fi')"
v-model="params.fi"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.serialNumber')"
v-model="params.serialNumber"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.serial')"
v-model="params.serial"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('Amount')"
v-model="params.amount"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="euro" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem class="q-mb-md">
<QItemSection>
<QCheckbox
:label="t('params.isBooked')"
v-model="params.isBooked"
@update:model-value="searchFn()"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QExpansionItem :label="t('More options')" expand-separator>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('Id or Supplier')" :label="t('params.awb')"
v-model="params.search" v-model="params.awbCode"
is-outlined
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.supplierRef')"
v-model="params.supplierRef"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="vn:client" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.supplierFk')"
v-model="params.supplierFk"
:options="suppliers"
option-value="id"
option-label="nickname"
@input-value="suppliersRef.fetch()"
dense
outlined
rounded
>
</VnSelectFilter>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.fi')"
v-model="params.fi"
is-outlined is-outlined
lazy-rules lazy-rules
> >
@ -97,126 +163,45 @@ const suppliersRef = ref();
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('params.serialNumber')" :label="t('params.account')"
v-model="params.serialNumber" v-model="params.account"
is-outlined is-outlined
lazy-rules lazy-rules
> >
<template #prepend> <template #prepend>
<QIcon name="badge" size="sm"></QIcon> <QIcon name="person" size="sm" />
</template> </template>
</VnInput> </VnInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInputDate
:label="t('params.serial')" :label="t('From')"
v-model="params.serial" v-model="params.from"
is-outlined is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('Amount')"
v-model="params.amount"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="euro" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem class="q-mb-md">
<QItemSection>
<QCheckbox
:label="t('params.isBooked')"
v-model="params.isBooked"
@update:model-value="searchFn()"
toggle-indeterminate
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QExpansionItem :label="t('More options')" expand-separator> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate :label="t('To')" v-model="params.to" is-outlined />
<VnInput </QItemSection>
:label="t('params.awb')" </QItem>
v-model="params.awbCode" <QItem>
is-outlined <QItemSection>
lazy-rules <VnInputDate
> :label="t('Issued')"
<template #prepend> v-model="params.issued"
<QIcon name="badge" size="sm"></QIcon> is-outlined
</template> />
</VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> </QExpansionItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.account')"
v-model="params.account"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="person" size="sm" />
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('From')"
v-model="params.from"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('To')"
v-model="params.to"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('Issued')"
v-model="params.issued"
is-outlined
/>
</QItemSection>
</QItem>
</QExpansionItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -71,7 +71,7 @@ function viewSummary(id) {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="InvoiceInList" data-key="InvoiceInList"
url="InvoiceIns/filter" url="InvoiceIns/filter"
@ -156,13 +156,6 @@ function viewSummary(id) {
</QPageSticky> </QPageSticky>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
es: es:
Search invoice: Buscar factura emitida Search invoice: Buscar factura emitida

View File

@ -41,95 +41,89 @@ function setWorkers(data) {
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="q-gutter-y-sm q-mt-sm"> <QItem>
<QItemSection>
<VnInput
:label="t('Customer ID')"
v-model="params.clientFk"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput v-model="params.fi" :label="t('FI')" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput :label="t('Amount')" v-model="params.amount" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QInput
:label="t('Min')"
dense
lazy-rules
outlined
rounded
type="number"
v-model.number="params.min"
/>
</QItemSection>
<QItemSection>
<QInput
:label="t('Max')"
dense
lazy-rules
outlined
rounded
type="number"
v-model.number="params.max"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
:label="t('Has PDF')"
@update:model-value="searchFn()"
toggle-indeterminate
v-model="params.hasPdf"
/>
</QItemSection>
</QItem>
<QSeparator />
<QExpansionItem :label="t('More options')" expand-separator>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInputDate
:label="t('Customer ID')" v-model="params.issued"
v-model="params.clientFk" :label="t('Issued')"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput v-model="params.fi" :label="t('FI')" is-outlined /> <VnInputDate
</QItemSection> v-model="params.created"
</QItem> :label="t('Created')"
<QItem>
<QItemSection>
<VnInput
:label="t('Amount')"
v-model="params.amount"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<QInput <VnInputDate
:label="t('Min')" v-model="params.dued"
dense :label="t('Dued')"
lazy-rules is-outlined
outlined
rounded
type="number"
v-model.number="params.min"
/>
</QItemSection>
<QItemSection>
<QInput
:label="t('Max')"
dense
lazy-rules
outlined
rounded
type="number"
v-model.number="params.max"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> </QExpansionItem>
<QItemSection>
<QCheckbox
:label="t('Has PDF')"
@update:model-value="searchFn()"
toggle-indeterminate
v-model="params.hasPdf"
/>
</QItemSection>
</QItem>
<QSeparator />
<QExpansionItem :label="t('More options')" expand-separator>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.issued"
:label="t('Issued')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.created"
:label="t('Created')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.dued"
:label="t('Dued')"
is-outlined
/>
</QItemSection>
</QItem>
</QExpansionItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -11,6 +11,7 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import InvoiceOutFilter from './InvoiceOutFilter.vue'; import InvoiceOutFilter from './InvoiceOutFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue'; import CardList from 'src/components/ui/CardList.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const { t } = useI18n(); const { t } = useI18n();
const selectedCards = ref(new Map()); const selectedCards = ref(new Map());
@ -129,8 +130,8 @@ const downloadCsv = () => {
url="InvoiceOuts/filter" url="InvoiceOuts/filter"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QToolbar class="bg-vn-dark justify-end"> <VnSubToolbar class="bg-vn-dark justify-end">
<div id="st-actions"> <template #st-actions>
<QBtn <QBtn
@click="downloadCsv()" @click="downloadCsv()"
class="q-mr-xl" class="q-mr-xl"
@ -178,10 +179,10 @@ const downloadCsv = () => {
:model-value="selectedCards.size === rows.length" :model-value="selectedCards.size === rows.length"
class="q-mr-md" class="q-mr-md"
/> />
</div> </template>
</QToolbar> </VnSubToolbar>
<div class="flex flex-center q-pa-md"> <div class="flex flex-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<CardList <CardList
:element="row" :element="row"
:id="row.id" :id="row.id"
@ -246,13 +247,6 @@ const downloadCsv = () => {
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
en: en:
searchInvoice: Search issued invoice searchInvoice: Search issued invoice

View File

@ -27,87 +27,83 @@ const props = defineProps({
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense class="q-gutter-y-sm q-mt-sm"> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.from"
v-model="params.from" :label="t('invoiceOut.negativeBases.from')"
:label="t('invoiceOut.negativeBases.from')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.to"
v-model="params.to" :label="t('invoiceOut.negativeBases.to')"
:label="t('invoiceOut.negativeBases.to')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.company"
v-model="params.company" :label="t('invoiceOut.negativeBases.company')"
:label="t('invoiceOut.negativeBases.company')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.country"
v-model="params.country" :label="t('invoiceOut.negativeBases.country')"
:label="t('invoiceOut.negativeBases.country')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
v-model="params.clientId" v-model="params.clientId"
:label="t('invoiceOut.negativeBases.clientId')" :label="t('invoiceOut.negativeBases.clientId')"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
v-model="params.clientSocialName" v-model="params.clientSocialName"
:label="t('invoiceOut.negativeBases.client')" :label="t('invoiceOut.negativeBases.client')"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
v-model="params.amount" v-model="params.amount"
:label="t('invoiceOut.negativeBases.amount')" :label="t('invoiceOut.negativeBases.amount')"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
v-model="params.comercialName" v-model="params.comercialName"
:label="t('invoiceOut.negativeBases.comercial')" :label="t('invoiceOut.negativeBases.comercial')"
is-outlined is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped></style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -0,0 +1,25 @@
<script setup>
import LeftMenu from 'components/LeftMenu.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import ItemDescriptor from './ItemDescriptor.vue';
import { useStateStore } from 'stores/useStateStore';
const stateStore = useStateStore();
</script>
<template>
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
<QScrollArea class="fit">
<ItemDescriptor />
<QSeparator />
<LeftMenu source="card" />
</QScrollArea>
</QDrawer>
<QPageContainer>
<QPage>
<VnSubToolbar />
<div class="q-pa-md"><RouterView></RouterView></div>
</QPage>
</QPageContainer>
</template>

View File

@ -0,0 +1,316 @@
<script setup>
import { computed, ref, onMounted, onUnmounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
import EditPictureForm from 'components/EditPictureForm.vue';
import { useState } from 'src/composables/useState';
import useCardDescription from 'src/composables/useCardDescription';
import { useSession } from 'src/composables/useSession';
import axios from 'axios';
const $props = defineProps({
id: {
type: Number,
required: false,
default: null,
},
summary: {
type: Object,
default: null,
},
dated: {
type: String,
default: null,
},
});
const quasar = useQuasar();
const route = useRoute();
const router = useRouter();
const { t } = useI18n();
const { getToken } = useSession();
const state = useState();
const user = state.getUser();
const entityId = computed(() => {
return $props.id || route.params.id;
});
const image = ref(null);
const regularizeStockFormDialog = ref(null);
const editPhotoFormDialog = ref(null);
const item = ref(null);
const available = ref(null);
const visible = ref(null);
const _warehouseFk = ref(null);
const warehouseText = ref(null);
const warehouseFk = computed({
get() {
return _warehouseFk.value;
},
set(val) {
_warehouseFk.value = val;
if (val) {
updateStock();
getWarehouseName(val);
}
},
});
const showWarehouseIconTooltip = ref(true);
const showEditPhotoForm = ref(false);
onMounted(async () => {
await getItemAvatar();
warehouseFk.value = user.value.warehouseFk;
});
const getItemAvatar = async () => {
const token = getToken();
const timeStamp = `timestamp=${Date.now()}`;
image.value = `/api/Images/catalog/200x200/${entityId.value}/download?access_token=${token}&${timeStamp}`;
};
const data = ref(useCardDescription());
const setData = (entity) => {
if (!entity) return;
data.value = useCardDescription(entity.name, entity.id);
};
const getWarehouseName = async (warehouseFk) => {
try {
showWarehouseIconTooltip.value = false;
const filter = {
where: { id: warehouseFk },
};
const { data } = await axios.get('Warehouses/findOne', { filter });
warehouseText.value = t('item.descriptor.warehouseText', {
warehouseName: data.name,
});
showWarehouseIconTooltip.value = true;
} catch (err) {
console.error('Error finding warehouse');
}
};
const updateStock = async () => {
try {
available.value = null;
visible.value = null;
const params = {
warehouseFk: warehouseFk.value,
dated: $props.dated,
};
const { data } = await axios.get(`Items/${entityId.value}/getVisibleAvailable`, {
params,
});
available.value = data.available;
visible.value = data.visible;
} catch (err) {
console.error('Error updating stock');
}
};
const openRegularizeStockForm = () => {
regularizeStockFormDialog.value.show();
};
const toggleEditPictureForm = () => {
showEditPhotoForm.value = !showEditPhotoForm.value;
};
const cloneItem = async () => {
try {
const { data } = await axios.post(`Items/${entityId.value}/clone`);
router.push({ name: 'ItemTags', params: { id: data.id } });
} catch (err) {
console.error('Error cloning item');
}
};
const openCloneDialog = async () => {
quasar
.dialog({
component: VnConfirm,
componentProps: {
title: t("All it's properties will be copied"),
message: t('Do you want to clone this item?'),
},
})
.onOk(async () => {
await cloneItem();
});
};
</script>
<template>
<CardDescriptor
data-key="ItemData"
module="Item"
:title="data.title"
:subtitle="data.subtitle"
:summary="$props.summary"
:url="`Items/${entityId}/getCard`"
@on-fetch="
(data) => {
item = data;
setData(data);
}
"
>
<template #menu="{}">
<QItem v-ripple clickable @click="openRegularizeStockForm()">
<QItemSection>
{{ t('Regularize stock') }}
<QDialog ref="regularizeStockFormDialog">
<RegularizeStockForm
:item-fk="entityId"
:warehouse-fk="warehouseFk"
@on-data-saved="updateStock()"
/>
</QDialog>
</QItemSection>
</QItem>
<QItem v-ripple clickable @click="openCloneDialog()">
<QItemSection>
{{ t('Clone') }}
</QItemSection>
</QItem>
</template>
<template #before>
<div class="relative-position">
<QImg :src="image" spinner-color="primary" class="photo">
<template #error>
<div
class="absolute-full picture text-center q-pa-md flex flex-center"
>
<div>
<div
class="text-grey-5"
style="opacity: 0.4; font-size: 5vh"
>
<QIcon name="vn:item" />
</div>
<div class="text-grey-5" style="opacity: 0.4">
{{ t('item.descriptor.item') }}
</div>
</div>
</div>
</template>
</QImg>
<QBtn
color="primary"
size="lg"
round
class="edit-photo-btn"
@click="toggleEditPictureForm()"
>
<QIcon name="edit" size="sm" />
<QDialog ref="editPhotoFormDialog" v-model="showEditPhotoForm">
<EditPictureForm
collection="catalog"
:id="entityId"
@close-form="toggleEditPictureForm()"
@on-photo-uploaded="getItemAvatar()"
/>
</QDialog>
</QBtn>
</div>
<div
class="row justify-between items-center full-width bg-primary"
style="height: 54px"
>
<div class="col column items-center">
<span class="text-uppercase color-vn-white" style="font-size: 11px">
{{ t('item.descriptor.visible') }}
</span>
<span class="text-weight-bold text-h5 color-vn-white">{{
visible
}}</span>
</div>
<div
class="col column items-center separation-borders"
style="font-size: 11px"
>
<span class="text-uppercase color-vn-white">
{{ t('item.descriptor.available') }}
</span>
<span class="text-weight-bold text-h5 color-vn-white">{{
available
}}</span>
</div>
<div class="col column items-center justify-center">
<QIcon name="info" class="cursor-pointer color-vn-white" size="md">
<QTooltip>{{ warehouseText }}</QTooltip>
</QIcon>
</div>
</div>
</template>
<template #body="{ entity }">
<VnLv :label="t('item.descriptor.buyer')">
<template #value>
<span class="link">
{{ t('item.descriptor.buyer') }}
<WorkerDescriptorProxy :id="entity.itemType?.worker?.id" />
</span>
</template>
</VnLv>
<VnLv :label="t('item.descriptor.color')" :value="entity.value5"> </VnLv>
<VnLv :label="t('item.descriptor.color')" :value="entity.value6" />
<VnLv :label="t('item.descriptor.stems')" :value="entity.value7" />
</template>
<template #actions="{}">
<QCardActions class="row justify-center">
<QBtn
:to="{ name: 'ItemDiary' }"
size="md"
icon="vn:transaction"
color="primary"
>
<QTooltip>{{ t('item.descriptor.itemDiary') }}</QTooltip>
</QBtn>
</QCardActions>
</template>
</CardDescriptor>
</template>
<i18n>
es:
Regularize stock: Regularizar stock
Clone: Clonar
All it's properties will be copied: Todas sus propiedades serán copiadas
Do you want to clone this item?: ¿Desea clonar este artículo?
</i18n>
<style lang="scss" scoped>
.photo {
height: 256px;
}
.edit-photo-btn {
position: absolute;
right: 12px;
bottom: 12px;
z-index: 1;
cursor: pointer;
}
.separation-borders {
border-left: 1px solid $white;
border-right: 1px solid $white;
}
</style>

View File

@ -0,0 +1,26 @@
<script setup>
import ItemDescriptor from './ItemDescriptor.vue';
import ItemSummaryDialog from './ItemSummaryDialog.vue';
const $props = defineProps({
id: {
type: Number,
required: true,
},
dated: {
type: String,
default: null,
},
});
</script>
<template>
<QPopupProxy>
<ItemDescriptor
v-if="$props.id"
:id="$props.id"
:summary="ItemSummaryDialog"
:dated="dated"
/>
</QPopupProxy>
</template>

View File

@ -0,0 +1 @@
<template>Item diary (CREAR CUANDO SE DESARROLLE EL MODULO DE ITEMS)</template>

View File

@ -0,0 +1 @@
<template>Item summary</template>

View File

@ -0,0 +1,5 @@
<template>
<QDialog
>Item summary dialog (A DESARROLLAR CUANDO SE CREE EL MODULO DE ITEMS)</QDialog
>
</template>

View File

@ -0,0 +1 @@
<template>Item tags (CREAR CUANDO SE DESARROLLE EL MODULO DE ITEMS)</template>

View File

@ -0,0 +1 @@
<template>Item list</template>

View File

@ -0,0 +1,18 @@
<script setup>
import LeftMenu from 'src/components/LeftMenu.vue';
import { useStateStore } from 'stores/useStateStore';
const stateStore = useStateStore();
</script>
<template>
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
<QScrollArea class="fit text-grey-8">
<LeftMenu />
</QScrollArea>
</QDrawer>
<QPageContainer>
<RouterView></RouterView>
</QPageContainer>
</template>

View File

@ -219,183 +219,181 @@ const getCategoryClass = (category, params) => {
</template> </template>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense style="max-width: 256px"> <QItem class="category-filter q-mt-md">
<QItem class="category-filter q-mt-md"> <div
<div v-for="category in categoryList"
v-for="category in categoryList" :key="category.name"
:key="category.name" :class="['category', getCategoryClass(category, params)]"
:class="['category', getCategoryClass(category, params)]"
>
<QIcon
:name="category.icon"
class="category-icon"
@click="selectCategory(params, category, searchFn)"
>
<QTooltip>
{{ t(category.name) }}
</QTooltip>
</QIcon>
</div>
</QItem>
<QItem class="q-my-md">
<QItemSection>
<VnSelectFilter
:label="t('params.type')"
v-model="params.typeFk"
:options="typeList"
option-value="id"
option-label="name"
dense
outlined
rounded
emit-value
use-input
:disable="!selectedCategoryFk"
@update:model-value="
(value) => {
selectedTypeFk = value;
searchFn();
}
"
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel caption>
{{ opt.categoryName }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</QItemSection>
</QItem>
<QSeparator />
<QItem class="q-my-md">
<QItemSection>
<VnSelectFilter
:label="t('params.order')"
v-model="selectedOrder"
:options="orderList || []"
option-value="way"
option-label="name"
dense
outlined
rounded
:emit-value="false"
use-input
:is-clearable="false"
@update:model-value="
(value) => onOrderChange(value, params, searchFn)
"
/>
</QItemSection>
</QItem>
<QItem class="q-mb-md">
<QItemSection>
<VnSelectFilter
:label="t('params.order')"
v-model="selectedOrderField"
:options="OrderFields || []"
option-value="field"
option-label="name"
dense
outlined
rounded
:emit-value="false"
use-input
:is-clearable="false"
@update:model-value="
(value) => onOrderFieldChange(value, params, searchFn)
"
/>
</QItemSection>
</QItem>
<QSeparator />
<QItem class="q-mt-md">
<QItemSection>
<VnSelectFilter
:label="t('params.tag')"
v-model="selectedTag"
:options="props.tags || []"
option-value="id"
option-label="name"
dense
outlined
rounded
:emit-value="false"
use-input
/>
</QItemSection>
</QItem>
<QItem
v-for="(value, index) in tagValues"
:key="value"
class="q-mt-md filter-value"
> >
<VnInput <QIcon
v-if="selectedTag?.isFree" :name="category.icon"
v-model="value.value" class="category-icon"
:label="t('params.value')" @click="selectCategory(params, category, searchFn)"
is-outlined >
class="filter-input" <QTooltip>
/> {{ t(category.name) }}
</QTooltip>
</QIcon>
</div>
</QItem>
<QItem class="q-my-md">
<QItemSection>
<VnSelectFilter <VnSelectFilter
v-else :label="t('params.type')"
:label="t('params.value')" v-model="params.typeFk"
v-model="value.value" :options="typeList"
:options="tagOptions || []" option-value="id"
option-value="value" option-label="name"
option-label="value"
dense dense
outlined outlined
rounded rounded
emit-value emit-value
use-input use-input
:disable="!selectedTag" :disable="!selectedCategoryFk"
class="filter-input" @update:model-value="
(value) => {
selectedTypeFk = value;
searchFn();
}
"
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection>
<QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel caption>
{{ opt.categoryName }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</QItemSection>
</QItem>
<QSeparator />
<QItem class="q-my-md">
<QItemSection>
<VnSelectFilter
:label="t('params.order')"
v-model="selectedOrder"
:options="orderList || []"
option-value="way"
option-label="name"
dense
outlined
rounded
:emit-value="false"
use-input
:is-clearable="false"
@update:model-value="
(value) => onOrderChange(value, params, searchFn)
"
/> />
</QItemSection>
</QItem>
<QItem class="q-mb-md">
<QItemSection>
<VnSelectFilter
:label="t('params.order')"
v-model="selectedOrderField"
:options="OrderFields || []"
option-value="field"
option-label="name"
dense
outlined
rounded
:emit-value="false"
use-input
:is-clearable="false"
@update:model-value="
(value) => onOrderFieldChange(value, params, searchFn)
"
/>
</QItemSection>
</QItem>
<QSeparator />
<QItem class="q-mt-md">
<QItemSection>
<VnSelectFilter
:label="t('params.tag')"
v-model="selectedTag"
:options="props.tags || []"
option-value="id"
option-label="name"
dense
outlined
rounded
:emit-value="false"
use-input
/>
</QItemSection>
</QItem>
<QItem
v-for="(value, index) in tagValues"
:key="value"
class="q-mt-md filter-value"
>
<VnInput
v-if="selectedTag?.isFree"
v-model="value.value"
:label="t('params.value')"
is-outlined
class="filter-input"
/>
<VnSelectFilter
v-else
:label="t('params.value')"
v-model="value.value"
:options="tagOptions || []"
option-value="value"
option-label="value"
dense
outlined
rounded
emit-value
use-input
:disable="!selectedTag"
class="filter-input"
/>
<FetchData <FetchData
v-if="selectedTag && !selectedTag.isFree" v-if="selectedTag && !selectedTag.isFree"
:url="`Tags/${selectedTag?.id}/filterValue`" :url="`Tags/${selectedTag?.id}/filterValue`"
limit="30" limit="30"
auto-load auto-load
@on-fetch="(data) => (tagOptions = data)" @on-fetch="(data) => (tagOptions = data)"
/> />
<QIcon <QIcon
name="delete" name="delete"
class="filter-icon" class="filter-icon"
@click="(tagValues || []).splice(index, 1)" @click="(tagValues || []).splice(index, 1)"
/>
</QItem>
<QItem class="q-mt-lg">
<QIcon
name="add_circle"
class="filter-icon"
@click="tagValues.push({})"
/>
</QItem>
<QItem>
<QItemSection class="q-py-sm">
<QBtn
:label="t('Search')"
class="full-width"
color="primary"
dense
icon="search"
rounded
type="button"
unelevated
:disable="isButtonDisabled"
@click.stop="applyTagFilter(params, searchFn)"
/> />
</QItem> </QItemSection>
<QItem class="q-mt-lg"> </QItem>
<QIcon <QSeparator />
name="add_circle"
class="filter-icon"
@click="tagValues.push({})"
/>
</QItem>
<QItem>
<QItemSection class="q-py-sm">
<QBtn
:label="t('Search')"
class="full-width"
color="primary"
dense
icon="search"
rounded
type="button"
unelevated
:disable="isButtonDisabled"
@click.stop="applyTagFilter(params, searchFn)"
/>
</QItemSection>
</QItem>
<QSeparator />
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -1,10 +1,13 @@
<script setup> <script setup>
import { useSession } from 'composables/useSession';
import VnLv from 'components/ui/VnLv.vue';
import { useI18n } from 'vue-i18n';
import OrderCatalogItemDialog from 'pages/Order/Card/OrderCatalogItemDialog.vue';
import toCurrency from '../../../filters/toCurrency';
import { ref } from 'vue'; import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnLv from 'components/ui/VnLv.vue';
import OrderCatalogItemDialog from 'pages/Order/Card/OrderCatalogItemDialog.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { useSession } from 'composables/useSession';
import toCurrency from '../../../filters/toCurrency';
const DEFAULT_PRICE_KG = 0; const DEFAULT_PRICE_KG = 0;
@ -42,7 +45,10 @@ const dialog = ref(null);
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<span class="link">{{ item.name }}</span> <span class="link">
{{ item.name }}
<ItemDescriptorProxy :id="item.id" />
</span>
<p class="subName">{{ item.subName }}</p> <p class="subName">{{ item.subName }}</p>
<template v-for="index in 4" :key="`tag-${index}`"> <template v-for="index in 4" :key="`tag-${index}`">
<VnLv <VnLv

View File

@ -59,162 +59,152 @@ const sourceList = ref(null);
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList id="orderFilter" dense> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput is-outlined
is-outlined :label="t('customerId')"
:label="t('customerId')" v-model="params.clientFk"
v-model="params.clientFk" lazy-rules
lazy-rules >
> <template #prepend>
<template #prepend> <QIcon name="badge" size="sm"></QIcon>
<QIcon name="badge" size="sm"></QIcon> </template>
</template> </VnInput>
</VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection v-if="agencyList">
<QItemSection v-if="agencyList"> <VnSelectFilter
<VnSelectFilter :label="t('agency')"
:label="t('agency')" v-model="params.agencyModeFk"
v-model="params.agencyModeFk" :options="agencyList"
:options="agencyList" option-value="id"
option-value="id" option-label="name"
option-label="name" dense
dense outlined
outlined rounded
rounded emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> <QItemSection v-else>
<QItemSection v-else> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection v-if="salesPersonList">
<QItemSection v-if="salesPersonList"> <VnSelectFilter
<VnSelectFilter :label="t('salesPerson')"
:label="t('salesPerson')" v-model="params.workerFk"
v-model="params.workerFk" :options="salesPersonList"
:options="salesPersonList" option-value="id"
option-value="id" option-label="name"
option-label="name" dense
dense outlined
outlined rounded
rounded emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" >
> <template #option="{ itemProps, opt }">
<template #option="{ itemProps, opt }"> <QItem v-bind="itemProps">
<QItem v-bind="itemProps"> <QItemSection>
<QItemSection> <QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel>{{ opt.name }}</QItemLabel> <QItemLabel caption>
<QItemLabel caption> {{ opt.nickname }},{{ opt.code }}
{{ opt.nickname }},{{ opt.code }} </QItemLabel>
</QItemLabel> </QItemSection>
</QItemSection> </QItem>
</QItem> </template>
</template> </VnSelectFilter>
</VnSelectFilter> </QItemSection>
</QItemSection> <QItemSection v-else>
<QItemSection v-else> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.from"
v-model="params.from" :label="t('fromLanded')"
:label="t('fromLanded')" dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.to"
v-model="params.to" :label="t('toLanded')"
:label="t('toLanded')" dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('orderId')"
:label="t('orderId')" v-model="params.orderFk"
v-model="params.orderFk" lazy-rules
lazy-rules is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection v-if="sourceList">
<QItemSection v-if="sourceList"> <VnSelectFilter
<VnSelectFilter :label="t('application')"
:label="t('application')" v-model="params.sourceApp"
v-model="params.sourceApp" :options="sourceList"
:options="sourceList" option-label="value"
option-label="value" emit-value
emit-value map-options
map-options use-input
use-input dense
dense outlined
outlined rounded
rounded :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> <QItemSection v-else>
<QItemSection v-else> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QCheckbox
<QCheckbox v-model="params.myTeam"
v-model="params.myTeam" :label="t('myTeam')"
:label="t('myTeam')" toggle-indeterminate
toggle-indeterminate />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QCheckbox
<QCheckbox v-model="params.isConfirmed"
v-model="params.isConfirmed" :label="t('isConfirmed')"
:label="t('isConfirmed')" toggle-indeterminate
toggle-indeterminate />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QCheckbox v-model="params.showEmpty" :label="t('showEmpty')" />
<QCheckbox v-model="params.showEmpty" :label="t('showEmpty')" /> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style lang="scss">
#orderFilter {
.q-item {
padding-top: 8px;
}
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import {onMounted, onUnmounted, ref} from 'vue'; import { onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnPaginate from 'components/ui/VnPaginate.vue'; import VnPaginate from 'components/ui/VnPaginate.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
@ -20,7 +20,7 @@ const catalogParams = {
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }), orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
}; };
const tags = ref([]) const tags = ref([]);
function extractTags(items) { function extractTags(items) {
const resultTags = []; const resultTags = [];
@ -34,7 +34,7 @@ function extractTags(items) {
} }
}); });
}); });
tags.value = resultTags tags.value = resultTags;
} }
</script> </script>
@ -70,7 +70,7 @@ function extractTags(items) {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="full-width">
<VnPaginate <VnPaginate
data-key="OrderCatalogList" data-key="OrderCatalogList"
url="Orders/CatalogFilter" url="Orders/CatalogFilter"
@ -93,10 +93,6 @@ function extractTags(items) {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.card-list {
width: 100%;
}
.catalog-list { .catalog-list {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;

View File

@ -83,7 +83,7 @@ async function confirmOrder() {
auto-load auto-load
/> />
<QPage :key="componentKey" class="column items-center q-pa-md"> <QPage :key="componentKey" class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<div v-if="!orderSummary.total" class="no-result"> <div v-if="!orderSummary.total" class="no-result">
{{ t('globals.noResults') }} {{ t('globals.noResults') }}
</div> </div>
@ -228,11 +228,6 @@ async function confirmOrder() {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
.header { .header {
color: $primary; color: $primary;
font-weight: bold; font-weight: bold;

View File

@ -4,7 +4,7 @@ import { onMounted, onUnmounted } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { toCurrency, toDate } from 'src/filters'; import { toCurrency, toDate } from 'src/filters';
import {useQuasar} from "quasar"; import { useQuasar } from 'quasar';
import CardList from 'components/ui/CardList.vue'; import CardList from 'components/ui/CardList.vue';
import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
@ -12,7 +12,7 @@ import VnPaginate from 'components/ui/VnPaginate.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import OrderSearchbar from 'pages/Order/Card/OrderSearchbar.vue'; import OrderSearchbar from 'pages/Order/Card/OrderSearchbar.vue';
import OrderFilter from 'pages/Order/Card/OrderFilter.vue'; import OrderFilter from 'pages/Order/Card/OrderFilter.vue';
import OrderSummaryDialog from "pages/Order/Card/OrderSummaryDialog.vue"; import OrderSummaryDialog from 'pages/Order/Card/OrderSummaryDialog.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const quasar = useQuasar(); const quasar = useQuasar();
@ -63,7 +63,7 @@ function viewSummary(id) {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="OrderList" data-key="OrderList"
url="Orders/filter" url="Orders/filter"
@ -153,10 +153,3 @@ function viewSummary(id) {
</QPageSticky> </QPageSticky>
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>

View File

@ -35,7 +35,7 @@ const loadVolumes = async (rows) => {
auto-load auto-load
/> />
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<div <div
v-if="!volumeSummary?.totalVolume && !volumeSummary?.totalBoxes" v-if="!volumeSummary?.totalVolume && !volumeSummary?.totalBoxes"
class="no-result" class="no-result"
@ -121,11 +121,6 @@ const loadVolumes = async (rows) => {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
.header { .header {
color: $primary; color: $primary;
font-weight: bold; font-weight: bold;

View File

@ -61,144 +61,142 @@ const warehouseList = ref([]);
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection v-if="workerList">
<QItemSection v-if="workerList"> <VnSelectFilter
<VnSelectFilter :label="t('Worker')"
:label="t('Worker')" v-model="params.workerFk"
v-model="params.workerFk" :options="workerList"
:options="workerList" option-value="id"
option-value="id" option-label="nickname"
option-label="nickname" dense
dense outlined
outlined rounded
rounded emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" >
> <template #option="{ itemProps, opt }">
<template #option="{ itemProps, opt }"> <QItem v-bind="itemProps">
<QItem v-bind="itemProps"> <QItemSection>
<QItemSection> <QItemLabel>{{ opt.name }}</QItemLabel>
<QItemLabel>{{ opt.name }}</QItemLabel> <QItemLabel caption>
<QItemLabel caption> {{ opt.nickname }},{{ opt.code }}
{{ opt.nickname }},{{ opt.code }} </QItemLabel>
</QItemLabel> </QItemSection>
</QItemSection> </QItem>
</QItem> </template>
</template> </VnSelectFilter>
</VnSelectFilter> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection v-if="agencyList">
<QItemSection v-if="agencyList"> <VnSelectFilter
<VnSelectFilter :label="t('Agency')"
:label="t('Agency')" v-model="params.agencyModeFk"
v-model="params.agencyModeFk" :options="agencyList"
:options="agencyList" option-value="id"
option-value="id" option-label="name"
option-label="name" dense
dense outlined
outlined rounded
rounded emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.from"
v-model="params.from" :label="t('From')"
:label="t('From')" is-outlined
is-outlined :disable="Boolean(params.scopeDays)"
:disable="Boolean(params.scopeDays)" @update:model-value="params.scopeDays = null"
@update:model-value="params.scopeDays = null" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.to"
v-model="params.to" :label="t('To')"
:label="t('To')" is-outlined
is-outlined :disable="Boolean(params.scopeDays)"
:disable="Boolean(params.scopeDays)" @update:model-value="params.scopeDays = null"
@update:model-value="params.scopeDays = null" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.scopeDays"
v-model="params.scopeDays" type="number"
type="number" :label="t('Days Onward')"
:label="t('Days Onward')" is-outlined
is-outlined clearable
clearable :disable="Boolean(params.from || params.to)"
:disable="Boolean(params.from || params.to)" @update:model-value="
@update:model-value=" params.to = null;
params.to = null; params.from = null;
params.from = null; "
" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection v-if="vehicleList">
<QItemSection v-if="vehicleList"> <VnSelectFilter
<VnSelectFilter :label="t('Vehicle')"
:label="t('Vehicle')" v-model="params.vehicleFk"
v-model="params.vehicleFk" :options="vehicleList"
:options="vehicleList" option-value="id"
option-value="id" option-label="numberPlate"
option-label="numberPlate" dense
dense outlined
outlined rounded
rounded emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection>
<QItemSection> <VnInput v-model="params.m3" label="m³" is-outlined clearable />
<VnInput v-model="params.m3" label="m³" is-outlined clearable /> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection v-if="vehicleList">
<QItemSection v-if="vehicleList"> <VnSelectFilter
<VnSelectFilter :label="t('Warehouse')"
:label="t('Warehouse')" v-model="params.warehouseFk"
v-model="params.warehouseFk" :options="warehouseList"
:options="warehouseList" option-value="id"
option-value="id" option-label="name"
option-label="name" dense
dense outlined
outlined rounded
rounded emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.description"
v-model="params.description" :label="t('Description')"
:label="t('Description')" is-outlined
is-outlined clearable
clearable />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -198,6 +198,13 @@ const onSave = (data, response) => {
clearable clearable
/> />
</div> </div>
<div class="col flex items-center">
<QCheckbox
size="sm"
v-model="data.isOk"
:label="t('Is served')"
/>
</div>
</VnRow> </VnRow>
</template> </template>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
@ -212,3 +219,15 @@ const onSave = (data, response) => {
</template> </template>
</FormModel> </FormModel>
</template> </template>
<i18n>
es:
Worker: Trabajador
Vehicle: Vehículo
Agency: Agencia
Km Start: Km de inicio
Km End: Km de fin
Hour started: Hora inicio
Hour finished: Hora fin
Description: Descripción
Is served: Se ha servido
</i18n>

View File

@ -28,103 +28,101 @@ const countries = ref();
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense class="q-gutter-y-sm q-mt-sm"> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('route.cmr.list.cmrFk')"
:label="t('route.cmr.list.cmrFk')" v-model="params.cmrFk"
v-model="params.cmrFk" is-outlined
is-outlined >
> <template #prepend>
<template #prepend> <QIcon name="article" size="sm"></QIcon>
<QIcon name="article" size="sm"></QIcon> </template>
</template> </VnInput>
</VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QCheckbox
<QCheckbox :label="t('route.cmr.list.hasCmrDms')"
:label="t('route.cmr.list.hasCmrDms')" v-model="params.hasCmrDms"
v-model="params.hasCmrDms" lazy-rules
lazy-rules />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('route.cmr.list.ticketFk')"
:label="t('route.cmr.list.ticketFk')" v-model="params.ticketFk"
v-model="params.ticketFk" is-outlined
is-outlined >
> <template #prepend>
<template #prepend> <QIcon name="vn:ticket" size="sm"></QIcon>
<QIcon name="vn:ticket" size="sm"></QIcon> </template>
</template> </VnInput>
</VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('route.cmr.list.routeFk')"
:label="t('route.cmr.list.routeFk')" v-model="params.routeFk"
v-model="params.routeFk" is-outlined
is-outlined >
> <template #prepend>
<template #prepend> <QIcon name="vn:delivery" size="sm"></QIcon>
<QIcon name="vn:delivery" size="sm"></QIcon> </template>
</template> </VnInput>
</VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('route.cmr.list.clientFk')"
:label="t('route.cmr.list.clientFk')" v-model="params.clientFk"
v-model="params.clientFk" is-outlined
is-outlined >
> <template #prepend>
<template #prepend> <QIcon name="vn:client" size="sm"></QIcon>
<QIcon name="vn:client" size="sm"></QIcon> </template>
</template> </VnInput>
</VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection v-if="!countries">
<QItemSection v-if="!countries"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="countries" class="q-mb-sm">
<QItemSection v-if="countries" class="q-mb-sm"> <QSelect
<QSelect :label="t('route.cmr.list.country')"
:label="t('route.cmr.list.country')" v-model="params.country"
v-model="params.country" :options="countries"
:options="countries" option-value="country"
option-value="country" option-label="country"
option-label="country" transition-show="jump-down"
transition-show="jump-down" transition-hide="jump-up"
transition-hide="jump-up" emit-value
emit-value map-options
map-options dense
dense outlined
outlined rounded
rounded >
> <template #prepend>
<template #prepend> <QIcon name="flag" size="sm"></QIcon>
<QIcon name="flag" size="sm"></QIcon> </template>
</template> </QSelect>
</QSelect> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.shipped"
v-model="params.shipped" :label="t('route.cmr.list.shipped')"
:label="t('route.cmr.list.shipped')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -15,7 +15,8 @@ import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
import RouteFilter from 'pages/Route/Card/RouteFilter.vue'; import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import RouteSummaryDialog from 'pages/Route/Card/RouteSummaryDialog.vue'; import RouteSummaryDialog from 'pages/Route/Card/RouteSummaryDialog.vue';
import {useSession} from "composables/useSession"; import { useSession } from 'composables/useSession';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
@ -152,8 +153,8 @@ const cloneRoutes = () => {
}; };
const showRouteReport = () => { const showRouteReport = () => {
const ids = selectedRows.value.map(row => row?.id) const ids = selectedRows.value.map((row) => row?.id);
const idString = ids.join(',') const idString = ids.join(',');
let url; let url;
if (selectedRows.value.length <= 1) { if (selectedRows.value.length <= 1) {
@ -161,12 +162,12 @@ const showRouteReport = () => {
} else { } else {
const params = new URLSearchParams({ const params = new URLSearchParams({
access_token: session.getToken(), access_token: session.getToken(),
id: idString id: idString,
}) });
url = `api/Routes/downloadZip?${params.toString()}`; url = `api/Routes/downloadZip?${params.toString()}`;
} }
window.open(url, '_blank'); window.open(url, '_blank');
} };
const markAsServed = () => { const markAsServed = () => {
selectedRows.value.forEach((row) => { selectedRows.value.forEach((row) => {
@ -246,8 +247,8 @@ function previewRoute(id) {
<FetchData url="AgencyModes" @on-fetch="(data) => (agencyList = data)" auto-load /> <FetchData url="AgencyModes" @on-fetch="(data) => (agencyList = data)" auto-load />
<FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load /> <FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load />
<QPage class="column items-center"> <QPage class="column items-center">
<QToolbar class="bg-vn-dark justify-end"> <VnSubToolbar class="bg-vn-dark justify-end">
<div id="st-actions" class="q-pa-sm"> <template #st-actions>
<QBtn <QBtn
icon="vn:clone" icon="vn:clone"
color="primary" color="primary"
@ -275,8 +276,8 @@ function previewRoute(id) {
> >
<QTooltip>{{ t('Mark as served') }}</QTooltip> <QTooltip>{{ t('Mark as served') }}</QTooltip>
</QBtn> </QBtn>
</div> </template>
</QToolbar> </VnSubToolbar>
<div class="route-list"> <div class="route-list">
<VnPaginate <VnPaginate
:key="refreshKey" :key="refreshKey"
@ -297,6 +298,7 @@ function previewRoute(id) {
selection="multiple" selection="multiple"
:rows-per-page-options="[0]" :rows-per-page-options="[0]"
hide-pagination hide-pagination
:pagination="{ sortBy: 'ID', descending: true }"
> >
<template #body-cell-worker="props"> <template #body-cell-worker="props">
<QTd :props="props"> <QTd :props="props">
@ -484,11 +486,12 @@ function previewRoute(id) {
</template> </template>
<template #body-cell-actions="props"> <template #body-cell-actions="props">
<QTd :props="props"> <QTd :props="props">
<div class="table-actions"> <div class="flex items-center table-actions">
<QIcon <QIcon
name="vn:ticketAdd" name="vn:ticketAdd"
size="xs" size="xs"
color="primary" color="primary"
class="cursor-pointer"
> >
<QTooltip>{{ t('Add ticket') }}</QTooltip> <QTooltip>{{ t('Add ticket') }}</QTooltip>
</QIcon> </QIcon>
@ -497,6 +500,7 @@ function previewRoute(id) {
size="xs" size="xs"
color="primary" color="primary"
@click="previewRoute(props?.row?.id)" @click="previewRoute(props?.row?.id)"
class="cursor-pointer"
> >
<QTooltip>{{ t('Preview') }}</QTooltip> <QTooltip>{{ t('Preview') }}</QTooltip>
</QIcon> </QIcon>
@ -525,13 +529,7 @@ function previewRoute(id) {
} }
.table-actions { .table-actions {
display: flex;
align-items: center;
gap: 12px; gap: 12px;
i {
cursor: pointer;
}
} }
</style> </style>
<i18n> <i18n>
@ -554,4 +552,6 @@ es:
Clone: Clonar Clone: Clonar
Mark as served: Marcar como servidas Mark as served: Marcar como servidas
Download selected routes as PDF: Descargar rutas seleccionadas como PDF Download selected routes as PDF: Descargar rutas seleccionadas como PDF
Add ticket: Añadir tickets
Preview: Vista previa
</i18n> </i18n>

View File

@ -41,7 +41,11 @@ function setParkings(data) {
@on-fetch="setWorkers" @on-fetch="setWorkers"
auto-load auto-load
/> />
<VnFilterPanel :data-key="props.dataKey" :search-button="true" @search="emit('search')"> <VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
@search="emit('search')"
>
<template #tags="{ tag, formatFn }"> <template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs"> <div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong> <strong>{{ t(`params.${tag.label}`) }}: </strong>
@ -49,59 +53,57 @@ function setParkings(data) {
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense> <QItem class="q-my-sm">
<QItem class="q-my-sm"> <QItemSection v-if="!parkings">
<QItemSection v-if="!parkings"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="parkings">
<QItemSection v-if="parkings"> <QSelect
<QSelect dense
dense outlined
outlined rounded
rounded :label="t('params.parkingFk')"
:label="t('params.parkingFk')" v-model="params.parkingFk"
v-model="params.parkingFk" :options="parkings"
:options="parkings" option-value="id"
option-value="id" option-label="code"
option-label="code" emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-mb-sm">
<QItem class="q-mb-sm"> <QItemSection v-if="!workers">
<QItemSection v-if="!workers"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="workers">
<QItemSection v-if="workers"> <QSelect
<QSelect dense
dense outlined
outlined rounded
rounded :label="t('params.userFk')"
:label="t('params.userFk')" v-model="params.userFk"
v-model="params.userFk" :options="workers"
:options="workers" option-value="id"
option-value="id" option-label="name"
option-label="name" emit-value
emit-value map-options
map-options use-input
use-input :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem class="q-mb-md">
<QItem class="q-mb-md"> <QItemSection>
<QItemSection> <QCheckbox
<QCheckbox v-model="params.isRecyclable"
v-model="params.isRecyclable" :label="t('params.isRecyclable')"
:label="t('params.isRecyclable')" toggle-indeterminate
toggle-indeterminate />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -74,7 +74,7 @@ function exprBuilder(param, value) {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="ShelvingList" data-key="ShelvingList"
url="Shelvings" url="Shelvings"
@ -129,10 +129,3 @@ function exprBuilder(param, value) {
</QPageSticky> </QPageSticky>
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>

View File

@ -99,14 +99,19 @@ onMounted(() => {
class="row q-gutter-md q-mb-md" class="row q-gutter-md q-mb-md"
> >
<div class="col"> <div class="col">
<VnInput <VnInput :label="t('supplier.accounts.iban')" v-model="row.iban">
:label="t('supplier.accounts.iban')" <template #append>
v-model="row.iban" <QIcon name="info" class="cursor-info">
/> <QTooltip>{{
t('components.iban_tooltip')
}}</QTooltip>
</QIcon>
</template>
</VnInput>
</div> </div>
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectCreate
:label="t('worker.create.bankEntity')" :label="t('supplier.accounts.bankEntity')"
v-model="row.bankEntityFk" v-model="row.bankEntityFk"
:options="bankEntitiesOptions" :options="bankEntitiesOptions"
option-label="name" option-label="name"
@ -135,7 +140,17 @@ onMounted(() => {
<VnInput <VnInput
:label="t('supplier.accounts.beneficiary')" :label="t('supplier.accounts.beneficiary')"
v-model="row.beneficiary" v-model="row.beneficiary"
/> >
<template #append>
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{
t(
'Name of the bank account holder if different from the provider'
)
}}</QTooltip>
</QIcon>
</template>
</VnInput>
</div> </div>
<div class="col-1 row justify-center items-center"> <div class="col-1 row justify-center items-center">
<QIcon <QIcon
@ -174,4 +189,5 @@ onMounted(() => {
Do you want to change the pay method to wire transfer?: ¿Quieres modificar la forma de pago a transferencia? Do you want to change the pay method to wire transfer?: ¿Quieres modificar la forma de pago a transferencia?
Add account: Añadir cuenta Add account: Añadir cuenta
Remove account: Remover cuenta Remove account: Remover cuenta
Name of the bank account holder if different from the provider: Nombre del titular de la cuenta bancaria en caso de ser diferente del proveedor
</i18n> </i18n>

View File

@ -47,7 +47,7 @@ const redirectToUpdateView = (addressData) => {
<template> <template>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="SupplierAddress" data-key="SupplierAddress"
:url="`Suppliers/${route.params.id}/addresses`" :url="`Suppliers/${route.params.id}/addresses`"
@ -88,10 +88,3 @@ const redirectToUpdateView = (addressData) => {
</QPageSticky> </QPageSticky>
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>

View File

@ -147,8 +147,6 @@ onMounted(() => {
option-value="id" option-value="id"
/> />
</div> </div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnSelectFilter <VnSelectFilter
:label="t('supplier.addresses.province')" :label="t('supplier.addresses.province')"
@ -160,21 +158,20 @@ onMounted(() => {
v-model="data.provinceFk" v-model="data.provinceFk"
/> />
</div> </div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnInput <VnInput
v-model="data.phone" v-model="data.phone"
:label="t('supplier.addresses.phone')" :label="t('supplier.addresses.phone')"
/> />
</div> </div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnInput <VnInput
v-model="data.mobile" v-model="data.mobile"
:label="t('supplier.addresses.mobile')" :label="t('supplier.addresses.mobile')"
/> />
</div> </div>
<div class="col" />
</VnRow> </VnRow>
</template> </template>
</FormModel> </FormModel>

View File

@ -80,8 +80,6 @@ const onDataSaved = () => {
type="number" type="number"
/> />
</div> </div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<QInput <QInput
:label="t('supplier.agencyTerms.m3Price')" :label="t('supplier.agencyTerms.m3Price')"
@ -89,6 +87,8 @@ const onDataSaved = () => {
type="number" type="number"
/> />
</div> </div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<QInput <QInput
:label="t('supplier.agencyTerms.routePrice')" :label="t('supplier.agencyTerms.routePrice')"
@ -96,8 +96,6 @@ const onDataSaved = () => {
type="number" type="number"
/> />
</div> </div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<QInput <QInput
:label="t('supplier.agencyTerms.minimumKm')" :label="t('supplier.agencyTerms.minimumKm')"
@ -105,7 +103,6 @@ const onDataSaved = () => {
type="number" type="number"
/> />
</div> </div>
<div class="col" />
</VnRow> </VnRow>
</template> </template>
</FormModel> </FormModel>

View File

@ -48,6 +48,13 @@ const workersOptions = ref([]);
map-options map-options
:rules="validate('supplier.workerFk')" :rules="validate('supplier.workerFk')"
> >
<template #append>
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{
t('Responsible for approving invoices')
}}</QTooltip>
</QIcon>
</template>
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
@ -88,10 +95,14 @@ const workersOptions = ref([]);
type="textarea" type="textarea"
v-model="data.note" v-model="data.note"
fill-input fill-input
autogrow
/> />
</div> </div>
</VnRow> </VnRow>
</template> </template>
</FormModel> </FormModel>
</template> </template>
<i18n>
es:
Responsible for approving invoices: Responsable de aprobar las facturas
</i18n>

View File

@ -13,6 +13,13 @@ const { t } = useI18n();
const paymethodsOptions = ref([]); const paymethodsOptions = ref([]);
const payDemsOptions = ref([]); const payDemsOptions = ref([]);
const formatPayDems = (data) => {
payDemsOptions.value = data.map(({ id, payDem }) => ({
id: id,
payDem: payDem || '0',
}));
};
</script> </script>
<template> <template>
<FetchData <FetchData
@ -20,7 +27,7 @@ const payDemsOptions = ref([]);
@on-fetch="(data) => (paymethodsOptions = data)" @on-fetch="(data) => (paymethodsOptions = data)"
auto-load auto-load
/> />
<FetchData url="PayDems" @on-fetch="(data) => (payDemsOptions = data)" auto-load /> <FetchData url="PayDems" @on-fetch="(data) => formatPayDems(data)" auto-load />
<FormModel <FormModel
:url="`Suppliers/${route.params.id}`" :url="`Suppliers/${route.params.id}`"
:url-update="`Suppliers/${route.params.id}`" :url-update="`Suppliers/${route.params.id}`"
@ -37,7 +44,6 @@ const payDemsOptions = ref([]);
option-value="id" option-value="id"
option-label="name" option-label="name"
hide-selected hide-selected
map-options
:rules="validate('supplier.payMethodFk')" :rules="validate('supplier.payMethodFk')"
/> />
</div> </div>
@ -49,7 +55,6 @@ const payDemsOptions = ref([]);
option-value="id" option-value="id"
option-label="payDem" option-label="payDem"
hide-selected hide-selected
map-options
:rules="validate('supplier.payDemFk')" :rules="validate('supplier.payDemFk')"
/> />
</div> </div>

View File

@ -14,6 +14,7 @@ const { t } = useI18n();
<Teleport to="#searchbar"> <Teleport to="#searchbar">
<VnSearchbar <VnSearchbar
data-key="SuppliersList" data-key="SuppliersList"
url="Suppliers/filter"
:limit="20" :limit="20"
:label="t('Search suppliers')" :label="t('Search suppliers')"
/> />

View File

@ -1,47 +1,64 @@
<script setup> <script setup>
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { ref, computed } from 'vue'; import { computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import FetchData from 'components/FetchData.vue';
import FetchedTags from 'components/ui/FetchedTags.vue'; import FetchedTags from 'components/ui/FetchedTags.vue';
import SendEmailDialog from 'components/common/SendEmailDialog.vue'; import SendEmailDialog from 'components/common/SendEmailDialog.vue';
import SupplierConsumptionFilter from './SupplierConsumptionFilter.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { toDate, toDateString } from 'src/filters'; import { toDate } from 'src/filters';
import { dashIfEmpty } from 'src/filters'; import { dashIfEmpty } from 'src/filters';
import { usePrintService } from 'composables/usePrintService'; import { usePrintService } from 'composables/usePrintService';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import axios from 'axios'; import axios from 'axios';
import { useStateStore } from 'stores/useStateStore';
import { useArrayData } from 'composables/useArrayData';
const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const { openReport, sendEmail } = usePrintService(); const { openReport, sendEmail } = usePrintService();
const quasar = useQuasar(); const quasar = useQuasar();
const { notify } = useNotify(); const { notify } = useNotify();
const suppliersConsumption = ref(); const arrayData = useArrayData('SupplierConsumption', {
url: 'Suppliers/consumption',
order: ['itemTypeFk', 'itemName', 'itemSize'],
userFilter: { where: { supplierFk: route.params.id } },
});
const userParams = computed(() => { const store = arrayData.store;
const minDate = Date.vnNew();
minDate.setHours(0, 0, 0, 0);
minDate.setMonth(minDate.getMonth() - 2);
const maxDate = Date.vnNew(); const dateRanges = computed(() => {
maxDate.setHours(23, 59, 59, 59); const ranges = {
from: null,
return { to: null,
from: toDateString(minDate),
to: toDateString(maxDate),
}; };
if (route.query && route.query.params) {
const params = JSON.parse(route.query.params);
if (params.from && params.to) {
ranges.from = params.from;
ranges.to = params.to;
}
}
return ranges;
}); });
const reportParams = computed(() => ({ const reportParams = computed(() => ({
recipientId: Number(route.params.id), recipientId: Number(route.params.id),
...userParams.value, ...dateRanges.value,
})); }));
const rows = computed(() => suppliersConsumption.value || []); async function getSupplierConsumptionData() {
await arrayData.fetch({ append: false });
}
const rows = computed(() => store.data || []);
const openReportPdf = () => { const openReportPdf = () => {
openReport(`Suppliers/${route.params.id}/campaign-metrics-pdf`, reportParams.value); openReport(`Suppliers/${route.params.id}/campaign-metrics-pdf`, reportParams.value);
@ -88,59 +105,55 @@ const sendCampaignMetricsEmail = ({ address }) => {
}); });
}; };
const calculateTotal = (buysArray) => { const calculateTotal = (buysArray = []) =>
return buysArray.reduce((accumulator, { total }) => accumulator + total, 0); buysArray.reduce((accumulator, { total }) => accumulator + total, 0);
};
onMounted(async () => {
stateStore.rightDrawer = true;
await getSupplierConsumptionData();
});
</script> </script>
<template> <template>
<FetchData <Teleport to="#st-actions" v-if="stateStore.isSubToolbarShown()">
url="Suppliers/consumption" <QBtn
@on-fetch="(data) => (suppliersConsumption = data)" :disabled="!dateRanges.from && !dateRanges.to"
:filter="{ color="primary"
where: { supplierFk: route.params.id }, icon-right="picture_as_pdf"
order: ['itemTypeFk', 'itemName', 'itemSize'], no-caps
}" class="q-mr-md"
:params="userParams" @click="openReportPdf()"
auto-load >
/> <QTooltip>
<QToolbar class="bg-vn-dark justify-end"> {{ t('Open as PDF') }}
<div id="st-data"> </QTooltip>
<QBtn </QBtn>
v-if="userParams.from && userParams.to" <QBtn
color="primary" :disabled="!dateRanges.from && !dateRanges.to"
icon-right="picture_as_pdf" color="primary"
no-caps icon-right="email"
class="q-mr-md" no-caps
@click="openReportPdf()" @click="openSendEmailDialog()"
> >
<QTooltip> <QTooltip>
{{ t('Open as PDF') }} {{ t('Send to email') }}
</QTooltip> </QTooltip>
</QBtn> </QBtn>
<QBtn </Teleport>
v-if="userParams.from && userParams.to"
color="primary"
icon-right="email"
no-caps
@click="openSendEmailDialog()"
>
<QTooltip>
{{ t('Send to email') }}
</QTooltip>
</QBtn>
</div>
<QSpace />
<div id="st-actions"></div>
</QToolbar>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8">
<SupplierConsumptionFilter data-key="SupplierConsumption" />
</QScrollArea>
</QDrawer>
<QTable <QTable
:rows="rows" :rows="rows"
hide-bottom
row-key="id" row-key="id"
hide-header hide-header
:pagination="{ rowsPerPage: 0 }" :pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md" class="full-width q-mt-md"
:no-data-label="t('No results')"
> >
<template #body="{ row }"> <template #body="{ row }">
<QTr> <QTr>
@ -156,7 +169,10 @@ const calculateTotal = (buysArray) => {
<QTd no-hover>{{ row.invoiceNumber }}</QTd> <QTd no-hover>{{ row.invoiceNumber }}</QTd>
</QTr> </QTr>
<QTr v-for="(buy, index) in row.buys" :key="index"> <QTr v-for="(buy, index) in row.buys" :key="index">
<QTd no-hover> {{ buy.itemName }}</QTd> <QTd no-hover>
<QBtn flat color="blue" dense>{{ buy.itemName }}</QBtn>
<ItemDescriptorProxy :id="buy.itemFk" />
</QTd>
<QTd no-hover> <QTd no-hover>
<span>{{ buy.subName }}</span> <span>{{ buy.subName }}</span>

View File

@ -0,0 +1,181 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
const { t } = useI18n();
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
const buyersOptions = ref([]);
const itemTypesOptions = ref([]);
const itemCategoriesOptions = ref([]);
</script>
<template>
<FetchData
url="TicketRequests/getItemTypeWorker"
:filter="{
fields: ['id', 'nickname'],
order: 'nickname ASC',
}"
@on-fetch="(data) => (buyersOptions = data)"
auto-load
/>
<FetchData
url="ItemTypes"
:filter="{
fields: ['id', 'name', 'categoryFk'],
include: 'category',
order: 'name ASC',
}"
@on-fetch="(data) => (itemTypesOptions = data)"
auto-load
/>
<FetchData
url="ItemCategories"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
@on-fetch="(data) => (itemCategoriesOptions = data)"
auto-load
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<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, searchFn }">
<QItem>
<QItemSection>
<VnInput
v-model="params.search"
:label="t('params.search')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.itemId"
:label="t('params.itemId')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.buyerId')"
v-model="params.buyerId"
@update:model-value="searchFn()"
:options="buyersOptions"
option-value="id"
option-label="nickname"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.typeId')"
v-model="params.typeId"
@update:model-value="searchFn()"
:options="itemTypesOptions"
option-value="id"
option-label="name"
hide-selected
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>{{
scope.opt?.category?.name
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.categoryId')"
v-model="params.categoryId"
@update:model-value="searchFn()"
:options="itemCategoriesOptions"
option-value="id"
option-label="name"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.from')"
v-model="params.from"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.to')"
v-model="params.to"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
search: General search
itemId: Item id
buyerId: Buyer
typeId: Type
categoryId: Category
from: From
to: To
es:
params:
search: Búsqueda general
itemId: Id Artículo
buyerId: Comprador
typeId: Tipo
categoryId: Reino
from: Desde
to: Hasta
</i18n>

View File

@ -1,10 +1,14 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { toDateString } from 'src/filters';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
import { getUrl } from 'src/composables/getUrl';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -16,6 +20,7 @@ const $props = defineProps({
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const url = ref();
const filter = { const filter = {
fields: [ fields: [
@ -53,6 +58,10 @@ const filter = {
], ],
}; };
onMounted(async () => {
url.value = await getUrl('');
});
const entityId = computed(() => { const entityId = computed(() => {
return $props.id || route.params.id; return $props.id || route.params.id;
}); });
@ -61,6 +70,27 @@ const data = ref(useCardDescription());
const setData = (entity) => { const setData = (entity) => {
data.value = useCardDescription(entity.ref, entity.id); data.value = useCardDescription(entity.ref, entity.id);
}; };
const getEntryQueryParams = (supplier) => {
if (!supplier) return null;
const date = Date.vnNew();
date.setHours(0, 0, 0, 0);
const from = new Date(date.getTime());
from.setDate(from.getDate() - 10);
const to = new Date(date.getTime());
to.setDate(to.getDate() + 10);
const params = {
supplierFk: supplier.id,
from: toDateString(from),
to: toDateString(to),
};
return params;
};
</script> </script>
<template> <template>
@ -73,6 +103,22 @@ const setData = (entity) => {
@on-fetch="setData" @on-fetch="setData"
data-key="Supplier" data-key="Supplier"
> >
<template #header-extra-action>
<QBtn
round
flat
dense
size="md"
icon="vn:supplier"
color="white"
class="link"
:to="{ name: 'SupplierList' }"
>
<QTooltip>
{{ t('Go to module index') }}
</QTooltip>
</QBtn>
</template>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('supplier.summary.taxNumber')" :value="entity.nif" /> <VnLv :label="t('supplier.summary.taxNumber')" :value="entity.nif" />
<VnLv label="Alias" :value="entity.nickname" /> <VnLv label="Alias" :value="entity.nickname" />
@ -87,8 +133,69 @@ const setData = (entity) => {
<VnLv :label="t('supplier.summary.payDay')" :value="entity.payDay" /> <VnLv :label="t('supplier.summary.payDay')" :value="entity.payDay" />
<VnLv :label="t('supplier.summary.account')" :value="entity.account" /> <VnLv :label="t('supplier.summary.account')" :value="entity.account" />
</template> </template>
<template #icons="{ entity }">
<QCardActions class="q-gutter-x-md">
<QIcon
v-if="!entity.isActive"
name="vn:disabled"
color="primary"
size="xs"
>
<QTooltip>{{ t('Inactive supplier') }}</QTooltip>
</QIcon>
<QIcon
v-if="!entity.isSerious"
name="vn:supplierfalse"
color="primary"
size="xs"
>
<QTooltip>{{ t('Unverified supplier') }}</QTooltip>
</QIcon>
</QCardActions>
</template>
<template #actions="{ entity }">
<QCardActions>
<QBtn
:to="{
name: 'EntryList',
query: { params: JSON.stringify(getEntryQueryParams(entity)) },
}"
size="md"
icon="vn:entry"
color="primary"
>
<QTooltip>{{ t('All entries with current supplier') }}</QTooltip>
</QBtn>
<QBtn
:to="{
name: 'CustomerCard',
params: { id: entity.client?.id },
}"
size="md"
icon="vn:Person"
color="primary"
>
<QTooltip>{{ t('Go to client') }}</QTooltip>
</QBtn>
<QBtn
:href="`${url}invoice-in/create?supplierFk=${entity.id}`"
size="md"
icon="vn:invoice-in-create"
color="primary"
>
<QTooltip>{{ t('Create invoiceIn') }}</QTooltip>
</QBtn>
</QCardActions>
</template>
</CardDescriptor> </CardDescriptor>
</template> </template>
<i18n>
<i18n>
es:
All entries with current supplier: Todas las entradas con proveedor actual
Go to client: Ir a cliente
Create invoiceIn: Crear factura recibida
Go to module index: Ir al índice del módulo
Inactive supplier: Proveedor inactivo
Unverified supplier: Proveedor no verificado
</i18n> </i18n>

View File

@ -1,6 +1,8 @@
<script setup> <script setup>
import { reactive } from 'vue'; import { reactive } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
@ -9,12 +11,17 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const stateStore = useStateStore(); const stateStore = useStateStore();
const newSupplierForm = reactive({ const newSupplierForm = reactive({
name: null, name: null,
}); });
const redirectToSupplierFiscalData = (_, responseData) => {
router.push({ name: 'SupplierFiscalData', params: { id: responseData.id } });
};
</script> </script>
<template> <template>
@ -34,6 +41,7 @@ const newSupplierForm = reactive({
url-create="Suppliers/newSupplier" url-create="Suppliers/newSupplier"
model="supplier" model="supplier"
:form-initial-data="newSupplierForm" :form-initial-data="newSupplierForm"
@on-data-saved="redirectToSupplierFiscalData"
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">

View File

@ -1,13 +1,16 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore'; import { useQuasar } from 'quasar';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue';
import CardList from 'src/components/ui/CardList.vue'; import CardList from 'src/components/ui/CardList.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { useQuasar } from 'quasar';
import SupplierSummaryDialog from './Card/SupplierSummaryDialog.vue'; import SupplierSummaryDialog from './Card/SupplierSummaryDialog.vue';
import SupplierListFilter from './SupplierListFilter.vue';
import { useStateStore } from 'stores/useStateStore';
const stateStore = useStateStore(); const stateStore = useStateStore();
const router = useRouter(); const router = useRouter();
@ -44,7 +47,12 @@ const viewSummary = (id) => {
</template> </template>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8">
<SupplierListFilter data-key="SuppliersList" />
</QScrollArea>
</QDrawer>
<div class="vn-card-list">
<VnPaginate data-key="SuppliersList" url="Suppliers/filter" auto-load> <VnPaginate data-key="SuppliersList" url="Suppliers/filter" auto-load>
<template #body="{ rows }"> <template #body="{ rows }">
<CardList <CardList
@ -56,7 +64,7 @@ const viewSummary = (id) => {
> >
<template #list-items> <template #list-items>
<VnLv label="NIF/CIF" :value="row.nif" /> <VnLv label="NIF/CIF" :value="row.nif" />
<VnLv label="Alias" :value="row.nickname" /> <VnLv label="Alias" :value="row.alias" />
<VnLv <VnLv
:label="t('supplier.list.payMethod')" :label="t('supplier.list.payMethod')"
:value="row.payMethod" :value="row.payMethod"
@ -95,13 +103,6 @@ const viewSummary = (id) => {
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
en: en:
Search suppliers: Search suppliers Search suppliers: Search suppliers

View File

@ -0,0 +1,122 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
const { t } = useI18n();
const provincesOptions = ref([]);
const countriesOptions = ref([]);
</script>
<template>
<FetchData
url="Provinces"
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
@on-fetch="(data) => (provincesOptions = data)"
auto-load
/>
<FetchData
url="countries"
:filter="{ fields: ['id', 'country'], order: 'country ASC', limit: 30 }"
@on-fetch="(data) => (countriesOptions = data)"
auto-load
/>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:unremovable-params="['supplierFk']"
>
<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, searchFn }">
<QItem>
<QItemSection>
<VnInput
v-model="params.search"
:label="t('params.search')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.nickname"
:label="t('params.nickname')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput v-model="params.nif" :label="t('params.nif')" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.provinceFk')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provincesOptions"
option-value="id"
option-label="name"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.countryFk')"
v-model="params.countryFk"
@update:model-value="searchFn()"
:options="countriesOptions"
option-value="id"
option-label="country"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
search: General search
nickname: Alias
nif: Tax number
provinceFk: Province
countryFk: Country
es:
params:
search: Búsqueda general
nickname: Alias
nif: NIF/CIF
provinceFk: Provincia
countryFk: País
</i18n>

View File

@ -56,66 +56,138 @@ const warehouses = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="q-gutter-y-sm q-mt-sm"> <QItem>
<QItemSection>
<VnInput
v-model="params.clientFk"
:label="t('Customer ID')"
is-outlined
/>
</QItemSection>
<QItemSection>
<VnInput
v-model="params.orderFk"
:label="t('Order ID')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate v-model="params.from" :label="t('From')" is-outlined />
</QItemSection>
<QItemSection>
<VnInputDate v-model="params.to" :label="t('To')" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!workers">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="workers">
<QSelect
:label="t('Salesperson')"
v-model="params.salesPersonFk"
:options="workers"
option-value="id"
option-label="name"
emit-value
map-options
use-input
dense
outlined
rounded
:input-debounce="0"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!states">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="states">
<QSelect
:label="t('State')"
v-model="params.stateFk"
@update:model-value="searchFn()"
:options="states"
option-value="id"
option-label="name"
emit-value
map-options
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.refFk"
:label="t('Invoice Ref.')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.myTeam"
@update:model-value="searchFn()"
:label="t('My team')"
toggle-indeterminate
/>
</QItemSection>
<QItemSection>
<QCheckbox
v-model="params.pending"
@update:model-value="searchFn()"
:label="t('Pending')"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.hasInvoice"
@update:model-value="searchFn()"
:label="t('Invoiced')"
toggle-indeterminate
/>
</QItemSection>
<QItemSection>
<QCheckbox
v-model="params.hasRoute"
@update:model-value="searchFn()"
:label="t('Routed')"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.problems"
@update:model-value="searchFn()"
:label="t('With problems')"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QSeparator />
<QExpansionItem :label="t('More options')" expand-separator>
<QItem> <QItem>
<QItemSection> <QItemSection v-if="!provinces">
<VnInput
v-model="params.clientFk"
:label="t('Customer ID')"
is-outlined
/>
</QItemSection>
<QItemSection>
<VnInput
v-model="params.orderFk"
:label="t('Order ID')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.from"
:label="t('From')"
is-outlined
/>
</QItemSection>
<QItemSection>
<VnInputDate v-model="params.to" :label="t('To')" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!workers">
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />
</QItemSection> </QItemSection>
<QItemSection v-if="workers"> <QItemSection v-if="provinces">
<QSelect <QSelect
:label="t('Salesperson')" :label="t('Province')"
v-model="params.salesPersonFk" v-model="params.provinceFk"
:options="workers"
option-value="id"
option-label="name"
emit-value
map-options
use-input
dense
outlined
rounded
:input-debounce="0"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!states">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="states">
<QSelect
:label="t('State')"
v-model="params.stateFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
:options="states" :options="provinces"
option-value="id" option-value="id"
option-label="name" option-label="name"
emit-value emit-value
@ -127,124 +199,46 @@ const warehouses = ref();
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection v-if="!agencies">
<VnInput <QSkeleton type="QInput" class="full-width" />
v-model="params.refFk" </QItemSection>
:label="t('Invoice Ref.')" <QItemSection v-if="agencies">
is-outlined <QSelect
:label="t('Agency')"
v-model="params.agencyModeFk"
@update:model-value="searchFn()"
:options="agencies"
option-value="id"
option-label="name"
emit-value
map-options
dense
outlined
rounded
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection v-if="!warehouses">
<QCheckbox <QSkeleton type="QInput" class="full-width" />
v-model="params.myTeam"
@update:model-value="searchFn()"
:label="t('My team')"
toggle-indeterminate
/>
</QItemSection> </QItemSection>
<QItemSection> <QItemSection v-if="warehouses">
<QCheckbox <QSelect
v-model="params.pending" :label="t('Warehouse')"
v-model="params.warehouseFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
:label="t('Pending')" :options="warehouses"
toggle-indeterminate option-value="id"
option-label="name"
emit-value
map-options
dense
outlined
rounded
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> </QExpansionItem>
<QItemSection>
<QCheckbox
v-model="params.hasInvoice"
@update:model-value="searchFn()"
:label="t('Invoiced')"
toggle-indeterminate
/>
</QItemSection>
<QItemSection>
<QCheckbox
v-model="params.hasRoute"
@update:model-value="searchFn()"
:label="t('Routed')"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.problems"
@update:model-value="searchFn()"
:label="t('With problems')"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QSeparator />
<QExpansionItem :label="t('More options')" expand-separator>
<QItem>
<QItemSection v-if="!provinces">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="provinces">
<QSelect
:label="t('Province')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provinces"
option-value="id"
option-label="name"
emit-value
map-options
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!agencies">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="agencies">
<QSelect
:label="t('Agency')"
v-model="params.agencyModeFk"
@update:model-value="searchFn()"
:options="agencies"
option-value="id"
option-label="name"
emit-value
map-options
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!warehouses">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="warehouses">
<QSelect
:label="t('Warehouse')"
v-model="params.warehouseFk"
@update:model-value="searchFn()"
:options="warehouses"
option-value="id"
option-label="name"
emit-value
map-options
dense
outlined
rounded
/>
</QItemSection>
</QItem>
</QExpansionItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -74,7 +74,7 @@ function viewSummary(id) {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="TicketList" data-key="TicketList"
url="Tickets/filter" url="Tickets/filter"
@ -134,13 +134,6 @@ function viewSummary(id) {
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
es: es:
Search ticket: Buscar ticket Search ticket: Buscar ticket

View File

@ -263,10 +263,8 @@ onMounted(async () => {
/> />
</Teleport> </Teleport>
</template> </template>
<QToolbar class="bg-vn-dark justify-end"> <VnSubToolbar class="bg-vn-dark justify-end">
<div id="st-data"></div> <template #st-actions>
<QSpace />
<div id="st-actions">
<QBtn <QBtn
color="primary" color="primary"
icon-right="picture_as_pdf" icon-right="picture_as_pdf"
@ -277,8 +275,8 @@ onMounted(async () => {
{{ t('Open as PDF') }} {{ t('Open as PDF') }}
</QTooltip> </QTooltip>
</QBtn> </QBtn>
</div> </template>
</QToolbar> </VnSubToolbar>
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above> <QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8"> <QScrollArea class="fit text-grey-8">
<ExtraCommunityFilter data-key="ExtraCommunity" /> <ExtraCommunityFilter data-key="ExtraCommunity" />

View File

@ -66,158 +66,149 @@ const decrement = (paramsObj, key) => {
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense class="list q-gutter-y-sm q-mt-sm"> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput label="id" v-model="params.id" is-outlined />
<VnInput label="id" v-model="params.id" is-outlined /> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('params.reference')"
:label="t('params.reference')" v-model="params.reference"
v-model="params.reference" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QInput
<QInput v-model="params.totalEntries"
v-model="params.totalEntries" type="number"
type="number" :label="t('params.totalEntries')"
:label="t('params.totalEntries')" dense
dense outlined
outlined rounded
rounded min="0"
min="0" class="input-number"
class="input-number" >
> <template #append>
<template #append> <QBtn
<QBtn icon="add"
icon="add" flat
flat dense
dense size="12px"
size="12px" @click="add(params, 'totalEntries')"
@click="add(params, 'totalEntries')" />
/> <QBtn
<QBtn icon="remove"
icon="remove" flat
flat dense
dense size="12px"
size="12px" @click="decrement(params, 'totalEntries')"
@click="decrement(params, 'totalEntries')" />
/> </template>
</template> </QInput>
</QInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.agencyModeFk')"
:label="t('params.agencyModeFk')" v-model="params.agencyModeFk"
v-model="params.agencyModeFk" :options="agenciesOptions"
:options="agenciesOptions" option-value="agencyFk"
option-value="agencyFk" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.shippedFrom"
v-model="params.shippedFrom" :label="t('params.shippedFrom')"
:label="t('params.shippedFrom')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInputDate
<VnInputDate v-model="params.landedTo"
v-model="params.landedTo" :label="t('params.landedTo')"
:label="t('params.landedTo')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.warehouseOutFk')"
:label="t('params.warehouseOutFk')" v-model="params.warehouseOutFk"
v-model="params.warehouseOutFk" :options="warehousesOptions"
:options="warehousesOptions" option-value="id"
option-value="id" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.warehouseInFk')"
:label="t('params.warehouseInFk')" v-model="params.warehouseInFk"
v-model="params.warehouseInFk" :options="warehousesOptions"
:options="warehousesOptions" option-value="id"
option-value="id" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('supplier.pageTitles.supplier')"
:label="t('supplier.pageTitles.supplier')" v-model="params.cargoSupplierFk"
v-model="params.cargoSupplierFk" :options="suppliersOptions"
:options="suppliersOptions" option-value="id"
option-value="id" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.continent')"
:label="t('params.continent')" v-model="params.continent"
v-model="params.continent" :options="continentsOptions"
:options="continentsOptions" option-value="code"
option-value="code" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped> <style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
.input-number >>> input[type='number'] { .input-number >>> input[type='number'] {
-moz-appearance: textfield; -moz-appearance: textfield;
} }

View File

@ -61,216 +61,207 @@ const decrement = (paramsObj, key) => {
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QList dense class="list q-gutter-y-sm q-mt-sm"> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput v-model="params.search"
v-model="params.search" :label="t('params.search')"
:label="t('params.search')" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.agencyModeFk')"
:label="t('params.agencyModeFk')" v-model="params.agencyModeFk"
v-model="params.agencyModeFk" :options="agenciesOptions"
:options="agenciesOptions" option-value="agencyFk"
option-value="agencyFk" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.warehouseOutFk')"
:label="t('params.warehouseOutFk')" v-model="params.warehouseOutFk"
v-model="params.warehouseOutFk" :options="warehousesOptions"
:options="warehousesOptions" option-value="id"
option-value="id" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.warehouseInFk')"
:label="t('params.warehouseInFk')" v-model="params.warehouseInFk"
v-model="params.warehouseInFk" :options="warehousesOptions"
:options="warehousesOptions" option-value="id"
option-value="id" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QInput
<QInput v-model="params.scopeDays"
v-model="params.scopeDays" type="number"
type="number" :label="t('params.scopeDays')"
:label="t('params.scopeDays')" dense
dense outlined
outlined rounded
rounded class="input-number"
class="input-number" >
> <template #append>
<template #append> <QBtn
<QBtn icon="add"
icon="add" flat
flat dense
dense size="12px"
size="12px" @click="add(params, 'scopeDays')"
@click="add(params, 'scopeDays')" />
/> <QBtn
<QBtn icon="remove"
icon="remove" flat
flat dense
dense size="12px"
size="12px" @click="decrement(params, 'scopeDays')"
@click="decrement(params, 'scopeDays')" />
/> </template>
</template> </QInput>
</QInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QInput
<QInput dense
dense outlined
outlined rounded
rounded placeholder="dd-mm-aaa"
placeholder="dd-mm-aaa" :label="t('params.landedFrom')"
:label="t('params.landedFrom')" :model-value="toDate(params.landedFrom)"
:model-value="toDate(params.landedFrom)" >
> <template #append>
<template #append> <QIcon name="event" class="cursor-pointer">
<QIcon name="event" class="cursor-pointer"> <QPopupProxy
<QPopupProxy cover
cover transition-show="scale"
transition-show="scale" transition-hide="scale"
transition-hide="scale" >
> <QDate v-model="params.landedFrom">
<QDate v-model="params.landedFrom"> <div class="row items-center justify-end">
<div class="row items-center justify-end"> <QBtn
<QBtn v-close-popup
v-close-popup :label="t('globals.close')"
:label="t('globals.close')" color="primary"
color="primary" flat
flat />
/> </div>
</div> </QDate>
</QDate> </QPopupProxy>
</QPopupProxy> </QIcon>
</QIcon> </template>
</template> </QInput>
</QInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QInput
<QInput dense
dense outlined
outlined rounded
rounded placeholder="dd-mm-aaa"
placeholder="dd-mm-aaa" :model-value="toDate(params.landedTo)"
:model-value="toDate(params.landedTo)" :label="t('params.landedTo')"
:label="t('params.landedTo')" >
> <template #append>
<template #append> <QIcon name="event" class="cursor-pointer">
<QIcon name="event" class="cursor-pointer"> <QPopupProxy
<QPopupProxy cover
cover transition-show="scale"
transition-show="scale" transition-hide="scale"
transition-hide="scale" >
> <QDate v-model="params.landedTo">
<QDate v-model="params.landedTo"> <div class="row items-center justify-end">
<div class="row items-center justify-end"> <QBtn
<QBtn v-close-popup
v-close-popup :label="t('globals.close')"
:label="t('globals.close')" color="primary"
color="primary" flat
flat />
/> </div>
</div> </QDate>
</QDate> </QPopupProxy>
</QPopupProxy> </QIcon>
</QIcon> </template>
</template> </QInput>
</QInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnSelectFilter
<VnSelectFilter :label="t('params.continent')"
:label="t('params.continent')" v-model="params.continent"
v-model="params.continent" :options="continentsOptions"
:options="continentsOptions" option-value="code"
option-value="code" option-label="name"
option-label="name" hide-selected
hide-selected dense
dense outlined
outlined rounded
rounded />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <QInput
<QInput v-model="params.totalEntries"
v-model="params.totalEntries" type="number"
type="number" :label="t('params.totalEntries')"
:label="t('params.totalEntries')" dense
dense outlined
outlined rounded
rounded min="0"
min="0" class="input-number"
class="input-number" >
> <template #append>
<template #append> <QBtn
<QBtn icon="add"
icon="add" flat
flat dense
dense size="12px"
size="12px" @click="add(params, 'totalEntries')"
@click="add(params, 'totalEntries')" />
/> <QBtn
<QBtn icon="remove"
icon="remove" flat
flat dense
dense size="12px"
size="12px" @click="decrement(params, 'totalEntries')"
@click="decrement(params, 'totalEntries')" />
/> </template>
</template> </QInput>
</QInput> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped> <style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
.input-number >>> input[type='number'] { .input-number >>> input[type='number'] {
-moz-appearance: textfield; -moz-appearance: textfield;
} }

View File

@ -70,7 +70,7 @@ onMounted(async () => {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="TravelList" data-key="TravelList"
url="Travels/filter" url="Travels/filter"
@ -147,13 +147,6 @@ onMounted(async () => {
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
en: en:
addEntry: Add entry addEntry: Add entry

View File

@ -42,7 +42,7 @@ async function remove(row) {
<template> <template>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="WagonTypeList" data-key="WagonTypeList"
url="/WagonTypes" url="/WagonTypes"
@ -80,10 +80,3 @@ async function remove(row) {
</QPageSticky> </QPageSticky>
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>

View File

@ -48,7 +48,7 @@ async function remove(row) {
<template> <template>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="WagonList" data-key="WagonList"
url="/Wagons" url="/Wagons"
@ -99,10 +99,3 @@ async function remove(row) {
</QPageSticky> </QPageSticky>
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>

View File

@ -248,7 +248,15 @@ onMounted(async () => {
v-model="data.iban" v-model="data.iban"
:label="t('worker.create.iban')" :label="t('worker.create.iban')"
:rules="validate('Worker.iban')" :rules="validate('Worker.iban')"
/> >
<template #append>
<QIcon name="info" class="cursor-info">
<QTooltip>{{
t('components.iban_tooltip')
}}</QTooltip>
</QIcon>
</template>
</VnInput>
</div> </div>
<VnSelectCreate <VnSelectCreate
:label="t('worker.create.bankEntity')" :label="t('worker.create.bankEntity')"

View File

@ -27,74 +27,72 @@ const departments = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QList dense class="q-gutter-y-sm q-mt-sm"> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput :label="t('FI')" v-model="params.fi" is-outlined
<VnInput :label="t('FI')" v-model="params.fi" is-outlined ><template #prepend>
><template #prepend> <QIcon name="badge" size="xs"></QIcon> </template
<QIcon name="badge" size="xs"></QIcon> </template ></VnInput>
></VnInput> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('First Name')"
:label="t('First Name')" v-model="params.firstName"
v-model="params.firstName" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('Last Name')"
:label="t('Last Name')" v-model="params.lastName"
v-model="params.lastName" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('User Name')"
:label="t('User Name')" v-model="params.userName"
v-model="params.userName" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection v-if="!departments">
<QItemSection v-if="!departments"> <QSkeleton type="QInput" class="full-width" />
<QSkeleton type="QInput" class="full-width" /> </QItemSection>
</QItemSection> <QItemSection v-if="departments">
<QItemSection v-if="departments"> <QSelect
<QSelect :label="t('Department')"
:label="t('Department')" v-model="params.departmentFk"
v-model="params.departmentFk" @update:model-value="searchFn()"
@update:model-value="searchFn()" :options="departments"
:options="departments" option-value="id"
option-value="id" option-label="name"
option-label="name" emit-value
emit-value map-options
map-options use-input
use-input dense
dense outlined
outlined rounded
rounded :input-debounce="0"
:input-debounce="0" />
/> </QItemSection>
</QItemSection> </QItem>
</QItem> <QItem>
<QItem> <QItemSection>
<QItemSection> <VnInput
<VnInput :label="t('Extension')"
:label="t('Extension')" v-model="params.extension"
v-model="params.extension" is-outlined
is-outlined />
/> </QItemSection>
</QItemSection> </QItem>
</QItem>
</QList>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>

View File

@ -64,7 +64,7 @@ const redirectToCreateView = () => {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate
data-key="WorkerList" data-key="WorkerList"
url="Workers/filter" url="Workers/filter"
@ -114,13 +114,6 @@ const redirectToCreateView = () => {
</QPage> </QPage>
</template> </template>
<style lang="scss" scoped>
.card-list {
width: 100%;
max-width: 60em;
}
</style>
<i18n> <i18n>
es: es:
Search worker: Buscar trabajador Search worker: Buscar trabajador

View File

@ -1,3 +1,4 @@
import Item from './item';
import Customer from './customer'; import Customer from './customer';
import Ticket from './ticket'; import Ticket from './ticket';
import Claim from './claim'; import Claim from './claim';
@ -14,6 +15,7 @@ import Department from './department';
import Entry from './entry'; import Entry from './entry';
export default [ export default [
Item,
Customer, Customer,
Ticket, Ticket,
Claim, Claim,

View File

@ -0,0 +1,70 @@
import { RouterView } from 'vue-router';
export default {
path: '/item',
name: 'Item',
meta: {
title: 'items',
icon: 'vn:item',
},
component: RouterView,
redirect: { name: 'ItemMain' },
menus: {
main: [],
card: [],
},
children: [
{
path: '',
name: 'ItemMain',
component: () => import('src/pages/Item/ItemMain.vue'),
redirect: { name: 'Itemlist' },
children: [
{
path: 'list',
name: 'ItemList',
meta: {
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Item/ItemList.vue'),
},
],
},
{
name: 'ItemCard',
path: ':id',
component: () => import('src/pages/Item/Card/ItemCard.vue'),
redirect: { name: 'ItemSummary' },
children: [
{
name: 'ItemSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'launch',
},
component: () => import('src/pages/Item/Card/ItemSummary.vue'),
},
{
path: 'diary',
name: 'ItemDiary',
meta: {
title: 'diary',
icon: 'vn:transaction',
},
component: () => import('src/pages/Item/Card/ItemDiary.vue'),
},
{
path: 'tags',
name: 'ItemTags',
meta: {
title: 'Tags',
icon: 'vn:tags',
},
component: () => import('src/pages/Item/Card/ItemTags.vue'),
},
],
},
],
};

View File

@ -1,3 +1,4 @@
import item from './modules/item';
import customer from './modules/customer'; import customer from './modules/customer';
import ticket from './modules/ticket'; import ticket from './modules/ticket';
import claim from './modules/claim'; import claim from './modules/claim';
@ -51,6 +52,7 @@ const routes = [
component: () => import('../pages/Dashboard/DashboardMain.vue'), component: () => import('../pages/Dashboard/DashboardMain.vue'),
}, },
// Module routes // Module routes
item,
customer, customer,
ticket, ticket,
claim, claim,

View File

@ -7,19 +7,19 @@ import routes from 'src/router/modules';
export const useNavigationStore = defineStore('navigationStore', () => { export const useNavigationStore = defineStore('navigationStore', () => {
const modules = [ const modules = [
'customer',
'claim',
'ticket',
'invoiceOut',
'invoiceIn',
'worker',
'shelving', 'shelving',
'order', 'order',
'wagon', 'customer',
'route',
'supplier',
'travel',
'entry', 'entry',
'travel',
'invoiceOut',
'invoiceIn',
'supplier',
'claim',
'route',
'ticket',
'worker',
'wagon',
]; ];
const pinnedModules = ref([]); const pinnedModules = ref([]);
const role = useRole(); const role = useRole();

View File

@ -16,11 +16,12 @@ describe('InvoiceInBasicData', () => {
cy.get(selects).eq(0).type('Bros'); cy.get(selects).eq(0).type('Bros');
cy.get(selects).eq(0).type('{enter}'); cy.get(selects).eq(0).type('{enter}');
cy.get('[title="Reset"]').click();
cy.get(appendBtns).eq(0).click(); cy.get(appendBtns).eq(0).click();
cy.get('input').eq(2).type(4739); cy.get('input').eq(2).type(4739);
cy.saveCard(); cy.saveCard();
cy.get(`${selects} input`).eq(0).invoke('val').should('eq', 'Bros nick'); cy.get(`${selects} input`).eq(0).invoke('val').should('eq', 'Plants nick');
cy.get('input').eq(2).invoke('val').should('eq', '4739'); cy.get('input').eq(2).invoke('val').should('eq', '4739');
}); });