diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 9bb05d439..c8fa5809c 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -176,8 +176,8 @@ async function remove(data) { .dialog({ component: VnConfirm, componentProps: { - title: t('confirmDeletion'), - message: t('confirmDeletionMessage'), + title: t('globals.confirmDeletion'), + message: t('globals.confirmDeletionMessage'), newData, ids, }, @@ -317,16 +317,3 @@ watch(formUrl, async () => { color="primary" /> - - - { - "en": { - "confirmDeletion": "Confirm deletion", - "confirmDeletionMessage": "Are you sure you want to delete this?" - }, - "es": { - "confirmDeletion": "Confirmar eliminación", - "confirmDeletionMessage": "Seguro que quieres eliminar?" - } - } - diff --git a/src/components/EditPictureForm.vue b/src/components/EditPictureForm.vue index 9f69896b5..3d7f3615b 100644 --- a/src/components/EditPictureForm.vue +++ b/src/components/EditPictureForm.vue @@ -272,7 +272,7 @@ const makeRequest = async () => { class="cursor-pointer q-mr-sm" @click="openInputFile()" > - + {{ diff --git a/src/components/FetchData.vue b/src/components/FetchData.vue index 4f5d7a57d..5b3dcbea7 100644 --- a/src/components/FetchData.vue +++ b/src/components/FetchData.vue @@ -59,11 +59,4 @@ async function fetch(fetchFilter = {}) { // } } - -const render = () => { - return h('div', []); -}; - diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 5c65650e1..c8d83b6c4 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -61,6 +61,10 @@ const $props = defineProps({ type: Function, default: null, }, + saveFn: { + type: Function, + default: null, + }, }); const emit = defineEmits(['onFetch', 'onDataSaved']); @@ -77,9 +81,8 @@ onMounted(async () => { }); // Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla - if ($props.formInitialData && !$props.autoLoad) { - state.set($props.model, $props.formInitialData); - } else { + state.set($props.model, $props.formInitialData ?? {}); + if ($props.autoLoad && !$props.formInitialData) { await fetch(); } @@ -153,17 +156,20 @@ async function save() { try { const body = $props.mapper ? $props.mapper(formData.value) : formData.value; let response; - if ($props.urlCreate) { - response = await axios.post($props.urlCreate, body); - notify('globals.dataCreated', 'positive'); - } else { - response = await axios.patch($props.urlUpdate || $props.url, body); - } + if ($props.saveFn) response = await $props.saveFn(body); + else + response = await axios[$props.urlCreate ? 'post' : 'patch']( + $props.urlCreate || $props.urlUpdate || $props.url, + body + ); + if ($props.urlCreate) notify('globals.dataCreated', 'positive'); + emit('onDataSaved', formData.value, response?.data); originalData.value = JSON.parse(JSON.stringify(formData.value)); hasChanges.value = false; } catch (err) { - notify('errors.create', 'negative'); + console.error(err); + notify('errors.writeRequest', 'negative'); } isLoading.value = false; } diff --git a/src/components/common/VnDms.vue b/src/components/common/VnDms.vue new file mode 100644 index 000000000..d2651f5d8 --- /dev/null +++ b/src/components/common/VnDms.vue @@ -0,0 +1,201 @@ + + + + +en: + contentTypesInfo: Allowed file types {allowedContentTypes} + EntryDmsDescription: Reference {reference} +es: + Generate identifier for original file: Generar identificador para archivo original + contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes} + EntryDmsDescription: Referencia {reference} + + diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue new file mode 100644 index 000000000..5057c0790 --- /dev/null +++ b/src/components/common/VnDmsList.vue @@ -0,0 +1,316 @@ + + + + +en: + contentTypesInfo: Allowed file types {allowedContentTypes} +es: + contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes} + Generate identifier for original file: Generar identificador para archivo original + diff --git a/src/components/ui/VnRow.vue b/src/components/ui/VnRow.vue index c3c951528..e13730e62 100644 --- a/src/components/ui/VnRow.vue +++ b/src/components/ui/VnRow.vue @@ -1,12 +1,16 @@ diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 298720027..0cc91c88d 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -24,6 +24,7 @@ export default { dataCreated: 'Data created', add: 'Add', create: 'Create', + edit: 'Edit', save: 'Save', remove: 'Remove', reset: 'Reset', @@ -64,12 +65,22 @@ export default { markAll: 'Mark all', requiredField: 'Required field', class: 'clase', - type: 'type', + type: 'Type', reason: 'reason', noResults: 'No results', system: 'System', + warehouse: 'Warehouse', + company: 'Company', fieldRequired: 'Field required', 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', + selectFile: 'Select a file', copyClipboard: 'Copy on clipboard', }, errors: { @@ -78,7 +89,7 @@ export default { statusBadGateway: 'It seems that the server has fall down', statusGatewayTimeout: 'Could not contact the server', userConfig: 'Error fetching user config', - create: 'Error during creation', + writeRequest: 'The requested operation could not be completed', }, login: { title: 'Login', @@ -276,6 +287,7 @@ export default { basicData: 'Basic data', buys: 'Buys', notes: 'Notes', + dms: 'File management', log: 'Log', create: 'Create', latestBuys: 'Latest buys', @@ -347,7 +359,6 @@ export default { reference: 'Reference', observations: 'Observations', item: 'Item', - description: 'Description', size: 'Size', packing: 'Packing', grouping: 'Grouping', @@ -362,7 +373,6 @@ export default { }, notes: { observationType: 'Observation type', - description: 'Description', }, descriptor: { agency: 'Agency', @@ -375,7 +385,6 @@ export default { packing: 'Packing', grouping: 'Grouping', quantity: 'Quantity', - description: 'Description', size: 'Size', tags: 'Tags', type: 'Type', @@ -461,7 +470,6 @@ export default { visible: 'Visible', available: 'Available', quantity: 'Quantity', - description: 'Description', price: 'Price', discount: 'Discount', packing: 'Packing', @@ -534,7 +542,6 @@ export default { landed: 'Landed', quantity: 'Quantity', claimed: 'Claimed', - description: 'Description', price: 'Price', discount: 'Discount', total: 'Total', @@ -796,7 +803,6 @@ export default { orderTicketList: 'Order Ticket List', details: 'Details', item: 'Item', - description: 'Description', quantity: 'Quantity', price: 'Price', amount: 'Amount', @@ -1141,7 +1147,6 @@ export default { warehouse: 'Warehouse', travelFileDescription: 'Travel id { travelId }', file: 'File', - description: 'Description', }, }, item: { @@ -1175,7 +1180,6 @@ export default { clone: 'Clone', openCard: 'View', openSummary: 'Summary', - viewDescription: 'Description', }, cardDescriptor: { mainList: 'Main list', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 2fe197304..7369721e6 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -24,6 +24,7 @@ export default { dataCreated: 'Datos creados', add: 'Añadir', create: 'Crear', + edit: 'Modificar', save: 'Guardar', remove: 'Eliminar', reset: 'Restaurar', @@ -64,12 +65,22 @@ export default { markAll: 'Marcar todo', requiredField: 'Campo obligatorio', class: 'clase', - type: 'tipo', + type: 'Tipo', reason: 'motivo', noResults: 'Sin resultados', system: 'Sistema', + warehouse: 'Almacén', + company: 'Empresa', fieldRequired: 'Campo requerido', 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', + selectFile: 'Seleccione un fichero', copyClipboard: 'Copiar en portapapeles', }, errors: { @@ -78,7 +89,7 @@ export default { statusBadGateway: 'Parece ser que el servidor ha caído', statusGatewayTimeout: 'No se ha podido contactar con el servidor', userConfig: 'Error al obtener configuración de usuario', - create: 'Error al crear', + writeRequest: 'No se pudo completar la operación solicitada', }, login: { title: 'Inicio de sesión', @@ -275,6 +286,7 @@ export default { basicData: 'Datos básicos', buys: 'Compras', notes: 'Notas', + dms: 'Gestión documental', log: 'Historial', create: 'Crear', latestBuys: 'Últimas compras', @@ -346,7 +358,6 @@ export default { reference: 'Referencia', observations: 'Observaciónes', item: 'Artículo', - description: 'Descripción', size: 'Medida', packing: 'Packing', grouping: 'Grouping', @@ -361,7 +372,6 @@ export default { }, notes: { observationType: 'Tipo de observación', - description: 'Descripción', }, descriptor: { agency: 'Agencia', @@ -374,7 +384,6 @@ export default { packing: 'Packing', grouping: 'Grouping', quantity: 'Cantidad', - description: 'Descripción', size: 'Medida', tags: 'Etiquetas', type: 'Tipo', @@ -460,7 +469,6 @@ export default { visible: 'Visible', available: 'Disponible', quantity: 'Cantidad', - description: 'Descripción', price: 'Precio', discount: 'Descuento', packing: 'Encajado', @@ -533,7 +541,6 @@ export default { landed: 'Entregado', quantity: 'Cantidad', claimed: 'Reclamado', - description: 'Descripción', price: 'Precio', discount: 'Descuento', total: 'Total', @@ -704,7 +711,6 @@ export default { orderTicketList: 'Tickets del pedido', details: 'Detalles', item: 'Item', - description: 'Descripción', quantity: 'Cantidad', price: 'Precio', amount: 'Monto', @@ -1141,7 +1147,6 @@ export default { warehouse: 'Almacén', travelFileDescription: 'Id envío { travelId }', file: 'Fichero', - description: 'Descripción', }, }, item: { @@ -1175,7 +1180,6 @@ export default { clone: 'Clonar', openCard: 'Ficha', openSummary: 'Detalles', - viewDescription: 'Descripción', }, cardDescriptor: { mainList: 'Listado principal', diff --git a/src/pages/Claim/ClaimList.vue b/src/pages/Claim/ClaimList.vue index 322055b13..fd0d2561f 100644 --- a/src/pages/Claim/ClaimList.vue +++ b/src/pages/Claim/ClaimList.vue @@ -116,7 +116,13 @@ function navigate(event, id) { @@ -292,6 +292,6 @@ const redirectToBuysView = () => { es: - Select a file: Selecciona un fichero + globals.selectFile: Selecciona un fichero Some of the imported buys does not have an item: Algunas de las compras importadas no tienen un artículo diff --git a/src/pages/Entry/Card/EntryDms.vue b/src/pages/Entry/Card/EntryDms.vue new file mode 100644 index 000000000..bab1ea6c2 --- /dev/null +++ b/src/pages/Entry/Card/EntryDms.vue @@ -0,0 +1,11 @@ + + diff --git a/src/pages/Entry/Card/EntryNotes.vue b/src/pages/Entry/Card/EntryNotes.vue index f56e59253..0d2e5e51a 100644 --- a/src/pages/Entry/Card/EntryNotes.vue +++ b/src/pages/Entry/Card/EntryNotes.vue @@ -63,7 +63,7 @@ onMounted(() => {
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue index f4a423f3b..09a6a2f27 100644 --- a/src/pages/Entry/EntryLatestBuys.vue +++ b/src/pages/Entry/EntryLatestBuys.vue @@ -59,7 +59,7 @@ const columns = computed(() => [ align: 'left', }, { - label: t('entry.latestBuys.description'), + label: t('globals.description'), field: 'description', name: 'description', align: 'left', @@ -214,7 +214,7 @@ const editTableCellFormFieldsOptions = [ { 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: 'description', label: t('globals.description') }, { field: 'size', label: t('entry.latestBuys.size') }, { field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') }, { field: 'packingOut', label: t('entry.latestBuys.packingOut') }, diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index 2a29a3d0e..f557c8ef4 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -174,7 +174,12 @@ async function upsert() { @on-fetch="(data) => (userConfig = data)" auto-load /> - +