All checks were successful
Build and Deploy Front / deploy (push) Successful in 3m58s
支持声明式报价模板(壹号/万国/3PE)、左列渠道识别、对比步预填新建渠道并写入草稿买价;按票挂号费并入操作费 handling。 Co-authored-by: Cursor <cursoragent@cursor.com>
85 lines
3.2 KiB
Markdown
85 lines
3.2 KiB
Markdown
---
|
||
name: oms-channel-quote-template
|
||
description: >-
|
||
Generates a declarative OMS quote-parse template (QuoteParseTemplate JSON)
|
||
from sample vendor Excel sheet TSVs for pricing workbench. Use when adding a
|
||
报价模板, training parse rules from 样例报价表, or mapping 壹号/万国/3PE-like
|
||
layouts — not for extracting row amounts (use oms-channel-quote-extract).
|
||
---
|
||
|
||
# OMS 渠道报价解析模板生成
|
||
|
||
根据供应商报价 Excel 的**样例 sheet TSV**,产出一份可保存的声明式 `QuoteParseTemplate` JSON。
|
||
前端本地引擎解释该 JSON 做秒级识别;**禁止**返回可执行代码 / JS / 公式脚本。
|
||
|
||
运行时镜像:`src/views/channel/pricingWorkbench/channelQuoteTemplateAiSkill.ts`
|
||
场景键:`channelQuoteTemplate`
|
||
|
||
## 产出格式(必须)
|
||
|
||
只输出一个 JSON 对象(可用 \`\`\`json 包裹):
|
||
|
||
```json
|
||
{
|
||
"templateKey": "vendor-slug",
|
||
"name": "显示名",
|
||
"version": 1,
|
||
"matchHints": {
|
||
"fileNameIncludes": ["关键词"],
|
||
"skipSheetNameRe": "目录|附加费|邮编|操作指南"
|
||
},
|
||
"sheetPolicy": {
|
||
"channelSource": "leftOfWeight",
|
||
"channelHeaderAliases": ["对接代码", "渠道名称"],
|
||
"channelFillDown": true,
|
||
"countryFillDown": false
|
||
},
|
||
"columns": {
|
||
"weightAliases": ["重量段(KG)", "包裹重量"],
|
||
"freightPerKgAliases": ["运费(RMB/KG)"],
|
||
"handlingAliases": ["处理费(RMB/票)"],
|
||
"registrationAliases": ["挂号费"],
|
||
"countryAliases": ["国家"]
|
||
},
|
||
"pricing": {
|
||
"mode": "unit_plus_fee",
|
||
"flatLayout": null,
|
||
"subtypeRowRe": null
|
||
},
|
||
"currencyDefault": "CNY",
|
||
"notes": "一句话说明版式"
|
||
}
|
||
```
|
||
|
||
### channelSource
|
||
|
||
| 值 | 何时用 |
|
||
|----|--------|
|
||
| `leftOfWeight` | 真实渠道在「重量段」左侧列(常合并下填);**sheet 名只是分组**(如壹号「TK扫一枪 预上网渠道」) |
|
||
| `dockColumn` | 有「对接代码 / 渠道代码 / 渠道名称」表头列 |
|
||
| `sheetName` | **sheet 名即渠道**(如万国「万国快线-普货」、3PE「3SZ01-…」) |
|
||
|
||
### pricing.mode
|
||
|
||
| 值 | 含义 |
|
||
|----|------|
|
||
| `unit_plus_fee` | 运费 RMB/KG + 处理费/挂号费 RMB/票 |
|
||
| `flat` | 一口价;并排「包裹重量\|国家」用 `flatLayout=sideBySideBlocks`;纵表用 `long` |
|
||
| `auto` | 仅当版式混杂、无法判定时使用 |
|
||
|
||
## 硬规则
|
||
|
||
1. 只根据样例表头与样例行判断;**禁止编造**表中不存在的列名
|
||
2. sheet 名**不一定**是渠道——左侧出现「690普货BT(预上网)」这类标签且跨多行重量段 → 必须 `leftOfWeight` + `channelFillDown=true`
|
||
3. 国家列首行有值、后续空 → `countryFillDown=true`
|
||
4. 目录 / 附加费 / 邮编 / 操作指南 / 禁寄 → 写入 `skipSheetNameRe`
|
||
5. PAK / WPX 分段标题 → `subtypeRowRe`,不要当成渠道
|
||
6. `templateKey` 用英文短横线 slug;`name` 用中文供应商/产品名
|
||
7. 不要输出 `channelQuotes` 明细金额(那是 extract skill 的事)
|
||
|
||
## 常见版式速查
|
||
|
||
- **壹号小包**:左列渠道 + 重量段 + 运费/KG + 处理费/票
|
||
- **万国优联**:sheet=渠道;国家下填;挂号费 + 运费/KG
|
||
- **3PE**:sheet 含渠道码;并排一口价;PAK/WPX subtype
|