diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index e8dd1b526..e214770d2 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -897,7 +897,7 @@ const rowCtrlClickFunction = computed(() => { {{ row[splittedColumns.title.name] }} - + +import VnConfirm from '../ui/VnConfirm.vue'; +import VnInput from './VnInput.vue'; +import VnDms from './VnDms.vue'; +import axios from 'axios'; +import { useQuasar } from 'quasar'; +import { ref } from 'vue'; +import { useI18n } from 'vue-i18n'; +import { downloadFile } from 'src/composables/downloadFile'; + +const { t } = useI18n(); +const quasar = useQuasar(); +const documentDialogRef = ref({}); +const editDownloadDisabled = ref(false); +const $props = defineProps({ + defaultDmsCode: { + type: String, + default: 'InvoiceIn', + }, + disable: { + type: Boolean, + default: true, + }, + data: { + type: Object, + default: null, + }, + formRef: { + type: Object, + default: null, + }, +}); + +function deleteFile(dmsFk) { + quasar + .dialog({ + component: VnConfirm, + componentProps: { + title: t('globals.confirmDeletion'), + message: t('globals.confirmDeletionMessage'), + }, + }) + .onOk(async () => { + await axios.post(`dms/${dmsFk}/removeFile`); + $props.formRef.formData.dmsFk = null; + $props.formRef.formData.dms = undefined; + $props.formRef.hasChanges = true; + $props.formRef.save(); + }); +} + + + +es: + Document: Documento + Download file: Descargar archivo + Edit document: Editar documento + Delete file: Eliminar archivo + Create document: Crear documento + + diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 9821992cb..474d68116 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -84,7 +84,7 @@ const mixinRules = [ ...($attrs.rules ?? []), (val) => { const maxlength = $props.maxlength; - if (maxlength && +val.length > maxlength) + if (maxlength && +val?.length > maxlength) return t(`maxLength`, { value: maxlength }); const { min, max } = vnInputRef.value.$attrs; if (!min) return null; diff --git a/src/components/ui/VnToSummary.vue b/src/components/ui/VnToSummary.vue index 305d65e02..853d26230 100644 --- a/src/components/ui/VnToSummary.vue +++ b/src/components/ui/VnToSummary.vue @@ -26,6 +26,7 @@ const id = props.entityId; :to="{ name: routeName, params: { id: id } }" class="header link" :href="url" + data-cy="goToSummaryBtn" > diff --git a/src/composables/downloadFile.js b/src/composables/downloadFile.js index 302836e09..0c4e8edb6 100644 --- a/src/composables/downloadFile.js +++ b/src/composables/downloadFile.js @@ -5,18 +5,19 @@ import { exportFile } from 'quasar'; const { getTokenMultimedia } = useSession(); const token = getTokenMultimedia(); -const appUrl = (await getUrl('', 'lilium')).replace('/#/', ''); export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) { + const appUrl = await getAppUrl(); const response = await axios.get( url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`, - { responseType: 'blob' } + { responseType: 'blob' }, ); download(response); } export async function downloadDocuware(url, params) { + const appUrl = await getAppUrl(); const response = await axios.get(`${appUrl}/api/` + url, { responseType: 'blob', params, @@ -32,3 +33,7 @@ function download(response) { exportFile(filename, response.data); } + +async function getAppUrl() { + return (await getUrl('', 'lilium')).replace('/#/', ''); +} diff --git a/src/css/app.scss b/src/css/app.scss index 5befd150b..b299973d1 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -325,7 +325,6 @@ input::-webkit-inner-spin-button { min-height: auto !important; display: flex; align-items: flex-end; - padding-bottom: 2px; .q-field__native.row { min-height: auto !important; } diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 7374cda68..c62305f95 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -817,6 +817,7 @@ travel: search: Search travel searchInfo: You can search by travel id or name id: Id + awbFk: AWB travelList: tableVisibleColumns: ref: Reference diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f0ce53e37..86d15e985 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -900,6 +900,7 @@ travel: search: Buscar envío searchInfo: Buscar envío por id o nombre id: Id + awbFk: Guía aérea travelList: tableVisibleColumns: ref: Referencia diff --git a/src/pages/Entry/Card/EntryBasicData.vue b/src/pages/Entry/Card/EntryBasicData.vue index 34e4a0f9c..f6d15a977 100644 --- a/src/pages/Entry/Card/EntryBasicData.vue +++ b/src/pages/Entry/Card/EntryBasicData.vue @@ -14,6 +14,8 @@ import VnInputNumber from 'src/components/common/VnInputNumber.vue'; import VnSelectTravelExtended from 'src/components/common/VnSelectTravelExtended.vue'; import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue'; import VnCheckbox from 'src/components/common/VnCheckbox.vue'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; +import VnDmsInput from 'src/components/common/VnDmsInput.vue'; const route = useRoute(); const { t } = useI18n(); @@ -24,6 +26,7 @@ const user = state.getUser().fn(); const companiesOptions = ref([]); const currenciesOptions = ref([]); +const entryRef = ref({}); onMounted(() => { checkEntryLock(route.params.id, user.id); @@ -48,10 +51,11 @@ onMounted(() => { auto-load />