Save multi-position norm drafts and open public catalog
This commit is contained in:
+49
-1
@@ -263,6 +263,11 @@ button { font-family: inherit; }
|
||||
#header .mode-on { border-color: var(--accent); color: var(--accent); font-weight: 650; }
|
||||
|
||||
#messages { flex: 1; overflow-y: auto; padding: 1.2rem 1.6rem; display: flex; flex-direction: column; gap: .7rem; width: 100%; }
|
||||
.norm-draft-banner { margin:.5rem 1rem 0; padding:.65rem .8rem; border:1px solid var(--border);
|
||||
border-radius:var(--radius); background:var(--bg-card); font-size:.82rem; }
|
||||
.norm-draft-banner a { color:var(--accent); }
|
||||
.norm-draft-banner button { margin-left:.5rem; border:1px solid var(--border); border-radius:6px;
|
||||
padding:.25rem .5rem; background:var(--bg-card); color:var(--text); cursor:pointer; }
|
||||
.msg { max-width: 85%; padding: .8rem 1.1rem; border-radius: var(--radius-lg); line-height: 1.6; white-space: pre-wrap; word-break: break-word; font-size: .9rem; box-shadow: var(--shadow-sm); position: relative; }
|
||||
.msg-time { display: block; font-size: .65rem; color: var(--text-muted, #999); margin-bottom: .3rem; opacity: .7; }
|
||||
.msg-user { align-self: flex-end; background: var(--user-bg); color: var(--user-text); border-bottom-right-radius: 4px; }
|
||||
@@ -638,6 +643,7 @@ html { color-scheme: light; }
|
||||
<div class="cta-row">
|
||||
<a class="btn btn-primary" href="#login-card" onclick="return goToLogin(event)">Войти</a>
|
||||
<a class="btn btn-ghost" href="/register">Зарегистрироваться</a>
|
||||
<a class="btn btn-ghost" href="/podbor">Найти норму без входа</a>
|
||||
</div>
|
||||
<p class="landing-pricing"><a href="/static/pricing.html" target="_blank" rel="noopener">Цены: вопрос — от 2,5 ₽, разбор сметы — от 14 ₽. Подробно о стоимости →</a></p>
|
||||
</div>
|
||||
@@ -915,6 +921,13 @@ html { color-scheme: light; }
|
||||
<button type="button" onclick="returnToOwnDialog()">К своим диалогам</button>
|
||||
</div>
|
||||
|
||||
<div id="norm-draft-banner" class="norm-draft-banner" role="region" aria-label="Выбранная подборка норм" hidden>
|
||||
<strong>Подборка норм в этом диалоге</strong>
|
||||
<span id="norm-draft-summary"></span>
|
||||
<a id="norm-draft-open" href="/podbor">Открыть подборку</a>
|
||||
<button type="button" onclick="detachNormDraft()">Открепить</button>
|
||||
</div>
|
||||
|
||||
<!-- role=log имеет неявный aria-live=polite; глушим его (aria-live=off), иначе стрим-перерисовка
|
||||
innerHTML на каждый чанк зачитывала бы весь растущий ответ. Объявления — через #sr-status. -->
|
||||
<div id="messages" role="log" aria-live="off" aria-label="История сообщений"></div>
|
||||
@@ -1592,6 +1605,7 @@ function showChat() {
|
||||
document.getElementById('chat-screen').style.display = 'flex';
|
||||
document.getElementById('msg-input').focus();
|
||||
restoreDraft(); // черновик текущего диалога (UX №5)
|
||||
loadNormDraftFromUrl();
|
||||
loadHistory();
|
||||
loadSessions();
|
||||
loadSessionDate(); // дата сметы текущего диалога → бейдж
|
||||
@@ -1599,6 +1613,37 @@ function showChat() {
|
||||
подхватитьРазбор(); // разбор мог идти, пока вкладки не было
|
||||
}
|
||||
|
||||
let activeNormDraftId = 0;
|
||||
async function loadNormDraftFromUrl() {
|
||||
const id = Number(new URLSearchParams(location.search).get('norm_draft'));
|
||||
if (!Number.isSafeInteger(id) || id < 1 || viewOwner) return;
|
||||
const requestedTab = tabId;
|
||||
try {
|
||||
const response = await authFetch(API + '/api/norm-finder/drafts/' + id);
|
||||
if (!response.ok) throw new Error('Подборка этого диалога не найдена');
|
||||
const draft = await response.json();
|
||||
if (requestedTab !== tabId || viewOwner) return;
|
||||
activeNormDraftId = id;
|
||||
const summary = document.getElementById('norm-draft-summary');
|
||||
summary.textContent = ': ' + (draft.positions || []).map(p => p.base_type + ' ' + p.code
|
||||
+ ' × ' + p.quantity + ' ' + p.unit).join('; ') + '. ';
|
||||
document.getElementById('norm-draft-open').href = '/podbor?draft=' + encodeURIComponent(id);
|
||||
document.getElementById('norm-draft-banner').hidden = false;
|
||||
} catch (e) {
|
||||
if (requestedTab !== tabId) return;
|
||||
const banner = document.getElementById('norm-draft-banner');
|
||||
document.getElementById('norm-draft-summary').textContent = ': ' + (e.message || 'не удалось загрузить');
|
||||
banner.hidden = false;
|
||||
}
|
||||
}
|
||||
function detachNormDraft() {
|
||||
activeNormDraftId = 0;
|
||||
document.getElementById('norm-draft-banner').hidden = true;
|
||||
const url = new URL(location.href);
|
||||
url.searchParams.delete('norm_draft');
|
||||
history.replaceState(null, '', url.pathname + url.search + url.hash);
|
||||
}
|
||||
|
||||
// Разбор, который шёл, пока страница была закрыта. Без этого человек видит свой вопрос без
|
||||
// ответа и без признака работы, решает, что сервис молчит, и спрашивает заново — платит
|
||||
// дважды. Пока слой задач выключен, ответ всегда «разбора нет», и ничего не меняется.
|
||||
@@ -3139,7 +3184,8 @@ async function runChat(text, retried, готовыйПоток, внешнийCt
|
||||
const r = готовыйПоток || await authFetch(API + '/api/chat', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({message: text}),
|
||||
body: JSON.stringify({message: text,
|
||||
...(activeNormDraftId ? {norm_draft_id: activeNormDraftId} : {})}),
|
||||
signal: myCtrl.signal,
|
||||
});
|
||||
|
||||
@@ -3906,6 +3952,7 @@ async function newChat() {
|
||||
// диалог и тратил деньги человека (дипсик 17.09.2026).
|
||||
if (текущийРазбор) { отменитьРазбор(текущийРазбор); текущийРазбор = null; }
|
||||
tabId = genUUID();
|
||||
detachNormDraft();
|
||||
rememberTab();
|
||||
updateDateBadge(null, false); // новый диалог — дата сброшена на «сегодня»
|
||||
msgs.innerHTML = '';
|
||||
@@ -4250,6 +4297,7 @@ async function switchChat(id) {
|
||||
// Та же причина, что и в новом диалоге: брошенный разбор тратит деньги и пишет не туда.
|
||||
if (текущийРазбор) { отменитьРазбор(текущийРазбор); текущийРазбор = null; }
|
||||
tabId = id;
|
||||
detachNormDraft();
|
||||
rememberTab();
|
||||
loadSessionDate(); // подтянуть дату сметы этого диалога
|
||||
// Новый диалог открывается с конца: прилипание к низу — свойство ленты, а не человека,
|
||||
|
||||
+18
-3
@@ -29,6 +29,7 @@
|
||||
#query { flex:1 1 330px; }
|
||||
.search-row label:has(#query) { flex:1 1 330px; }
|
||||
.primary,.secondary { min-height:42px; padding:8px 16px; border-radius:8px; font-weight:650; }
|
||||
a.secondary { display:inline-flex; align-items:center; text-decoration:none; }
|
||||
.primary { background:var(--accent); border:1px solid var(--accent); color:#fff; }
|
||||
.secondary { background:var(--card); border:1px solid var(--line); color:var(--text); }
|
||||
.small { min-height:34px; padding:5px 10px; font-size:.84rem; }
|
||||
@@ -60,6 +61,11 @@
|
||||
.comparison .card { overflow-wrap:anywhere; }
|
||||
.notice { background:var(--warn); border-radius:9px; padding:10px 12px; font-size:.86rem; }
|
||||
.result-amount { font-size:1.5rem; font-weight:750; font-variant-numeric:tabular-nums; }
|
||||
.draft-rows { display:grid; gap:9px; }
|
||||
.draft-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:10px 0;
|
||||
border-bottom:1px solid var(--line); }
|
||||
.draft-row .draft-name { flex:1 1 270px; }
|
||||
.draft-row input { width:110px; }
|
||||
.quote-controls label { min-width:140px; }
|
||||
.quote-controls #qty { width:125px; }
|
||||
[hidden] { display:none !important; }
|
||||
@@ -74,7 +80,7 @@
|
||||
<header><a class="brand" href="/">ИНФОСМЕТА</a><a href="/">Вернуться в чат</a></header>
|
||||
<h1>Подбор норм</h1>
|
||||
<p class="intro">Найдите работу по названию или шифру, проверьте состав и измеритель, сравните варианты. Цены считаются только по доступной форме выбранной зоны и квартала.</p>
|
||||
<div id="auth-notice" class="notice" hidden>Чтобы искать нормы, <a href="/">войдите в Инфосмету</a>.</div>
|
||||
<div id="auth-notice" class="notice" hidden>Нормы можно искать без входа. Для расчёта по ценам и сохранения подборки <a href="/">войдите в Инфосмету</a>.</div>
|
||||
<form id="search-form" class="panel">
|
||||
<div class="search-row">
|
||||
<label for="query">Работа или шифр<input id="query" type="search" maxlength="160" placeholder="Например, монтаж пожарного извещателя" required></label>
|
||||
@@ -89,7 +95,7 @@
|
||||
<section id="results-section" class="section" hidden><h2>Подходящие нормы</h2><div id="results" class="results"></div></section>
|
||||
<section id="detail-section" class="section" hidden><div class="detail-grid">
|
||||
<div class="panel"><h2 id="detail-title">Состав нормы</h2><div id="detail"></div></div>
|
||||
<div class="panel"><h2>Предварительный расчёт</h2><p class="hint">Объём вводится в выбранной единице. Недостающие цены и затраты будут отмечены.</p>
|
||||
<div class="panel" id="quote-panel"><h2>Предварительный расчёт</h2><p class="hint">Объём вводится в выбранной единице. Недостающие цены и затраты будут отмечены.</p>
|
||||
<div class="controls quote-controls">
|
||||
<label for="subject">Регион<select id="subject"></select></label>
|
||||
<label for="zone">Ценовая зона<select id="zone"></select></label>
|
||||
@@ -98,10 +104,19 @@
|
||||
<label for="unit">Единица<select id="unit"></select></label>
|
||||
</div>
|
||||
<div class="actions" style="margin-top:16px"><button id="calc" type="button" class="primary">Рассчитать</button>
|
||||
<button id="to-chat" type="button" class="secondary">Перенести в чат</button></div>
|
||||
<button id="add-draft" type="button" class="secondary">Добавить в подборку</button>
|
||||
<button id="to-chat" type="button" class="secondary">Открыть подборку в чате</button></div>
|
||||
<div id="quote" style="margin-top:16px" aria-live="polite"></div>
|
||||
</div>
|
||||
</div></section>
|
||||
<section id="draft-section" class="section panel" hidden>
|
||||
<h2>Подборка работ</h2>
|
||||
<p class="hint">Объёмы сохраняются по шифру и измерителю. Для расчёта всей подборки выберите регион, зону и квартал в карточке нормы выше.</p>
|
||||
<div id="draft-positions" class="draft-rows"></div>
|
||||
<div class="actions" style="margin-top:16px"><button id="draft-calc" type="button" class="primary">Рассчитать подборку</button>
|
||||
<a id="draft-chat" class="secondary" href="/">Открыть в чате</a></div>
|
||||
<div id="draft-result" aria-live="polite" style="margin-top:16px"></div>
|
||||
</section>
|
||||
<section id="compare-section" class="section" hidden><h2>Сравнение норм</h2><p id="compare-warning" class="notice" hidden></p>
|
||||
<div id="comparison" class="comparison"></div></section>
|
||||
</main>
|
||||
|
||||
+139
-17
@@ -6,6 +6,7 @@
|
||||
try { return JSON.parse(atob(token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/'))).sub || ''; }
|
||||
catch { return ''; }
|
||||
})();
|
||||
const publicMode = !token || !subject;
|
||||
const tabKey = 'tabId:' + subject;
|
||||
const tabId = (() => {
|
||||
try {
|
||||
@@ -16,6 +17,7 @@
|
||||
})();
|
||||
let active = null;
|
||||
let savedQuote = null;
|
||||
let draft = null;
|
||||
let subjects = [];
|
||||
let priceZones = [];
|
||||
const compared = new Map();
|
||||
@@ -40,6 +42,9 @@
|
||||
if (!response.ok) throw new Error(typeof data.detail === 'string' ? data.detail : 'Запрос не выполнен');
|
||||
return data;
|
||||
}
|
||||
function readPath(action) {
|
||||
return (publicMode ? '/api/public/norm-finder/' : '/api/norm-finder/') + action;
|
||||
}
|
||||
function fillSelect(select, rows, valueKey, nameKey, placeholder) {
|
||||
select.replaceChildren();
|
||||
select.append(node('option', placeholder));
|
||||
@@ -74,7 +79,7 @@
|
||||
function key(item) { return [item.base, item.base_type, item.code].join('|'); }
|
||||
function baseAlias(item) { return item.base === 'ФЕР-2020' ? '2020' : '2022'; }
|
||||
function detailUrl(item) {
|
||||
return '/api/norm-finder/detail?' + new URLSearchParams({base:baseAlias(item),
|
||||
return readPath('detail') + '?' + new URLSearchParams({base:baseAlias(item),
|
||||
base_type:item.base_type, code:item.code});
|
||||
}
|
||||
async function detailFor(item) { return api(detailUrl(item)); }
|
||||
@@ -121,8 +126,8 @@
|
||||
}
|
||||
variants.disabled = true;
|
||||
try {
|
||||
const found = await api('/api/norm-finder/search?' + new URLSearchParams({
|
||||
q:familyCode, base:baseAlias(item), limit:'30'}));
|
||||
const found = await api(readPath('search') + '?' + new URLSearchParams({
|
||||
q:familyCode, base:baseAlias(item), limit:publicMode ? '8' : '30'}));
|
||||
const family = (found.items || []).filter(row => row.base_type === item.base_type
|
||||
&& row.code.startsWith(familyCode + '-'));
|
||||
variantList.replaceChildren();
|
||||
@@ -153,7 +158,8 @@
|
||||
status('Ищу нормы…');
|
||||
$('results-section').hidden = true; $('detail-section').hidden = true;
|
||||
try {
|
||||
const data = await api('/api/norm-finder/search?' + new URLSearchParams({q,base,limit:'12'}));
|
||||
const data = await api(readPath('search') + '?' +
|
||||
new URLSearchParams({q,base,limit:publicMode ? '8' : '12'}));
|
||||
const items = data.items || [];
|
||||
$('results').replaceChildren(...items.map(renderSearchItem));
|
||||
$('results-section').hidden = !items.length;
|
||||
@@ -255,6 +261,100 @@
|
||||
link.href = '/podbor?quote=' + encodeURIComponent(data.id);
|
||||
root.append(link);
|
||||
}
|
||||
function draftPosition(item) {
|
||||
const quantity = Number($('qty').value);
|
||||
if (!Number.isFinite(quantity) || quantity <= 0 || !$('qty').checkValidity() || !$('unit').value)
|
||||
throw new Error('Укажите положительный объём и измеритель нормы');
|
||||
return {base:baseAlias(item),base_type:item.base_type,code:item.code,
|
||||
quantity,unit:$('unit').value};
|
||||
}
|
||||
function renderDraft() {
|
||||
$('draft-section').hidden = !draft;
|
||||
const root = $('draft-positions'); root.replaceChildren();
|
||||
if (!draft) return;
|
||||
for (const [index, position] of draft.positions.entries()) {
|
||||
const row = node('div', null, 'draft-row');
|
||||
row.append(node('span', position.base_type + ' ' + position.code + ' — ' + (position.name || position.code),
|
||||
'draft-name'));
|
||||
const label = node('label', null);
|
||||
label.append(node('span', 'Объём · ' + position.unit));
|
||||
const input = node('input'); input.type = 'number'; input.min = '0.000001';
|
||||
input.max = '1000000'; input.step = 'any'; input.value = String(position.quantity);
|
||||
input.setAttribute('aria-label', 'Объём для ' + position.code);
|
||||
input.addEventListener('change', async () => {
|
||||
const quantity = Number(input.value);
|
||||
if (!input.checkValidity() || !Number.isFinite(quantity) || quantity <= 0) {
|
||||
input.value = String(position.quantity); status('Укажите положительный объём', true); return;
|
||||
}
|
||||
try { await saveDraft(draft.positions.map((p, i) => i === index ? {...p,quantity} : p)); }
|
||||
catch (e) { renderDraft(); status(e.message, true); }
|
||||
});
|
||||
label.append(input); row.append(label);
|
||||
const remove = node('button', 'Убрать', 'secondary small'); remove.type = 'button';
|
||||
remove.disabled = draft.positions.length === 1;
|
||||
remove.addEventListener('click', async () => {
|
||||
try { await saveDraft(draft.positions.filter((_, i) => i !== index)); }
|
||||
catch (e) { status(e.message, true); }
|
||||
});
|
||||
row.append(remove); root.append(row);
|
||||
}
|
||||
$('draft-chat').href = '/?norm_draft=' + encodeURIComponent(draft.id);
|
||||
const output = $('draft-result'); output.replaceChildren();
|
||||
const calculation = draft.calculation;
|
||||
if (!calculation) return;
|
||||
output.append(node('p', calculation.zone + ' · ' + calculation.period, 'meta'));
|
||||
if (calculation.complete && calculation.total != null)
|
||||
output.append(node('p', 'Предварительный итог всей подборки', 'meta'),
|
||||
node('div', money(calculation.total), 'result-amount'));
|
||||
else {
|
||||
output.append(node('p', 'Расчёт неполный: итог всей подборки не определён.', 'notice'));
|
||||
if (calculation.accounted != null)
|
||||
output.append(node('p', 'Стоимость только учтённой части', 'meta'),
|
||||
node('div', money(calculation.accounted), 'result-amount'));
|
||||
}
|
||||
for (const line of calculation.lines || []) {
|
||||
const result = line.result || {};
|
||||
output.append(node('p', line.position.code + ' · ' +
|
||||
(result.complete && result.total != null ? money(result.total)
|
||||
: result.message || 'Часть ресурсов не оценена'), 'hint'));
|
||||
}
|
||||
}
|
||||
async function saveDraft(positions) {
|
||||
const path = draft ? '/api/norm-finder/drafts/' + draft.id : '/api/norm-finder/drafts';
|
||||
const data = await api(path, {method:draft ? 'PUT' : 'POST',
|
||||
body:JSON.stringify({positions,...(draft ? {revision:draft.revision} : {})})});
|
||||
draft = data;
|
||||
try { localStorage.setItem('normDraftId:' + tabId, String(data.id)); } catch {}
|
||||
history.replaceState(null, '', '/podbor?draft=' + encodeURIComponent(data.id));
|
||||
renderDraft();
|
||||
status('Подборка сохранена: ' + data.positions.length + ' поз.');
|
||||
return data;
|
||||
}
|
||||
async function addToDraft() {
|
||||
if (!active) throw new Error('Сначала откройте норму');
|
||||
const position = draftPosition(active);
|
||||
const rows = draft ? [...draft.positions] : [];
|
||||
const current = rows.findIndex(row => row.base === position.base
|
||||
&& row.base_type === position.base_type && row.code === position.code);
|
||||
if (current >= 0) rows[current] = position;
|
||||
else rows.push(position);
|
||||
return saveDraft(rows);
|
||||
}
|
||||
async function calculateDraft() {
|
||||
if (!draft) return;
|
||||
if (!$('subject').value || !$('zone').value || !$('period').value) {
|
||||
status('Для подборки выберите регион, зону и квартал выше', true); return;
|
||||
}
|
||||
$('draft-calc').disabled = true; status('Считаю подборку…');
|
||||
try {
|
||||
draft = await api('/api/norm-finder/drafts/' + draft.id + '/calculate', {
|
||||
method:'POST', body:JSON.stringify({revision:draft.revision,
|
||||
subject_id:Number($('subject').value),zone_id:Number($('zone').value),
|
||||
period_id:Number($('period').value)})});
|
||||
renderDraft(); status('Подборка пересчитана по выбранным ценам.');
|
||||
} catch (e) { status(e.message, true); }
|
||||
finally { $('draft-calc').disabled = false; }
|
||||
}
|
||||
async function calculate() {
|
||||
if (!active) return;
|
||||
const quantity = Number($('qty').value);
|
||||
@@ -276,15 +376,35 @@
|
||||
} catch (e) { status(e.message, true); }
|
||||
finally { $('calc').disabled = false; }
|
||||
}
|
||||
function toChat() {
|
||||
if (!active) return;
|
||||
const prompt = 'Посчитай ' + ($('qty').value || '1') + ' ' + ($('unit').value || active.unit || '') +
|
||||
' по норме ' + active.base_type + ' ' + active.code +
|
||||
(selectedZone() && $('period').value ? ', ' + selectedZone().name + ', ' +
|
||||
$('period').selectedOptions[0].textContent : '') + '. Проверь состав ресурсов.';
|
||||
try { localStorage.setItem('draft_' + tabId, prompt); }
|
||||
catch { status('Не удалось сохранить черновик для чата', true); return; }
|
||||
location.href = '/';
|
||||
async function toChat() {
|
||||
try { const saved = draft || await addToDraft(); location.href = '/?norm_draft=' + encodeURIComponent(saved.id); }
|
||||
catch (e) { status(e.message, true); }
|
||||
}
|
||||
async function restoreDraft() {
|
||||
const fromUrl = new URLSearchParams(location.search).get('draft');
|
||||
const savedId = (() => { try { return localStorage.getItem('normDraftId:' + tabId); } catch { return ''; } })();
|
||||
const id = Number(fromUrl || savedId);
|
||||
if (!Number.isSafeInteger(id) || id < 1) return false;
|
||||
try {
|
||||
draft = await api('/api/norm-finder/drafts/' + id);
|
||||
renderDraft();
|
||||
const first = draft.positions?.[0];
|
||||
if (first) await openDetail({base:first.base === '2020' ? 'ФЕР-2020' : 'ГЭСН-2022',
|
||||
base_type:first.base_type,code:first.code});
|
||||
if (first) { $('qty').value = String(first.quantity); $('unit').value = first.unit; }
|
||||
const selection = draft.price_selection || {};
|
||||
if (selection.subject_id) {
|
||||
$('subject').value = String(selection.subject_id);
|
||||
await loadPrices(); $('zone').value = String(selection.zone_id); fillPeriods();
|
||||
$('period').value = String(selection.period_id);
|
||||
}
|
||||
status('Сохранённая подборка загружена.');
|
||||
return true;
|
||||
} catch (e) {
|
||||
if (!fromUrl) { try { localStorage.removeItem('normDraftId:' + tabId); } catch {} }
|
||||
else status(e.message, true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async function restoreQuote() {
|
||||
const id = Number(new URLSearchParams(location.search).get('quote'));
|
||||
@@ -304,17 +424,17 @@
|
||||
} catch (e) { status(e.message, true); }
|
||||
}
|
||||
async function init() {
|
||||
if (!token || !subject) { $('auth-notice').hidden = false; $('search-form').hidden = true; return; }
|
||||
if (publicMode) { $('auth-notice').hidden = false; $('quote-panel').hidden = true; }
|
||||
try {
|
||||
const data = await api('/api/norm-finder/catalog');
|
||||
const data = await api(readPath('catalog'));
|
||||
const bases = [...new Set((data.bases || []).map(x => x.base))];
|
||||
fillSelect($('base'), bases.map(b => ({id:b === 'ФЕР-2020' ? '2020' : '2022',name:b})),
|
||||
'id', 'name', 'Выберите базу');
|
||||
if (bases.length) $('base').selectedIndex = 1;
|
||||
subjects = data.subjects || [];
|
||||
fillSelect($('subject'), subjects, 'id', 'name', 'Выберите регион');
|
||||
if (!publicMode) fillSelect($('subject'), subjects, 'id', 'name', 'Выберите регион');
|
||||
if (!bases.length) status('Нормативная база пока недоступна', true);
|
||||
await restoreQuote();
|
||||
if (!publicMode && !(await restoreDraft())) await restoreQuote();
|
||||
} catch (e) { status(e.message, true); }
|
||||
}
|
||||
$('search-form').addEventListener('submit', search);
|
||||
@@ -329,6 +449,8 @@
|
||||
});
|
||||
}
|
||||
$('calc').addEventListener('click', calculate);
|
||||
$('add-draft').addEventListener('click', () => addToDraft().catch(e => status(e.message, true)));
|
||||
$('draft-calc').addEventListener('click', calculateDraft);
|
||||
$('to-chat').addEventListener('click', toChat);
|
||||
init();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user