diff --git a/backend-py/app/main.py b/backend-py/app/main.py index 2458acf..51e63f8 100644 --- a/backend-py/app/main.py +++ b/backend-py/app/main.py @@ -1069,6 +1069,8 @@ def _handle_clients(body: dict[str, Any]) -> dict[str, Any]: "client_tg_id": ctg_id or None, "client_phone": phone or "", "address": "", + "gps_lat": "", + "gps_lng": "", "client_no": "", "contract_no": "", "contract_date": "", @@ -1153,6 +1155,9 @@ def _handle_clients(body: dict[str, Any]) -> dict[str, Any]: if contract_date and not c.get("contract_date"): c["contract_date"] = contract_date if address and not c.get("address"): c["address"] = address if client_phone and not c.get("client_phone"): c["client_phone"] = client_phone + gps_lat = (row.get("gps_lat") or "").strip() + gps_lng = (row.get("gps_lng") or "").strip() + if gps_lat and gps_lng and not c.get("gps_lat"): c["gps_lat"] = gps_lat; c["gps_lng"] = gps_lng c["measurements_count"] = c.get("measurements_count", 0) + 1 # Замер не-draft = клиент в работе (requested/scheduled/completed) if m_status and m_status != "draft": diff --git a/miniapp/assets/clients.js b/miniapp/assets/clients.js index 39ccfe4..5f8242e 100644 --- a/miniapp/assets/clients.js +++ b/miniapp/assets/clients.js @@ -510,8 +510,15 @@ const Clients = (function () { const contractTag = client.contract_no ? `
📋 договор ${escHtml(client.contract_no)}${client.contract_date ? ` · ${escHtml(client.contract_date)}` : ""}
` : ""; + const mapUrl = (client.gps_lat && client.gps_lng) + ? `https://yandex.ru/maps/?ll=${client.gps_lng},${client.gps_lat}&z=17&pt=${client.gps_lng},${client.gps_lat},pm2rdm` + : ""; const addressTag = client.address - ? `
📍 ${escHtml(client.address)}
` + ? `
+ 📍 ${escHtml(client.address)}${mapUrl + ? `🗺 Карта` + : ""} +
` : ""; const statusTag = client.in_work ? "" diff --git a/miniapp/assets/podbor.css b/miniapp/assets/podbor.css index 856fac8..1af4f33 100644 --- a/miniapp/assets/podbor.css +++ b/miniapp/assets/podbor.css @@ -2085,6 +2085,33 @@ font-family: var(--font-mono, "JetBrains Mono", monospace); margin-top: 4px; } +.client-detail-addr { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; +} +.client-detail-addr .addr-text { + flex: 1; + min-width: 0; +} +.map-link-btn { + flex-shrink: 0; + display: inline-flex; + align-items: center; + gap: 3px; + padding: 3px 9px; + background: rgba(107,74,43,0.08); + border: 1px solid rgba(107,74,43,0.20); + border-radius: 12px; + font-size: 11px; + font-weight: 600; + color: var(--walnut, #6B4A2B); + text-decoration: none; + font-family: inherit; + white-space: nowrap; +} +.map-link-btn:active { background: rgba(107,74,43,0.16); } /* ===== Опасная зона удаления ===== */ .danger-zone { diff --git a/miniapp/index.html b/miniapp/index.html index 6f8d472..9950fd7 100644 --- a/miniapp/index.html +++ b/miniapp/index.html @@ -12,14 +12,14 @@ - - + +
- +
- - - - - - - - - - + + + + + + + + + +