Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- methods: {
- created() {
- const createAction = {
- uid: 1,
- title: 'Отправить в Госключ',
- type: 'Menu',
- icon: '',
- disabled: false,
- loading: false,
- visibled: true,
- action: () => this.customActionHandler(),
- };
- this.$emit('external-component-emit', { name: 'set-card-actions', data: [createAction] });
- },
- async customActionHandler() {
- const instruction = this.instructionInfo.instruction;
- const files = await this.execQuery(this.queryId.InstructionFilesQuery, { instrId: String(instruction.id), fromRemote: false })
- // const obj = {
- // type: this.instructionInfo.instructionType,
- // context: this.context,
- // defaultReceivers: [
- // {
- // id: instruction.receiverID,
- // name: instruction.receiverName,
- // },
- // ],
- // };
- // let document;
- // if (instruction.baseDocumentID) {
- // document = await this.execQuery(this.queryId.DocumentQuery, {
- // documentId: instruction.baseDocumentID,
- // journalId: Number(this.context.folderId),
- // });
- // obj.baseDocument = document;
- // }
- // this.$app.createMessage(obj);
- const selectedIds = [];
- files.map(el => el.id)
- const result = this.selectedIds.join();
- const params = {
- files: result,
- };
- try {
- this.execCommand(this.commandId.ExecuteServerScriptCommand, {
- name: 'statekey_send_docs',
- parameters: params
- });
- this.$toasted.success(this.$gettext('Выбранные файлы отправлены в Госключ'));
- } catch (e) {
- this.$log.error('Возникла ошибка при попытке вызвать серверный скрипт:', e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment