forked from verdnatura/salix-front
Merge pull request 'Ticket Dms' (!495) from hyervoni/salix-front-mindshore:feature/TicketDms into dev
Reviewed-on: verdnatura/salix-front#495 Reviewed-by: Alex Moreno <alexm@verdnatura.es> Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
9c6722a6fd
|
@ -273,6 +273,10 @@ function shouldRenderButton(button, isExternal = false) {
|
|||
if (button.name == 'download') return true;
|
||||
return button.external === isExternal;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
dmsRef,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<VnPaginate
|
||||
|
@ -374,7 +378,11 @@ function shouldRenderButton(button, isExternal = false) {
|
|||
/>
|
||||
</QDialog>
|
||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||
<QBtn fab color="primary" icon="add" @click="showFormDialog()" />
|
||||
<QBtn fab color="primary" icon="add" @click="showFormDialog()" class="fill-icon">
|
||||
<QTooltip>
|
||||
{{ t('Upload file') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
</QPageSticky>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
@ -392,4 +400,5 @@ en:
|
|||
es:
|
||||
contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
|
||||
Generate identifier for original file: Generar identificador para archivo original
|
||||
Upload file: Subir fichero
|
||||
</i18n>
|
||||
|
|
|
@ -548,6 +548,7 @@ ticket:
|
|||
sms: Sms
|
||||
notes: Notes
|
||||
sale: Sale
|
||||
dms: File management
|
||||
volume: Volume
|
||||
observation: Notes
|
||||
ticketAdvance: Advance tickets
|
||||
|
|
|
@ -553,6 +553,7 @@ ticket:
|
|||
sms: Sms
|
||||
notes: Notas
|
||||
sale: Lineas del pedido
|
||||
dms: Gestión documental
|
||||
volume: Volumen
|
||||
observation: Notas
|
||||
ticketAdvance: Adelantar tickets
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import VnDmsList from 'src/components/common/VnDmsList.vue';
|
||||
import TicketDmsImportForm from 'src/pages/Ticket/Card/TicketDmsImportForm.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const dmsListRef = ref(null);
|
||||
const showImportDialog = ref(false);
|
||||
|
||||
const onDataSaved = () => dmsListRef.value.dmsRef.fetch();
|
||||
</script>
|
||||
<template>
|
||||
<VnDmsList
|
||||
ref="dmsListRef"
|
||||
model="TicketDms"
|
||||
update-model="tickets"
|
||||
delete-model="TicketDms"
|
||||
download-model="dms"
|
||||
default-dms-code="ticket"
|
||||
filter="ticketFk"
|
||||
allow-import
|
||||
/>
|
||||
<QDialog v-model="showImportDialog">
|
||||
<TicketDmsImportForm @on-data-saved="onDataSaved()" />
|
||||
</QDialog>
|
||||
<QPageSticky position="bottom-right" :offset="[25, 90]">
|
||||
<QBtn
|
||||
fab
|
||||
color="primary"
|
||||
icon="file_copy"
|
||||
@click="showImportDialog = true"
|
||||
class="fill-icon"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Import from existing') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
</QPageSticky>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Import from existing: Importar desde existente
|
||||
</i18n>
|
|
@ -0,0 +1,76 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import axios from 'axios';
|
||||
|
||||
const emit = defineEmits(['onDataSaved']);
|
||||
|
||||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
const route = useRoute();
|
||||
|
||||
const dmsOptions = ref([]);
|
||||
const dmsId = ref(null);
|
||||
|
||||
const importDms = async () => {
|
||||
try {
|
||||
if (!dmsId.value) throw new Error(t(`The document identifier can't be empty`));
|
||||
|
||||
const data = {
|
||||
ticketFk: route.params.id,
|
||||
dmsFk: dmsId.value,
|
||||
};
|
||||
|
||||
await axios.post('ticketDms', data);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
dmsId.value = null;
|
||||
emit('onDataSaved');
|
||||
} catch (e) {
|
||||
throw new Error(e.message);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="Dms"
|
||||
:filter="{ fields: ['id'], order: 'id ASC' }"
|
||||
auto-load
|
||||
@on-fetch="(data) => (dmsOptions = data)"
|
||||
/>
|
||||
<FormModelPopup
|
||||
url-create="genera"
|
||||
model="DmsImport"
|
||||
:title="t('Select document id')"
|
||||
:form-initial-data="{}"
|
||||
:save-fn="importDms"
|
||||
>
|
||||
<template #form-inputs>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelect
|
||||
:label="t('Document')"
|
||||
:options="dmsOptions"
|
||||
hide-selected
|
||||
option-label="id"
|
||||
option-value="id"
|
||||
v-model="dmsId"
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormModelPopup>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Select document id: Introduzca id de gestion documental
|
||||
Document: Documento
|
||||
The document indentifier can't be empty: El número de documento no puede estar vacío
|
||||
</i18n>
|
|
@ -12,7 +12,6 @@ import VnLv from 'src/components/ui/VnLv.vue';
|
|||
import CardList from 'src/components/ui/CardList.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import { toDate, toCurrency } from 'src/filters';
|
||||
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
|
|
|
@ -17,6 +17,7 @@ export default {
|
|||
'TicketSale',
|
||||
'TicketLog',
|
||||
'TicketExpedition',
|
||||
'TicketDms',
|
||||
'TicketPurchaseRequest',
|
||||
'TicketTracking',
|
||||
'TicketNotes',
|
||||
|
@ -171,6 +172,7 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketVolume.vue'),
|
||||
},
|
||||
|
||||
{
|
||||
path: 'observation',
|
||||
name: 'TicketNotes',
|
||||
|
@ -180,6 +182,15 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketNotes.vue'),
|
||||
},
|
||||
{
|
||||
path: 'dms',
|
||||
name: 'TicketDms',
|
||||
meta: {
|
||||
title: 'dms',
|
||||
icon: 'cloud_upload',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketDms.vue'),
|
||||
},
|
||||
{
|
||||
path: 'sale-tracking',
|
||||
name: 'TicketSaleTracking',
|
||||
|
|
Loading…
Reference in New Issue