lcrm-presales-itinerary

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

场景3:售前行程管理

Scenario 3: Presales Itinerary Management

目标

Objectives

售前可以管理自己的行程(增删改查完成),销售可以查询售前的行程和工作负载。
Presales staff can manage their own itineraries (create, read, update, delete, complete), and sales staff can query presales itineraries and workloads.

脚本入口

Script Entries

  • 主脚本:
    node scripts/presales-itinerary.mjs <action> [options]
  • 查询脚本:
    node scripts/search.mjs presales-itineraries [options]
  • 通用脚本:
    node scripts/request.mjs ...
  • 环境变量:
    • 必填:
      LCRM_API_KEY
    • 可选:
      LCRM_BASE_URL
      (默认
      https://crm.langcore.net
  • Main script:
    node scripts/presales-itinerary.mjs <action> [options]
  • Query script:
    node scripts/search.mjs presales-itineraries [options]
  • General script:
    node scripts/request.mjs ...
  • Environment variables:
    • Required:
      LCRM_API_KEY
    • Optional:
      LCRM_BASE_URL
      (default
      https://crm.langcore.net
      )

目标接口

Target APIs

  • 创建:
    POST /api/presales-itineraries
  • 修改:
    PUT /api/presales-itineraries/{id}
  • 删除:
    DELETE /api/presales-itineraries/{id}
  • 完成:
    POST /api/presales-itineraries/{id}/complete
  • 查询:
    GET /api/presales-itineraries/week
    (支持时间段、用户、机会筛选)
  • 辅助机会检索:
    GET /api/presales-itineraries/opportunities?keyword=<关键词>&limit=20
  • Create:
    POST /api/presales-itineraries
  • Modify:
    PUT /api/presales-itineraries/{id}
  • Delete:
    DELETE /api/presales-itineraries/{id}
  • Complete:
    POST /api/presales-itineraries/{id}/complete
  • Query:
    GET /api/presales-itineraries/week
    (supports filtering by time period, user, opportunity)
  • Auxiliary opportunity retrieval:
    GET /api/presales-itineraries/opportunities?keyword=<关键词>&limit=20

创建接口必填字段

Required Fields for Create API

  • title
  • startTime
  • endTime
  • opportunityId
  • tripType
  • deliveryMode
  • title
  • startTime
  • endTime
  • opportunityId
  • tripType
  • deliveryMode

枚举约束

Enum Constraints

tripType
  • 需求调研
    产品介绍
    技术交流
    方案沟通
    方案撰写
    技术预研
    POC测试
  • 产品演示
    产品部署
    标书撰写
    讲标支持
    商务谈判
    内部会议
    案例整理
    培训学习
deliveryMode
  • 现场
    远程
status
  • PLANNED
    已计划
  • COMPLETED
    已完成
tripType
:
  • Requirements Research
    ,
    Product Introduction
    ,
    Technical Communication
    ,
    Solution Discussion
    ,
    Solution Compilation
    ,
    Technical Pre-research
    ,
    POC Testing
  • Product Demonstration
    ,
    Product Deployment
    ,
    Tender Document Compilation
    ,
    Bid Defense Support
    ,
    Business Negotiation
    ,
    Internal Meeting
    ,
    Case Compilation
    ,
    Training & Learning
deliveryMode
:
  • On-site
    ,
    Remote
status
:
  • PLANNED
    Planned
  • COMPLETED
    Completed

时间约束

Time Constraints

  • 必须是半小时粒度(分钟只能
    00
    30
    )。
  • endTime
    必须晚于
    startTime
  • Must be in 30-minute increments (minutes can only be
    00
    or
    30
    ).
  • endTime
    must be later than
    startTime
    .

必须执行的流程

Mandatory Process Flow

  1. 先调脚本解析原文:
    • node scripts/presales-itinerary.mjs ai-parse --text "<用户原文>"
  2. 根据解析结果补齐字段:
    • opportunityId
      缺失时,调用:
      • node scripts/presales-itinerary.mjs search-opportunities --keyword "<关键词>" --limit 20
      • 然后让用户确认具体机会。
    • tripType
      deliveryMode
      缺失/非法时,让用户从枚举里选。
    • title/startTime/endTime
      缺失时,逐项追问。
  3. 本地校验:
    • 时间合法且半小时粒度。
    • 枚举合法。
  4. 提交前确认(强制):
    • 展示确认卡片:
      • 标题
      • 时间范围
      • 机会(名称 + 客户)
      • 行程类型
      • 交付形式
    • 仅当用户明确回复“确认/提交/是”后再调用创建接口。
  5. 调用创建脚本并回传结果:
    • node scripts/presales-itinerary.mjs create --payload '<JSON>'
    • --payload-file <file>
  1. First run the script to parse the original text:
    • node scripts/presales-itinerary.mjs ai-parse --text "<用户原文>"
  2. Fill in missing fields based on parsing results:
    • When
      opportunityId
      is missing, call:
      • node scripts/presales-itinerary.mjs search-opportunities --keyword "<关键词>" --limit 20
      • Then ask the user to confirm the specific opportunity.
    • When
      tripType
      or
      deliveryMode
      is missing/invalid, ask the user to select from the enum options.
    • When
      title/startTime/endTime
      is missing, ask the user to provide the information item by item.
  3. Local Validation:
    • Time is valid and in 30-minute increments.
    • Enum values are valid.
  4. Confirm Before Submission (Mandatory):
    • Display a confirmation card with:
      • Title
      • Time range
      • Opportunity (Name + Client)
      • Itinerary type
      • Delivery mode
    • Only call the create API after the user explicitly replies "Confirm/Submit/Yes".
  5. Call the create script and return the result:
    • node scripts/presales-itinerary.mjs create --payload '<JSON>'
    • Or
      --payload-file <file>

操作命令示例

Operation Command Examples

创建行程

Create Itinerary

bash
node scripts/presales-itinerary.mjs create \
  --title "朗致产品演示" \
  --start-time "2026-02-12T14:00:00" \
  --end-time "2026-02-12T16:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "产品演示" \
  --delivery-mode "现场"
bash
node scripts/presales-itinerary.mjs create \
  --title "朗致产品演示" \
  --start-time "2026-02-12T14:00:00" \
  --end-time "2026-02-12T16:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "产品演示" \
  --delivery-mode "现场"

修改行程

Modify Itinerary

bash
node scripts/presales-itinerary.mjs update \
  --id "<itineraryId>" \
  --title "更新后的标题" \
  --start-time "2026-02-12T15:00:00" \
  --end-time "2026-02-12T17:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "方案沟通" \
  --delivery-mode "远程"
bash
node scripts/presales-itinerary.mjs update \
  --id "<itineraryId>" \
  --title "更新后的标题" \
  --start-time "2026-02-12T15:00:00" \
  --end-time "2026-02-12T17:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "方案沟通" \
  --delivery-mode "远程"

删除行程

Delete Itinerary

bash
node scripts/presales-itinerary.mjs delete --id "<itineraryId>"
bash
node scripts/presales-itinerary.mjs delete --id "<itineraryId>"

完成行程

Complete Itinerary

bash
node scripts/presales-itinerary.mjs complete \
  --id "<itineraryId>" \
  --actual-hours 2.5 \
  --completion-note "完成产品演示,客户反馈良好"
bash
node scripts/presales-itinerary.mjs complete \
  --id "<itineraryId>" \
  --actual-hours 2.5 \
  --completion-note "完成产品演示,客户反馈良好"

查询行程

Query Itinerary

bash
undefined
bash
undefined

查询指定时间段的行程

查询指定时间段的行程

node scripts/search.mjs presales-itineraries
--start-date 2026-02-10
--end-date 2026-02-16
node scripts/search.mjs presales-itineraries
--start-date 2026-02-10
--end-date 2026-02-16

查询某个售前的行程(销售查询售前工作负载)

查询某个售前的行程(销售查询售前工作负载)

node scripts/search.mjs presales-itineraries
--user-id "<userId>"
--start-date 2026-02-10
--end-date 2026-02-16
node scripts/search.mjs presales-itineraries
--user-id "<userId>"
--start-date 2026-02-10
--end-date 2026-02-16

查询某个机会的行程

查询某个机会的行程

node scripts/search.mjs presales-itineraries
--opportunity-id "<opportunityId>"
undefined
node scripts/search.mjs presales-itineraries
--opportunity-id "<opportunityId>"
undefined

缺失信息提示模板

Missing Information Prompt Templates

  • 缺机会:
    请确认要关联的机会(可提供机会名或客户名)。
  • 缺类型:
    请确认行程类型(从系统枚举中选择)。
  • 缺交付形式:
    请确认交付形式(现场/远程)。
  • 缺时间:
    请补充开始和结束时间(半小时粒度,例如 2026-02-11T14:00:00 到 2026-02-11T16:30:00)。
  • Missing opportunity:
    Please confirm the opportunity to associate (you can provide the opportunity name or client name).
  • Missing type:
    Please confirm the itinerary type (select from system enums).
  • Missing delivery mode:
    Please confirm the delivery mode (On-site/Remote).
  • Missing time:
    Please supplement the start and end times (in 30-minute increments, e.g., 2026-02-11T14:00:00 to 2026-02-11T16:30:00).

权限说明

Permission Instructions

  • 售前(PreSales):可以创建、修改、删除、完成、查询自己的行程
  • 销售(Sales):可以查询售前的行程和工作负载(用于了解售前是否有空)
  • 管理员(SystemAdmin):拥有所有权限
  • Presales: Can create, modify, delete, complete, and query their own itineraries
  • Sales: Can query presales itineraries and workloads (to check if presales staff are available)
  • SystemAdmin: Has all permissions