refs #5509 feat: VnDms & VnDmsList

This commit is contained in:
Alex Moreno 2024-02-12 15:06:20 +01:00
parent cb6ba483d0
commit aa4d5bffc3
15 changed files with 258 additions and 120 deletions

View File

@ -176,8 +176,8 @@ async function remove(data) {
.dialog({ .dialog({
component: VnConfirm, component: VnConfirm,
componentProps: { componentProps: {
title: t('confirmDeletion'), title: t('globals.confirmDeletion'),
message: t('confirmDeletionMessage'), message: t('globals.confirmDeletionMessage'),
newData, newData,
ids, ids,
}, },
@ -317,16 +317,3 @@ watch(formUrl, async () => {
color="primary" color="primary"
/> />
</template> </template>
<i18n>
{
"en": {
"confirmDeletion": "Confirm deletion",
"confirmDeletionMessage": "Are you sure you want to delete this?"
},
"es": {
"confirmDeletion": "Confirmar eliminación",
"confirmDeletionMessage": "Seguro que quieres eliminar?"
}
}
</i18n>

View File

@ -59,9 +59,9 @@ const $props = defineProps({
type: Function, type: Function,
default: null, default: null,
}, },
updateType: { saveFn: {
type: String, type: Function,
default: 'patch', default: null,
}, },
}); });
@ -79,8 +79,8 @@ onMounted(async () => {
}); });
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla // Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
if ($props.formInitialData && !$props.autoLoad) { if ($props.formInitialData || !$props.autoLoad) {
state.set($props.model, $props.formInitialData); state.set($props.model, $props.formInitialData ?? {});
} else { } else {
await fetch(); await fetch();
} }
@ -142,19 +142,19 @@ 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.saveFn) response = await $props.saveFn(body);
response = await axios.post($props.urlCreate, body); else
notify('globals.dataCreated', 'positive'); response = await axios[$props.urlCreate ? 'post' : 'patch'](
} else { $props.urlCreate || $props.urlUpdate || $props.url,
response = await axios[$props.updateType](
$props.urlUpdate || $props.url,
body body
); );
} if ($props.urlCreate) notify('globals.dataCreated', 'positive');
emit('onDataSaved', formData.value, response?.data); emit('onDataSaved', formData.value, response?.data);
originalData.value = JSON.parse(JSON.stringify(formData.value)); originalData.value = JSON.parse(JSON.stringify(formData.value));
hasChanges.value = false; hasChanges.value = false;
} catch (err) { } catch (err) {
console.error(err);
notify('errors.create', 'negative'); notify('errors.create', 'negative');
} }
isLoading.value = false; isLoading.value = false;

View File

@ -1,25 +1,35 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import axios from 'axios';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.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 VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import FormModelPopup from 'components/FormModelPopup.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const emit = defineEmits(['onDataSaved']);
const props = defineProps({ const $props = defineProps({
model: { model: {
type: String, type: String,
required: true, required: true,
}, },
defaultDmsCode: { defaultDmsCode: {
type: String, type: String,
required: true, default: null,
},
formInitialData: {
type: Object,
default: null,
},
description: {
type: Function,
default: null,
}, },
}); });
@ -27,47 +37,67 @@ const warehouses = ref();
const companies = ref(); const companies = ref();
const dmsTypes = ref(); const dmsTypes = ref();
const allowedContentTypes = ref(); const allowedContentTypes = ref();
const config = ref({});
const dms = ref({}); const dms = ref({});
onMounted(() => defaultData());
function onFileChange(files) { function onFileChange(files) {
dms.value.hasFileAttached = !!files; dms.value.hasFileAttached = !!files;
dms.value.file = files?.name; dms.value.file = files?.name;
} }
function parseDms(data) {
const defaultDms = {};
for (let prop in data) {
if (prop.endsWith('Fk')) data[prop.replace('Fk', 'Id')] = data[prop];
}
console.log(data);
dms.value = data;
}
function mapperDms(data) { function mapperDms(data) {
const formData = new FormData(); const formData = new FormData();
const { files } = data; const { files } = data;
if (files) formData.append(files?.name, files); if (files) formData.append(files?.name, files);
console.log('data', data);
delete data.files; delete data.files;
const dms = { const dms = {
hasFile: false, hasFile: !!data.hasFile,
hasFileAttached: false, hasFileAttached: data.hasFileAttached,
reference: data.id, reference: data.reference,
warehouseId: config.value.warehouseFk, warehouseId: data.warehouseFk,
companyId: config.value.companyFk, companyId: data.companyFk,
dmsTypeId: data.dmsTypeFk, dmsTypeId: data.dmsTypeFk,
description: 'ASD', description: data.description,
}; };
return [formData, { params: dms }]; return [formData, { params: dms }];
} }
function getUrl() {
if ($props.formInitialData) return 'dms/' + $props.formInitialData.id + '/updateFile';
return `${$props.model}/${route.params.id}/uploadFile`;
}
async function save() {
const body = mapperDms(dms.value);
await axios.post(getUrl(), body[0], body[1]);
emit('onDataSaved', body[1].params);
}
function defaultData() {
if ($props.formInitialData) return (dms.value = $props.formInitialData);
return addDefaultData({
reference: route.params.id,
description: $props.description && $props.description(dms.value),
});
}
function setDmsTypes(data) {
dmsTypes.value = data;
if (!$props.formInitialData && $props.defaultDmsCode) {
const { id } = data.find((dmsType) => dmsType.code == $props.defaultDmsCode);
addDefaultData({ dmsTypeFk: id });
}
}
function addDefaultData(data) {
Object.assign(dms.value, data);
}
</script> </script>
<template> <template>
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load /> <FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load /> <FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load />
<FetchData url="DmsTypes" @on-fetch="(data) => (dmsTypes = data)" auto-load /> <FetchData url="DmsTypes" @on-fetch="setDmsTypes" auto-load />
<FetchData <FetchData
url="DmsContainers/allowedContentTypes" url="DmsContainers/allowedContentTypes"
@on-fetch="(data) => (allowedContentTypes = data.join(','))" @on-fetch="(data) => (allowedContentTypes = data.join(','))"
@ -75,19 +105,16 @@ function mapperDms(data) {
/> />
<FetchData <FetchData
url="UserConfigs/getUserConfig" url="UserConfigs/getUserConfig"
@on-fetch="(data) => (config = data)" @on-fetch="addDefaultData"
auto-load :auto-load="!$props.formInitialData"
/> />
<FormModel <FormModelPopup
:url="`Dms/${route.params.id}`" :title="t('create')"
update-type="post"
:url-update="`${props.model}/${route.params.id}/uploadFile`"
@on-fetch="parseDms"
model="dms" model="dms"
:auto-load="!!route.params.id" :form-initial-data="formInitialData"
:mapper="mapperDms" :save-fn="save"
> >
<template #form> <template #form-inputs>
<div class="q-gutter-y-ms"> <div class="q-gutter-y-ms">
<VnRow> <VnRow>
<VnInput :label="t('Reference')" v-model="dms.reference" /> <VnInput :label="t('Reference')" v-model="dms.reference" />
@ -123,7 +150,6 @@ function mapperDms(data) {
v-model="dms.description" v-model="dms.description"
type="textarea" type="textarea"
/> />
{{ allowedContentTypes }}
<QFile <QFile
:label="t('entry.buys.file')" :label="t('entry.buys.file')"
v-model="dms.files" v-model="dms.files"
@ -152,7 +178,7 @@ function mapperDms(data) {
/> />
</div> </div>
</template> </template>
</FormModel> </FormModelPopup>
</template> </template>
<style scoped> <style scoped>
.q-gutter-y-ms { .q-gutter-y-ms {
@ -164,6 +190,6 @@ function mapperDms(data) {
en: en:
contentTypesInfo: Allowed file types {allowedContentTypes} contentTypesInfo: Allowed file types {allowedContentTypes}
es: es:
contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
Generate identifier for original file: Generar identificador para archivo original Generate identifier for original file: Generar identificador para archivo original
contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
</i18n> </i18n>

View File

@ -1,31 +1,43 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue'; import VnDms from 'src/components/common/VnDms.vue';
import VnRow from 'components/ui/VnRow.vue'; import { downloadFile } from 'src/composables/downloadFile';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnConfirm from 'components/ui/VnConfirm.vue';
import VnInput from 'src/components/common/VnInput.vue'; import axios from 'axios';
import { QCheckbox, QBtn } from 'quasar'; import { QCheckbox, QBtn, QInput } from 'quasar';
import { useQuasar } from 'quasar';
const route = useRoute(); const route = useRoute();
const quasar = useQuasar();
const { t } = useI18n(); const { t } = useI18n();
const rows = ref(); const rows = ref();
const dmsRef = ref();
const formDialog = ref({});
const $props = defineProps({ const $props = defineProps({
model: { model: {
type: String, type: String,
required: true, required: true,
}, },
updateModel: {
type: String,
default: null,
},
defaultDmsCode: { defaultDmsCode: {
type: String, type: String,
required: true, required: true,
}, },
entity: { filter: {
type: String, type: String,
default: 'entryFk', required: true,
},
description: {
type: Function,
required: true,
}, },
}); });
@ -42,6 +54,8 @@ const dmsFilter = {
'hasFile', 'hasFile',
'file', 'file',
'created', 'created',
'companyFk',
'warehouseFk',
], ],
include: [ include: [
{ {
@ -65,60 +79,69 @@ const dmsFilter = {
], ],
}, },
}, },
order: ['dmsFk DESC'],
}; };
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
field: 'id', field: 'id',
label: t('id'), label: t('globals.id'),
name: 'id', name: 'id',
component: 'span', component: 'span',
}, },
{ {
align: 'left', align: 'left',
field: 'type', field: 'type',
label: t('type'), label: t('globals.type'),
name: 'type', name: 'type',
component: 'span', component: QInput,
props: (prop) => ({
readonly: true,
borderless: true,
'model-value': prop.row.dmsType.name,
}),
}, },
{ {
align: 'left', align: 'left',
field: 'order', field: 'order',
label: t('order'), label: t('globals.order'),
name: 'order', name: 'order',
component: 'span', component: 'span',
}, },
{ {
align: 'left', align: 'left',
field: 'reference', field: 'reference',
label: t('reference'), label: t('globals.reference'),
name: 'reference', name: 'reference',
component: 'span', component: 'span',
}, },
{ {
align: 'left', align: 'left',
field: 'description', field: 'description',
label: t('description'), label: t('globals.description'),
name: 'description', name: 'description',
component: 'span', component: 'span',
}, },
{ {
align: 'left', align: 'left',
field: 'hasFile', field: 'hasFile',
label: t('hasFile'), label: t('globals.original'),
name: 'hasFile', name: 'hasFile',
component: QCheckbox, component: QCheckbox,
props: (prop) => ({
disable: true,
'model-value': Boolean(prop.value),
}),
}, },
{ {
align: 'left', align: 'left',
field: 'file', field: 'file',
label: t('file'), label: t('globals.file'),
name: 'file', name: 'file',
component: 'span', component: 'span',
}, },
{ {
align: 'center',
field: 'options', field: 'options',
name: 'options', name: 'options',
}, },
@ -126,15 +149,46 @@ const columns = computed(() => [
function setData(data) { function setData(data) {
const newData = data.map((value) => value.dms); const newData = data.map((value) => value.dms);
console.log(newData);
rows.value = newData; rows.value = newData;
} }
function deleteDms(dmsFk) {
quasar
.dialog({
component: VnConfirm,
componentProps: {
title: t('globals.confirmDeletion'),
message: t('globals.confirmDeletionMessage'),
},
})
.onOk(async () => {
await axios.post(`${$props.model}/${dmsFk}/removeFile`);
const index = rows.value.findIndex((row) => row.id == dmsFk);
rows.value.splice(index, 1);
});
}
function showFormDialog(dms) {
if (dms) dms = parseDms(dms);
formDialog.value = {
show: true,
dms,
};
}
function parseDms(data) {
for (let prop in data) {
if (prop.endsWith('Fk')) data[prop.replace('Fk', 'Id')] = data[prop];
}
return data;
}
</script> </script>
<template> <template>
<FetchData <FetchData
ref="dmsRef"
:url="$props.model" :url="$props.model"
:where="{ [$props.entity]: route.params.id }"
:filter="dmsFilter" :filter="dmsFilter"
:where="{ [$props.filter]: route.params.id }"
@on-fetch="setData" @on-fetch="setData"
auto-load auto-load
/> />
@ -145,26 +199,86 @@ function setData(data) {
class="full-width q-mt-md" class="full-width q-mt-md"
hide-bottom hide-bottom
row-key="clientFk" row-key="clientFk"
selection="multiple" :grid="$q.screen.lt.md"
v-model:selected="selected"
> >
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
<QTr :props="props" class="cursor-pointer"> <QTr :props="props">
<component <component
v-if="props.col.component" v-if="props.col.component"
:is="props.col.component" :is="props.col.component"
v-bind="props.col.props && props.col.props(props)" v-bind="props.col.props && props.col.props(props)"
@click="props.col.event(props)"
> >
{{ props.value }} <span v-if="props.col.component == 'span'">{{
<!-- <QBtn --> props.value
}}</span>
</component> </component>
</QTr> </QTr>
<div class="flex justify-center" v-if="props.col.name == 'options'">
<QBtn
icon="cloud_download"
flat
color="primary"
@click="downloadFile(props.row.id)"
/>
<QBtn
icon="edit"
flat
color="primary"
@click="showFormDialog(props.row)"
/>
<QBtn
icon="delete"
flat
color="primary"
@click="deleteDms(props.row.id)"
/>
</div>
</QTd> </QTd>
</template> </template>
asd <template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
<QCard
bordered
flat
@keyup.ctrl.enter.stop="claimDevelopmentForm?.saveChanges()"
>
<QCardSection>
<QCheckbox v-model="props.selected" dense />
</QCardSection>
<QSeparator />
<QList dense>
<QItem v-for="col in props.cols" :key="col.name">
<QItemSection>
<component
v-if="col.component"
:is="col.component"
v-bind="col.props && col.props(props)"
>
<span v-if="col.component == 'span'">{{
`${col.label}:${col.value}`
}}</span>
</component>
</QItemSection>
</QItem>
</QList>
</QCard>
</div>
</template>
</QTable> </QTable>
<QDialog v-model="formDialog.show">
<VnDms
:model="updateModel ?? model"
:default-dms-code="defaultDmsCode"
:form-initial-data="formDialog.dms"
@on-data-saved="dmsRef.fetch()"
:description="$props.description"
/>
</QDialog>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn fab color="primary" icon="add" @click="showFormDialog()" />
</QPageSticky>
</template> </template>
<style scoped> <style scoped>
.q-gutter-y-ms { .q-gutter-y-ms {

View File

@ -64,7 +64,7 @@ export default {
markAll: 'Mark all', markAll: 'Mark all',
requiredField: 'Required field', requiredField: 'Required field',
class: 'clase', class: 'clase',
type: 'type', type: 'Type',
reason: 'reason', reason: 'reason',
noResults: 'No results', noResults: 'No results',
system: 'System', system: 'System',
@ -72,6 +72,13 @@ export default {
company: 'Company', company: 'Company',
fieldRequired: 'Field required', fieldRequired: 'Field required',
allowedFilesText: 'Allowed file types: { allowedContentTypes }', allowedFilesText: 'Allowed file types: { allowedContentTypes }',
confirmDeletion: 'Confirm deletion',
confirmDeletionMessage: 'Are you sure you want to delete this?',
description: 'Description',
id: 'Id',
order: 'Order',
original: 'Original',
file: 'File',
}, },
errors: { errors: {
statusUnauthorized: 'Access denied', statusUnauthorized: 'Access denied',
@ -347,7 +354,6 @@ export default {
reference: 'Reference', reference: 'Reference',
observations: 'Observations', observations: 'Observations',
item: 'Item', item: 'Item',
description: 'Description',
size: 'Size', size: 'Size',
packing: 'Packing', packing: 'Packing',
grouping: 'Grouping', grouping: 'Grouping',
@ -362,7 +368,6 @@ export default {
}, },
notes: { notes: {
observationType: 'Observation type', observationType: 'Observation type',
description: 'Description',
}, },
descriptor: { descriptor: {
agency: 'Agency', agency: 'Agency',
@ -375,7 +380,6 @@ export default {
packing: 'Packing', packing: 'Packing',
grouping: 'Grouping', grouping: 'Grouping',
quantity: 'Quantity', quantity: 'Quantity',
description: 'Description',
size: 'Size', size: 'Size',
tags: 'Tags', tags: 'Tags',
type: 'Type', type: 'Type',
@ -461,7 +465,6 @@ export default {
visible: 'Visible', visible: 'Visible',
available: 'Available', available: 'Available',
quantity: 'Quantity', quantity: 'Quantity',
description: 'Description',
price: 'Price', price: 'Price',
discount: 'Discount', discount: 'Discount',
packing: 'Packing', packing: 'Packing',
@ -534,7 +537,6 @@ export default {
landed: 'Landed', landed: 'Landed',
quantity: 'Quantity', quantity: 'Quantity',
claimed: 'Claimed', claimed: 'Claimed',
description: 'Description',
price: 'Price', price: 'Price',
discount: 'Discount', discount: 'Discount',
total: 'Total', total: 'Total',
@ -795,7 +797,6 @@ export default {
orderTicketList: 'Order Ticket List', orderTicketList: 'Order Ticket List',
details: 'Details', details: 'Details',
item: 'Item', item: 'Item',
description: 'Description',
quantity: 'Quantity', quantity: 'Quantity',
price: 'Price', price: 'Price',
amount: 'Amount', amount: 'Amount',
@ -1140,7 +1141,6 @@ export default {
warehouse: 'Warehouse', warehouse: 'Warehouse',
travelFileDescription: 'Travel id { travelId }', travelFileDescription: 'Travel id { travelId }',
file: 'File', file: 'File',
description: 'Description',
}, },
}, },
item: { item: {
@ -1174,7 +1174,6 @@ export default {
clone: 'Clone', clone: 'Clone',
openCard: 'View', openCard: 'View',
openSummary: 'Summary', openSummary: 'Summary',
viewDescription: 'Description',
}, },
cardDescriptor: { cardDescriptor: {
mainList: 'Main list', mainList: 'Main list',

View File

@ -64,7 +64,7 @@ export default {
markAll: 'Marcar todo', markAll: 'Marcar todo',
requiredField: 'Campo obligatorio', requiredField: 'Campo obligatorio',
class: 'clase', class: 'clase',
type: 'tipo', type: 'Tipo',
reason: 'motivo', reason: 'motivo',
noResults: 'Sin resultados', noResults: 'Sin resultados',
system: 'Sistema', system: 'Sistema',
@ -72,6 +72,13 @@ export default {
company: 'Empresa', company: 'Empresa',
fieldRequired: 'Campo requerido', fieldRequired: 'Campo requerido',
allowedFilesText: 'Tipos de archivo permitidos: { allowedContentTypes }', allowedFilesText: 'Tipos de archivo permitidos: { allowedContentTypes }',
confirmDeletion: 'Confirmar eliminación',
confirmDeletionMessage: '¿Seguro que quieres eliminar?',
description: 'Descripción',
id: 'Id',
order: 'Orden',
original: 'Original',
file: 'Fichero',
}, },
errors: { errors: {
statusUnauthorized: 'Acceso denegado', statusUnauthorized: 'Acceso denegado',
@ -346,7 +353,6 @@ export default {
reference: 'Referencia', reference: 'Referencia',
observations: 'Observaciónes', observations: 'Observaciónes',
item: 'Artículo', item: 'Artículo',
description: 'Descripción',
size: 'Medida', size: 'Medida',
packing: 'Packing', packing: 'Packing',
grouping: 'Grouping', grouping: 'Grouping',
@ -361,7 +367,6 @@ export default {
}, },
notes: { notes: {
observationType: 'Tipo de observación', observationType: 'Tipo de observación',
description: 'Descripción',
}, },
descriptor: { descriptor: {
agency: 'Agencia', agency: 'Agencia',
@ -374,7 +379,6 @@ export default {
packing: 'Packing', packing: 'Packing',
grouping: 'Grouping', grouping: 'Grouping',
quantity: 'Cantidad', quantity: 'Cantidad',
description: 'Descripción',
size: 'Medida', size: 'Medida',
tags: 'Etiquetas', tags: 'Etiquetas',
type: 'Tipo', type: 'Tipo',
@ -460,7 +464,6 @@ export default {
visible: 'Visible', visible: 'Visible',
available: 'Disponible', available: 'Disponible',
quantity: 'Cantidad', quantity: 'Cantidad',
description: 'Descripción',
price: 'Precio', price: 'Precio',
discount: 'Descuento', discount: 'Descuento',
packing: 'Encajado', packing: 'Encajado',
@ -533,7 +536,6 @@ export default {
landed: 'Entregado', landed: 'Entregado',
quantity: 'Cantidad', quantity: 'Cantidad',
claimed: 'Reclamado', claimed: 'Reclamado',
description: 'Descripción',
price: 'Precio', price: 'Precio',
discount: 'Descuento', discount: 'Descuento',
total: 'Total', total: 'Total',
@ -703,7 +705,6 @@ export default {
orderTicketList: 'Tickets del pedido', orderTicketList: 'Tickets del pedido',
details: 'Detalles', details: 'Detalles',
item: 'Item', item: 'Item',
description: 'Descripción',
quantity: 'Cantidad', quantity: 'Cantidad',
price: 'Precio', price: 'Precio',
amount: 'Monto', amount: 'Monto',
@ -1140,7 +1141,6 @@ export default {
warehouse: 'Almacén', warehouse: 'Almacén',
travelFileDescription: 'Id envío { travelId }', travelFileDescription: 'Id envío { travelId }',
file: 'Fichero', file: 'Fichero',
description: 'Descripción',
}, },
}, },
item: { item: {
@ -1174,7 +1174,6 @@ export default {
clone: 'Clonar', clone: 'Clonar',
openCard: 'Ficha', openCard: 'Ficha',
openSummary: 'Detalles', openSummary: 'Detalles',
viewDescription: 'Descripción',
}, },
cardDescriptor: { cardDescriptor: {
mainList: 'Listado principal', mainList: 'Listado principal',

View File

@ -116,7 +116,7 @@ function navigate(id) {
outline outline
/> />
<QBtn <QBtn
:label="t('components.smartCard.viewDescription')" :label="t('globals.description')"
@click.stop @click.stop
class="bg-vn-dark" class="bg-vn-dark"
outline outline

View File

@ -44,7 +44,7 @@ const columns = computed(() => [
align: 'left', align: 'left',
}, },
{ {
label: t('entry.buys.description'), label: t('globals.description'),
name: 'description', name: 'description',
field: 'description', field: 'description',
align: 'left', align: 'left',

View File

@ -2,6 +2,19 @@
import VnDmsList from 'src/components/common/VnDmsList.vue'; import VnDmsList from 'src/components/common/VnDmsList.vue';
</script> </script>
<template> <template>
<VnDmsList model="EntryDms" default-dms-code="entry" /> <VnDmsList
<!-- CHANGE ME--> model="EntryDms"
update-model="EntryDms"
default-dms-code="entry"
filter="entryFk"
:description="
(data) => t('description', { reference: data.reference, id: data.id })
"
/>
</template> </template>
<i18n>
en:
description: Reference {reference} id {id}
es:
description: Referencia {reference} id {id}
</i18n>

View File

@ -63,7 +63,7 @@ onMounted(() => {
</div> </div>
<div class="col"> <div class="col">
<VnInput <VnInput
:label="t('entry.notes.description')" :label="t('globals.description')"
v-model="row.description" v-model="row.description"
:rules="validate('EntryObservation.description')" :rules="validate('EntryObservation.description')"
/> />

View File

@ -59,7 +59,7 @@ const columns = computed(() => [
align: 'left', align: 'left',
}, },
{ {
label: t('entry.latestBuys.description'), label: t('globals.description'),
field: 'description', field: 'description',
name: 'description', name: 'description',
align: 'left', align: 'left',
@ -214,7 +214,7 @@ const editTableCellFormFieldsOptions = [
{ field: 'grouping', label: t('entry.latestBuys.grouping') }, { field: 'grouping', label: t('entry.latestBuys.grouping') },
{ field: 'packageValue', label: t('entry.latestBuys.packageValue') }, { field: 'packageValue', label: t('entry.latestBuys.packageValue') },
{ field: 'weight', label: t('entry.latestBuys.weight') }, { field: 'weight', label: t('entry.latestBuys.weight') },
{ field: 'description', label: t('entry.latestBuys.description') }, { field: 'description', label: t('globals.description') },
{ field: 'size', label: t('entry.latestBuys.size') }, { field: 'size', label: t('entry.latestBuys.size') },
{ field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') }, { field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') },
{ field: 'packingOut', label: t('entry.latestBuys.packingOut') }, { field: 'packingOut', label: t('entry.latestBuys.packingOut') },

View File

@ -31,7 +31,7 @@ const detailsColumns = ref([
}, },
{ {
name: 'description', name: 'description',
label: t('order.summary.description'), label: t('globals.description'),
field: (row) => row?.item?.name, field: (row) => row?.item?.name,
}, },
{ {
@ -167,7 +167,7 @@ const detailsColumns = ref([
<template #header="props"> <template #header="props">
<QTr :props="props"> <QTr :props="props">
<QTh auto-width>{{ t('order.summary.item') }}</QTh> <QTh auto-width>{{ t('order.summary.item') }}</QTh>
<QTh>{{ t('order.summary.description') }}</QTh> <QTh>{{ t('globals.description') }}</QTh>
<QTh auto-width>{{ t('order.summary.quantity') }}</QTh> <QTh auto-width>{{ t('order.summary.quantity') }}</QTh>
<QTh auto-width>{{ t('order.summary.price') }}</QTh> <QTh auto-width>{{ t('order.summary.price') }}</QTh>
<QTh auto-width>{{ t('order.summary.amount') }}</QTh> <QTh auto-width>{{ t('order.summary.amount') }}</QTh>

View File

@ -199,7 +199,7 @@ const openBuscaman = async (route, ticket) => {
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<div class="header"> <div class="header">
{{ t('route.summary.description') }} {{ t('globals.description') }}
</div> </div>
<p> <p>
{{ dashIfEmpty(entity?.route?.description) }} {{ dashIfEmpty(entity?.route?.description) }}

View File

@ -270,7 +270,7 @@ async function changeState(value) {
<QTh auto-width>{{ t('ticket.summary.visible') }}</QTh> <QTh auto-width>{{ t('ticket.summary.visible') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.available') }}</QTh> <QTh auto-width>{{ t('ticket.summary.available') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.quantity') }}</QTh> <QTh auto-width>{{ t('ticket.summary.quantity') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.description') }}</QTh> <QTh auto-width>{{ t('globals.description') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.price') }}</QTh> <QTh auto-width>{{ t('ticket.summary.price') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.discount') }}</QTh> <QTh auto-width>{{ t('ticket.summary.discount') }}</QTh>
<QTh auto-width>{{ t('globals.amount') }}</QTh> <QTh auto-width>{{ t('globals.amount') }}</QTh>
@ -425,7 +425,7 @@ async function changeState(value) {
<template #header="props"> <template #header="props">
<QTr :props="props"> <QTr :props="props">
<QTh auto-width>{{ t('ticket.summary.quantity') }}</QTh> <QTh auto-width>{{ t('ticket.summary.quantity') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.description') }}</QTh> <QTh auto-width>{{ t('globals.description') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.price') }}</QTh> <QTh auto-width>{{ t('ticket.summary.price') }}</QTh>
<QTh auto-width>{{ t('ticket.summary.taxClass') }}</QTh> <QTh auto-width>{{ t('ticket.summary.taxClass') }}</QTh>
<QTh auto-width>{{ t('globals.amount') }}</QTh> <QTh auto-width>{{ t('globals.amount') }}</QTh>

View File

@ -300,7 +300,7 @@ const onThermographCreated = async (data) => {
<VnRow v-if="viewAction === 'edit'" class="row q-gutter-md q-mb-md"> <VnRow v-if="viewAction === 'edit'" class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<QInput <QInput
:label="t('travel.thermographs.description')" :label="t('globals.description')"
type="textarea" type="textarea"
v-model="thermographForm.description" v-model="thermographForm.description"
fill-input fill-input