front/.cursor/skills/oms-channel-quote-extract/SKILL.md
zzh 1cb4631480
All checks were successful
Build and Deploy Front / deploy (push) Successful in 10m58s
feat: 定价工作台更新买价支持报价表本地识别与融合预览
本地规则优先解析渠道买价 Excel,失败再 AI 补齐;四步向导含对比与写库后矩阵预览。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-24 18:34:58 +08:00

84 lines
3.2 KiB
Markdown
Raw 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.

---
name: oms-channel-quote-extract
description: >-
Extracts OMS channel buy-price quotes from vendor Excel sheets for pricing
workbench Step 0. Use when the user uploads 报价表, asks to 更新渠道买价,
parse 重量段/一口价/运费RMB/KG/处理费, or map sheet names to service channels
on /channel/pricingWorkbench.
---
# OMS 渠道报价表提取 · 买价更新
从下游报价 Excel 提取结构化买价,供定价工作台「更新买价」回写渠道草稿买价。
**运行时主路径是本地规则解析**(`channelQuoteLocalParse.ts`),覆盖常见「公斤+票费」「一口价/并排国家列」。
本 skill / AI 仅在本地失败时补齐难拆 sheet。
- 本地:`src/views/channel/pricingWorkbench/channelQuoteLocalParse.ts`
- AI system:`src/views/channel/pricingWorkbench/channelQuoteAiSkill.ts`
- 面板:`src/views/channel/pricingWorkbench/components/ChannelQuoteImportPanel.vue`
## 产出格式(必须)
只输出一个 JSON 对象(可用 \`\`\`json 包裹),禁止编造表中不存在的金额。
```json
{
"sheetName": "3PE ePost",
"isPriceSheet": true,
"skipReason": null,
"currency": "CNY",
"effectiveAt": "2026-05-08",
"channelQuotes": [
{
"channelCodeHint": "3SZ51",
"channelNameHint": "3PE ePost普货",
"serviceSubtype": null,
"mode": "unit_plus_fee",
"destinationHints": ["美国"],
"rows": [
{
"weightStart": 0,
"weightEnd": 0.1,
"zoneHint": "美国",
"freightPerKg": 86,
"handlingPerShipment": 30,
"registrationPerShipment": null,
"flatTotal": null
}
]
}
],
"warnings": []
}
```
### mode
| mode | 含义 | 行字段 |
|------|------|--------|
| `flat` | 一口价(重量点/段 → 总价) | `flatTotal` 必填;`freightPerKg`/`handling*` 为空 |
| `unit_plus_fee` | 运费 RMB/KG + 处理费/挂号费 RMB/票 | `freightPerKg` 与/或 `handlingPerShipment` / `registrationPerShipment` |
### 重量
- 区间 `0-0.1` / `0.101-0.2` → `weightStart` + `weightEnd`
- 单点一口价 `0.5` → 至少填 `weightEnd=0.5`;`weightStart` 可留空由前端按有序上界补成 `(prev-end]`
- 不要输出偏远邮编清单或条款长文
## 硬规则
1. 非报价 sheet(目录、附加费规定、操作指南、偏远邮编、增值服务、纯邮编列表):`isPriceSheet=false`,`channelQuotes=[]`,写清 `skipReason`
2. 列名别名:包裹重量/重量KG、重量段(KG)、运费(RMB/KG)、处理费/操作费(RMB/票)、挂号费、国家/国家名称/分区/对接代码
3. 一 sheet 多个「对接代码」或渠道码 → 拆成多个 `channelQuotes`
4. PAK/WPX 等分段标题写入 `serviceSubtype`,不要当成渠道码
5. sheet 名常含渠道码(如 `3SZ01-3PE Express--优先`),写入 `channelCodeHint` / `channelNameHint`
6. 金额必须来自单元格;说明行、空行忽略
7. 币种默认人民币 → `CNY`;生效日从「生效日期」类文案解析(可空)
## 原则
- 只提取可进 OMS 买价矩阵的运费/处理费/挂号费
- 前端负责匹配 OMS 渠道、价格分区与重量段重建;你只输出结构化报价
- 不确定是否报价表时宁可 `isPriceSheet=false` 并说明原因