Show shared-number badge in the treatment table and lead detail
This commit is contained in:
@@ -438,9 +438,19 @@ const Tratamento = (() => {
|
||||
if (checkedAt) detalhes.push(`Consultado em ${checkedAt}`);
|
||||
return h('div', { class: 'whatsapp-verification' },
|
||||
h('span', { class: `badge whatsapp-${status}` }, WHATSAPP_STATUS_LABELS[status] || status),
|
||||
numeroCompartilhadoBadge(lead),
|
||||
detalhes.length ? h('div', { class: 'sub' }, detalhes.join(' · ')) : null);
|
||||
}
|
||||
|
||||
function numeroCompartilhadoBadge(lead) {
|
||||
if (!lead.numero_compartilhado) return null;
|
||||
const classe = lead.numero_compartilhado_liberado ? 'numero-compartilhado-liberado' : 'numero-compartilhado';
|
||||
const texto = lead.numero_compartilhado_liberado
|
||||
? `Compartilhado (liberado, ${lead.numero_compartilhado_total} leads)`
|
||||
: `Número compartilhado (${lead.numero_compartilhado_total} leads)`;
|
||||
return h('span', { class: `badge ${classe}` }, texto);
|
||||
}
|
||||
|
||||
function produtoCell(produto, afinidade) {
|
||||
if (!produto) return '—';
|
||||
const label = AFINIDADE_TABELA_LABELS[afinidade];
|
||||
@@ -526,6 +536,9 @@ const Tratamento = (() => {
|
||||
linha('Status WhatsApp', WHATSAPP_STATUS_LABELS[lead.whatsapp_status] || lead.whatsapp_status || 'Não consultado'),
|
||||
linha('Número WhatsApp confirmado', lead.whatsapp_numero_resolvido),
|
||||
linha('WhatsApp consultado em', whatsappCheckedAt(lead.whatsapp_checked_at)),
|
||||
linha('Número compartilhado com outro lead', lead.numero_compartilhado
|
||||
? `${lead.numero_compartilhado_total} leads${lead.numero_compartilhado_liberado ? ' (liberado)' : ''}`
|
||||
: 'Não'),
|
||||
linha('Cidade/UF', `${lead.cidade}/${lead.uf}`),
|
||||
linha('Endereço', lead.endereco),
|
||||
linha('Nicho', lead.segmento_label || lead.segmento),
|
||||
|
||||
Reference in New Issue
Block a user