From 984ead3f2f2c1a8854a8280b0b4730acbb8d44b8 Mon Sep 17 00:00:00 2001 From: wasrusgen Date: Mon, 1 Jun 2026 07:48:35 +0300 Subject: [PATCH] =?UTF-8?q?ui:=20=D0=B2=D0=BA=D0=BB=D0=B0=D0=B4=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=A1=D0=B4=D0=B5=D0=BB=D0=BA=D0=B0=20=E2=80=94=20?= =?UTF-8?q?=D0=BF=D0=BB=D0=BE=D1=82=D0=BD=D1=8B=D0=B9=20=D0=BE=D0=B1=D0=B7?= =?UTF-8?q?=D0=BE=D1=80=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0=20(?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B5=D1=81=D1=81+=D1=84=D0=B8?= =?UTF-8?q?=D0=BD=D0=B0=D0=BD=D1=81=D1=8B+=D0=BA=D0=BE=D0=BD=D1=82=D0=B0?= =?UTF-8?q?=D0=BA=D1=82+=D0=B7=D0=B0=D0=BC=D0=B5=D1=82=D0=BA=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/crm.html | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/crm.html b/docs/crm.html index 087be7b..b281248 100644 --- a/docs/crm.html +++ b/docs/crm.html @@ -305,6 +305,11 @@ function renderMainPanel(){ const p=document.getElementById("mainPanel");if(!p)return; const crm=state.crm||{pipeline:"lead",deal_amount:0,source:""}; if(mainTab==="deal"){ + const deal=crm.deal_amount||0; + const pays=crm.payments||[]; const paid=pays.reduce((s,x)=>s+(x.amount||0),0); const left=Math.max(0,deal-paid); + const doneArr=CLIENT_STAGES.map(s=>stageIsDone(s.key)); + const firstUndone=doneArr.findIndex(d=>!d); + const doneCnt=doneArr.filter(Boolean).length; p.innerHTML=`
Статус воронки
@@ -312,7 +317,36 @@ function renderMainPanel(){
Источник
-
👁 Открыть кабинет
`; +
👁 Открыть кабинет
+
+
+
📍 Прогресс проекта${doneCnt}/5 этапов
+ ${CLIENT_STAGES.map((s,i)=>{ + const done=doneArr[i], cur=!done&&i===firstUndone; + const brd=done?'#047857':cur?'#10B981':'#E5E7EB'; + const tag=done?'✓ готово':cur?'● в работе':'ожидает'; + return `
+ ${s.icon} +
${s.name}
${esc(s.desc)}
+ ${tag} +
`; + }).join('')} +
+
+
+
💰 Финансы
+
Смета${deal>0?money(deal):'—'}
+
Получено${money(paid)}
+
Остаток${money(left)}
+
+
+
Контакт
+ +
Заметка
+ +
+
+
`; renderPayments(); } else if(mainTab==="pricing"){p.innerHTML=`
`;renderPricing();} @@ -598,7 +632,10 @@ function addTask(){const t=document.getElementById("newTask").value.trim();if(!t function toggleTask(i){state.tasks[i].done=!state.tasks[i].done;saveTasks();renderClient();} function delTask(i){state.tasks.splice(i,1);saveTasks();renderClient();} async function saveCrm(){ - const crm={pipeline:document.getElementById("cpPipe").value,deal_amount:+document.getElementById("cpDeal").value||0,source:document.getElementById("cpSrc").value}; + const g=id=>document.getElementById(id); + const crm={pipeline:g("cpPipe").value,deal_amount:+g("cpDeal").value||0,source:g("cpSrc").value}; + if(g("cpContact"))crm.contact=g("cpContact").value; + if(g("cpNote"))crm.note=g("cpNote").value; state.crm={...state.crm,...crm}; await fetch(`${API}/api/project/crm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:current,...crm})}); await loadProjects();