Objectives
Pre-sales can manage their own itineraries (create, delete, modify, query, complete), and sales can query pre-sales itineraries and workload.
Script entry points
- 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(defaulthttps://crm.langcore.net)
- Required:
Target APIs
- 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 range, user, and opportunity) - Auxiliary opportunity lookup:
GET /api/presales-itineraries/opportunities?keyword=<关键词>&limit=20
Create API fields
Required:
titlestartTimeendTimeopportunityIdtripTypedeliveryMode
Optional:
remark: remarks, which will be synced to the Feishu calendar event description
Enum constraints
tripType:
需求调研产品介绍技术交流方案沟通方案撰写技术预研POC测试产品演示产品部署标书撰写讲标支持商务谈判内部会议案例整理培训学习
deliveryMode:
现场远程
status:
PLANNEDPLANNEDCOMPLETEDCOMPLETED
Time constraints
- Must be in half-hour increments (minutes can only be
00or30)。 endTimemust be later thanstartTime。
Mandatory workflow
- First call the script to parse the original text:
node scripts/presales-itinerary.mjs ai-parse --text "<用户原文>"
- Fill in the fields based on the parsing result:
opportunityIdWhen missing, call:node scripts/presales-itinerary.mjs search-opportunities --keyword "<关键词>" --limit 20- Then have the user confirm the specific opportunity.
tripTypeordeliveryModeWhen missing/invalid, have the user choose from the enum.title/startTime/endTimeWhen missing, ask follow-up questions item by item.
- Local validation:
- The time is valid and in half-hour increments.
- The enum is valid.
- Confirmation before submission (mandatory):
- Display a confirmation card:
- Title
- Time range
- Opportunity (name + customer)
- Itinerary type
- Delivery mode
- Remarks (display if any)
- Call the create API only after the user explicitly replies "confirm/submit/yes".
- Display a confirmation card:
- Call the create script and return the result:
node scripts/presales-itinerary.mjs create --payload '<JSON>'- or
--payload-file <file>
Example operation commands
Create itinerary
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 "现场"
# 带备注
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 "现场" \
--remark "需要准备演示环境"
Modify itinerary
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 "远程"
# 带备注
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 "远程" \
--remark "更新备注"
Delete itinerary
node scripts/presales-itinerary.mjs delete --id "<itineraryId>"
Complete itinerary
After completing an itinerary, the system will automatically create a business record based on the completion details (the follow-up type is "pre-sales onsite" or "pre-sales remote", depending on the itinerary's delivery mode).
--completion-note Supports rich text (HTML format).
node scripts/presales-itinerary.mjs complete \
--id "<itineraryId>" \
--actual-hours 2.5 \
--completion-note "完成产品演示,客户反馈良好"
Query itinerary
# 查询指定时间段的行程
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 \
--opportunity-id "<opportunityId>"
Missing information prompt template
- Missing opportunity:
请确认要关联的机会(可提供机会名或客户名)。 - Missing type:
请确认行程类型(从系统枚举中选择)。 - Missing delivery mode:
请确认交付形式(现场/远程)。 - Missing time:
请补充开始和结束时间(半小时粒度,例如 2026-02-11T14:00:00 到 2026-02-11T16:30:00)。
Permission description
- Pre-sales (PreSales): can create, modify, delete, complete, and query their own itineraries
- Sales (Sales): can query pre-sales itineraries and workload (used to check whether pre-sales are available)
- Administrator (SystemAdmin): has all permissions