Журнал: онлайн-статус «чего ждёт заявка», ссылка из ручного ввода в журнал, правки формы
- livestatus.go: одна фраза состояния для исходящих (сделка M2M + черновик/подача/MS010 поручения 16) и входящих (наше решение → поручение 16/1); признак «в работе» - строки журналов и карточки показывают её и обновляют по /admin/journal/live каждые 8 с, пока заявка в работе; завершённые и отклонённые не опрашиваются - ручной ввод: у отправленного поручения ссылка «в журнале →» и тот же онлайн-статус; вид документа занимает две колонки - выбор участника: по ИНН и коду с кнопки, а не по номеру строки; Enter выбирает только при единственном совпадении Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4YVo4UMopqT5DzicqpPjL
This commit is contained in:
@@ -150,6 +150,14 @@ tbody tr:hover td { background:var(--accent-weak); }
|
||||
|
||||
/* ---- Бейджи статусов ---- */
|
||||
.badge { display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; }
|
||||
.live { font-size:11.5px; margin-top:4px; color:var(--muted); display:flex; align-items:center; gap:6px; line-height:1.3 }
|
||||
.live::before { content:''; width:7px; height:7px; border-radius:50%; background:var(--muted); flex:none }
|
||||
.live-wait::before { background:var(--accent); animation:pulse 2.4s var(--ease) infinite }
|
||||
.live-warn { color:var(--warn) } .live-warn::before { background:var(--warn); animation:pulse 2.4s var(--ease) infinite }
|
||||
.live-ok { color:var(--ok) } .live-ok::before { background:var(--ok) }
|
||||
.live-bad { color:var(--err) } .live-bad::before { background:var(--err) }
|
||||
.live-big { font-size:14px; margin:-6px 0 12px; font-weight:500 }
|
||||
.live[data-active] { color:var(--text-2) } .live-warn[data-active] { color:var(--warn) }
|
||||
.badge.draft, .badge.validated, .badge.submitted_to_nsd { background:var(--accent-weak); color:var(--accent); }
|
||||
.badge.awaiting_decision, .badge.manual_approval { background:var(--warn-weak); color:var(--warn); }
|
||||
.badge.confirmed, .badge.awaiting_sub16, .badge.done { background:var(--ok-weak); color:var(--ok); }
|
||||
@@ -524,6 +532,27 @@ label { font-size:13px; font-weight:500; }
|
||||
}
|
||||
poll();
|
||||
setInterval(poll, 12000); // каждые 12 сек
|
||||
// Онлайн-статус заявок в работе: строки с data-live и data-active опрашиваются, пока ждут.
|
||||
(function(){
|
||||
function tick(){
|
||||
var els = document.querySelectorAll('.live[data-live][data-active]');
|
||||
if (!els.length) return;
|
||||
var out = [], inn = [];
|
||||
els.forEach(function(e){ var k = e.getAttribute('data-live').split(':'); (k[0]==='out'?out:inn).push(k[1]); });
|
||||
var q = 'out=' + encodeURIComponent(out.join(',')) + '&in=' + encodeURIComponent(inn.join(','));
|
||||
fetch('/admin/journal/live?' + q, {cache:'no-store'}).then(function(r){ return r.json(); }).then(function(d){
|
||||
els.forEach(function(e){
|
||||
var k = e.getAttribute('data-live').split(':'), st = (d[k[0]]||{})[k[1]];
|
||||
if (!st) return;
|
||||
e.textContent = st.text;
|
||||
e.className = 'live ' + (e.classList.contains('live-big') ? 'live-big ' : '') + 'live-' + st.kind;
|
||||
if (!st.active) e.removeAttribute('data-active');
|
||||
});
|
||||
}).catch(function(){});
|
||||
}
|
||||
setInterval(tick, 8000);
|
||||
if (document.querySelector('.live[data-live][data-active]')) setTimeout(tick, 1500);
|
||||
})();
|
||||
})();
|
||||
})();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user