0
0
Fork 0

Change dms import form ubication

This commit is contained in:
William Buezas 2024-07-01 09:48:27 -03:00
parent 0e8106af17
commit c3a064eeda
3 changed files with 19 additions and 13 deletions

View File

@ -3,7 +3,6 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar';
import VnDmsImportForm from 'src/components/common/VnDmsImportForm.vue';
import axios from 'axios';
import VnPaginate from 'components/ui/VnPaginate.vue';
@ -19,7 +18,6 @@ const { t } = useI18n();
const rows = ref();
const dmsRef = ref();
const formDialog = ref({});
const showImportDialog = ref(false);
const $props = defineProps({
model: {
@ -47,10 +45,6 @@ const $props = defineProps({
type: String,
required: true,
},
allowImport: {
type: Boolean,
default: false,
},
});
const dmsFilter = {
@ -279,6 +273,10 @@ function shouldRenderButton(button, isExternal = false) {
if (button.name == 'download') return true;
return button.external === isExternal;
}
defineExpose({
dmsRef,
});
</script>
<template>
<VnPaginate
@ -379,15 +377,9 @@ function shouldRenderButton(button, isExternal = false) {
:description="$props.description"
/>
</QDialog>
<QDialog v-model="showImportDialog">
<VnDmsImportForm @on-data-saved="dmsRef.fetch()" />
</QDialog>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn fab color="primary" icon="add" @click="showFormDialog()" />
</QPageSticky>
<QPageSticky v-if="allowImport" position="bottom-right" :offset="[25, 90]">
<QBtn fab color="primary" icon="file_copy" @click="showImportDialog = true" />
</QPageSticky>
</template>
<style scoped>
.q-gutter-y-ms {

View File

@ -1,8 +1,16 @@
<script setup>
import { ref } from 'vue';
import VnDmsList from 'src/components/common/VnDmsList.vue';
import TicketDmsImportForm from 'src/pages/Ticket/Card/TicketDmsImportForm.vue';
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"
@ -11,4 +19,10 @@ import VnDmsList from 'src/components/common/VnDmsList.vue';
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" />
</QPageSticky>
</template>

View File

@ -26,7 +26,7 @@ const onDataSaved = (formData, requestResponse) => {
const importDms = async () => {
try {
if (!dmsId.value) throw new Error(t(`The document indentifier can't be empty`));
if (!dmsId.value) throw new Error(t(`The document identifier can't be empty`));
const data = {
ticketFk: route.params.id,