Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
e478ed9c
Commit
e478ed9c
authored
Feb 02, 2022
by
Irina Oleynik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавление файла на форме
parent
dacb54f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
interpreter/event.blocking.interpreter.savePrintForm
interpreter/event.blocking.interpreter.savePrintForm
+28
-0
No files found.
interpreter/event.blocking.interpreter.savePrintForm
0 → 100644
View file @
e478ed9c
var result = true;
var message = "ok";
try {
let fileName = "printFormFile.pdf";
let PDFFile = API.getPrintFilePDF(dataUUID);
let tmpFile = API.startUpload();
let uploadPartResult = API.uploadPart(tmpFile.file, PDFFile);
let asfFileAddResult = API.addFileInForm(dataUUID, fileName, tmpFile.file);
if(asfFileAddResult && asfFileAddResult.hasOwnProperty('fileId')) {
let resultSaveFile = API.appendTable(dataUUID, 'attachments', [{
id: 'file',
type: 'file',
value: fileName,
key: asfFileAddResult.fileId
}]);
if(resultSaveFile.errorCode != '0') throw new Error('Ошибка сохранения файла на форме appendTable');
message = 'Файл успешно добавлен';
} else {
throw new Error('Ошибка загрузки файла addFileInForm');
}
} catch (err) {
log.error(err.message);
message = err.message;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment