spacerose

Untitled

Feb 13th, 2023
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. methods: {
  2. created() {
  3. const createAction = {
  4. uid: 1,
  5. title: 'Отправить в Госключ',
  6. type: 'Menu',
  7. icon: '',
  8. disabled: false,
  9. loading: false,
  10. visibled: true,
  11.  
  12. action: () => this.customActionHandler(),
  13. };
  14.  
  15. this.$emit('external-component-emit', { name: 'set-card-actions', data: [createAction] });
  16. },
  17. async customActionHandler() {
  18. const instruction = this.instructionInfo.instruction;
  19.  
  20. const files = await this.execQuery(this.queryId.InstructionFilesQuery, { instrId: String(instruction.id), fromRemote: false })
  21. // const obj = {
  22. // type: this.instructionInfo.instructionType,
  23. // context: this.context,
  24. // defaultReceivers: [
  25. // {
  26. // id: instruction.receiverID,
  27. // name: instruction.receiverName,
  28. // },
  29. // ],
  30. // };
  31. // let document;
  32. // if (instruction.baseDocumentID) {
  33. // document = await this.execQuery(this.queryId.DocumentQuery, {
  34. // documentId: instruction.baseDocumentID,
  35. // journalId: Number(this.context.folderId),
  36. // });
  37. // obj.baseDocument = document;
  38. // }
  39. // this.$app.createMessage(obj);
  40. const selectedIds = [];
  41. files.map(el => el.id)
  42. const result = this.selectedIds.join();
  43. const params = {
  44. files: result,
  45. };
  46. try {
  47. this.execCommand(this.commandId.ExecuteServerScriptCommand, {
  48. name: 'statekey_send_docs',
  49. parameters: params
  50. });
  51. this.$toasted.success(this.$gettext('Выбранные файлы отправлены в Госключ'));
  52. } catch (e) {
  53. this.$log.error('Возникла ошибка при попытке вызвать серверный скрипт:', e);
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment