front/.cursor/skills/oms-channel-quote-extract/SKILL.md
zzh d7e991aece
All checks were successful
Build and Deploy Front / deploy (push) Successful in 3m58s
feat: 定价工作台报价模板解析与新建渠道草稿买价
支持声明式报价模板(壹号/万国/3PE)、左列渠道识别、对比步预填新建渠道并写入草稿买价;按票挂号费并入操作费 handling。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-25 16:16:49 +08:00

3.6 KiB
Raw Blame History

name description
oms-channel-quote-extract 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 包裹),禁止编造表中不存在的金额。

{
  "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]
  • OMS 存左开右闭:前端会把 0.05-0.3 + 0.301-1 收成 (0.05-0.3]、(0.3-1]
  • 不要输出偏远邮编清单或条款长文

硬规则

  1. 非报价 sheet(目录、附加费规定、操作指南、偏远邮编、增值服务、纯邮编列表):isPriceSheet=false,channelQuotes=[],写清 skipReason
  2. 列名别名:包裹重量/重量KG、重量段(KG)、运费(RMB/KG)、处理费/操作费(RMB/票)、挂号费、国家/国家名称/分区/对接代码
  3. 一 sheet 多个「对接代码」或渠道码 → 拆成多个 channelQuotes
  4. PAK/WPX 等分段标题写入 serviceSubtype,不要当成渠道码
  5. sheet 名不一定是渠道:若「重量段」左侧有合并渠道名(如 690普货BT(预上网)),以左列为准拆多条;sheet 名仅作分组
  6. sheet 名含渠道码(如 3SZ01-3PE Express--优先)或 sheet 名即渠道时,写入 channelCodeHint / channelNameHint
  7. 金额必须来自单元格;说明行、空行忽略
  8. 币种默认人民币 → CNY;生效日从「生效日期」类文案解析(可空)
  9. 若工作台已选声明式模板,优先按模板;本 skill 仅补齐本地失败 sheet

原则

  • 只提取可进 OMS 买价矩阵的运费/处理费/挂号费
  • 前端负责匹配 OMS 渠道、价格分区与重量段重建;你只输出结构化报价
  • 不确定是否报价表时宁可 isPriceSheet=false 并说明原因