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/VnNotes.vue b/src/components/ui/VnNotes.vue index 6ce28254d..b7e6ccbec 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -40,6 +40,11 @@ const quasar = useQuasar(); const newNote = reactive({ text: null, observationTypeFk: null }); const observationTypes = ref([]); const vnPaginateRef = ref(); + +const defaultObservationType = computed(() => + observationTypes.value.find(ot => ot.code === 'salesPerson')?.id +); + let originalText; function handleClick(e) { @@ -111,14 +116,22 @@ function fetchData([data]) { originalText = data?.notes; emit('onFetch', data); } + +const handleObservationTypes = (data) => { + observationTypes.value = data; + if(defaultObservationType.value) { + newNote.observationTypeFk = defaultObservationType.value; + } +}; +