2999-ticket_dms_import_from_existing + buyer to ticket.isEditable #678

Merged
joan merged 8 commits from 2999-ticket_dms_import_from_existing into dev 2021-06-29 10:13:24 +00:00
3 changed files with 53 additions and 9 deletions
Showing only changes of commit 832452df95 - Show all commits

View File

@ -96,18 +96,48 @@
</vn-table>
</vn-card>
</vn-data-viewer>
<div fixed-bottom-right>
<vn-vertical style="align-items: center;">
<vn-button class="round sm vn-mb-sm"
icon="file_copy"
ng-click="$ctrl.$.dmsImportDialog.show()"
vn-tooltip="Import from existing"
tooltip-position="left">
</vn-button>
<a ui-sref="ticket.card.dms.create" vn-bind="+">
<vn-button class="round md vn-mb-sm"
icon="publish"
vn-tooltip="Upload file"
tooltip-position="left">
</vn-button>
</a>
</vn-vertical>
</div>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>
<a ui-sref="ticket.card.dms.create"
vn-tooltip="Upload file"
vn-bind="+"
fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>
</a>
<vn-confirm
vn-id="confirm"
message="This file will be deleted"
question="Are you sure you want to continue?"
on-accept="$ctrl.deleteDms($data)">
</vn-confirm>
<vn-dialog
message="Select document id"
vn-id="dmsImportDialog"
on-accept="$ctrl.importDms()">
<tpl-body>
<vn-autocomplete
label="Document"
ng-model="$ctrl.dmsId"
url="Dms"
show-field="id"
vn-focus>
</vn-autocomplete>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>

View File

@ -55,6 +55,18 @@ class Controller extends Section {
downloadFile(dmsId) {
this.vnFile.download(`api/dms/${dmsId}/downloadFile`);
}
importDms() {
const data = {
ticketFk: this.$params.id,
dmsFk: this.dmsId
};
this.$http.post('ticketDms', data).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.$.model.refresh();
});
}
}
Controller.$inject = ['$element', '$scope', 'vnFile'];

View File

@ -7,3 +7,5 @@ Generate identifier for original file: Generar identificador para archivo origin
ContentTypesInfo: 'Tipos de archivo permitidos: {{allowedContentTypes}}'
Are you sure you want to continue?: ¿Seguro que quieres continuar?
File management: Gestión documental
Select document id: Introduzca id de gestion documental
Import from existing: Importar desde existente