| Line 2726... |
Line 2726... |
| 2726 |
var html = '';
|
2726 |
var html = '';
|
| 2727 |
rows.forEach(function (r) {
|
2727 |
rows.forEach(function (r) {
|
| 2728 |
var leadLine = '<strong style="color:#e2e8f0;">' + (r.leadName || ('Lead #' + r.leadId)) + '</strong>';
|
2728 |
var leadLine = '<strong style="color:#e2e8f0;">' + (r.leadName || ('Lead #' + r.leadId)) + '</strong>';
|
| 2729 |
if (r.leadOutlet) leadLine += ' · <span style="color:#cbd5e1;">' + r.leadOutlet + '</span>';
|
2729 |
if (r.leadOutlet) leadLine += ' · <span style="color:#cbd5e1;">' + r.leadOutlet + '</span>';
|
| 2730 |
if (r.leadMobile) leadLine += ' · <span style="color:#94a3b8;">' + r.leadMobile + '</span>';
|
2730 |
if (r.leadMobile) leadLine += ' · <span style="color:#94a3b8;">' + r.leadMobile + '</span>';
|
| - |
|
2731 |
var locParts = [];
|
| - |
|
2732 |
if (r.leadCity) locParts.push(r.leadCity);
|
| - |
|
2733 |
if (r.leadState) locParts.push(r.leadState);
|
| - |
|
2734 |
var locLine = locParts.length
|
| - |
|
2735 |
? '<div style="color:#94a3b8;font-size:11px;">Location: <span style="color:#cbd5e1;">' + locParts.join(', ') + '</span></div>'
|
| - |
|
2736 |
: '';
|
| 2731 |
var nearLine = '';
|
2737 |
var nearLine = '';
|
| 2732 |
if (r.nearestStoreCode) nearLine = '<div style="color:#94a3b8;font-size:11px;">Near: ' + r.nearestStoreCode
|
2738 |
if (r.nearestStoreCode) nearLine = '<div style="color:#94a3b8;font-size:11px;">Near: ' + r.nearestStoreCode
|
| 2733 |
+ (r.nearestStoreOutlet ? ' — ' + r.nearestStoreOutlet : '') + '</div>';
|
2739 |
+ (r.nearestStoreOutlet ? ' — ' + r.nearestStoreOutlet : '') + '</div>';
|
| 2734 |
// Show "Name (#authUserId)" so the head can quickly match identities —
|
2740 |
// Show "Name (#authUserId)" so the head can quickly match identities —
|
| 2735 |
// especially useful when they need the id for the Reassign prompt.
|
2741 |
// especially useful when they need the id for the Reassign prompt.
|
| Line 2742... |
Line 2748... |
| 2742 |
+ (r.communicationType ? ' · ' + r.communicationType : '')
|
2748 |
+ (r.communicationType ? ' · ' + r.communicationType : '')
|
| 2743 |
+ '</div>';
|
2749 |
+ '</div>';
|
| 2744 |
var safeName = String(r.leadName || '').replace(/"/g, '"');
|
2750 |
var safeName = String(r.leadName || '').replace(/"/g, '"');
|
| 2745 |
html += '<div data-rid="' + r.id + '" style="padding:8px;border:1px solid #334155;border-radius:6px;background:#0f172a;margin-bottom:6px;">'
|
2751 |
html += '<div data-rid="' + r.id + '" style="padding:8px;border:1px solid #334155;border-radius:6px;background:#0f172a;margin-bottom:6px;">'
|
| 2746 |
+ leadLine
|
2752 |
+ leadLine
|
| - |
|
2753 |
+ locLine
|
| 2747 |
+ nearLine
|
2754 |
+ nearLine
|
| 2748 |
+ reqMeta
|
2755 |
+ reqMeta
|
| 2749 |
+ '<div style="margin-top:6px;display:flex;gap:6px;flex-wrap:wrap;">'
|
2756 |
+ '<div style="margin-top:6px;display:flex;gap:6px;flex-wrap:wrap;">'
|
| 2750 |
+ '<button class="vr-schedule" data-rid="' + r.id + '" data-lead="' + r.leadId + '" data-leadname="' + safeName + '" data-assignee="' + r.assigneeAuthId + '" style="font-size:11px;padding:3px 8px;border:none;border-radius:4px;background:#22c55e;color:#fff;cursor:pointer;">Schedule on a beat</button>'
|
2757 |
+ '<button class="vr-schedule" data-rid="' + r.id + '" data-lead="' + r.leadId + '" data-leadname="' + safeName + '" data-assignee="' + r.assigneeAuthId + '" style="font-size:11px;padding:3px 8px;border:none;border-radius:4px;background:#22c55e;color:#fff;cursor:pointer;">Schedule on a beat</button>'
|
| 2751 |
+ '<button class="vr-reassign" data-rid="' + r.id + '" style="font-size:11px;padding:3px 8px;border:1px solid #475569;border-radius:4px;background:none;color:#cbd5e1;cursor:pointer;">Reassign</button>'
|
2758 |
+ '<button class="vr-reassign" data-rid="' + r.id + '" style="font-size:11px;padding:3px 8px;border:1px solid #475569;border-radius:4px;background:none;color:#cbd5e1;cursor:pointer;">Reassign</button>'
|