@puyinkai/xiaobao-cli 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{api-client-zDBFgk0y.mjs → api-client-CDNjkArS.mjs} +1 -1
  2. package/dist/{api-CX99_4K7.mjs → api-fsHHWWa3.mjs} +1 -1
  3. package/dist/{audio-ShfvRomP.mjs → audio-CRSMqaKo.mjs} +2 -2
  4. package/dist/{auth-DpK81Vp5.mjs → auth-_3hBh87U.mjs} +1 -1
  5. package/dist/cli.mjs +10 -10
  6. package/dist/{consultant-CS9B42d3.mjs → consultant-E33hTGUO.mjs} +1 -1
  7. package/dist/{customer-B1cxRbJ9.mjs → customer-DcQ83oKD.mjs} +1 -1
  8. package/dist/{focus-DfNPPhm5.mjs → focus-XMRxnHPw.mjs} +1 -1
  9. package/dist/{list-DI1OD95x.mjs → list-B3nN4pd2.mjs} +1 -1
  10. package/dist/{list-CD08BRLk.mjs → list-CXquxzex.mjs} +1 -1
  11. package/dist/{list-CKlx8YuL.mjs → list-Cc4zcaNz.mjs} +1 -1
  12. package/dist/{list-DCcCS6LM.mjs → list-CnlQdzPp.mjs} +1 -1
  13. package/dist/{list-D56gEqiB.mjs → list-CrMOrnS-.mjs} +1 -1
  14. package/dist/{list-CnlFIFiY.mjs → list-DFdDcHFq.mjs} +1 -1
  15. package/dist/{list-Cu6WzPpA.mjs → list-dm9YaCG1.mjs} +1 -1
  16. package/dist/{project-BuQQewOs.mjs → project-BD0g4oAW.mjs} +1 -1
  17. package/dist/{qa-CKsKiQIm.mjs → qa-CdMcxCE_.mjs} +1 -1
  18. package/dist/{resistance-DsE-Ha6Y.mjs → resistance-6_V6At3T.mjs} +1 -1
  19. package/dist/{text-C3jhdPoe.mjs → text-C3Ap6L5n.mjs} +1 -1
  20. package/dist/{visit-CX0Mc1n6.mjs → visit-DoeECi8w.mjs} +1 -1
  21. package/dist/{whoami-CZVez-rm.mjs → whoami-z-76WaCP.mjs} +1 -1
  22. package/package.json +5 -1
  23. package/skills/wangxiaobao-audio-query/SKILL.md +2 -2
  24. package/skills/wangxiaobao-audio-wiki/SKILL.md +4 -4
  25. package/skills/wangxiaobao-customer-focus-query/SKILL.md +2 -2
  26. package/skills/wangxiaobao-customer-query/SKILL.md +2 -2
  27. package/skills/wangxiaobao-customer-resistance-query/SKILL.md +2 -2
  28. package/skills/wangxiaobao-html-to-pdf/SKILL.md +116 -0
  29. package/skills/wangxiaobao-html-to-pdf/scripts/html2pdf.py +132 -0
  30. package/skills/wangxiaobao-html-to-pdf/scripts/html2pdf_exact.py +92 -0
  31. package/skills/wangxiaobao-project-daily-report/SKILL.md +170 -0
  32. package/skills/wangxiaobao-project-daily-report/_meta.json +9 -0
  33. package/skills/wangxiaobao-project-daily-report/references/report_template.html +308 -0
  34. package/skills/wangxiaobao-project-daily-report/scripts/fetch_data.py +219 -0
  35. package/skills/wangxiaobao-project-daily-report/scripts/generate_report.py +1029 -0
  36. package/skills/wangxiaobao-project-daily-report/scripts/run.py +34 -0
  37. package/skills/wangxiaobao-project-weekly-report/SKILL.md +169 -0
  38. package/skills/wangxiaobao-project-weekly-report/scripts/generate_report.py +308 -0
  39. package/skills/wangxiaobao-project-weekly-report/scripts/html2pdf_fast.py +161 -0
  40. package/skills/wangxiaobao-project-weekly-report/scripts/logo_wangai.png +0 -0
  41. package/skills/wangxiaobao-project-weekly-report/scripts/logo_wangxiaobao.png +0 -0
  42. package/skills/wangxiaobao-project-weekly-report/scripts/prepare_data.py +682 -0
  43. package/skills/wangxiaobao-project-weekly-report/scripts/template.py +925 -0
  44. package/skills/wangxiaobao-quick-qa/SKILL.md +2 -2
  45. package/skills/wangxiaobao-shared/SKILL.md +5 -5
  46. package/skills/wangxiaobao-switch-project/SKILL.md +3 -3
  47. package/skills/wangxiaobao-visit-query/SKILL.md +2 -2
@@ -0,0 +1,92 @@
1
+ """Convert HTML to PDF with exact same layout as browser rendering.
2
+
3
+ Instead of fitting to A4, this script measures the actual rendered content size
4
+ and creates a PDF page that exactly matches, preserving the original layout 1:1.
5
+
6
+ Usage:
7
+ python3 html2pdf_exact.py <html_path_or_url> [output_pdf_path]
8
+ """
9
+
10
+ import sys
11
+ import os
12
+ from pathlib import Path
13
+ from playwright.sync_api import sync_playwright
14
+
15
+
16
+ def html_to_pdf_exact(source: str, pdf_path: str = None) -> str:
17
+ """
18
+ Convert HTML to PDF preserving exact layout.
19
+ Measures rendered content size and uses that as PDF page size.
20
+ """
21
+ is_url = source.startswith("http://") or source.startswith("https://")
22
+
23
+ if not is_url:
24
+ source = os.path.abspath(source)
25
+ if not os.path.exists(source):
26
+ raise FileNotFoundError(f"HTML file not found: {source}")
27
+ file_url = Path(source).as_uri()
28
+ else:
29
+ file_url = source
30
+
31
+ if pdf_path is None:
32
+ if is_url:
33
+ from urllib.parse import urlparse
34
+ path_part = urlparse(source).path
35
+ base_name = Path(path_part).stem or "page"
36
+ pdf_path = os.path.join(os.getcwd(), base_name + ".pdf")
37
+ else:
38
+ pdf_path = source.rsplit(".", 1)[0] + ".pdf"
39
+
40
+ with sync_playwright() as p:
41
+ browser = p.chromium.launch(headless=True)
42
+ # Use a wide viewport to avoid unwanted wrapping
43
+ page = browser.new_page(viewport={"width": 1440, "height": 900})
44
+ page.goto(file_url, wait_until="networkidle")
45
+ page.wait_for_timeout(5000) # Wait for Chart.js to render
46
+
47
+ # Get actual content dimensions
48
+ dims = page.evaluate("""() => {
49
+ const body = document.body;
50
+ const html = document.documentElement;
51
+ const width = Math.max(
52
+ body.scrollWidth, body.offsetWidth,
53
+ html.clientWidth, html.scrollWidth, html.offsetWidth
54
+ );
55
+ const height = Math.max(
56
+ body.scrollHeight, body.offsetHeight,
57
+ html.clientHeight, html.scrollHeight, html.offsetHeight
58
+ );
59
+ return { width: Math.ceil(width), height: Math.ceil(height) };
60
+ }""")
61
+
62
+ content_width = dims["width"]
63
+ content_height = dims["height"]
64
+
65
+ # Add small padding
66
+ pdf_width = content_width + 2
67
+ pdf_height = content_height + 2
68
+
69
+ page.pdf(
70
+ path=pdf_path,
71
+ width=f"{pdf_width}px",
72
+ height=f"{pdf_height}px",
73
+ print_background=True,
74
+ margin={"top": "0mm", "bottom": "0mm", "left": "0mm", "right": "0mm"},
75
+ display_header_footer=False,
76
+ prefer_css_page_size=False,
77
+ )
78
+ browser.close()
79
+
80
+ return pdf_path
81
+
82
+
83
+ if __name__ == "__main__":
84
+ if len(sys.argv) < 2:
85
+ print("Usage: python3 html2pdf_exact.py <html_file_or_url> [output_pdf]")
86
+ sys.exit(1)
87
+
88
+ source_arg = sys.argv[1]
89
+ pdf_arg = sys.argv[2] if len(sys.argv) > 2 else None
90
+
91
+ result = html_to_pdf_exact(source_arg, pdf_arg)
92
+ print(f"PDF generated: {result}")
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: wangxiaobao-project-daily-report
3
+ description: >
4
+ 地产项目营销日报生成器。基于旺小宝 API 拉取来访、客户画像、成交数据,
5
+ 生成结构化 HTML + PDF 日报。触发词:营销日报、项目日报、生成日报、daily report。
6
+ agent_created: true
7
+ ---
8
+
9
+ # 旺小宝项目日报生成技能
10
+
11
+ ## 概述
12
+
13
+ 基于旺小宝API自动拉取数据,生成 `<项目名>` 营销日报HTML+PDF文件(排版完全一致)。
14
+
15
+ ## 功能特性
16
+
17
+ - 自动拉取旺小宝来访数据、客户画像、成交数据
18
+ - 意向等级分析(A/B/C/D)
19
+ - 渠道分布分析(中介/自渠/顺访等)
20
+ - 存量客户复访分析
21
+ - 生成专业排版HTML日报(与参考模板完全一致)
22
+ - **同时生成同名PDF文件,排版与HTML 1:1一致**(需Chrome/Edge)
23
+
24
+ ## 触发词
25
+
26
+ ```
27
+ 营销日报
28
+ 项目日报
29
+ 生成日报
30
+ daily report
31
+ ```
32
+
33
+ ## 使用方法
34
+
35
+ ### 方式一:直接语音/文字命令(推荐)
36
+
37
+ ```
38
+ 生成项目日报
39
+ ```
40
+
41
+ ### 方式二:指定日期
42
+
43
+ ```
44
+ 生成2026年5月19日的项目日报
45
+ ```
46
+
47
+ ### 方式三:本地执行脚本
48
+
49
+ ```bash
50
+ cd <skill目录>/scripts
51
+ python generate_report.py 2026-05-19
52
+ ```
53
+
54
+ 可通过环境变量或命令行参数指定项目:
55
+
56
+ ```bash
57
+ python generate_report.py 2026-05-19 \
58
+ --tenant-id <你的租户ID> \
59
+ --project-id <你的项目ID> \
60
+ --project-name "<项目名>"
61
+ ```
62
+
63
+ ### 方式四:一键运行(自动用昨日日期)
64
+
65
+ ```bash
66
+ python3 run.py # 不带日期参数,自动用昨天的日期
67
+ python3 run.py 2026-05-19 # 也可指定日期,参数原样透传给 generate_report.py
68
+ ```
69
+
70
+ ## 输出文件
71
+
72
+ 每次生成同时产生两个文件,默认写入当前工作目录:
73
+
74
+ ```
75
+ <工作目录>/<项目名>_日报_YYYYMMDD.html
76
+ <工作目录>/<项目名>_日报_YYYYMMDD.pdf
77
+ ```
78
+
79
+ - **HTML**:可直接在浏览器中打开查看、打印
80
+ - **PDF**:由 Chrome/Edge headless 打印生成,排版与 HTML 完全一致,可直接转发
81
+
82
+ ## 日报内容结构
83
+
84
+ | 模块 | 说明 |
85
+ |------|------|
86
+ | KPI概览 | 本月来访、来访进度达成、本月成交、昨日本月来访 |
87
+ | 来访指标 | 月度客储指标、截至昨日来访、完成率、进度达成率 |
88
+ | 来访意向等级 | A级/B级/C级/D级分布及占比 |
89
+ | 销售指标 | 月度销售指标、截至昨日成交、完成率、进度达成率 |
90
+ | 成交意向等级 | 成交客户的意向等级分布 |
91
+ | 来访渠道分布 | 中介/自渠/顺访/约访等渠道统计 |
92
+ | 存量客户汇总 | 近3月未成交客户按渠道分布 |
93
+ | 存量客户明细 | 预计本周复访客户完整信息(10条) |
94
+ | 昨日来访明细 | 昨日来访客户记录 |
95
+ | 顾问来访统计 | 顾问来访排行 |
96
+ | 数据说明 | 数据来源及状态说明 |
97
+
98
+ ## 数据来源
99
+
100
+ | 数据类型 | 来源 | 说明 |
101
+ |---------|------|------|
102
+ | 来访数据 | 旺小宝 `/ai-open/visits/page` | 来访时间、顾问、次数、时长 |
103
+ | 客户画像 | 旺小宝 `/ai-open/customers/page` | 意向等级、渠道、成交状态 |
104
+ | 成交数据 | 旺小宝客户画像 dealStatus=1 | 成交套数 |
105
+ | KPI指标 | 配置项(环境变量/命令行参数) | 来访目标、销售目标 |
106
+
107
+ ## 依赖
108
+
109
+ - 旺小宝OAuth授权(首次使用需授权)
110
+ - Python 3.x(内置urllib,无需额外依赖)
111
+ - Google Chrome 或 Microsoft Edge(用于生成PDF,已安装可跳过)
112
+
113
+ ## 首次使用
114
+
115
+ 1. 如果没有授权旺小宝,系统会提示授权
116
+ 2. 打开授权链接,输入验证码完成授权
117
+ 3. 重新执行生成命令
118
+
119
+ ## 项目配置
120
+
121
+ 项目标识与KPI指标均可配置,优先级为:命令行参数 > 环境变量 > 默认值。
122
+
123
+ ### 方式一:环境变量
124
+
125
+ ```bash
126
+ export XIAOBAO_TENANT_ID="你的租户ID"
127
+ export XIAOBAO_PROJECT_ID="你的项目ID"
128
+ export XIAOBAO_PROJECT_NAME="项目名称"
129
+ export XIAOBAO_MONTH_VISIT_TARGET="500" # 月度来访目标
130
+ export XIAOBAO_MONTH_SALES_TARGET="21000" # 月度销售目标(万元)
131
+ ```
132
+
133
+ ### 方式二:命令行参数
134
+
135
+ ```bash
136
+ python generate_report.py 2026-05-19 \
137
+ --tenant-id <你的租户ID> \
138
+ --project-id <你的项目ID> \
139
+ --project-name "<项目名>" \
140
+ --month-visit-target 500 \
141
+ --month-sales-target 21000
142
+ ```
143
+
144
+ ## 文件结构
145
+
146
+ ```
147
+ wangxiaobao-project-daily-report/
148
+ ├── SKILL.md # 本文档
149
+ ├── _meta.json # Skill元数据
150
+ ├── scripts/
151
+ │ ├── fetch_data.py # 数据拉取脚本
152
+ │ ├── generate_report.py # 主生成脚本
153
+ │ └── run.py # 一键运行入口(默认昨日日期,跨平台)
154
+ └── references/
155
+ └── report_template.html # HTML模板参考
156
+ ```
157
+
158
+ ## 技术细节
159
+
160
+ - 使用Python原生urllib调用API,彻底避免PowerShell中文编码乱码问题
161
+ - HTML模板完全参照参考文件样式
162
+ - PDF由Chrome/Edge headless `--print-to-pdf` 生成,排版与HTML 1:1一致
163
+ - 数据自动关联来访记录与客户画像
164
+ - 客户姓名自动脱敏
165
+ - **PDF打印优化**:
166
+ - 使用 `--print-background` 参数强制打印背景色
167
+ - `@media print` CSS块中强制所有表头元素背景色+文字颜色(`print-color-adjust: exact !important`)
168
+ - 表头文字统一白色(`color: #fff !important`),深色背景确保可读性
169
+ - KPI卡片打印布局使用 `flex-wrap: nowrap`,4个卡片强制1行排列
170
+ - 所有 `.section-title` / `.table-header td` / `.table-header-peach` 等表头类均有独立打印样式声明
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "wangxiaobao-project-daily-report",
3
+ "displayName": "旺小宝项目日报生成器",
4
+ "description": "地产项目营销日报生成器,基于旺小宝API实时数据",
5
+ "version": "1.0.0",
6
+ "author": "xiaobao-cli",
7
+ "tags": ["地产", "日报", "旺小宝", "营销"],
8
+ "created": "2026-05-21"
9
+ }
@@ -0,0 +1,308 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>{project_name} 日报 {date}</title>
7
+ <style>
8
+ * { box-sizing: border-box; margin: 0; padding: 0; }
9
+ body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; font-size: 12px; color: #333; background: #fff; padding: 15px; }
10
+ table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
11
+ th, td { border: 1px solid #ddd; padding: 6px 8px; text-align: center; vertical-align: middle; font-size: 11px; }
12
+ th { color: #fff; font-weight: bold; }
13
+
14
+ .title-bg { background: #1F4E79; }
15
+ .orange-bg { background: #975765; }
16
+ .pink-bg { background: #EEE2E6; color: #333; }
17
+ .peach-bg { background: #C59BA6; }
18
+ .light-bg { background: #f5f5f5; }
19
+
20
+ .kpi-row { display: flex; gap: 8px; margin-bottom: 12px; }
21
+ .kpi-card { flex: 1; border: 2px solid #1F4E79; border-radius: 4px; padding: 10px; text-align: center; background: #fafafa; }
22
+ .kpi-card .label { font-size: 10px; color: #666; margin-bottom: 3px; }
23
+ .kpi-card .value { font-size: 22px; font-weight: bold; color: #1F4E79; line-height: 1.2; }
24
+ .kpi-card .sub { font-size: 9px; color: #888; margin-top: 3px; }
25
+
26
+ .col-2 { display: flex; gap: 12px; margin-bottom: 12px; }
27
+ .col-2 > div { flex: 1; }
28
+
29
+ .section-title { background: #1F4E79; color: #fff; font-size: 13px; font-weight: bold; padding: 8px; text-align: center; }
30
+ .table-header { background: #975765; color: #fff; font-weight: bold; }
31
+ .table-header-pink { background: #EEE2E6; color: #333; font-weight: bold; }
32
+ .table-header-peach { background: #C59BA6; color: #fff; font-weight: bold; }
33
+
34
+ .data-value { font-weight: bold; font-size: 14px; color: #1F4E79; }
35
+ .data-red { color: #c00; font-weight: bold; }
36
+
37
+ tr:nth-child(even) { background: #f9f9f9; }
38
+
39
+ .footer { text-align: center; padding: 15px; color: #999; font-size: 10px; border-top: 1px solid #ddd; margin-top: 20px; }
40
+ </style>
41
+ </head>
42
+ <body>
43
+
44
+ <!-- 项目标题 -->
45
+ <table>
46
+ <tr>
47
+ <td class="title-bg" style="font-size: 18px; font-weight: bold; padding: 12px; text-align: center;">
48
+ {project_name} 营销日报
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <td style="text-align: center; padding: 6px; color: #666; background: #f5f5f5; font-size: 11px;">
53
+ 数据日期:{yesterday}(昨日) | 统计周期:{month_start} ~ {yesterday} | 截至时间:23:59
54
+ </td>
55
+ </tr>
56
+ </table>
57
+
58
+ <!-- KPI概览 -->
59
+ <div class="kpi-row">
60
+ <div class="kpi-card">
61
+ <div class="label">本月来访(组)</div>
62
+ <div class="value">{month_visit_actual}</div>
63
+ <div class="sub">目标{month_visit_target}组 | 完成率{visit_complete_rate}%</div>
64
+ </div>
65
+ <div class="kpi-card">
66
+ <div class="label">来访进度达成</div>
67
+ <div class="value">{progress_rate}%</div>
68
+ <div class="sub">时间进度{time_progress}% | 超额{over_progress}%</div>
69
+ </div>
70
+ <div class="kpi-card">
71
+ <div class="label">本月成交(组)</div>
72
+ <div class="value">{month_deals}</div>
73
+ <div class="sub">目标待确认 | 成交金额待填报</div>
74
+ </div>
75
+ <div class="kpi-card">
76
+ <div class="label">昨日来访(组)</div>
77
+ <div class="value">{yesterday_visits}</div>
78
+ <div class="sub">本周来访量平稳</div>
79
+ </div>
80
+ </div>
81
+
82
+ <!-- 来访指标 + 来访意向等级 -->
83
+ <div class="col-2">
84
+ <div>
85
+ <table>
86
+ <tr><td colspan="6" class="section-title" style="font-size:12px;">本月来访指标及达成</td></tr>
87
+ <tr class="table-header">
88
+ <td>月度客储指标</td>
89
+ <td>截至昨日来访</td>
90
+ <td>完成率</td>
91
+ <td>进度达成率</td>
92
+ <td>总组数</td>
93
+ <td>转化率</td>
94
+ </tr>
95
+ <tr>
96
+ <td class="data-value">{month_visit_target}</td>
97
+ <td class="data-value">{month_visit_actual}</td>
98
+ <td class="data-red">{visit_complete_rate}%</td>
99
+ <td class="data-red">{progress_rate}%</td>
100
+ <td class="data-value">{month_visit_actual}</td>
101
+ <td>-</td>
102
+ </tr>
103
+ </table>
104
+ </div>
105
+ <div>
106
+ <table>
107
+ <tr><td colspan="5" class="section-title" style="font-size:12px;">本月来访客户意向等级分析</td></tr>
108
+ <tr class="table-header">
109
+ <td>A级(高意向)</td>
110
+ <td>B级(中高)</td>
111
+ <td>C级(中意向)</td>
112
+ <td>D级(低意向)</td>
113
+ <td>合计</td>
114
+ </tr>
115
+ <tr>
116
+ <td class="data-value">{intent_A}</td>
117
+ <td class="data-value">{intent_B}</td>
118
+ <td class="data-value">{intent_C}</td>
119
+ <td class="data-value">{intent_D}</td>
120
+ <td class="data-value" style="font-size:16px;">{intent_total}</td>
121
+ </tr>
122
+ <tr style="background:#f5f5f5;">
123
+ <td>{intent_A_pct}%</td>
124
+ <td>{intent_B_pct}%</td>
125
+ <td>{intent_C_pct}%</td>
126
+ <td>{intent_D_pct}%</td>
127
+ <td>100%</td>
128
+ </tr>
129
+ </table>
130
+ </div>
131
+ </div>
132
+
133
+ <!-- 销售指标 + 成交意向等级 -->
134
+ <div class="col-2">
135
+ <div>
136
+ <table>
137
+ <tr><td colspan="6" class="section-title" style="font-size:12px;">本月销售指标及达成</td></tr>
138
+ <tr class="table-header">
139
+ <td>月度销售指标(万)</td>
140
+ <td>截至昨日成交(万)</td>
141
+ <td>完成率</td>
142
+ <td>进度达成率</td>
143
+ <td>总套数</td>
144
+ <td>转化率</td>
145
+ </tr>
146
+ <tr>
147
+ <td class="data-value">{month_sales_target:,}</td>
148
+ <td class="data-value">待填报</td>
149
+ <td class="data-red">-</td>
150
+ <td class="data-red">-</td>
151
+ <td class="data-value">{month_deals}</td>
152
+ <td>-</td>
153
+ </tr>
154
+ <tr style="background:#fff3cd; font-size:9px;">
155
+ <td colspan="6" style="text-align:left;">⚠ 成交金额待确认,建议从销售管理系统补充数据</td>
156
+ </tr>
157
+ </table>
158
+ </div>
159
+ <div>
160
+ <table>
161
+ <tr><td colspan="5" class="section-title" style="font-size:12px;">本月成交客户意向等级分析</td></tr>
162
+ <tr class="table-header">
163
+ <td>A级</td>
164
+ <td>B级</td>
165
+ <td>C/C+级</td>
166
+ <td>D级</td>
167
+ <td>合计</td>
168
+ </tr>
169
+ <tr>
170
+ <td class="data-value">{deal_A}</td>
171
+ <td>{deal_B}</td>
172
+ <td>{deal_C}</td>
173
+ <td>{deal_D}</td>
174
+ <td class="data-value">{month_deals}</td>
175
+ </tr>
176
+ </table>
177
+ </div>
178
+ </div>
179
+
180
+ <!-- 来访渠道分布 -->
181
+ <table>
182
+ <tr><td colspan="5" class="section-title" style="font-size:12px;">来访渠道分布(本月)</td></tr>
183
+ <tr class="table-header">
184
+ <td>渠道类型</td>
185
+ <td>来访组数</td>
186
+ <td>占比</td>
187
+ <td>意向等级分布</td>
188
+ <td>备注</td>
189
+ </tr>
190
+ {channel_rows}
191
+ <tr style="background:#1F4E79; color:#fff;">
192
+ <td><strong>合计</strong></td>
193
+ <td class="data-value" style="color:#fff;">{channel_total}</td>
194
+ <td>100%</td>
195
+ <td>A:{intent_A}, B:{intent_B}, C:{intent_C}, D:{intent_D}</td>
196
+ <td>-</td>
197
+ </tr>
198
+ </table>
199
+
200
+ <!-- 存量客户汇总 -->
201
+ <table>
202
+ <tr><td colspan="7" class="section-title" style="font-size:12px;">存量客户本周复访 - 近3月未成交({three_months_ago} ~ {yesterday})</td></tr>
203
+ <tr class="table-header">
204
+ <td>渠道</td>
205
+ <td>未成交总数</td>
206
+ <td>A级</td>
207
+ <td>B级</td>
208
+ <td>C级</td>
209
+ <td>D级</td>
210
+ <td>占比</td>
211
+ </tr>
212
+ {stock_rows}
213
+ <tr style="background:#1F4E79; color:#fff;">
214
+ <td><strong>合计</strong></td>
215
+ <td class="data-value" style="color:#fff;">{stock_total}</td>
216
+ <td>{stock_A}</td>
217
+ <td>{stock_B}</td>
218
+ <td>{stock_C}</td>
219
+ <td>{stock_D}</td>
220
+ <td>100%</td>
221
+ </tr>
222
+ </table>
223
+
224
+ <!-- 存量客户明细 -->
225
+ <table>
226
+ <tr><td colspan="12" class="section-title" style="font-size:12px; background:#C59BA6;">存量客户预计本周复访明细</td></tr>
227
+ <tr class="table-header-peach">
228
+ <td style="width:30px;">序号</td>
229
+ <td>客户姓名</td>
230
+ <td>来访渠道</td>
231
+ <td>置业顾问</td>
232
+ <td>最近来访</td>
233
+ <td>意向等级</td>
234
+ <td>跟进情况</td>
235
+ <td>决策周期</td>
236
+ <td>未成交原因</td>
237
+ <td>复访概率</td>
238
+ <td>成交概率</td>
239
+ <td>跟进策略</td>
240
+ </tr>
241
+ {customer_rows}
242
+ </table>
243
+
244
+ <!-- 昨日来访明细 -->
245
+ <table>
246
+ <tr><td colspan="7" class="section-title" style="font-size:12px;">昨日来访明细({yesterday} 共{yesterday_visits}组)</td></tr>
247
+ <tr class="table-header">
248
+ <td style="width:30px;">序号</td>
249
+ <td>到访时间</td>
250
+ <td>顾问</td>
251
+ <td>到访次数</td>
252
+ <td>停留时长</td>
253
+ <td>首访/复访</td>
254
+ <td>备注</td>
255
+ </tr>
256
+ {yesterday_rows}
257
+ </table>
258
+
259
+ <!-- 数据说明 -->
260
+ <table>
261
+ <tr><td colspan="4" class="section-title" style="font-size:12px;">数据说明</td></tr>
262
+ <tr class="table-header-pink">
263
+ <td>数据项</td>
264
+ <td>数据来源</td>
265
+ <td>数据状态</td>
266
+ <td>备注</td>
267
+ </tr>
268
+ <tr>
269
+ <td>来访数据</td>
270
+ <td>旺小宝来访记录API</td>
271
+ <td class="data-value" style="color:#0a0;">已获取</td>
272
+ <td>{month_start}~{yesterday}共{month_visit_actual}组</td>
273
+ </tr>
274
+ <tr>
275
+ <td>意向等级</td>
276
+ <td>旺小宝客户画像API</td>
277
+ <td class="data-value" style="color:#0a0;">已获取</td>
278
+ <td>顾问评级(A/B/C/D)</td>
279
+ </tr>
280
+ <tr>
281
+ <td>渠道分类</td>
282
+ <td>旺小宝dynamicTags</td>
283
+ <td class="data-value" style="color:#0a0;">已获取</td>
284
+ <td>五大类来访渠道</td>
285
+ </tr>
286
+ <tr>
287
+ <td>成交数据</td>
288
+ <td>旺小宝客户画像API</td>
289
+ <td class="data-value" style="color:#f90;">待确认</td>
290
+ <td>本月成交{month_deals}组,金额待填报</td>
291
+ </tr>
292
+ <tr>
293
+ <td>月度KPI指标</td>
294
+ <td>IMA知识库/配置</td>
295
+ <td class="data-value" style="color:#0a0;">已配置</td>
296
+ <td>来访{month_visit_target}组/销售{month_sales_target}万</td>
297
+ </tr>
298
+ </table>
299
+
300
+ <!-- 页脚 -->
301
+ <div class="footer">
302
+ <p>{project_name} 营销日报 | 数据日期:{yesterday} | 生成时间:{date}</p>
303
+ <p>数据来源:旺小宝智能营销系统 | 本月来访{month_visit_actual}组 | 意向客户{intent_A}组(A级)</p>
304
+ <p style="color:#c00; font-weight:bold;">⚠ 成交金额待从销售管理系统补充,建议每日同步</p>
305
+ </div>
306
+
307
+ </body>
308
+ </html>