Files
verify-invoice-default/TUTORIAL.md
chenfuqiang 39eacc4c4a
All checks were successful
技能自动化发布 / release (push) Successful in 18s
chore: auto release commit (2026-09-15 10:19:55)
2026-09-15 10:19:55 +08:00

86 lines
2.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
本技能有以下使用方式:
- **CLI 命令**:通过命令行执行发票提取、票据预审等操作
- **对话任务**:用自然语言让 Agent 完成票据合规预审
## 本技能做什么
票据合规预审助手,帮助财务人员快速完成差旅报销发票的合规性预审:
1. **RPA 发票提取**:自动登录智慧校园系统,从票据合规预审页面提取发票数据
2. **四步审核**:发票字段完整性、税号白名单、日期逻辑、经费标准
3. **初审意见单**:生成 HTML 格式的审核报告
## 开始前
- 已安装 Python 3.10+、Playwright
- 已安装 `jiangchang-platform-kit`(或设置 `PYTHONPATH` 指向其 `src/`)
- 已安装 Edge 或 Chrome 浏览器
## 入口一:CLI 命令
### 提取发票数据
```powershell
$env:PYTHONPATH="D:\jiangchang\huashang\jiangchang-platform-kit\jiangchang-platform-kit\src"
cd D:\jiangchang\huashang\verify-invoice-default\verify-invoice-default
python scripts\main.py extract-invoices --profile-dir "$env:TEMP\verify-invoice-edge-profile"
```
参数说明:
| 参数 | 说明 |
|---|---|
| `--username` | sandbox 门户手机号 |
| `--password` | sandbox 门户密码 |
| `--profile-dir` | 浏览器 Profile 目录(保存登录态,多次复用) |
| `--headless` | 可选,无头模式(生产不建议) |
| `--detail-mode` | 可选,提取详细信息 |
### 测试连接
```powershell
python scripts\main.py test-rpa-connection --profile-dir "$env:TEMP\verify-invoice-edge-profile"
```
### 票据合规预审
```powershell
python scripts\main.py prereview --invoice-json invoices.json
```
### 重建初审意见单
```powershell
python scripts\main.py render-html
```
## 入口二:对话任务
直接告诉 Agent:
> 帮我从智慧校园提取发票数据
> 对这些发票做票据合规预审
Agent 会调用本技能的 CLI 命令完成操作并返回结果。
## 主能力对照表
| 能力 | CLI 命令 | 对话触发 |
|---|---|---|
| RPA 发票提取 | `extract-invoices` | "提取发票数据" |
| 票据合规预审 | `prereview` | "做票据预审" |
| 重建意见单 | `render-html` | "重建意见单" |
| 查看预审历史 | `list-reports` | "查看预审记录" |
## 常见卡住怎么办
| 问题 | 解决方法 |
|---|---|
| 浏览器没弹出 | 检查 `OPENCLAW_BROWSER_HEADLESS=0`,确认 Edge/Chrome 已安装 |
| 登录超时 | 检查网络,确认 sandbox.jc2009.com 可访问 |
| 智慧校园进不去 | 删除 Profile 目录重新运行,让它重新登录 |
| 提取不到发票 | 检查 Profile 目录下是否有登录态,运行 `test-rpa-connection` 测试 |