Skip to content

Commit

Permalink
feat: добавлена ссылка на отчёт-таблицу во всплывалку отчёта "Оформит…
Browse files Browse the repository at this point in the history
…ь смету"
  • Loading branch information
popstas committed May 14, 2020
1 parent 4bd3ecd commit e771e73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/_planfixfix.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ let $; // заглушает ошибки в определении $ в мод
smeta: {
aid: 314, // смета на разработку
reportId: 5469, // id отчёта на смету
reportTableId: 5467, // id отчёта на смету теблицей
orderByFids: [950, 1093], // тип работ, №
name: '[data-fid="934"]',
price: '[data-fid="934:h1016"]',
Expand Down
4 changes: 3 additions & 1 deletion src/smeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ const pffSmeta = {
win.PFF.editorInsertHtml(styledHtml);
}
else {
// сделать отчёт
// сделать отчёт во всплывалке
const link = `https://tagilcity.planfix.ru/?action=report&id=${win.PFF.fields.smeta.reportId}&task=${win.PlanfixPage.task}&run=1`;
const linkTable = `https://tagilcity.planfix.ru/?action=report&id=${win.PFF.fields.smeta.reportTableId}&task=${win.PlanfixPage.task}&run=1`;
const html = `<div class="pff-report-frame"><iframe src="${link}" width="100%" height="600"></iframe></div>`;

// noinspection JSValidateTypes
Expand All @@ -267,6 +268,7 @@ const pffSmeta = {
const iframe = $('.pff-report-frame iframe').get(0);
win.PFF.waitFor('.tbl-report', 1000, 10, iframe).then(() => {
iframe.contentWindow.ReportJS.expandLevel(0);
iframe.contentWindow.$('.report-view-ddl').after(`<a href="${linkTable}" target="_blank">В виде таблицы</a>`)
});
}
},
Expand Down

0 comments on commit e771e73

Please sign in to comment.