0
0
Fork 0

Merge remote-tracking branch 'salix/dev' into bugfix/shelving-154

# Conflicts:
#	src/components/ui/VnSearchbar.vue
#	src/pages/Route/RouteList.vue
This commit is contained in:
Kevin Martinez 2024-02-07 22:38:57 -03:00
commit 15f7f85734
147 changed files with 6372 additions and 3929 deletions

View File

@ -58,7 +58,7 @@ module.exports = {
rules: { rules: {
'prefer-promise-reject-errors': 'off', 'prefer-promise-reject-errors': 'off',
'no-unused-vars': 'warn', 'no-unused-vars': 'warn',
"vue/no-multiple-template-root": "off" ,
// allow debugger during development only // allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
}, },

2
Jenkinsfile vendored
View File

@ -96,4 +96,4 @@ pipeline {
} }
} }
} }
} }

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,13 +19,13 @@
"@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",
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-router": "^4.2.1", "vue-router": "^4.2.1"
"vue-router-mock": "^0.2.0"
}, },
"devDependencies": { "devDependencies": {
"@intlify/unplugin-vue-i18n": "^0.8.1", "@intlify/unplugin-vue-i18n": "^0.8.1",

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

@ -8,7 +8,7 @@ import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import CreateNewCityForm from './CreateNewCityForm.vue'; import CreateNewCityForm from './CreateNewCityForm.vue';
import CreateNewProvinceForm from './CreateNewProvinceForm.vue'; import CreateNewProvinceForm from './CreateNewProvinceForm.vue';
import VnSelectCreate from 'components/common/VnSelectCreate.vue'; import VnSelectDialog from 'components/common/VnSelectDialog.vue';
import FormModelPopup from './FormModelPopup.vue'; import FormModelPopup from './FormModelPopup.vue';
const emit = defineEmits(['onDataSaved']); const emit = defineEmits(['onDataSaved']);
@ -85,7 +85,7 @@ const onProvinceCreated = async ({ name }, formData) => {
/> />
</div> </div>
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectDialog
:label="t('City')" :label="t('City')"
:options="townsLocationOptions" :options="townsLocationOptions"
v-model="data.townFk" v-model="data.townFk"
@ -100,12 +100,12 @@ const onProvinceCreated = async ({ name }, formData) => {
@on-data-saved="onCityCreated($event, data)" @on-data-saved="onCityCreated($event, data)"
/> />
</template> </template>
</VnSelectCreate> </VnSelectDialog>
</div> </div>
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-xl"> <VnRow class="row q-gutter-md q-mb-xl">
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectDialog
:label="t('Province')" :label="t('Province')"
:options="provincesOptions" :options="provincesOptions"
hide-selected hide-selected
@ -120,7 +120,7 @@ const onProvinceCreated = async ({ name }, formData) => {
@on-data-saved="onProvinceCreated($event, data)" @on-data-saved="onProvinceCreated($event, data)"
/> />
</template> </template>
</VnSelectCreate> </VnSelectDialog>
</div> </div>
<div class="col"> <div class="col">
<VnSelectFilter <VnSelectFilter

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

@ -0,0 +1,141 @@
<script setup>
import { ref, reactive } from 'vue';
import { useI18n } from 'vue-i18n';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
const emit = defineEmits(['onDataSaved']);
const $props = defineProps({
rows: {
type: Array,
default: () => [],
},
fieldsOptions: {
type: Array,
default: () => [],
},
editUrl: {
type: String,
default: '',
},
});
const { t } = useI18n();
const { notify } = useNotify();
const formData = reactive({
field: null,
newValue: null,
});
const closeButton = ref(null);
const isLoading = ref(false);
const onDataSaved = () => {
notify('globals.dataSaved', 'positive');
emit('onDataSaved');
closeForm();
};
const submitData = async () => {
try {
isLoading.value = true;
const rowsToEdit = $props.rows.map((row) => ({ id: row.id, itemFk: row.itemFk }));
const payload = {
field: formData.field,
newValue: formData.newValue,
lines: rowsToEdit,
};
await axios.post($props.editUrl, payload);
onDataSaved();
isLoading.value = false;
} catch (err) {
console.error('Error submitting table cell edit');
}
};
const closeForm = () => {
if (closeButton.value) closeButton.value.click();
};
</script>
<template>
<QForm @submit="submitData()" 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('editBuyTitle', {
buysAmount: rows.length,
})
}}
</h1>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Field to edit')"
:options="fieldsOptions"
hide-selected
option-label="label"
option-value="field"
v-model="formData.field"
/>
</div>
<div class="col">
<VnInput :label="t('Value')" v-model="formData.newValue" />
</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>
</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>
en:
editBuyTitle: Edit {buysAmount} buy(s)
es:
editBuyTitle: Editar {buysAmount} compra(s)
Field to edit: Campo a editar
Value: Valor
</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

@ -0,0 +1,242 @@
<script setup>
import { ref, reactive, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import axios from 'axios';
import { dashIfEmpty } from 'src/filters';
const emit = defineEmits(['itemSelected']);
const { t } = useI18n();
const route = useRoute();
const itemFilter = {
include: [
{
relation: 'producer',
scope: {
fields: ['name'],
},
},
{
relation: 'ink',
scope: {
fields: ['name'],
},
},
],
};
const itemFilterParams = reactive({});
const closeButton = ref(null);
const isLoading = ref(false);
const producersOptions = ref([]);
const ItemTypesOptions = ref([]);
const InksOptions = ref([]);
const tableRows = ref([]);
const loading = ref(false);
const tableColumns = computed(() => [
{
label: t('entry.buys.id'),
name: 'id',
field: 'id',
align: 'left',
},
{
label: t('entry.buys.name'),
name: 'name',
field: 'name',
align: 'left',
},
{
label: t('entry.buys.size'),
name: 'size',
field: 'size',
align: 'left',
},
{
label: t('entry.buys.producer'),
name: 'producerName',
field: 'producer',
align: 'left',
format: (val) => dashIfEmpty(val),
},
{
label: t('entry.buys.color'),
name: 'ink',
field: 'inkName',
align: 'left',
},
]);
const fetchResults = async () => {
try {
let filter = itemFilter;
const params = itemFilterParams;
const where = {};
for (let key in params) {
const value = params[key];
if (!value) continue;
switch (key) {
case 'name':
where[key] = { like: `%${value}%` };
break;
case 'producerFk':
case 'typeFk':
case 'size':
case 'inkFk':
where[key] = value;
}
}
filter.where = where;
const { data } = await axios.get(`Entries/${route.params.id}/lastItemBuys`, {
params: { filter: JSON.stringify(filter) },
});
tableRows.value = data;
} catch (err) {
console.error('Error fetching entries items');
}
};
const closeForm = () => {
if (closeButton.value) closeButton.value.click();
};
const selectItem = ({ id }) => {
emit('itemSelected', id);
closeForm();
};
</script>
<template>
<FetchData
url="Producers"
@on-fetch="(data) => (producersOptions = data)"
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
auto-load
/>
<FetchData
url="ItemTypes"
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
order="name"
@on-fetch="(data) => (ItemTypesOptions = data)"
auto-load
/>
<FetchData
url="Inks"
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
order="name"
@on-fetch="(data) => (InksOptions = data)"
auto-load
/>
<QForm @submit="fetchResults()" class="all-pointer-events">
<QCard class="column" style="padding: 32px; z-index: 100">
<span ref="closeButton" class="close-icon" v-close-popup>
<QIcon name="close" size="sm" />
</span>
<h1 class="title">{{ t('Filter item') }}</h1>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput
:label="t('entry.buys.name')"
v-model="itemFilterParams.name"
/>
</div>
<div class="col">
<VnInput
:label="t('entry.buys.size')"
v-model="itemFilterParams.size"
/>
</div>
<div class="col">
<VnSelectFilter
:label="t('entry.buys.producer')"
:options="producersOptions"
hide-selected
option-label="name"
option-value="id"
v-model="itemFilterParams.producerFk"
/>
</div>
<div class="col">
<VnSelectFilter
:label="t('entry.buys.type')"
:options="ItemTypesOptions"
hide-selected
option-label="name"
option-value="id"
v-model="itemFilterParams.typeFk"
/>
</div>
<div class="col">
<VnSelectFilter
:label="t('entry.buys.color')"
:options="InksOptions"
hide-selected
option-label="name"
option-value="id"
v-model="itemFilterParams.inkFk"
/>
</div>
</VnRow>
<div class="q-mt-lg row justify-end">
<QBtn
:label="t('globals.search')"
type="submit"
color="primary"
:disabled="isLoading"
:loading="isLoading"
/>
</div>
<QTable
:columns="tableColumns"
:rows="tableRows"
:pagination="{ rowsPerPage: 0 }"
:loading="loading"
:hide-header="!tableRows || !tableRows.length > 0"
:no-data-label="t('Enter a new search')"
class="q-mt-lg"
@row-click="(_, row) => selectItem(row)"
>
<template #body-cell-id="{ row }">
<QTd auto-width @click.stop>
<QBtn flat color="blue">{{ row.id }}</QBtn>
<ItemDescriptorProxy :id="row.id" />
</QTd>
</template>
</QTable>
</QCard>
</QForm>
</template>
<i18n>
es:
Filter item: Filtrar artículo
Enter a new search: Introduce una nueva búsqueda
</i18n>
<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>

View File

@ -0,0 +1,240 @@
<script setup>
import { ref, reactive, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'components/FetchData.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
import axios from 'axios';
import { toDate } from 'src/filters';
const emit = defineEmits(['travelSelected']);
const { t } = useI18n();
const travelFilter = {
include: [
{
relation: 'agency',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
],
};
const travelFilterParams = reactive({});
const closeButton = ref(null);
const isLoading = ref(false);
const agenciesOptions = ref([]);
const warehousesOptions = ref([]);
const tableRows = ref([]);
const loading = ref(false);
const tableColumns = computed(() => [
{
label: t('entry.basicData.id'),
name: 'id',
field: 'id',
align: 'left',
},
{
label: t('entry.basicData.warehouseOut'),
name: 'warehouseOutFk',
field: 'warehouseOutFk',
align: 'left',
format: (val) =>
warehousesOptions.value.find((warehouse) => warehouse.id === val).name,
},
{
label: t('entry.basicData.warehouseIn'),
name: 'warehouseInFk',
field: 'warehouseInFk',
align: 'left',
format: (val) =>
warehousesOptions.value.find((warehouse) => warehouse.id === val).name,
},
{
label: t('entry.basicData.shipped'),
name: 'shipped',
field: 'shipped',
align: 'left',
format: (val) => toDate(val),
},
{
label: t('entry.basicData.landed'),
name: 'landed',
field: 'landed',
align: 'left',
format: (val) => toDate(val),
},
]);
const fetchResults = async () => {
try {
let filter = travelFilter;
const params = travelFilterParams;
const where = {};
for (let key in params) {
const value = params[key];
if (!value) continue;
switch (key) {
case 'agencyModeFk':
case 'warehouseInFk':
case 'warehouseOutFk':
case 'shipped':
case 'landed':
where[key] = value;
}
}
filter.where = where;
const { data } = await axios.get('Travels', {
params: { filter: JSON.stringify(filter) },
});
tableRows.value = data;
} catch (err) {
console.error('Error fetching travels');
}
};
const closeForm = () => {
if (closeButton.value) closeButton.value.click();
};
const selectTravel = ({ id }) => {
emit('travelSelected', id);
closeForm();
};
</script>
<template>
<FetchData
url="AgencyModes"
@on-fetch="(data) => (agenciesOptions = data)"
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
auto-load
/>
<FetchData
url="Warehouses"
:filter="{ fields: ['id', 'name'] }"
order="name"
@on-fetch="(data) => (warehousesOptions = data)"
auto-load
/>
<QForm @submit="fetchResults()" class="all-pointer-events">
<QCard class="column" style="padding: 32px; z-index: 100">
<span ref="closeButton" class="close-icon" v-close-popup>
<QIcon name="close" size="sm" />
</span>
<h1 class="title">{{ t('Filter travels') }}</h1>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('entry.basicData.agency')"
:options="agenciesOptions"
hide-selected
option-label="name"
option-value="id"
v-model="travelFilterParams.agencyModeFk"
/>
</div>
<div class="col">
<VnSelectFilter
:label="t('entry.basicData.warehouseOut')"
:options="warehousesOptions"
hide-selected
option-label="name"
option-value="id"
v-model="travelFilterParams.warehouseOutFk"
/>
</div>
<div class="col">
<VnSelectFilter
:label="t('entry.basicData.warehouseIn')"
:options="warehousesOptions"
hide-selected
option-label="name"
option-value="id"
v-model="travelFilterParams.warehouseInFk"
/>
</div>
<div class="col">
<VnInputDate
:label="t('entry.basicData.shipped')"
v-model="travelFilterParams.shipped"
/>
</div>
<div class="col">
<VnInputDate
:label="t('entry.basicData.landed')"
v-model="travelFilterParams.landed"
/>
</div>
</VnRow>
<div class="q-mt-lg row justify-end">
<QBtn
:label="t('globals.search')"
type="submit"
color="primary"
:disabled="isLoading"
:loading="isLoading"
/>
</div>
<QTable
:columns="tableColumns"
:rows="tableRows"
:pagination="{ rowsPerPage: 0 }"
:loading="loading"
:hide-header="!tableRows || !tableRows.length > 0"
:no-data-label="t('Enter a new search')"
class="q-mt-lg"
@row-click="(_, row) => selectTravel(row)"
>
<template #body-cell-id="{ row }">
<QTd auto-width @click.stop>
<QBtn flat color="blue">{{ row.id }}</QBtn>
<TravelDescriptorProxy :id="row.id" />
</QTd>
</template>
</QTable>
</QCard>
</QForm>
</template>
<i18n>
es:
Filter travels: Filtro envíos
Enter a new search: Introduce una nueva búsqueda
</i18n>
<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>

View File

@ -81,9 +81,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);
} }
}); });
@ -134,7 +137,7 @@ async function save() {
try { try {
const body = $props.mapper ? $props.mapper(formData.value) : formData.value; const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
let response let response;
if ($props.urlCreate) { if ($props.urlCreate) {
response = await axios.post($props.urlCreate, body); response = await axios.post($props.urlCreate, body);
notify('globals.dataCreated', 'positive'); notify('globals.dataCreated', 'positive');
@ -183,13 +186,6 @@ watch(formUrl, async () => {
}); });
</script> </script>
<template> <template>
<QBanner
v-if="$props.observeFormChanges && hasChanges"
class="text-white bg-warning full-width"
>
<QIcon name="warning" size="md" class="q-mr-md" />
<span>{{ t('globals.changesToSave') }}</span>
</QBanner>
<div class="column items-center full-width"> <div class="column items-center full-width">
<QForm <QForm
v-if="formData" v-if="formData"

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,19 +1,19 @@
<script setup> <script setup>
import { onMounted, computed } from 'vue'; import { onMounted, computed } from 'vue';
import { Dark, Quasar, useQuasar } from 'quasar'; import { Dark, Quasar } from 'quasar';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import axios from 'axios'; import axios from 'axios';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { localeEquivalence } from "src/i18n/index"; import { localeEquivalence } from 'src/i18n/index';
const state = useState(); const state = useState();
const session = useSession(); const session = useSession();
const router = useRouter(); const router = useRouter();
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const quasar = useQuasar(); import { useClipboard } from 'src/composables/useClipboard';
const { copyText } = useClipboard();
const userLocale = computed({ const userLocale = computed({
get() { get() {
return locale.value; return locale.value;
@ -21,14 +21,14 @@ const userLocale = computed({
set(value) { set(value) {
locale.value = value; locale.value = value;
value = localeEquivalence[value] ?? value value = localeEquivalence[value] ?? value;
try { try {
/* @vite-ignore */ /* @vite-ignore */
import(`../../node_modules/quasar/lang/${value}.mjs`).then((lang) => { import(`../../node_modules/quasar/lang/${value}.mjs`).then((lang) => {
Quasar.lang.set(lang.default); Quasar.lang.set(lang.default);
}); });
} catch (error) { } catch (error) {
// //
} }
}, },
@ -81,12 +81,8 @@ function logout() {
router.push('/login'); router.push('/login');
} }
function copyUserToken(){ function copyUserToken() {
navigator.clipboard.writeText(session.getToken()); copyText(session.getToken(), { label: 'components.userPanel.copyToken' });
quasar.notify({
type: 'positive',
message: t('components.userPanel.copyToken'),
});
} }
</script> </script>
@ -129,8 +125,12 @@ function copyUserToken(){
<div class="text-subtitle1 q-mt-md"> <div class="text-subtitle1 q-mt-md">
<strong>{{ user.nickname }}</strong> <strong>{{ user.nickname }}</strong>
</div> </div>
<div class="text-subtitle3 text-grey-7 q-mb-xs copyUserToken" @click="copyUserToken()" >@{{ user.name }} <div
</div> class="text-subtitle3 text-grey-7 q-mb-xs copyText"
@click="copyUserToken()"
>
@{{ user.name }}
</div>
<QBtn <QBtn
id="logout" id="logout"
@ -152,9 +152,9 @@ function copyUserToken(){
width: 150px; width: 150px;
} }
.copyUserToken { .copyText {
&:hover{ &:hover {
cursor: alias; cursor: alias;
} }
} }
</style> </style>

View File

@ -41,7 +41,7 @@ const setUserConfigViewData = (data) => {
// Importante: El name de las columnas de la tabla debe conincidir con el name de las variables que devuelve la view config // Importante: El name de las columnas de la tabla debe conincidir con el name de las variables que devuelve la view config
formattedCols.value = $props.allColumns.map((col) => ({ formattedCols.value = $props.allColumns.map((col) => ({
name: col, name: col,
active: data[col], active: data[col] == undefined ? true : data[col],
})); }));
emitSavedConfig(); emitSavedConfig();
}; };

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

@ -0,0 +1,142 @@
<script setup>
import { ref, toRefs, computed, watch, onMounted } from 'vue';
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
import FetchData from 'components/FetchData.vue';
const emit = defineEmits(['update:modelValue', 'update:options']);
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const postcodesOptions = ref([]);
const postcodesRef = ref(null);
const $props = defineProps({
modelValue: {
type: [String, Number, Object],
default: null,
},
options: {
type: Array,
default: () => [],
},
optionLabel: {
type: String,
default: '',
},
optionValue: {
type: String,
default: '',
},
filterOptions: {
type: Array,
default: () => [],
},
isClearable: {
type: Boolean,
default: true,
},
defaultFilter: {
type: Boolean,
default: true,
},
});
const { options } = toRefs($props);
const myOptions = ref([]);
const myOptionsOriginal = ref([]);
const value = computed({
get() {
return $props.modelValue;
},
set(value) {
emit('update:modelValue', value);
},
});
onMounted(() => {
locationFilter($props.modelValue);
});
function setOptions(data) {
myOptions.value = JSON.parse(JSON.stringify(data));
myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
}
setOptions(options.value);
watch(options, (newValue) => {
setOptions(newValue);
});
function showLabel(data) {
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
}
function locationFilter(search = '') {
if (
search &&
(search.includes('undefined') || search.startsWith(`${$props.modelValue} - `))
)
return;
let where = { search };
postcodesRef.value.fetch({ filter: { where }, limit: 30 });
}
function handleFetch(data) {
postcodesOptions.value = data;
}
</script>
<template>
<FetchData
ref="postcodesRef"
url="Postcodes/filter"
@on-fetch="(data) => handleFetch(data)"
/>
<VnSelectDialog
v-if="postcodesRef"
:option-label="(opt) => showLabel(opt) ?? 'code'"
:option-value="(opt) => opt.code"
v-model="value"
:options="postcodesOptions"
:label="t('Location')"
:placeholder="t('search_by_postalcode')"
@input-value="locationFilter"
:default-filter="true"
:input-debounce="300"
:class="{ required: $attrs.required }"
v-bind="$attrs"
emit-value
map-options
use-input
clearable
hide-selected
fill-input
>
<template #form>
<CreateNewPostcode @on-data-saved="locationFilter()" />
</template>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
<QItemSection v-if="opt">
<QItemLabel>{{ opt.code }}</QItemLabel>
<QItemLabel caption>{{ showLabel(opt) }}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectDialog>
</template>
<style lang="scss" scoped>
.add-icon {
cursor: pointer;
background-color: $primary;
border-radius: 50px;
}
</style>
<i18n>
en:
search_by_postalcode: Search by postalcode, town, province or country
es:
Location: Ubicación
search_by_postalcode: Buscar por código postal, ciudad o país
</i18n>

View File

@ -168,17 +168,17 @@ function getLogTree(data) {
let originLog = null; let originLog = null;
let userLog = null; let userLog = null;
let modelLog = null; let modelLog = null;
let prevLog;
let nLogs; let nLogs;
data.forEach((log) => { for (let i = 0; i < data.length; i++) {
let log = data[i];
let prevLog = i > 0 ? data[i - 1] : null;
const locale = validations[log.changedModel]?.locale || {}; const locale = validations[log.changedModel]?.locale || {};
// Origin // Origin
const originChanged = !prevLog || log.originFk != prevLog.originFk; const originChanged = !prevLog || log.originFk != prevLog.originFk;
if (originChanged) { if (originChanged) {
logs.push((originLog = { originFk: log.originFk, logs: [] })); logs.push((originLog = { originFk: log.originFk, logs: [] }));
prevLog = log;
} }
// User // User
const userChanged = originChanged || log.userFk != prevLog.userFk; const userChanged = originChanged || log.userFk != prevLog.userFk;
@ -197,6 +197,7 @@ function getLogTree(data) {
log.changedModel != prevLog.changedModel || log.changedModel != prevLog.changedModel ||
log.changedModelId != prevLog.changedModelId || log.changedModelId != prevLog.changedModelId ||
nLogs >= 6; nLogs >= 6;
if (modelChanged) { if (modelChanged) {
userLog.logs.push( userLog.logs.push(
(modelLog = { (modelLog = {
@ -221,7 +222,7 @@ function getLogTree(data) {
propNames = [...new Set(propNames)]; propNames = [...new Set(propNames)];
log.props = parseProps(propNames, locale, vals, olds); log.props = parseProps(propNames, locale, vals, olds);
}); }
return logs; return logs;
} }
@ -320,7 +321,6 @@ function selectFilter(type, dateType) {
} }
if (type === 'action' && selectedFilters.value.changedModel === null) { if (type === 'action' && selectedFilters.value.changedModel === null) {
selectedFilters.value.changedModel = undefined; selectedFilters.value.changedModel = undefined;
reload = false;
} }
if (type === 'userRadio') { if (type === 'userRadio') {
selectedFilters.value.userFk = userRadio.value; selectedFilters.value.userFk = userRadio.value;
@ -415,18 +415,19 @@ setLogTree();
<div class="line bg-grey"></div> <div class="line bg-grey"></div>
</QItem> </QItem>
<div <div
class="user-log q-mb-sm row" class="user-log q-mb-sm"
v-for="(userLog, userIndex) in originLog.logs" v-for="(userLog, userIndex) in originLog.logs"
:key="userIndex" :key="userIndex"
> >
<div class="timeline"> <div class="timeline">
<div class="user-avatar"> <div class="user-avatar">
<VnUserLink v-if="userLog.user.image" :worker-id="userLog.user.id"> <VnUserLink :worker-id="userLog.user.id">
<template #link> <template #link>
<VnAvatar <VnAvatar
:class="{ 'cursor-pointer': userLog.user.id }" :class="{ 'cursor-pointer': userLog.user.id }"
:worker-id="userLog.user.id" :worker-id="userLog.user.id"
:title="userLog.user.nickname" :title="userLog.user.nickname"
size="lg"
/> />
</template> </template>
</VnUserLink> </VnUserLink>
@ -663,9 +664,9 @@ 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')"
@clear="() => selectFilter('action')"
hide-selected hide-selected
/> />
</QItem> </QItem>
@ -823,14 +824,30 @@ setLogTree();
.q-item { .q-item {
min-height: 0px; min-height: 0px;
} }
.q-menu {
display: block;
& > .loading {
display: flex;
justify-content: center;
}
& > .q-card {
min-width: 180px;
max-width: 400px;
& > .header {
color: $dark;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
.origin-log { .origin-log {
&:first-child > .origin-info { &:first-child > .origin-info {
margin-top: 0; margin-top: 0;
} }
& > .origin-info { & > .origin-info {
width: 100%;
max-width: 42em;
margin-top: 28px; margin-top: 28px;
gap: 6px; gap: 6px;
@ -847,14 +864,15 @@ setLogTree();
} }
} }
.user-log { .user-log {
display: flex;
width: 100%; width: 100%;
max-width: 40em; max-width: 40em;
& > .timeline { & > .timeline {
position: relative; position: relative;
padding-right: 5px; padding-right: 1px;
width: 50px; width: 38px;
min-width: 38px; min-width: 38px;
flex-grow: auto;
& > .arrow { & > .arrow {
height: 8px; height: 8px;
width: 8px; width: 8px;
@ -874,7 +892,7 @@ setLogTree();
position: absolute; position: absolute;
background-color: $primary; background-color: $primary;
width: 2px; width: 2px;
left: 23px; left: 19px;
z-index: -1; z-index: -1;
top: 0; top: 0;
bottom: -8px; bottom: -8px;
@ -893,6 +911,7 @@ setLogTree();
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
min-height: 22px;
.model-value { .model-value {
font-style: italic; font-style: italic;
} }
@ -984,25 +1003,6 @@ setLogTree();
} }
} }
} }
.q-menu {
display: block;
& > .loading {
display: flex;
justify-content: center;
}
& > .q-card {
min-width: 180px;
max-width: 400px;
& > .header {
color: $dark;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
</style> </style>
<i18n> <i18n>
en: en:

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

@ -20,6 +20,10 @@ const $props = defineProps({
type: Array, type: Array,
default: () => ['developer'], default: () => ['developer'],
}, },
actionIcon: {
type: String,
default: 'add',
},
}); });
const role = useRole(); const role = useRole();
@ -48,9 +52,9 @@ const toggleForm = () => {
<template v-if="isAllowedToCreate" #append> <template v-if="isAllowedToCreate" #append>
<QIcon <QIcon
@click.stop.prevent="toggleForm()" @click.stop.prevent="toggleForm()"
name="add" :name="actionIcon"
size="xs" :size="actionIcon === 'add' ? 'xs' : 'sm'"
class="add-icon" :class="['default-icon', { '--add-icon': actionIcon === 'add' }]"
/> />
<QDialog v-model="showForm" transition-show="scale" transition-hide="scale"> <QDialog v-model="showForm" transition-show="scale" transition-hide="scale">
<slot name="form" /> <slot name="form" />
@ -63,9 +67,14 @@ const toggleForm = () => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.add-icon { .default-icon {
cursor: pointer; cursor: pointer;
background-color: $primary; color: $primary;
border-radius: 50px; border-radius: 50px;
&.--add-icon {
color: var(--vn-text);
background-color: $primary;
}
} }
</style> </style>

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']);
@ -12,11 +14,19 @@ const $props = defineProps({
default: () => [], default: () => [],
}, },
optionLabel: { optionLabel: {
type: [String],
default: '',
},
optionValue: {
type: String,
default: '',
},
url: {
type: String, type: String,
default: '', default: '',
}, },
filterOptions: { filterOptions: {
type: Array, type: [Array],
default: () => [], default: () => [],
}, },
isClearable: { isClearable: {
@ -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,8 +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));
} }
setOptions(options.value); onMounted(() => {
const filter = (val, options) => { setOptions(options.value);
if ($props.url && $props.modelValue) fetchFilter($props.modelValue);
});
async function filter(val, options) {
const search = val.toString().toLowerCase(); const search = val.toString().toLowerCase();
if (!search) return options; if (!search) return options;
@ -66,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) {
@ -81,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
@ -116,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']);
@ -81,6 +79,7 @@ function viewSummary(id) {
<div class="descriptor"> <div class="descriptor">
<template v-if="entity"> <template v-if="entity">
<div class="header bg-primary q-pa-sm justify-between"> <div class="header bg-primary q-pa-sm justify-between">
<slot name="header-extra-action" />
<QBtn <QBtn
@click.stop="viewSummary(entity.id)" @click.stop="viewSummary(entity.id)"
round round
@ -118,7 +117,7 @@ function viewSummary(id) {
icon="more_vert" icon="more_vert"
round round
size="md" size="md"
v-if="slots.menu" :class="{ invisible: !slots.menu }"
> >
<QTooltip> <QTooltip>
{{ t('components.cardDescriptor.moreOptions') }} {{ t('components.cardDescriptor.moreOptions') }}

View File

@ -1,19 +1,37 @@
<script setup> <script setup>
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { useColor } from 'src/composables/useColor';
const $props = defineProps({ const $props = defineProps({
workerId: { type: Number, required: true }, workerId: { type: Number, required: true },
description: { type: String, default: null }, description: { type: String, default: null },
size: { type: String, default: null },
title: { type: String, default: null },
}); });
const session = useSession(); const session = useSession();
const token = session.getToken(); const token = session.getToken();
const { t } = useI18n();
const title = computed(() => $props.title ?? t('globals.system'));
const showLetter = ref(false);
</script> </script>
<template> <template>
<div class="avatar-picture column items-center"> <div class="avatar-picture column items-center">
<QAvatar color="orange"> <QAvatar
:style="{
backgroundColor: useColor(title),
}"
:size="$props.size"
:title="title"
>
<template v-if="showLetter">{{ title.charAt(0) }}</template>
<QImg <QImg
v-else
:src="`/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`" :src="`/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`"
spinner-color="white" spinner-color="white"
@error="showLetter = true"
/> />
</QAvatar> </QAvatar>
<div class="description"> <div class="description">

View File

@ -64,10 +64,12 @@ onMounted(() => {
}); });
const isLoading = ref(false); const isLoading = ref(false);
async function search() { async function search() {
isLoading.value = true; isLoading.value = true;
const params = { ...userParams.value }; const params = { ...userParams.value };
store.userParamsChanged = true;
store.filter.skip = 0;
store.skip = 0;
const { params: newParams } = await arrayData.addFilter({ params }); const { params: newParams } = await arrayData.addFilter({ params });
userParams.value = newParams; userParams.value = newParams;
@ -89,7 +91,9 @@ async function reload() {
async function clearFilters() { async function clearFilters() {
isLoading.value = true; isLoading.value = true;
store.userParamsChanged = true;
store.filter.skip = 0;
store.skip = 0;
// Filtrar los params no removibles // Filtrar los params no removibles
const removableFilters = Object.keys(userParams.value).filter((param) => const removableFilters = Object.keys(userParams.value).filter((param) =>
props.unremovableParams.includes(param) props.unremovableParams.includes(param)
@ -216,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">
@ -242,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

@ -2,6 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { dashIfEmpty } from 'src/filters'; import { dashIfEmpty } from 'src/filters';
import { useClipboard } from 'src/composables/useClipboard';
const $props = defineProps({ const $props = defineProps({
label: { type: String, default: null }, label: { type: String, default: null },
value: { value: {
@ -10,8 +11,19 @@ const $props = defineProps({
}, },
info: { type: String, default: null }, info: { type: String, default: null },
dash: { type: Boolean, default: true }, dash: { type: Boolean, default: true },
copy: { type: Boolean, default: false },
}); });
const isBooleanValue = computed(() => typeof $props.value === 'boolean'); const isBooleanValue = computed(() => typeof $props.value === 'boolean');
const { copyText } = useClipboard();
function copyValueText() {
copyText($props.value, {
component: {
copyValue: $props.value,
},
});
}
</script> </script>
<style scoped> <style scoped>
.label, .label,
@ -48,5 +60,16 @@ const isBooleanValue = computed(() => typeof $props.value === 'boolean');
</QTooltip> </QTooltip>
</QIcon> </QIcon>
</div> </div>
<div class="copy" v-if="$props.copy && $props.value" @click="copyValueText()">
<QIcon name="Content_Copy" color="primary" />
</div>
</div> </div>
</template> </template>
<style lang="scss" scoped>
.copy {
&:hover {
cursor: pointer;
}
}
</style>

View File

@ -104,6 +104,8 @@ async function paginate() {
await arrayData.loadMore(); await arrayData.loadMore();
if (!arrayData.hasMoreData.value) { if (!arrayData.hasMoreData.value) {
if (store.userParamsChanged) arrayData.hasMoreData.value = true;
store.userParamsChanged = false;
isLoading.value = false; isLoading.value = false;
return; return;
} }
@ -129,9 +131,9 @@ async function onLoad(...params) {
pagination.value.page = pagination.value.page + 1; pagination.value.page = pagination.value.page + 1;
await paginate(); await paginate();
let isDone = false;
const endOfPages = !arrayData.hasMoreData.value; if (store.userParamsChanged) isDone = !arrayData.hasMoreData.value;
done(endOfPages); done(isDone);
} }
</script> </script>
@ -172,7 +174,7 @@ async function onLoad(...params) {
v-if="store.data" v-if="store.data"
@load="onLoad" @load="onLoad"
:offset="offset" :offset="offset"
class="full-width full-height overflow-auto" class="full-width full-height"
> >
<slot name="body" :rows="store.data"></slot> <slot name="body" :rows="store.data"></slot>
<div v-if="isLoading" class="info-row q-pa-md text-center"> <div v-if="isLoading" class="info-row q-pa-md text-center">

View File

@ -61,6 +61,10 @@ const props = defineProps({
type: Function, type: Function,
default: null, default: null,
}, },
customRouteRedirectName: {
type: String,
default: '',
},
}); });
const router = useRouter(); const router = useRouter();
@ -87,15 +91,18 @@ async function search() {
}); });
if (!props.redirect) return; if (!props.redirect) return;
const rows = store.data; if (props.customRouteRedirectName) {
const module = route.matched[1]; router.push({
if (rows.length === 1) { name: props.customRouteRedirectName,
const [firstRow] = rows; params: { id: searchText.value },
await router.push({ path: `${module.path}/${firstRow.id}` }); });
} else if (route.matched.length > 3) { return;
await router.push({ path: `${module.path}` });
arrayData.updateStateParams();
} }
const { matched: matches } = route;
const { path } = matches[matches.length - 1];
const newRoute = path.replace(':id', searchText.value);
await router.push(newRoute);
} }
</script> </script>

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

@ -142,7 +142,8 @@ export function useArrayData(key, userOptions) {
userParams = sanitizerParams(userParams, store?.exprBuilder); userParams = sanitizerParams(userParams, store?.exprBuilder);
store.userParams = userParams; store.userParams = userParams;
store.skip = 0;
store.filter.skip = 0;
await fetch({ append: false }); await fetch({ append: false });
return { filter, params }; return { filter, params };
} }

View File

@ -0,0 +1,17 @@
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
export function useClipboard() {
const quasar = useQuasar();
const { t } = useI18n();
/**
*
* @param {String} value Value to send to clipboardAPI
* @param {Object} {label, component} Refer to Quasar notify configuration. Label is the text to translate
*/
function copyText(value, { label = 'components.VnLv.copyText', component = {} }) {
navigator.clipboard.writeText(value);
quasar.notify({ type: 'positive', message: t(label, component) });
}
return { copyText };
}

View File

@ -25,6 +25,7 @@ export function useState() {
lang: user.value.lang, lang: user.value.lang,
darkMode: user.value.darkMode, darkMode: user.value.darkMode,
companyFk: user.value.companyFk, companyFk: user.value.companyFk,
warehouseFk: user.value.warehouseFk,
}; };
}); });
} }
@ -37,6 +38,7 @@ export function useState() {
lang: data.lang, lang: data.lang,
darkMode: data.darkMode, darkMode: data.darkMode,
companyFk: data.companyFk, companyFk: data.companyFk,
warehouseFk: data.warehouseFk,
}; };
} }

View File

@ -12,6 +12,7 @@ export function useUserConfig() {
const user = state.getUser().value; const user = state.getUser().value;
user.darkMode = data.darkMode; user.darkMode = data.darkMode;
user.companyFk = data.companyFk; user.companyFk = data.companyFk;
user.warehouseFk = data.warehouseFk;
state.setUser(user); state.setUser(user);
return data; return data;

View File

@ -30,6 +30,15 @@ export function useValidator() {
const { t } = useI18n(); const { t } = useI18n();
const validations = function (validation) { const validations = function (validation) {
return { return {
format: (value) => {
const { allowNull, with: format, allowBlank } = validation;
const message = t(validation.message) || validation.message;
if (!allowBlank && value === '') return message;
if (!allowNull && value === null) return message;
const isValid = new RegExp(format).test(value);
if (!isValid) return message;
},
presence: (value) => { presence: (value) => {
let message = `Value can't be empty`; let message = `Value can't be empty`;
if (validation.message) if (validation.message)

View File

@ -52,13 +52,32 @@ 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: ' *';
} }
input[type='number'] {
-moz-appearance: textfield;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
}

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

@ -268,6 +268,8 @@ export default {
buys: 'Buys', buys: 'Buys',
notes: 'Notes', notes: 'Notes',
log: 'Log', log: 'Log',
create: 'Create',
latestBuys: 'Latest buys',
}, },
list: { list: {
newEntry: 'New entry', newEntry: 'New entry',
@ -323,6 +325,12 @@ export default {
booked: 'Booked', booked: 'Booked',
raid: 'Raid', raid: 'Raid',
excludedFromAvailable: 'Inventory', excludedFromAvailable: 'Inventory',
agency: 'Agency',
warehouseOut: 'Warehouse Out',
warehouseIn: 'Warehouse In',
shipped: 'Shipped',
landed: 'Landed',
id: 'ID',
}, },
buys: { buys: {
groupingPrice: 'Grouping price', groupingPrice: 'Grouping price',
@ -336,6 +344,12 @@ export default {
grouping: 'Grouping', grouping: 'Grouping',
buyingValue: 'Buying value', buyingValue: 'Buying value',
packagingFk: 'Box', packagingFk: 'Box',
file: 'File',
name: 'Name',
producer: 'Producer',
type: 'Type',
color: 'Color',
id: 'ID',
}, },
notes: { notes: {
observationType: 'Observation type', observationType: 'Observation type',
@ -346,6 +360,36 @@ export default {
landed: 'Landed', landed: 'Landed',
warehouseOut: 'Warehouse Out', warehouseOut: 'Warehouse Out',
}, },
latestBuys: {
picture: 'Picture',
itemFk: 'Item ID',
packing: 'Packing',
grouping: 'Grouping',
quantity: 'Quantity',
description: 'Description',
size: 'Size',
tags: 'Tags',
type: 'Type',
intrastat: 'Intrastat',
origin: 'Origin',
weightByPiece: 'Weight/Piece',
isActive: 'Active',
family: 'Family',
entryFk: 'Entry',
buyingValue: 'Buying value',
freightValue: 'Freight value',
comissionValue: 'Commission value',
packageValue: 'Package value',
isIgnored: 'Is ignored',
price2: 'Grouping',
price3: 'Packing',
minPrice: 'Min',
ektFk: 'Ekt',
weight: 'Weight',
packagingFk: 'Package',
packingOut: 'Package out',
landing: 'Landing',
},
}, },
ticket: { ticket: {
pageTitles: { pageTitles: {
@ -1018,6 +1062,7 @@ export default {
m3Price: 'M3 Price', m3Price: 'M3 Price',
routePrice: 'Route price', routePrice: 'Route price',
minimumKm: 'Minimum Km', minimumKm: 'Minimum Km',
addRow: 'Add row',
}, },
consumption: { consumption: {
entry: 'Entry', entry: 'Entry',
@ -1060,6 +1105,25 @@ export default {
totalEntries: 'Total entries', totalEntries: 'Total entries',
}, },
}, },
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: {
@ -1083,5 +1147,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: {
copyText: '{copyValue} has been copied to the clipboard',
},
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789',
}, },
}; };

View File

@ -267,6 +267,8 @@ export default {
buys: 'Compras', buys: 'Compras',
notes: 'Notas', notes: 'Notas',
log: 'Historial', log: 'Historial',
create: 'Crear',
latestBuys: 'Últimas compras',
}, },
list: { list: {
newEntry: 'Nueva entrada', newEntry: 'Nueva entrada',
@ -322,6 +324,12 @@ export default {
booked: 'Asentado', booked: 'Asentado',
raid: 'Redada', raid: 'Redada',
excludedFromAvailable: 'Inventario', excludedFromAvailable: 'Inventario',
agency: 'Agencia',
warehouseOut: 'Alm. salida',
warehouseIn: 'Alm. entrada',
shipped: 'F. envío',
landed: 'F. entrega',
id: 'ID',
}, },
buys: { buys: {
groupingPrice: 'Precio grouping', groupingPrice: 'Precio grouping',
@ -335,6 +343,12 @@ export default {
grouping: 'Grouping', grouping: 'Grouping',
buyingValue: 'Coste', buyingValue: 'Coste',
packagingFk: 'Embalaje', packagingFk: 'Embalaje',
file: 'Fichero',
name: 'Nombre',
producer: 'Productor',
type: 'Tipo',
color: 'Color',
id: 'ID',
}, },
notes: { notes: {
observationType: 'Tipo de observación', observationType: 'Tipo de observación',
@ -345,6 +359,36 @@ export default {
landed: 'F. entrega', landed: 'F. entrega',
warehouseOut: 'Alm. salida', warehouseOut: 'Alm. salida',
}, },
latestBuys: {
picture: 'Foto',
itemFk: 'ID Artículo',
packing: 'Packing',
grouping: 'Grouping',
quantity: 'Cantidad',
description: 'Descripción',
size: 'Medida',
tags: 'Etiquetas',
type: 'Tipo',
intrastat: 'Intrastat',
origin: 'Origen',
weightByPiece: 'Peso (gramos)/tallo',
isActive: 'Activo',
family: 'Familia',
entryFk: 'Entrada',
buyingValue: 'Coste',
freightValue: 'Porte',
comissionValue: 'Comisión',
packageValue: 'Embalaje',
isIgnored: 'Ignorado',
price2: 'Grouping',
price3: 'Packing',
minPrice: 'Min',
ektFk: 'Ekt',
weight: 'Peso',
packagingFk: 'Embalaje',
packingOut: 'Embalaje envíos',
landing: 'Llegada',
},
}, },
ticket: { ticket: {
pageTitles: { pageTitles: {
@ -1018,6 +1062,7 @@ export default {
m3Price: 'Precio M3', m3Price: 'Precio M3',
routePrice: 'Precio ruta', routePrice: 'Precio ruta',
minimumKm: 'Km mínimos', minimumKm: 'Km mínimos',
addRow: 'Añadir fila',
}, },
consumption: { consumption: {
entry: 'Entrada', entry: 'Entrada',
@ -1060,6 +1105,25 @@ export default {
totalEntries: 'Ent. totales', totalEntries: 'Ent. totales',
}, },
}, },
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: {
@ -1083,5 +1147,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: {
copyText: '{copyValue} se ha copiado al portapepeles',
},
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789',
}, },
}; };

View File

@ -37,6 +37,7 @@ const marker_labels = [
{ value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') }, { value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') },
{ value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') }, { value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') },
]; ];
const multiplicatorValue = ref();
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -134,17 +135,7 @@ async function regularizeClaim() {
message: t('globals.dataSaved'), message: t('globals.dataSaved'),
type: 'positive', type: 'positive',
}); });
if (claim.value.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2) { await onUpdateGreugeAccept();
quasar
.dialog({
component: VnConfirm,
componentProps: {
title: t('confirmGreuges'),
message: t('confirmGreugesMessage'),
},
})
.onOk(async () => await onUpdateGreugeAccept());
}
} }
async function onUpdateGreugeAccept() { async function onUpdateGreugeAccept() {
@ -153,9 +144,9 @@ async function onUpdateGreugeAccept() {
filter: { where: { code: 'freightPickUp' } }, filter: { where: { code: 'freightPickUp' } },
}) })
).data.id; ).data.id;
const freightPickUpPrice = (await axios.get(`GreugeConfigs/findOne`)).data const freightPickUpPrice =
.freightPickUpPrice; (await axios.get(`GreugeConfigs/findOne`)).data.freightPickUpPrice *
multiplicatorValue.value;
await axios.post(`Greuges`, { await axios.post(`Greuges`, {
clientFk: claim.value.clientFk, clientFk: claim.value.clientFk,
description: `${t('ClaimGreugeDescription')} ${claimId}`.toUpperCase(), description: `${t('ClaimGreugeDescription')} ${claimId}`.toUpperCase(),
@ -226,10 +217,10 @@ async function importToNewRefundTicket() {
show-if-above show-if-above
v-if="claim" v-if="claim"
> >
<QCard class="totalClaim vn-card q-my-md q-pa-sm"> <QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
{{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }} {{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }}
</QCard> </QCard>
<QCard class="vn-card q-mb-md q-pa-sm"> <QCard class="q-mb-md q-pa-sm no-box-shadow">
<QItem class="justify-between"> <QItem class="justify-between">
<QItemLabel class="slider-container"> <QItemLabel class="slider-container">
<p class="text-primary"> <p class="text-primary">
@ -250,13 +241,31 @@ async function importToNewRefundTicket() {
</QItemLabel> </QItemLabel>
</QItem> </QItem>
</QCard> </QCard>
<QItemLabel class="mana q-mb-md"> <QCard class="q-mb-md q-pa-sm no-box-shadow" style="margin-bottom: 1em">
<QCheckbox <QItemLabel class="mana q-mb-md">
v-model="claim.isChargedToMana" <QCheckbox
@update:model-value="(value) => save({ isChargedToMana: value })" v-model="claim.isChargedToMana"
@update:model-value="(value) => save({ isChargedToMana: value })"
/>
<span>{{ t('mana') }}</span>
</QItemLabel>
</QCard>
<QCard class="q-mb-md q-pa-sm no-box-shadow" style="position: static">
<QInput
:disable="
!(claim.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2)
"
:label="t('confirmGreuges')"
class="q-field__native text-grey-2"
type="number"
placeholder="0"
id="multiplicatorValue"
name="multiplicatorValue"
min="0"
max="50"
v-model="multiplicatorValue"
/> />
<span>{{ t('mana') }}</span> </QCard>
</QItemLabel>
</QDrawer> </QDrawer>
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> </Teleport> <Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> </Teleport>
<CrudModel <CrudModel
@ -494,4 +503,5 @@ es:
Id item: Id artículo Id item: Id artículo
confirmGreuges: ¿Desea insertar greuges? confirmGreuges: ¿Desea insertar greuges?
confirmGreugesMessage: Insertar greuges en la ficha del cliente confirmGreugesMessage: Insertar greuges en la ficha del cliente
Apply Greuges: Aplicar Greuges
</i18n> </i18n>

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

@ -2,7 +2,7 @@
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { toDate } from 'src/filters'; import { toDate, toPercentage } from 'src/filters';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue'; import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue'; import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
@ -32,7 +32,16 @@ const filter = {
{ {
relation: 'client', relation: 'client',
scope: { scope: {
include: { relation: 'salesPersonUser' }, include: [
{ relation: 'salesPersonUser' },
{
relation: 'claimsRatio',
scope: {
fields: ['claimingRate'],
limit: 1,
},
},
],
}, },
}, },
{ {
@ -135,6 +144,10 @@ const setData = (entity) => {
:value="entity.ticket?.address?.province?.name" :value="entity.ticket?.address?.province?.name"
/> />
<VnLv :label="t('claim.card.zone')" :value="entity.ticket?.zone?.name" /> <VnLv :label="t('claim.card.zone')" :value="entity.ticket?.zone?.name" />
<VnLv
:label="t('claimRate')"
:value="toPercentage(entity.client?.claimsRatio?.claimingRate)"
/>
</template> </template>
<template #actions="{ entity }"> <template #actions="{ entity }">
<QCardActions> <QCardActions>
@ -163,3 +176,9 @@ const setData = (entity) => {
margin-top: 0; margin-top: 0;
} }
</style> </style>
<i18n>
en:
claimRate: Claming rate
es:
claimRate: Ratio de reclamación
</i18n>

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

@ -30,7 +30,7 @@ const body = {
</script> </script>
<template> <template>
<div class="column items-center"> <div class="column items-center">
<VnNotes <VnNotes style="overflow-y: scroll;"
:add-note="$props.addNote" :add-note="$props.addNote"
:id="id" :id="id"
url="claimObservations" url="claimObservations"

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"
@ -87,20 +87,22 @@ function viewSummary(id) {
v-for="row of rows" v-for="row of rows"
> >
<template #list-items> <template #list-items>
<VnLv :label="t('claim.list.customer')" @click.stop> <VnLv :label="t('claim.list.customer')">
<template #value> <template #value>
<span class="link"> <span class="link" @click.stop>
{{ row.clientName }} {{ row.clientName }}
<CustomerDescriptorProxy :id="row.clientFk" /> <CustomerDescriptorProxy :id="row.clientFk" />
</span> </span>
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('claim.list.assignedTo')" @click.stop> <VnLv :label="t('claim.list.assignedTo')">
<template #value> <template #value>
<VnUserLink <span @click.stop>
:name="row.workerName" <VnUserLink
:worker-id="row.workerFk" :name="row.workerName"
/> :worker-id="row.workerFk"
/>
</span>
</template> </template>
</VnLv> </VnLv>
<VnLv <VnLv
@ -145,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

@ -1,14 +1,16 @@
<script setup> <script setup>
import { ref } from 'vue'; import { onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import axios from 'axios';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.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';
import VnInput from 'src/components/common/VnInput.vue'; 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 VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue'; import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue';
const { t } = useI18n(); const { t } = useI18n();
@ -16,16 +18,25 @@ const route = useRoute();
const payMethods = ref([]); const payMethods = ref([]);
const bankEntitiesOptions = ref([]); const bankEntitiesOptions = ref([]);
const bankEntitiesRef = ref(null);
const onBankEntityCreated = (data) => { const filter = {
bankEntitiesOptions.value.push(data); fields: ['id', 'bic', 'name'],
order: 'bic ASC',
limit: 30,
};
const getBankEntities = () => {
bankEntitiesRef.value.fetch();
}; };
</script> </script>
<template> <template>
<fetch-data @on-fetch="(data) => (payMethods = data)" auto-load url="PayMethods" /> <fetch-data @on-fetch="(data) => (payMethods = data)" auto-load url="PayMethods" />
<FetchData <fetch-data
ref="bankEntitiesRef"
@on-fetch="(data) => (bankEntitiesOptions = data)" @on-fetch="(data) => (bankEntitiesOptions = data)"
:filter="filter"
auto-load auto-load
url="BankEntities" url="BankEntities"
/> />
@ -59,10 +70,16 @@ const onBankEntityCreated = (data) => {
<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 <VnSelectDialog
:label="t('Swift / BIC')" :label="t('Swift / BIC')"
:options="bankEntitiesOptions" :options="bankEntitiesOptions"
:roles-allowed-to-create="['salesAssistant', 'hr']" :roles-allowed-to-create="['salesAssistant', 'hr']"
@ -73,9 +90,7 @@ const onBankEntityCreated = (data) => {
v-model="data.bankEntityFk" v-model="data.bankEntityFk"
> >
<template #form> <template #form>
<CreateBankEntityForm <CreateBankEntityForm @on-data-saved="getBankEntities()" />
@on-data-saved="onBankEntityCreated($event)"
/>
</template> </template>
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
@ -87,7 +102,7 @@ const onBankEntityCreated = (data) => {
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
</VnSelectCreate> </VnSelectDialog>
</div> </div>
</VnRow> </VnRow>

View File

@ -91,7 +91,7 @@ const toCustomerConsigneeEdit = (consigneeId) => {
}" }"
@click="toCustomerConsigneeEdit(item.id)" @click="toCustomerConsigneeEdit(item.id)"
> >
<div class="consignees-card-icon"> <div class="q-ml-xs q-mr-md flex items-center">
<QIcon name="star" size="md" color="primary" /> <QIcon name="star" size="md" color="primary" />
</div> </div>
<div> <div>
@ -160,11 +160,6 @@ const toCustomerConsigneeEdit = (consigneeId) => {
background-color: var(--vn-light-gray); background-color: var(--vn-light-gray);
} }
} }
.consignees-card-icon {
margin: 0 15px 0 5px;
display: flex;
align-items: center;
}
</style> </style>
<i18n> <i18n>

View File

@ -109,9 +109,9 @@ const toCustomerCreditCreate = () => {
<QTr :props="props" class="cursor-pointer"> <QTr :props="props" class="cursor-pointer">
<component <component
:is="tableColumnComponents[props.col.name].component" :is="tableColumnComponents[props.col.name].component"
class="col-content"
v-bind="tableColumnComponents[props.col.name].props(props)"
@click="tableColumnComponents[props.col.name].event(props)" @click="tableColumnComponents[props.col.name].event(props)"
class="rounded-borders q-pa-sm"
v-bind="tableColumnComponents[props.col.name].props(props)"
> >
{{ props.value }} {{ props.value }}
<WorkerDescriptorProxy :id="workerId" /> <WorkerDescriptorProxy :id="workerId" />
@ -130,13 +130,6 @@ const toCustomerCreditCreate = () => {
</QPageSticky> </QPageSticky>
</template> </template>
<style lang="scss" scoped>
.col-content {
border-radius: 4px;
padding: 6px;
}
</style>
<i18n> <i18n>
es: es:
Since: Desde Since: Desde

View File

@ -8,60 +8,31 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; 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 CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import VnLocation from 'src/components/common/VnLocation.vue';
import VnSelectCreate from 'src/components/common/VnSelectCreate.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const townsFetchDataRef = ref(null);
const postcodeFetchDataRef = ref(null);
const typesTaxes = ref([]); const typesTaxes = ref([]);
const typesTransactions = ref([]); const typesTransactions = ref([]);
const citiesLocationOptions = ref([]);
const provincesLocationOptions = ref([]);
const countriesOptions = ref([]);
const postcodesOptions = ref([]); const postcodesOptions = ref([]);
const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formData) => { function handleLocation(data, location) {
await postcodeFetchDataRef.value.fetch(); const { town, code, provinceFk, countryFk } = location ?? {};
await townsFetchDataRef.value.fetch(); data.postcode = code;
formData.postcode = code; data.city = town;
formData.provinceFk = provinceFk; data.provinceFk = provinceFk;
formData.city = citiesLocationOptions.value.find((town) => town.id === townFk).name; data.countryFk = countryFk;
formData.countryFk = countryFk; }
};
</script> </script>
<template> <template>
<fetch-data auto-load @on-fetch="(data) => (typesTaxes = data)" url="SageTaxTypes" /> <FetchData auto-load @on-fetch="(data) => (typesTaxes = data)" url="SageTaxTypes" />
<fetch-data <FetchData
auto-load auto-load
@on-fetch="(data) => (typesTransactions = data)" @on-fetch="(data) => (typesTransactions = data)"
url="SageTransactionTypes" url="SageTransactionTypes"
/> />
<FetchData
ref="townsFetchDataRef"
@on-fetch="(data) => (citiesLocationOptions = data)"
auto-load
url="Towns/location"
/>
<FetchData
@on-fetch="(data) => (provincesLocationOptions = data)"
auto-load
url="Provinces/location"
/>
<FetchData
@on-fetch="(data) => (countriesOptions = data)"
auto-load
url="Countries"
/>
<FetchData
ref="postcodeFetchDataRef"
url="Postcodes/location"
@on-fetch="(data) => (postcodesOptions = data)"
auto-load
/>
<FormModel <FormModel
:url-update="`Clients/${route.params.id}/updateFiscalData`" :url-update="`Clients/${route.params.id}/updateFiscalData`"
:url="`Clients/${route.params.id}/getCard`" :url="`Clients/${route.params.id}/getCard`"
@ -114,94 +85,14 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnSelectCreate <VnLocation
:label="t('Postcode')"
:options="postcodesOptions"
:roles-allowed-to-create="['deliveryAssistant']"
:rules="validate('Worker.postcode')" :rules="validate('Worker.postcode')"
hide-selected :roles-allowed-to-create="['deliveryAssistant']"
option-label="code" :options="postcodesOptions"
option-value="code"
v-model="data.postcode" v-model="data.postcode"
@update:model-value="(location) => handleLocation(data, location)"
> >
<template #form> </VnLocation>
<CustomerCreateNewPostcode
@on-data-saved="onPostcodeCreated($event, data)"
/>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection v-if="scope.opt">
<QItemLabel>{{ scope.opt.code }}</QItemLabel>
<QItemLabel caption
>{{ scope.opt.code }} -
{{ scope.opt.town.name }} ({{
scope.opt.town.province.name
}},
{{
scope.opt.town.province.country.country
}})</QItemLabel
>
</QItemSection>
</QItem>
</template>
</VnSelectCreate>
</div>
<div class="col">
<VnSelectFilter
:label="t('City')"
:options="citiesLocationOptions"
hide-selected
option-label="name"
option-value="name"
v-model="data.city"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt.name }}</QItemLabel>
<QItemLabel caption>
{{
`${scope.opt.name}, ${scope.opt.province.name} (${scope.opt.province.country.country})`
}}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Province')"
:options="provincesLocationOptions"
hide-selected
option-label="name"
option-value="id"
v-model="data.provinceFk"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
`${scope.opt.name} (${scope.opt.country.country})`
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div>
<div class="col">
<VnSelectFilter
:label="t('Country')"
:options="countriesOptions"
hide-selected
option-label="country"
option-value="id"
v-model="data.countryFk"
/>
</div> </div>
</VnRow> </VnRow>

View File

@ -36,7 +36,9 @@ const toCustomerNoteCreate = () => {
v-for="(item, index) in rows" v-for="(item, index) in rows"
:key="index" :key="index"
:class="{ :class="{
'consignees-card': true, 'q-pa-md': true,
'q-rounded': true,
'custom-border': true,
'q-mb-md': index < rows.length - 1, 'q-mb-md': index < rows.length - 1,
}" }"
> >
@ -82,7 +84,7 @@ const toCustomerNoteCreate = () => {
</template> </template>
<style lang="scss"> <style lang="scss">
.consignees-card { .custom-border {
border: 2px solid var(--vn-light-gray); border: 2px solid var(--vn-light-gray);
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;

View File

@ -38,7 +38,7 @@ const balanceDue = computed(() => {
const balanceDueWarning = computed(() => (balanceDue.value ? 'negative' : '')); const balanceDueWarning = computed(() => (balanceDue.value ? 'negative' : ''));
const claimRate = computed(() => { const claimRate = computed(() => {
return customer.value.claimsRatio.claimingRate * 100; return customer.value.claimsRatio.claimingRate;
}); });
const priceIncreasingRate = computed(() => { const priceIncreasingRate = computed(() => {
@ -81,7 +81,7 @@ const creditWarning = computed(() => {
<VnLinkPhone :phone-number="entity.mobile" /> <VnLinkPhone :phone-number="entity.mobile" />
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('customer.summary.email')" :value="entity.email" /> <VnLv :label="t('customer.summary.email')" :value="entity.email" copy />
<VnLv <VnLv
:label="t('customer.summary.salesPerson')" :label="t('customer.summary.salesPerson')"
:value="entity?.salesPersonUser?.name" :value="entity?.salesPersonUser?.name"

View File

@ -2,12 +2,11 @@
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.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';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; import VnLocation from 'src/components/common/VnLocation.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const { t } = useI18n(); const { t } = useI18n();
@ -29,23 +28,17 @@ const newClientForm = reactive({
isEqualizated: false, isEqualizated: false,
}); });
const postcodeFetchDataRef = ref(null);
const townsFetchDataRef = ref(null);
const workersOptions = ref([]); const workersOptions = ref([]);
const businessTypesOptions = ref([]); const businessTypesOptions = ref([]);
const citiesLocationOptions = ref([]);
const provincesLocationOptions = ref([]);
const countriesOptions = ref([]);
const postcodesOptions = ref([]); const postcodesOptions = ref([]);
const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formData) => { function handleLocation(data, location) {
await postcodeFetchDataRef.value.fetch(); const { town, code, provinceFk, countryFk } = location ?? {};
await townsFetchDataRef.value.fetch(); data.postcode = code;
formData.postcode = code; data.city = town;
formData.provinceFk = provinceFk; data.provinceFk = provinceFk;
formData.city = citiesLocationOptions.value.find((town) => town.id === townFk).name; data.countryFk = countryFk;
formData.countryFk = countryFk; }
};
</script> </script>
<template> <template>
@ -54,33 +47,11 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
auto-load auto-load
url="Workers/search?departmentCodes" url="Workers/search?departmentCodes"
/> />
<FetchData
ref="postcodeFetchDataRef"
url="Postcodes/location"
@on-fetch="(data) => (postcodesOptions = data)"
auto-load
/>
<FetchData <FetchData
@on-fetch="(data) => (businessTypesOptions = data)" @on-fetch="(data) => (businessTypesOptions = data)"
auto-load auto-load
url="BusinessTypes" url="BusinessTypes"
/> />
<FetchData
ref="townsFetchDataRef"
@on-fetch="(data) => (citiesLocationOptions = data)"
auto-load
url="Towns/location"
/>
<FetchData
@on-fetch="(data) => (provincesLocationOptions = data)"
auto-load
url="Provinces/location"
/>
<FetchData
@on-fetch="(data) => (countriesOptions = data)"
auto-load
url="Countries"
/>
<QPage> <QPage>
<VnSubToolbar /> <VnSubToolbar />
<FormModel <FormModel
@ -139,96 +110,19 @@ const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formDa
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnSelectCreate <VnLocation
v-model="data.postcode"
:label="t('Postcode')"
:rules="validate('Worker.postcode')" :rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant']" :roles-allowed-to-create="['deliveryAssistant']"
:options="postcodesOptions" :options="postcodesOptions"
option-label="code" v-model="data.location"
option-value="code" @update:model-value="
hide-selected (location) => handleLocation(data, location)
"
> >
<template #form> </VnLocation>
<CustomerCreateNewPostcode
@on-data-saved="onPostcodeCreated($event, data)"
/>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection v-if="scope.opt">
<QItemLabel>{{ scope.opt.code }}</QItemLabel>
<QItemLabel caption
>{{ scope.opt.code }} -
{{ scope.opt.town.name }} ({{
scope.opt.town.province.name
}},
{{
scope.opt.town.province.country.country
}})</QItemLabel
>
</QItemSection>
</QItem>
</template>
</VnSelectCreate>
</div>
<div class="col">
<!-- ciudades -->
<VnSelectFilter
:label="t('City')"
:options="citiesLocationOptions"
hide-selected
option-label="name"
option-value="name"
v-model="data.city"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt.name }}</QItemLabel>
<QItemLabel caption>
{{
`${scope.opt.name}, ${scope.opt.province.name} (${scope.opt.province.country.country})`
}}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Province')"
:options="provincesLocationOptions"
hide-selected
option-label="name"
option-value="id"
v-model="data.provinceFk"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
`${scope.opt.name} (${scope.opt.country.country})`
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div>
<div class="col">
<VnSelectFilter
:label="t('Country')"
:options="countriesOptions"
hide-selected
option-label="country"
option-value="id"
v-model="data.countryFk"
/>
</div> </div>
</VnRow> </VnRow>
<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 v-model="data.userName" :label="t('Web user')" /> <QInput v-model="data.userName" :label="t('Web user')" />

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

@ -12,6 +12,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();
@ -206,8 +207,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
@ -217,8 +218,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

@ -9,6 +9,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';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
@ -499,9 +500,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"
@ -510,10 +510,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

@ -1,7 +1,7 @@
<script setup> <script setup>
import { onBeforeMount, reactive, ref } from 'vue'; import { onBeforeMount, reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import axios from 'axios'; import axios from 'axios';
@ -10,26 +10,15 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; 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 VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter();
const formInitialData = reactive({ const formInitialData = reactive({ isDefaultAddress: false });
isDefaultAddress: false,
nickname: null,
street: null,
postalCode: null,
city: null,
provinceFk: null,
agencyModeFk: null,
phone: null,
mobile: null,
incotermsFk: null,
customsAgentFk: null,
});
const townsFetchDataRef = ref(null); const townsFetchDataRef = ref(null);
const postcodeFetchDataRef = ref(null); const postcodeFetchDataRef = ref(null);
@ -63,19 +52,28 @@ const getCustomsAgents = async () => {
const refreshData = () => { const refreshData = () => {
getCustomsAgents(); getCustomsAgents();
}; };
const toCustomerConsignees = () => {
router.push({
name: 'CustomerConsignees',
params: {
id: route.params.id,
},
});
};
</script> </script>
<template> <template>
<FetchData <FetchData
ref="postcodeFetchDataRef"
@on-fetch="(data) => (postcodesOptions = data)" @on-fetch="(data) => (postcodesOptions = data)"
auto-load auto-load
ref="postcodeFetchDataRef"
url="Postcodes/location" url="Postcodes/location"
/> />
<FetchData <FetchData
ref="townsFetchDataRef"
@on-fetch="(data) => (citiesLocationOptions = data)" @on-fetch="(data) => (citiesLocationOptions = data)"
auto-load auto-load
ref="townsFetchDataRef"
url="Towns/location" url="Towns/location"
/> />
<FetchData <FetchData
@ -94,6 +92,7 @@ const refreshData = () => {
:form-initial-data="formInitialData" :form-initial-data="formInitialData"
:observe-form-changes="false" :observe-form-changes="false"
:url-create="urlCreate" :url-create="urlCreate"
@on-data-saved="toCustomerConsignees()"
model="client" model="client"
> >
<template #form="{ data, validate }"> <template #form="{ data, validate }">
@ -114,7 +113,7 @@ const refreshData = () => {
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectDialog
:label="t('Postcode')" :label="t('Postcode')"
:options="postcodesOptions" :options="postcodesOptions"
:roles-allowed-to-create="['deliveryAssistant']" :roles-allowed-to-create="['deliveryAssistant']"
@ -142,7 +141,7 @@ const refreshData = () => {
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
</VnSelectCreate> </VnSelectDialog>
</div> </div>
<div class="col"> <div class="col">
<!-- ciudades --> <!-- ciudades -->
@ -224,7 +223,7 @@ const refreshData = () => {
/> />
</div> </div>
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectDialog
:label="t('Customs agent')" :label="t('Customs agent')"
:options="customsAgents" :options="customsAgents"
hide-selected hide-selected
@ -235,7 +234,7 @@ const refreshData = () => {
<template #form> <template #form>
<CustomerNewCustomsAgent @on-data-saved="refreshData()" /> <CustomerNewCustomsAgent @on-data-saved="refreshData()" />
</template> </template>
</VnSelectCreate> </VnSelectDialog>
</div> </div>
</VnRow> </VnRow>
</template> </template>

View File

@ -10,7 +10,7 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; 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 VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
@ -168,7 +168,7 @@ const onDataSaved = () => {
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectDialog
:label="t('Postcode')" :label="t('Postcode')"
:options="postcodesOptions" :options="postcodesOptions"
:roles-allowed-to-create="['deliveryAssistant']" :roles-allowed-to-create="['deliveryAssistant']"
@ -196,7 +196,7 @@ const onDataSaved = () => {
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
</VnSelectCreate> </VnSelectDialog>
</div> </div>
<div class="col"> <div class="col">
<!-- ciudades --> <!-- ciudades -->
@ -278,7 +278,7 @@ const onDataSaved = () => {
/> />
</div> </div>
<div class="col"> <div class="col">
<VnSelectCreate <VnSelectDialog
:label="t('Customs agent')" :label="t('Customs agent')"
:options="customsAgents" :options="customsAgents"
hide-selected hide-selected
@ -289,7 +289,7 @@ const onDataSaved = () => {
<template #form> <template #form>
<CustomsNewCustomsAgent /> <CustomsNewCustomsAgent />
</template> </template>
</VnSelectCreate> </VnSelectDialog>
</div> </div>
</VnRow> </VnRow>

View File

@ -44,7 +44,6 @@ const setData = (entity) => {
}; };
const removeDepartment = () => { const removeDepartment = () => {
console.log('entityId: ', entityId.value);
quasar quasar
.dialog({ .dialog({
title: 'Are you sure you want to delete it?', title: 'Are you sure you want to delete it?',
@ -90,17 +89,15 @@ const removeDepartment = () => {
</QItem> </QItem>
</template> </template>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('department.chat')" :value="entity.chatName" dash /> <VnLv :label="t('department.chat')" :value="entity.chatName" />
<VnLv :label="t('department.email')" :value="entity.notificationEmail" dash /> <VnLv :label="t('department.email')" :value="entity.notificationEmail" copy />
<VnLv <VnLv
:label="t('department.selfConsumptionCustomer')" :label="t('department.selfConsumptionCustomer')"
:value="entity.client?.name" :value="entity.client?.name"
dash
/> />
<VnLv <VnLv
:label="t('department.bossDepartment')" :label="t('department.bossDepartment')"
:value="entity.worker?.user?.name" :value="entity.worker?.user?.name"
dash
/> />
</template> </template>
<template #actions> <template #actions>

View File

@ -8,6 +8,8 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; 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 VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
@ -18,6 +20,10 @@ const suppliersOptions = ref([]);
const travelsOptions = ref([]); const travelsOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const currenciesOptions = ref([]); const currenciesOptions = ref([]);
const onFilterTravelSelected = (formData, id) => {
formData.travelFk = id;
};
</script> </script>
<template> <template>
<FetchData <FetchData
@ -82,7 +88,7 @@ const currenciesOptions = ref([]);
</VnSelectFilter> </VnSelectFilter>
</div> </div>
<div class="col"> <div class="col">
<VnSelectFilter <VnSelectDialog
:label="t('entry.basicData.travel')" :label="t('entry.basicData.travel')"
v-model="data.travelFk" v-model="data.travelFk"
:options="travelsOptions" :options="travelsOptions"
@ -91,7 +97,13 @@ const currenciesOptions = ref([]);
map-options map-options
hide-selected hide-selected
:required="true" :required="true"
action-icon="filter_alt"
> >
<template #form>
<FilterTravelForm
@travel-selected="onFilterTravelSelected(data, $event)"
/>
</template>
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
@ -106,7 +118,7 @@ const currenciesOptions = ref([]);
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
</VnSelectFilter> </VnSelectDialog>
</div> </div>
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
@ -163,8 +175,9 @@ const currenciesOptions = ref([]);
:label="t('entry.basicData.observation')" :label="t('entry.basicData.observation')"
type="textarea" type="textarea"
v-model="data.observation" v-model="data.observation"
:maxlength="45"
counter
fill-input fill-input
autogrow
/> />
</div> </div>
</VnRow> </VnRow>

View File

@ -2,6 +2,7 @@
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { QBtn } from 'quasar';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
@ -9,6 +10,7 @@ import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import FetchedTags from 'components/ui/FetchedTags.vue'; import FetchedTags from 'components/ui/FetchedTags.vue';
import VnConfirm from 'components/ui/VnConfirm.vue'; import VnConfirm from 'components/ui/VnConfirm.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
@ -26,28 +28,38 @@ const { notify } = useNotify();
const rowsSelected = ref([]); const rowsSelected = ref([]);
const entryBuysPaginateRef = ref(null); const entryBuysPaginateRef = ref(null);
const packagingsOptions = ref(null); const packagingsOptions = ref(null);
const originalRowDataCopy = ref(null);
const getInputEvents = (colField, props) => {
return colField === 'packagingFk'
? { 'update:modelValue': () => saveChange(colField, props) }
: {
'keyup.enter': () => saveChange(colField, props),
blur: () => saveChange(colField, props),
};
};
const tableColumnComponents = computed(() => ({ const tableColumnComponents = computed(() => ({
item: { item: {
component: () => 'span', component: QBtn,
props: () => {}, props: {
color: 'blue',
flat: true,
},
event: () => ({}), event: () => ({}),
}, },
quantity: { quantity: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label,
class: 'input-number', class: 'input-number',
}), },
event: (props) => ({ event: getInputEvents,
'keyup.enter': () => saveChange(props.row),
}),
}, },
packagingFk: { packagingFk: {
component: () => VnSelectFilter, component: VnSelectFilter,
props: () => ({ props: {
'option-value': 'id', 'option-value': 'id',
'option-label': 'id', 'option-label': 'id',
'emit-value': true, 'emit-value': true,
@ -55,92 +67,69 @@ const tableColumnComponents = computed(() => ({
'use-input': true, 'use-input': true,
'hide-selected': true, 'hide-selected': true,
options: packagingsOptions.value, options: packagingsOptions.value,
}), },
event: (props) => ({ event: getInputEvents,
'update:modelValue': () => saveChange(props.row),
}),
}, },
stickers: { stickers: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label,
class: 'input-number', class: 'input-number',
}), },
event: (props) => ({ event: getInputEvents,
'keyup.enter': () => saveChange(props.row),
}),
}, },
weight: { weight: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label, },
}), event: getInputEvents,
event: (props) => ({
'keyup.enter': () => saveChange(props.row),
}),
}, },
packing: { packing: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label, },
}), event: getInputEvents,
event: (props) => ({
'keyup.enter': () => saveChange(props.row),
}),
}, },
grouping: { grouping: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label, },
}), event: getInputEvents,
event: (props) => ({
'keyup.enter': () => saveChange(props.row),
}),
}, },
buyingValue: { buyingValue: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label, },
}), event: getInputEvents,
event: (props) => ({
'keyup.enter': () => saveChange(props.row),
}),
}, },
price2: { price2: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label, },
}), event: getInputEvents,
event: (props) => ({
'keyup.enter': () => saveChange(props.row),
}),
}, },
price3: { price3: {
component: () => VnInput, component: VnInput,
props: (col) => ({ props: {
type: 'number', type: 'number',
min: 0, min: 0,
label: col.label, },
}), event: getInputEvents,
event: (props) => ({
'keyup.enter': () => saveChange(props.row),
}),
}, },
import: { import: {
component: () => 'span', component: 'span',
props: () => {}, props: {},
event: () => ({}), event: () => ({}),
}, },
})); }));
@ -217,8 +206,19 @@ const entriesTableColumns = computed(() => {
]; ];
}); });
const saveChange = async (rowData) => { const copyOriginalRowsData = (rows) => {
await axios.patch(`Buys/${rowData.id}`, rowData); // el objetivo de esto es guardar los valores iniciales de todas las rows para evitar guardar cambios si la data no cambió al disparar los eventos
originalRowDataCopy.value = JSON.parse(JSON.stringify(rows));
};
const saveChange = async (field, { rowIndex, row }) => {
try {
if (originalRowDataCopy.value[rowIndex][field] == row[field]) return;
await axios.patch(`Buys/${row.id}`, row);
originalRowDataCopy.value[rowIndex][field] = row[field];
} catch (err) {
console.error('Error saving changes', err);
}
}; };
const openRemoveDialog = async () => { const openRemoveDialog = async () => {
@ -227,18 +227,20 @@ const openRemoveDialog = async () => {
component: VnConfirm, component: VnConfirm,
componentProps: { componentProps: {
title: t('Confirm deletion'), title: t('Confirm deletion'),
message: message: t(
rowsSelected.value.length > 1 `Are you sure you want to delete this buy${
? t('Are you sure you want to delete this buys?') rowsSelected.value.length > 1 ? 's' : ''
: t('Are you sure you want to delete this buy?'), }?`
),
data: rowsSelected.value, data: rowsSelected.value,
}, },
}) })
.onOk(async () => { .onOk(async () => {
try { try {
await deleteBuys(); await deleteBuys();
const notifyMessage = const notifyMessage = t(
rowsSelected.value.length > 1 ? t('Buys deleted') : t('Buy deleted'); `Buy${rowsSelected.value.length > 1 ? 's' : ''} deleted`
);
notify(notifyMessage, 'positive'); notify(notifyMessage, 'positive');
} catch (err) { } catch (err) {
console.error('Error deleting buys'); console.error('Error deleting buys');
@ -254,6 +256,33 @@ const deleteBuys = async () => {
const importBuys = () => { const importBuys = () => {
router.push({ name: 'EntryBuysImport' }); router.push({ name: 'EntryBuysImport' });
}; };
const toggleGroupingMode = async (buy, mode) => {
try {
const grouping = 1;
const packing = 2;
const groupingMode = mode === 'grouping' ? grouping : packing;
const newGroupingMode = buy.groupingMode === groupingMode ? 0 : groupingMode;
const params = {
groupingMode: newGroupingMode,
};
await axios.patch(`Buys/${buy.id}`, params);
buy.groupingMode = newGroupingMode;
} catch (err) {
console.error('Error toggling grouping mode');
}
};
const showLockIcon = (groupingMode, mode) => {
if (mode === 'packing') {
return groupingMode === 2 ? 'lock' : 'lock_open';
} else {
return groupingMode === 1 ? 'lock' : 'lock_open';
}
};
</script> </script>
<template> <template>
@ -282,6 +311,7 @@ const importBuys = () => {
ref="entryBuysPaginateRef" ref="entryBuysPaginateRef"
data-key="EntryBuys" data-key="EntryBuys"
:url="`Entries/${route.params.id}/getBuys`" :url="`Entries/${route.params.id}/getBuys`"
@on-fetch="copyOriginalRowsData($event)"
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
@ -302,16 +332,44 @@ const importBuys = () => {
</QTd> </QTd>
<QTd v-for="col in props.cols" :key="col.name"> <QTd v-for="col in props.cols" :key="col.name">
<component <component
:is="tableColumnComponents[col.name].component()" :is="tableColumnComponents[col.name].component"
v-bind="tableColumnComponents[col.name].props(col)" v-bind="tableColumnComponents[col.name].props"
v-model="props.row[col.field]" v-model="props.row[col.field]"
v-on="tableColumnComponents[col.name].event(props)" v-on="
tableColumnComponents[col.name].event(
col.field,
props
)
"
> >
<template
v-if="
col.name === 'grouping' || col.name === 'packing'
"
#append
>
<QBtn
:icon="
showLockIcon(props.row.groupingMode, col.name)
"
@click="toggleGroupingMode(props.row, col.name)"
class="cursor-pointer"
size="sm"
flat
dense
unelevated
push
/>
</template>
<template <template
v-if="col.name === 'item' || col.name === 'import'" v-if="col.name === 'item' || col.name === 'import'"
> >
{{ col.value }} {{ col.value }}
</template> </template>
<ItemDescriptorProxy
v-if="col.name === 'item'"
:id="props.row.id"
/>
</component> </component>
</QTd> </QTd>
</QTr> </QTr>
@ -352,13 +410,14 @@ const importBuys = () => {
<QList dense> <QList dense>
<QItem v-for="col in props.cols" :key="col.name"> <QItem v-for="col in props.cols" :key="col.name">
<component <component
:is="tableColumnComponents[col.name].component()" :is="tableColumnComponents[col.name].component"
v-bind=" v-bind="tableColumnComponents[col.name].props"
tableColumnComponents[col.name].props(col)
"
v-model="props.row[col.field]" v-model="props.row[col.field]"
v-on=" v-on="
tableColumnComponents[col.name].event(props) tableColumnComponents[col.name].event(
col.field,
props
)
" "
class="full-width" class="full-width"
> >
@ -379,9 +438,10 @@ const importBuys = () => {
</QTable> </QTable>
</template> </template>
</VnPaginate> </VnPaginate>
<QPageSticky :offset="[20, 20]"> <QPageSticky :offset="[20, 20]">
<QBtn fab icon="upload" color="primary" @click="importBuys()" /> <QBtn fab icon="upload" color="primary" @click="importBuys()" />
<QTooltip> <QTooltip class="text-no-wrap">
{{ t('Import buys') }} {{ t('Import buys') }}
</QTooltip> </QTooltip>
</QPageSticky> </QPageSticky>

View File

@ -7,6 +7,8 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnSelectFilter from 'components/common/VnSelectFilter.vue'; import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import FilterItemForm from 'src/components/FilterItemForm.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import axios from 'axios'; import axios from 'axios';
@ -27,6 +29,7 @@ const importData = ref({
ref: null, ref: null,
}); });
const inputFileRef = ref(null);
const lastItemBuysOptions = ref([]); const lastItemBuysOptions = ref([]);
const packagingsOptions = ref([]); const packagingsOptions = ref([]);
@ -197,13 +200,20 @@ const redirectToBuysView = () => {
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<QFile <QFile
label="Standard" ref="inputFileRef"
:multiple="false" :label="t('entry.buys.file')"
v-model="importData.file" v-model="importData.file"
:multiple="false"
accept=".json"
@update:model-value="onFileChange($event)" @update:model-value="onFileChange($event)"
class="required"
> >
<template #append> <template #append>
<QIcon name="vn:attach" class="cursor-pointer"> <QIcon
name="vn:attach"
class="cursor-pointer"
@click="inputFileRef.pickFiles()"
>
<QTooltip>{{ t('Select a file') }}</QTooltip> <QTooltip>{{ t('Select a file') }}</QTooltip>
</QIcon> </QIcon>
</template> </template>
@ -236,13 +246,19 @@ const redirectToBuysView = () => {
> >
<template #body-cell-item="{ row, col }"> <template #body-cell-item="{ row, col }">
<QTd auto-width> <QTd auto-width>
<VnSelectFilter <VnSelectDialog
v-model="row[col.field]" v-model="row[col.field]"
:options="col.options" :options="col.options"
:option-value="col.optionValue" :option-value="col.optionValue"
:option-label="col.optionLabel" :option-label="col.optionLabel"
hide-selected hide-selected
action-icon="filter_alt"
> >
<template #form>
<FilterItemForm
@item-selected="row[col.field] = $event"
/>
</template>
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
@ -253,7 +269,7 @@ const redirectToBuysView = () => {
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
</VnSelectFilter> </VnSelectDialog>
</QTd> </QTd>
</template> </template>
<template #body-cell-packagingFk="{ row, col }"> <template #body-cell-packagingFk="{ row, col }">

View File

@ -16,6 +16,7 @@ const stateStore = useStateStore();
<Teleport to="#searchbar"> <Teleport to="#searchbar">
<VnSearchbar <VnSearchbar
data-key="EntryList" data-key="EntryList"
url="Entries/filter"
:label="t('Search entries')" :label="t('Search entries')"
:info="t('You can search by entry reference')" :info="t('You can search by entry reference')"
/> />

View File

@ -111,26 +111,19 @@ const showEntryReport = () => {
<QItem v-ripple clickable @click="showEntryReport(entity)"> <QItem v-ripple clickable @click="showEntryReport(entity)">
<QItemSection>{{ t('Show entry report') }}</QItemSection> <QItemSection>{{ t('Show entry report') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable>
<QItemSection>
<RouterLink :to="{ name: 'EntryList' }" class="color-vn-text">
{{ t('Go to module index') }}
</RouterLink>
</QItemSection>
</QItem>
</template> </template>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv <VnLv
:label="t('entry.descriptor.agency')" :label="t('entry.descriptor.agency')"
:value="entity.travel.agency.name" :value="entity.travel?.agency?.name"
/> />
<VnLv <VnLv
:label="t('entry.descriptor.landed')" :label="t('entry.descriptor.landed')"
:value="toDate(entity.travel.landed)" :value="toDate(entity.travel?.landed)"
/> />
<VnLv <VnLv
:label="t('entry.descriptor.warehouseOut')" :label="t('entry.descriptor.warehouseOut')"
:value="entity.travel.warehouseOut.name" :value="entity.travel?.warehouseOut?.name"
/> />
</template> </template>
<template #icons="{ entity }"> <template #icons="{ entity }">

View File

@ -15,6 +15,12 @@ const { t } = useI18n();
const entryObservationsRef = ref(null); const entryObservationsRef = ref(null);
const entryObservationsOptions = ref([]); const entryObservationsOptions = ref([]);
const sortEntryObservationOptions = (data) => {
entryObservationsOptions.value = [...data].sort((a, b) =>
a.description.localeCompare(b.description)
);
};
onMounted(() => { onMounted(() => {
if (entryObservationsRef.value) entryObservationsRef.value.reload(); if (entryObservationsRef.value) entryObservationsRef.value.reload();
}); });
@ -22,7 +28,7 @@ onMounted(() => {
<template> <template>
<FetchData <FetchData
url="ObservationTypes" url="ObservationTypes"
@on-fetch="(data) => (entryObservationsOptions = data)" @on-fetch="(data) => sortEntryObservationOptions(data)"
auto-load auto-load
/> />
<CrudModel <CrudModel
@ -37,7 +43,7 @@ onMounted(() => {
:default-remove="false" :default-remove="false"
:data-required="{ entryFk: route.params.id }" :data-required="{ entryFk: route.params.id }"
> >
<template #body="{ rows }"> <template #body="{ rows, validate }">
<QCard class="q-pa-md"> <QCard class="q-pa-md">
<VnRow <VnRow
v-for="(row, index) in rows" v-for="(row, index) in rows"
@ -49,6 +55,7 @@ onMounted(() => {
:label="t('entry.notes.observationType')" :label="t('entry.notes.observationType')"
v-model="row.observationTypeFk" v-model="row.observationTypeFk"
:options="entryObservationsOptions" :options="entryObservationsOptions"
:disable="!!row.id"
option-label="description" option-label="description"
option-value="id" option-value="id"
hide-selected hide-selected
@ -58,6 +65,7 @@ onMounted(() => {
<VnInput <VnInput
:label="t('entry.notes.description')" :label="t('entry.notes.description')"
v-model="row.description" v-model="row.description"
:rules="validate('EntryObservation.description')"
/> />
</div> </div>
<div class="col-1 row justify-center items-center"> <div class="col-1 row justify-center items-center">

View File

@ -1,28 +1,38 @@
<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 { useRoute } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
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';
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';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
import { useState } from 'src/composables/useState';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
const state = useState();
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter();
const stateStore = useStateStore();
const user = state.getUser();
const newEntryForm = reactive({ const newEntryForm = reactive({
supplierFk: null, supplierFk: null,
travelFk: route.query?.travelFk || null, travelFk: route.query?.travelFk || null,
companyFk: null, companyFk: user.value.companyFk || null,
}); });
const suppliersOptions = ref([]); const suppliersOptions = ref([]);
const travelsOptionsOptions = ref([]); const travelsOptionsOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const redirectToEntryBasicData = (_, { id }) => {
router.push({ name: 'EntryBasicData', params: { id } });
};
</script> </script>
<template> <template>
@ -48,79 +58,99 @@ const companiesOptions = ref([]);
@on-fetch="(data) => (companiesOptions = data)" @on-fetch="(data) => (companiesOptions = data)"
auto-load auto-load
/> />
<template v-if="stateStore.isHeaderMounted()">
<!-- Agregar searchbar de entries --> <Teleport to="#searchbar">
<VnSearchbar
url="Entries/filter"
custom-route-redirect-name="EntrySummary"
data-key="EntrySummary"
:label="t('Search entries')"
:info="t('You can search by entry reference')"
/>
</Teleport>
</template>
<QPage> <QPage>
<VnSubToolbar /> <VnSubToolbar />
<FormModel url-create="Entries" model="entry" :form-initial-data="newEntryForm"> <FormModel
url-create="Entries"
model="entry"
:form-initial-data="newEntryForm"
@on-data-saved="redirectToEntryBasicData"
>
<template #form="{ data, validate }"> <template #form="{ data, validate }">
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<VnSelectFilter <div class="col">
:label="t('Supplier')" <VnSelectFilter
class="full-width" :label="t('Supplier')"
v-model="data.supplierFk" class="full-width"
:options="suppliersOptions" v-model="data.supplierFk"
option-value="id" :options="suppliersOptions"
option-label="nickname" option-value="id"
hide-selected option-label="nickname"
:required="true" hide-selected
:rules="validate('entry.supplierFk')" :required="true"
> :rules="validate('entry.supplierFk')"
<template #option="scope"> >
<QItem v-bind="scope.itemProps"> <template #option="scope">
<QItemSection> <QItem v-bind="scope.itemProps">
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel> <QItemSection>
<QItemLabel caption> <QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
#{{ scope.opt?.id }} <QItemLabel caption>
</QItemLabel> #{{ scope.opt?.id }}
</QItemSection> </QItemLabel>
</QItem> </QItemSection>
</template> </QItem>
</VnSelectFilter> </template>
</VnSelectFilter>
</div>
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<VnSelectFilter <div class="col">
:label="t('Travel')" <VnSelectFilter
class="full-width" :label="t('Travel')"
v-model="data.travelFk" class="full-width"
:options="travelsOptionsOptions" v-model="data.travelFk"
option-value="id" :options="travelsOptionsOptions"
option-label="warehouseInName" option-value="id"
map-options option-label="warehouseInName"
hide-selected map-options
:required="true" hide-selected
:rules="validate('entry.travelFk')" :required="true"
> :rules="validate('entry.travelFk')"
<template #option="scope"> >
<QItem v-bind="scope.itemProps"> <template #option="scope">
<QItemSection> <QItem v-bind="scope.itemProps">
<QItemLabel <QItemSection>
>{{ scope.opt?.agencyModeName }} - <QItemLabel
{{ scope.opt?.warehouseInName }} ({{ >{{ scope.opt?.agencyModeName }} -
toDate(scope.opt?.shipped) {{ scope.opt?.warehouseInName }} ({{
}}) &#x2192; {{ scope.opt?.warehouseOutName }} ({{ toDate(scope.opt?.shipped)
toDate(scope.opt?.landed) }}) &#x2192;
}})</QItemLabel {{ scope.opt?.warehouseOutName }} ({{
> toDate(scope.opt?.landed)
</QItemSection> }})</QItemLabel
</QItem> >
</template> </QItemSection>
</VnSelectFilter> </QItem>
</template>
</VnSelectFilter>
</div>
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<VnSelectFilter <div class="col">
:label="t('Company')" <VnSelectFilter
class="full-width" :label="t('Company')"
v-model="data.companyFk" class="full-width"
:options="companiesOptions" v-model="data.companyFk"
option-value="id" :options="companiesOptions"
option-label="code" option-value="id"
map-options option-label="code"
hide-selected map-options
:required="true" hide-selected
:rules="validate('entry.companyFk')" :required="true"
/> :rules="validate('entry.companyFk')"
/>
</div>
</VnRow> </VnRow>
</template> </template>
</FormModel> </FormModel>

View File

@ -53,165 +53,160 @@ const suppliersOptions = ref([]);
<span>{{ formatFn(tag.value) }}</span> <span>{{ formatFn(tag.value) }}</span>
</div> </div>
</template> </template>
<template #body="{ params }"> <template #body="{ params, searchFn }">
<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" @update:model-value="searchFn()"
: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" @update:model-value="searchFn()"
option-value="id" :options="currenciesOptions"
option-label="name" option-value="id"
hide-selected option-label="name"
dense hide-selected
outlined dense
rounded outlined
/> rounded
</QItemSection> />
</QItem> </QItemSection>
<QItem> </QItem>
<QItemSection> <QItem>
<VnSelectFilter <QItemSection>
:label="t('params.supplierFk')" <VnSelectFilter
v-model="params.supplierFk" :label="t('params.supplierFk')"
:options="suppliersOptions" v-model="params.supplierFk"
option-value="id" @update:model-value="searchFn()"
option-label="name" :options="suppliersOptions"
hide-selected option-value="id"
dense option-label="name"
outlined hide-selected
rounded dense
> outlined
<template #option="scope"> rounded
<QItem v-bind="scope.itemProps"> >
<QItemSection> <template #option="scope">
<QItemLabel>{{ <QItem v-bind="scope.itemProps">
scope.opt?.name + ': ' + scope.opt?.nickname <QItemSection>
}}</QItemLabel> <QItemLabel>{{
</QItemSection> scope.opt?.name + ': ' + scope.opt?.nickname
</QItem> }}</QItemLabel>
</template> </QItemSection>
</VnSelectFilter> </QItem>
</QItemSection> </template>
</QItem> </VnSelectFilter>
<QItem> </QItemSection>
<QItemSection> </QItem>
<VnInputDate <QItem>
:label="t('params.created')" <QItemSection>
is-outlined <VnInputDate
v-model="params.created" :label="t('params.created')"
/> v-model="params.created"
</QItemSection> @update:model-value="searchFn()"
</QItem> is-outlined
<QItem> />
<QItemSection> </QItemSection>
<VnInputDate </QItem>
:label="t('params.from')" <QItem>
is-outlined <QItemSection>
v-model="params.from" <VnInputDate
/> :label="t('params.from')"
</QItemSection> v-model="params.from"
</QItem> @update:model-value="searchFn()"
<QItem> is-outlined
<QItemSection> />
<VnInputDate </QItemSection>
:label="t('params.to')" </QItem>
is-outlined <QItem>
v-model="params.to" <QItemSection>
/> <VnInputDate
</QItemSection> :label="t('params.to')"
</QItem> v-model="params.to"
<QItem> @update:model-value="searchFn()"
<QItemSection> is-outlined
<QCheckbox />
:label="t('params.isBooked')" </QItemSection>
v-model="params.isBooked" </QItem>
toggle-indeterminate <QItem>
/> <QItemSection>
</QItemSection> <QCheckbox
<QItemSection> :label="t('params.isBooked')"
<QCheckbox v-model="params.isBooked"
:label="t('params.isConfirmed')" toggle-indeterminate
v-model="params.isConfirmed" />
toggle-indeterminate </QItemSection>
/> <QItemSection>
</QItemSection> <QCheckbox
</QItem> :label="t('params.isConfirmed')"
<QItem> v-model="params.isConfirmed"
<QItemSection> toggle-indeterminate
<QCheckbox />
:label="t('params.isOrdered')" </QItemSection>
v-model="params.isOrdered" </QItem>
toggle-indeterminate <QItem>
/> <QItemSection>
</QItemSection> <QCheckbox
</QItem> :label="t('params.isOrdered')"
</QList> v-model="params.isOrdered"
toggle-indeterminate
/>
</QItemSection>
</QItem>
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<style scoped>
.list {
width: 256px;
}
.list * {
max-width: 100%;
}
</style>
<i18n> <i18n>
en: en:
params: params:

View File

@ -0,0 +1,348 @@
<script setup>
import { onMounted, ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import FetchData from 'components/FetchData.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import EntryDescriptorProxy from './Card/EntryDescriptorProxy.vue';
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
import EditTableCellValueForm from 'src/components/EditTableCellValueForm.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDate, toCurrency } from 'src/filters';
import { useSession } from 'composables/useSession';
import { dashIfEmpty } from 'src/filters';
const router = useRouter();
const session = useSession();
const token = session.getToken();
const stateStore = useStateStore();
const { t } = useI18n();
const rowsFetchDataRef = ref(null);
const editTableCellDialogRef = ref(null);
const visibleColumns = ref([]);
const allColumnNames = ref([]);
const rows = ref([]);
const rowsSelected = ref([]);
const columns = computed(() => [
{
label: t('entry.latestBuys.picture'),
name: 'picture',
align: 'left',
},
{
label: t('entry.latestBuys.itemFk'),
name: 'itemFk',
field: 'itemFk',
align: 'left',
},
{
label: t('entry.latestBuys.packing'),
field: 'packing',
name: 'packing',
align: 'left',
format: (val) => dashIfEmpty(val),
},
{
label: t('entry.latestBuys.grouping'),
field: 'grouping',
name: 'grouping',
align: 'left',
format: (val) => dashIfEmpty(val),
},
{
label: t('entry.latestBuys.quantity'),
field: 'quantity',
name: 'quantity',
align: 'left',
},
{
label: t('entry.latestBuys.description'),
field: 'description',
name: 'description',
align: 'left',
format: (val) => dashIfEmpty(val),
},
{
label: t('entry.latestBuys.size'),
field: 'size',
name: 'size',
align: 'left',
},
{
label: t('entry.latestBuys.tags'),
name: 'tags',
align: 'left',
},
{
label: t('entry.latestBuys.type'),
field: 'code',
name: 'type',
align: 'left',
},
{
label: t('entry.latestBuys.intrastat'),
field: 'intrastat',
name: 'intrastat',
align: 'left',
},
{
label: t('entry.latestBuys.origin'),
field: 'origin',
name: 'origin',
align: 'left',
},
{
label: t('entry.latestBuys.weightByPiece'),
field: 'weightByPiece',
name: 'weightByPiece',
align: 'left',
format: (val) => dashIfEmpty(val),
},
{
label: t('entry.latestBuys.isActive'),
field: 'isActive',
name: 'isActive',
align: 'left',
},
{
label: t('entry.latestBuys.family'),
field: 'family',
name: 'family',
align: 'left',
},
{
label: t('entry.latestBuys.entryFk'),
field: 'entryFk',
name: 'entryFk',
align: 'left',
},
{
label: t('entry.latestBuys.buyingValue'),
field: 'buyingValue',
name: 'buyingValue',
align: 'left',
format: (val) => toCurrency(val),
},
{
label: t('entry.latestBuys.freightValue'),
field: 'freightValue',
name: 'freightValue',
align: 'left',
format: (val) => toCurrency(val),
},
{
label: t('entry.latestBuys.comissionValue'),
field: 'comissionValue',
name: 'comissionValue',
align: 'left',
format: (val) => toCurrency(val),
},
{
label: t('entry.latestBuys.packageValue'),
field: 'packageValue',
name: 'packageValue',
align: 'left',
format: (val) => toCurrency(val),
},
{
label: t('entry.latestBuys.isIgnored'),
field: 'isIgnored',
name: 'isIgnored',
align: 'left',
},
{
label: t('entry.latestBuys.price2'),
field: 'price2',
name: 'price2',
align: 'left',
format: (val) => toCurrency(val),
},
{
label: t('entry.latestBuys.price3'),
field: 'price3',
name: 'price3',
align: 'left',
format: (val) => toCurrency(val),
},
{
label: t('entry.latestBuys.minPrice'),
field: 'minPrice',
name: 'minPrice',
align: 'left',
format: (val) => toCurrency(val),
},
{
label: t('entry.latestBuys.ektFk'),
field: 'ektFk',
name: 'ektFk',
align: 'left',
format: (val) => dashIfEmpty(val),
},
{
label: t('entry.latestBuys.weight'),
field: 'weight',
name: 'weight',
align: 'left',
},
{
label: t('entry.latestBuys.packagingFk'),
field: 'packagingFk',
name: 'packagingFk',
align: 'left',
},
{
label: t('entry.latestBuys.packingOut'),
field: 'packingOut',
name: 'packingOut',
align: 'left',
format: (val) => dashIfEmpty(val),
},
{
label: t('entry.latestBuys.landing'),
field: 'landing',
name: 'landing',
align: 'left',
format: (val) => toDate(val),
},
]);
const editTableCellFormFieldsOptions = [
{ field: 'packing', label: t('entry.latestBuys.packing') },
{ field: 'grouping', label: t('entry.latestBuys.grouping') },
{ field: 'packageValue', label: t('entry.latestBuys.packageValue') },
{ field: 'weight', label: t('entry.latestBuys.weight') },
{ field: 'description', label: t('entry.latestBuys.description') },
{ field: 'size', label: t('entry.latestBuys.size') },
{ field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') },
{ field: 'packingOut', label: t('entry.latestBuys.packingOut') },
{ field: 'landing', label: t('entry.latestBuys.landing') },
];
const openEditTableCellDialog = () => {
editTableCellDialogRef.value.show();
};
const onEditCellDataSaved = async () => {
rowsSelected.value = [];
await rowsFetchDataRef.value.fetch();
};
const redirectToEntryBuys = (entryFk) => {
router.push({ name: 'EntryBuys', params: { id: entryFk } });
};
onMounted(async () => {
stateStore.rightDrawer = true;
const filteredColumns = columns.value.filter((col) => col.name !== 'picture');
allColumnNames.value = filteredColumns.map((col) => col.name);
});
</script>
<template>
<FetchData
ref="rowsFetchDataRef"
url="Buys/latestBuysFilter"
:filter="{ order: 'itemFk DESC', limit: 20 }"
@on-fetch="(data) => (rows = data)"
auto-load
/>
<QToolbar class="bg-vn-dark justify-end">
<div id="st-data">
<TableVisibleColumns
:all-columns="allColumnNames"
table-code="latestBuys"
labels-traductions-path="entry.latestBuys"
@on-config-saved="visibleColumns = ['picture', ...$event]"
/>
</div>
<QSpace />
<div id="st-actions"></div>
</QToolbar>
<QPage class="column items-center q-pa-md">
<QTable
:rows="rows"
:columns="columns"
hide-bottom
selection="multiple"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
:visible-columns="visibleColumns"
v-model:selected="rowsSelected"
@row-click="(_, row) => redirectToEntryBuys(row.entryFk)"
>
<template #body-cell-picture="{ row }">
<QTd>
<QImg
:src="`/api/Images/catalog/50x50/${row.itemFk}/download?access_token=${token}`"
spinner-color="primary"
:ratio="1"
height="50px"
width="50px"
class="image"
/>
</QTd>
</template>
<template #body-cell-itemFk="{ row }">
<QTd @click.stop>
<QBtn flat color="blue">
{{ row.itemFk }}
</QBtn>
</QTd>
</template>
<template #body-cell-tags="{ row }">
<QTd>
<fetched-tags :item="row" :max-length="6" />
</QTd>
</template>
<template #body-cell-entryFk="{ row }">
<QTd @click.stop>
<QBtn flat color="blue">
<EntryDescriptorProxy :id="row.entryFk" />
{{ row.entryFk }}
</QBtn>
</QTd>
</template>
<template #body-cell-isIgnored="{ row }">
<QTd>
<QIcon
:name="row.isIgnored ? `check` : `close`"
:color="row.isIgnored ? `positive` : `negative`"
size="sm"
/>
</QTd>
</template>
<template #body-cell-isActive="{ row }">
<QTd>
<QIcon
:name="row.isActive ? `check` : `close`"
:color="row.isActive ? `positive` : `negative`"
size="sm"
/>
</QTd>
</template>
</QTable>
<QPageSticky v-if="rowsSelected.length > 0" :offset="[20, 20]">
<QBtn @click="openEditTableCellDialog()" color="primary" fab icon="edit" />
<QTooltip>
{{ t('Edit buy(s)') }}
</QTooltip>
</QPageSticky>
<QDialog ref="editTableCellDialogRef">
<EditTableCellValueForm
edit-url="Buys/editLatestBuys"
:rows="rowsSelected"
:fields-options="editTableCellFormFieldsOptions"
@on-data-saved="onEditCellDataSaved()"
/>
</QDialog>
</QPage>
</template>
<i18n>
es:
Edit buy(s): Editar compra(s)
</i18n>

View File

@ -9,6 +9,7 @@ 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 EntrySummaryDialog from './Card/EntrySummaryDialog.vue'; import EntrySummaryDialog from './Card/EntrySummaryDialog.vue';
import EntryFilter from './EntryFilter.vue'; import EntryFilter from './EntryFilter.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { toDate } from 'src/filters/index'; import { toDate } from 'src/filters/index';
@ -41,17 +42,27 @@ onMounted(async () => {
</script> </script>
<template> <template>
<template v-if="stateStore.isHeaderMounted()">
<Teleport to="#searchbar">
<VnSearchbar
data-key="EntryList"
url="Entries/filter"
:label="t('Search entries')"
:info="t('You can search by entry reference')"
/>
</Teleport>
</template>
<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">
<EntryFilter data-key="EntryList" /> <EntryFilter data-key="EntryList" />
</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"
order="landed DESC, id DESC" :order="['landed DESC', 'id DESC']"
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
@ -128,17 +139,10 @@ 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
You can search by entry reference: Puedes buscar por referencia de la entrada
Inventory entry: Es inventario Inventory entry: Es inventario
Virtual entry: Es una redada Virtual entry: Es una redada
Search entries: Buscar entradas
You can search by entry reference: Puedes buscar por referencia de la entrada
</i18n> </i18n>

View File

@ -1,24 +1,12 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n';
import LeftMenu from 'src/components/LeftMenu.vue'; import LeftMenu from 'src/components/LeftMenu.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
const { t } = useI18n();
const stateStore = useStateStore(); const stateStore = useStateStore();
</script> </script>
<template> <template>
<template v-if="stateStore.isHeaderMounted()">
<Teleport to="#searchbar">
<VnSearchbar
data-key="EntryList"
:label="t('Search entries')"
:info="t('You can search by entry reference')"
/>
</Teleport>
</template>
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256"> <QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
<QScrollArea class="fit text-grey-8"> <QScrollArea class="fit text-grey-8">
<LeftMenu /> <LeftMenu />
@ -28,9 +16,3 @@ const stateStore = useStateStore();
<RouterView></RouterView> <RouterView></RouterView>
</QPageContainer> </QPageContainer>
</template> </template>
<i18n>
es:
Search entries: Buscar entradas
You can search by entry reference: Puedes buscar por referencia de la entrada
</i18n>

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,12 +71,11 @@ 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"
order="issued DESC, id DESC" order="issued DESC, id DESC"
auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
<CardList <CardList
@ -157,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
@ -51,13 +57,6 @@ const dialog = ref(null);
:value="item?.[`value${index + 4}`]" :value="item?.[`value${index + 4}`]"
/> />
</template> </template>
<QRating
:model-value="item.stars"
icon="star"
icon-selected="star"
color="primary"
readonly
/>
<div class="footer"> <div class="footer">
<div class="price"> <div class="price">
<p>{{ item.available }} {{ t('to') }} {{ item.price }}</p> <p>{{ item.available }} {{ t('to') }} {{ item.price }}</p>
@ -72,7 +71,8 @@ const dialog = ref(null);
</QIcon> </QIcon>
</div> </div>
<p v-if="item.priceKg" class="price-kg"> <p v-if="item.priceKg" class="price-kg">
{{ t('price-kg') }} {{ toCurrency(item.priceKg) || DEFAULT_PRICE_KG }} {{ t('price-kg') }}
{{ toCurrency(item.priceKg) || DEFAULT_PRICE_KG }}
</p> </p>
</div> </div>
</div> </div>

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>

Some files were not shown because too many files have changed in this diff Show More