yindie-erp-mcp 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/craft/guide.js +18 -2
- package/dist/craft/template.js +14 -5
- package/dist/tool-meta.js +150 -87
- package/dist/tools-merged.js +7 -4
- package/dist/tools-write.js +1 -0
- package/dist/tools.js +19 -3
- package/package.json +1 -1
package/dist/craft/guide.js
CHANGED
|
@@ -18,6 +18,13 @@ function buildExample(item) {
|
|
|
18
18
|
if (item.control === 'checkbox' && item.perItemSize) {
|
|
19
19
|
const opt = (item.options || []).find((o) => o !== (item.noneLabel || '无')) || item.options?.[0] || '领';
|
|
20
20
|
const size = item.sizeOptions?.[0] || '0.15';
|
|
21
|
+
if (item.gateNone) {
|
|
22
|
+
return JSON.stringify({
|
|
23
|
+
radio: '有',
|
|
24
|
+
checkbox: [opt],
|
|
25
|
+
combineMap: { [opt]: size },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
21
28
|
return JSON.stringify({ checkbox: [opt], combineMap: { [opt]: size } });
|
|
22
29
|
}
|
|
23
30
|
if (item.control === 'checkbox' && item.perItemInput) {
|
|
@@ -70,14 +77,21 @@ function buildHowTo(item) {
|
|
|
70
77
|
return text;
|
|
71
78
|
}
|
|
72
79
|
if (item.control === 'checkbox' && item.perItemSize) {
|
|
73
|
-
let text =
|
|
80
|
+
let text = '';
|
|
81
|
+
if (item.gateNone) {
|
|
82
|
+
text = '先选有/无;选「无」时 fieldValue={"radio":"无","checkbox":["无"]};选「有」后再';
|
|
83
|
+
}
|
|
84
|
+
text += `可多选部位:${(item.options || []).join('/')};勾选后每项再选尺寸 ${(item.sizeOptions || []).join('/')}`;
|
|
74
85
|
if (item.allowCustomSize) {
|
|
75
86
|
text += '或手填';
|
|
76
87
|
}
|
|
77
88
|
if (item.syncSizeOptions?.length) {
|
|
78
89
|
text += `;${item.syncSizeOptions.join('/')} 尺寸联动`;
|
|
79
90
|
}
|
|
80
|
-
if (item.
|
|
91
|
+
if (item.gateNone) {
|
|
92
|
+
text += ';有时 radio 固定为「有」';
|
|
93
|
+
}
|
|
94
|
+
else if (item.mutexNone) {
|
|
81
95
|
text += ';「无」与其它互斥';
|
|
82
96
|
}
|
|
83
97
|
return text;
|
|
@@ -139,6 +153,7 @@ function flattenGroups(garmentPart, groups) {
|
|
|
139
153
|
allowAdd: item.allowAdd,
|
|
140
154
|
multiFill: item.multiFill,
|
|
141
155
|
perItemSize: item.perItemSize,
|
|
156
|
+
gateNone: item.gateNone,
|
|
142
157
|
sizeOptions: item.sizeOptions,
|
|
143
158
|
syncSizeOptions: item.syncSizeOptions,
|
|
144
159
|
inputSuffix: item.inputSuffix,
|
|
@@ -162,6 +177,7 @@ export const CRAFT_SELECTION_GUIDE = {
|
|
|
162
177
|
radio: '单选 → {"radio":"选项"};特例 creaseHas/spareButton 可能再带 note',
|
|
163
178
|
checkbox: '多选 → {"checkbox":["a","b"]}',
|
|
164
179
|
'checkbox+perItemSize': '多选+尺寸 → {"checkbox":["领"],"combineMap":{"领":"0.15"}}',
|
|
180
|
+
'checkbox+gateNone': '先有无再多选 → 无:{"radio":"无","checkbox":["无"]};有:{"radio":"有","checkbox":["领"],"combineMap":{"领":"0.15"}}',
|
|
165
181
|
combine: '结合单选 → {"combineKey":"三折光","combineValue":"3"};needValue=false 可不带 combineValue',
|
|
166
182
|
'combine+multiFill': '多填 → {"combineMap":{"28L*":"2","24L*":"1"}}',
|
|
167
183
|
input: '输入 → {"input":"文案"}',
|
package/dist/craft/template.js
CHANGED
|
@@ -112,9 +112,12 @@ export const PANTS_STYLE_GROUPS = [
|
|
|
112
112
|
{
|
|
113
113
|
key: 'crotchCloth',
|
|
114
114
|
label: '小裆布',
|
|
115
|
-
control: '
|
|
115
|
+
control: 'combine',
|
|
116
116
|
textSuffix: '裆部',
|
|
117
|
-
|
|
117
|
+
combineOptions: [
|
|
118
|
+
{ label: '有', needValue: true, suffix: '', hideLabel: true },
|
|
119
|
+
{ label: '无', needValue: false },
|
|
120
|
+
],
|
|
118
121
|
},
|
|
119
122
|
{
|
|
120
123
|
key: 'beltLoop',
|
|
@@ -391,8 +394,11 @@ export const PANTS_STYLE_GROUPS = [
|
|
|
391
394
|
{
|
|
392
395
|
key: 'hemTape',
|
|
393
396
|
label: '脚口织带',
|
|
394
|
-
control: '
|
|
395
|
-
|
|
397
|
+
control: 'combine',
|
|
398
|
+
combineOptions: [
|
|
399
|
+
{ label: '有', needValue: true, suffix: '', hideLabel: true },
|
|
400
|
+
{ label: '无', needValue: false },
|
|
401
|
+
],
|
|
396
402
|
},
|
|
397
403
|
],
|
|
398
404
|
},
|
|
@@ -608,6 +614,8 @@ export const JACKET_STYLE_GROUPS = [
|
|
|
608
614
|
key: 'outerNeedle',
|
|
609
615
|
label: '外贡针',
|
|
610
616
|
control: 'checkbox',
|
|
617
|
+
gateNone: true,
|
|
618
|
+
mutexNone: true,
|
|
611
619
|
perItemSize: true,
|
|
612
620
|
allowCustomSize: true,
|
|
613
621
|
sizeOptions: ['0.15', '0.6'],
|
|
@@ -630,12 +638,13 @@ export const JACKET_STYLE_GROUPS = [
|
|
|
630
638
|
key: 'outerPress',
|
|
631
639
|
label: '外压线',
|
|
632
640
|
control: 'checkbox',
|
|
641
|
+
gateNone: true,
|
|
633
642
|
mutexNone: true,
|
|
634
643
|
perItemSize: true,
|
|
635
644
|
allowCustomSize: true,
|
|
636
645
|
sizeOptions: ['0.15', '0.6'],
|
|
637
646
|
sizeTextSuffix: '有外压线',
|
|
638
|
-
options:
|
|
647
|
+
options: EDGE_PARTS,
|
|
639
648
|
allowAdd: true,
|
|
640
649
|
},
|
|
641
650
|
{
|
package/dist/tool-meta.js
CHANGED
|
@@ -60,9 +60,9 @@ export const ENTITY_META = {
|
|
|
60
60
|
step: '业务流程第1步:建档',
|
|
61
61
|
label: '客户',
|
|
62
62
|
addRequired: 'customerName, customerType',
|
|
63
|
-
addOptional: 'country, defaultCurrency, communicationChannel, email, phone, assigneeId, status, remark',
|
|
63
|
+
addOptional: 'country, defaultCurrency, communicationChannel, email, phone, taxNo, shortCode, assigneeId, status, remark',
|
|
64
64
|
editRequired: 'id, customerName, customerType',
|
|
65
|
-
enums: 'customerType:direct/trader/foreign_trade; status:active/inactive(默认active);customerCode
|
|
65
|
+
enums: 'customerType:direct/trader/foreign_trade; status:active/inactive(默认active);customerCode 后端自动生成勿传;taxNo/shortCode 选手填',
|
|
66
66
|
removeConstraint: '客户存在关联PI时不可删除',
|
|
67
67
|
next: 'erp_customer_contact_add → erp_customer_address_add → erp_pi_add'
|
|
68
68
|
},
|
|
@@ -91,30 +91,30 @@ export const ENTITY_META = {
|
|
|
91
91
|
label: '客户品牌',
|
|
92
92
|
prerequisite: '客户已创建',
|
|
93
93
|
addRequired: 'customerId, brandName',
|
|
94
|
-
addOptional: 'status, remark',
|
|
94
|
+
addOptional: 'shortCode, status, remark',
|
|
95
95
|
editRequired: 'id, customerId, brandName',
|
|
96
|
-
enums: 'brandCode
|
|
96
|
+
enums: 'brandCode 后端自动生成勿传;shortCode 复制订单号用缩写'
|
|
97
97
|
},
|
|
98
98
|
erp_pi: {
|
|
99
99
|
module: 'PI管理',
|
|
100
100
|
step: '业务流程第2步:形式发票',
|
|
101
101
|
label: 'PI',
|
|
102
102
|
prerequisite: '客户已创建',
|
|
103
|
-
addRequired: 'customerId, sourceType',
|
|
103
|
+
addRequired: 'customerId, sourceType, piNo',
|
|
104
104
|
addOptional: 'orderId, piVersion, paymentTerms, totalAmount, currency, qtyTolerance, shippingMethod, shippingAddress, piFileOssId, status, confirmedDate, remark',
|
|
105
|
-
editRequired: 'id, customerId, sourceType',
|
|
106
|
-
enums: 'sourceType:customer/internal; status:draft/confirmed/superseded(默认draft);piNo
|
|
107
|
-
next: 'erp_order_add → erp_order_link_pi'
|
|
105
|
+
editRequired: 'id, customerId, sourceType, piNo',
|
|
106
|
+
enums: 'sourceType:customer/internal; status:draft/confirmed/superseded(默认draft);piNo 手填可改,同号同版本重复报PI编号已存在;传 orderId 则关联订单(客户须一致)',
|
|
107
|
+
next: 'erp_order_add → erp_order_link_pi(若 add 已带 orderId 可跳过 link)'
|
|
108
108
|
},
|
|
109
109
|
erp_order: {
|
|
110
110
|
module: '订单管理',
|
|
111
111
|
step: '业务流程第3步:创建订单',
|
|
112
112
|
label: '订单',
|
|
113
|
-
prerequisite: '
|
|
114
|
-
addRequired: 'customerId, bizLine, assigneeId',
|
|
113
|
+
prerequisite: '客户已创建;assigneeId 来自 erp_workbench action=merchandiser_options',
|
|
114
|
+
addRequired: 'orderNo, customerId, bizLine, assigneeId',
|
|
115
115
|
addOptional: 'brandId, orderStatus(默认inquiry), orderDate, deliveryDate, contractDate, depositReceived(Y/N), qtyTolerance, shippingMethod, packingType, priority, sourceChannel, parentOrderId, remark',
|
|
116
|
-
editRequired: 'id, customerId, bizLine, assigneeId',
|
|
117
|
-
enums: 'bizLine:direct/trader; orderStatus见erp_business_flow资源;orderNo
|
|
116
|
+
editRequired: 'id, orderNo, customerId, bizLine, assigneeId',
|
|
117
|
+
enums: 'bizLine:direct/trader; orderStatus见erp_business_flow资源;orderNo 手填全库唯一可改;重复报订单号已存在',
|
|
118
118
|
next: 'erp_order_link_pi → erp_order_style_save → erp_order_change_status'
|
|
119
119
|
},
|
|
120
120
|
erp_task: {
|
|
@@ -130,10 +130,12 @@ export const ENTITY_META = {
|
|
|
130
130
|
module: '主数据',
|
|
131
131
|
step: '维护面料/辅料等物料档案',
|
|
132
132
|
label: '物料',
|
|
133
|
-
addRequired: 'categoryId, materialName',
|
|
133
|
+
addRequired: 'categoryId, materialCode, materialName',
|
|
134
134
|
addOptional: 'spec, color, unit, defaultSupplierId, composition, width, weight, imageOssId, status, remark',
|
|
135
135
|
editRequired: 'id, categoryId, materialName',
|
|
136
|
-
enums: 'materialCode
|
|
136
|
+
enums: 'materialCode 新增手填必传、唯一,修改不可改;分类 fabric:materialCode=面料号且 color(色号)必填;分类 lining:composition(成分)必填',
|
|
137
|
+
removeConstraint: '已被订单引用(款式面料色号行/colorCardJson 色卡料/工艺 materialCode)、生产单引用或有比价快照时不可删,可改为停用',
|
|
138
|
+
next: '面料 → style_save colors[].fabricMaterialId(colorCode 取物料 color);色卡料 → colors[].colorCardJson'
|
|
137
139
|
},
|
|
138
140
|
erp_material_category: {
|
|
139
141
|
module: '主数据',
|
|
@@ -200,7 +202,7 @@ export const ENTITY_META = {
|
|
|
200
202
|
editRequired: 'id, orderId, bizLine',
|
|
201
203
|
enums: 'poStatus:draft/reviewing/issued/superseded;poNo 后端自动生成勿传',
|
|
202
204
|
removeConstraint: '已下发(issued)不可删除;仅draft可修改',
|
|
203
|
-
next: '
|
|
205
|
+
next: 'erp_production craft_save(可选)→ check → submit_review → issue;辅料工艺只读展示款式配置已选面料与色卡,一般不必 save_items'
|
|
204
206
|
},
|
|
205
207
|
erp_bid: {
|
|
206
208
|
module: '招标管理',
|
|
@@ -223,14 +225,14 @@ export const WORKFLOW_META = {
|
|
|
223
225
|
summary: '变更订单状态',
|
|
224
226
|
prerequisite: '订单已创建',
|
|
225
227
|
payload: '{id, orderStatus, remark?}',
|
|
226
|
-
constraint: '流转: inquiry→sampling|doc_preparing|quoted(跳过打样); sampling→sample_confirmed; sample_confirmed→quoted; quoted→po_drafting; doc_preparing→pre_prod_sample; pre_prod_sample→pre_prod_confirmed; pre_prod_confirmed→po_drafting; po_drafting→po_ai_checking; po_ai_checking→
|
|
228
|
+
constraint: '流转: inquiry→sampling|doc_preparing|quoted(跳过打样); sampling→sample_shipped; sample_shipped→sample_confirmed; sample_confirmed→quoted; quoted→po_drafting; doc_preparing→pre_prod_sample; pre_prod_sample→pre_prod_confirmed; pre_prod_confirmed→po_drafting; po_drafting→po_ai_checking; po_ai_checking→color_card_confirmed|po_drafting; color_card_confirmed→po_reviewing; po_reviewing→po_issued',
|
|
227
229
|
next: 'quoted/pre_prod_confirmed/po_drafting 时 erp_production_create_from_order'
|
|
228
230
|
},
|
|
229
231
|
erp_order_assign: {
|
|
230
232
|
module: '订单管理',
|
|
231
233
|
step: '订单分派跟单员',
|
|
232
234
|
summary: '分派或变更跟单员',
|
|
233
|
-
prerequisite: '
|
|
235
|
+
prerequisite: '订单已创建;assigneeId 来自 erp_workbench action=merchandiser_options',
|
|
234
236
|
payload: '{id, assigneeId}',
|
|
235
237
|
next: 'erp_order_style_save'
|
|
236
238
|
},
|
|
@@ -246,19 +248,28 @@ export const WORKFLOW_META = {
|
|
|
246
248
|
module: '订单管理',
|
|
247
249
|
step: '返单复制',
|
|
248
250
|
summary: '复制订单主档+款式颜色尺码+工艺商标,状态重置为inquiry,挂parentOrderId',
|
|
249
|
-
prerequisite: '
|
|
250
|
-
payload: '{id:源订单ID},ID 一律字符串;新 orderNo
|
|
251
|
-
constraint: '不复制PI
|
|
251
|
+
prerequisite: '源订单已存在;品牌或客户已维护 shortCode',
|
|
252
|
+
payload: '{id:源订单ID},ID 一律字符串;新 orderNo=年两位+缩写+当年序号如26SB01;款号=新订单号-序号',
|
|
253
|
+
constraint: '不复制PI/附件/轮次/生产单;无缩写报请先维护品牌或客户缩写;新单可直接 change_status→quoted 跳过打样',
|
|
252
254
|
next: '按需改款式工艺后 erp_order_change_status'
|
|
253
255
|
},
|
|
254
256
|
erp_order_style_save: {
|
|
255
257
|
module: '订单管理',
|
|
256
258
|
step: '录入款式明细',
|
|
257
|
-
summary: '
|
|
259
|
+
summary: '保存订单款式及颜色尺码/色卡物料,成功后回查 styles(含 id 作 styleId);页面配置确定即调本接口',
|
|
258
260
|
prerequisite: '订单已创建;payload 内 orderId 用字符串',
|
|
259
|
-
payload: '{orderId:string, styles:[{styleName?, colors:[{colorName, sizes:[{sizeName, qty}]}]}]};styleNo
|
|
260
|
-
constraint: '
|
|
261
|
-
next: '从返回 styles[].id 取 styleId →
|
|
261
|
+
payload: '{orderId:string, styles:[{id?, styleNo?, styleName?, sampleNo?, shipSampleTip?, materialUsage?, garmentType?, fabricMaterialId?, meterage?, colors:[{fabricMaterialId, colorCode, colorName, colorCardJson?, sizes:[{sizeName, qty}]}]}]};styleNo 可省略则默认订单号-序号;全库唯一;colors[].colorName 必填',
|
|
262
|
+
constraint: '全量 styles 列表;已有 styles[].id 或同款号则更新主档并替换颜色尺码,工艺/商标保留,sizeChartJson/样板号/船样提示空则沿用库中值;无 id 为新增;未出现在列表中的旧款整树删除(含工艺);款号重复报款号已存在;配置:每行 colors[] 各自 material.list/add 后面料 fabricMaterialId,colorCode 取该物料 color(色号),colorName=物料 materialName,勿手填独立色号、勿传 fabricColorNo;款式级 fabricMaterialId 取首行面料;色卡选料按行写入 colorCardJson(JSON 字符串,键=fieldKey 如 lining,值={materialCode,materialName,titleCn});页脚备注走 color_card_save,不在本接口',
|
|
263
|
+
next: '从返回 styles[].id 取 styleId → craft_save;色卡备注 → color_card_save'
|
|
264
|
+
},
|
|
265
|
+
erp_order_style_color_card_save: {
|
|
266
|
+
module: '订单管理',
|
|
267
|
+
step: '保存色卡页脚备注',
|
|
268
|
+
summary: '按 styleId 写 colorCardNote;与前端色卡弹窗一致',
|
|
269
|
+
prerequisite: '款式已保存;选料已在 style_save.colorCardJson',
|
|
270
|
+
payload: '{styleId:string, colorCardNote?, items?:[{garmentPart, fieldKey, colorCardCode?, materialCode?}]}',
|
|
271
|
+
constraint: '前端常规只传 colorCardNote 且 items:[];选料不在本接口。items 写 craft 编号为遗留可选,一般勿填;PDF 导出无 MCP,走前端',
|
|
272
|
+
next: 'erp_order action=change_status(如 color_card_confirmed)'
|
|
262
273
|
},
|
|
263
274
|
erp_bid_close: {
|
|
264
275
|
module: '招标管理',
|
|
@@ -291,9 +302,9 @@ export const WORKFLOW_META = {
|
|
|
291
302
|
step: '录入结构化工艺',
|
|
292
303
|
summary: '保存款式上衣/裤子工艺及商标位置(选项对齐打样单模板,非字典)',
|
|
293
304
|
prerequisite: '款式已保存且有 styleId;先读 erp_order_craft_schema 取 fieldKey',
|
|
294
|
-
payload: '{styleId, crafts:[{garmentPart, craftModule, fieldKey, fieldValue}], labelPositions?:[...]}。键名必须是 crafts(复数)与 craftModule;每条带 garmentPart;fieldValue 为 JSON 字符串,旁框用 note 不是 input',
|
|
305
|
+
payload: '{styleId, processNote?, crafts:[{garmentPart, craftModule, fieldKey, fieldValue}], labelPositions?:[...]}。键名必须是 crafts(复数)与 craftModule;每条带 garmentPart;fieldValue 为 JSON 字符串,旁框用 note 不是 input',
|
|
295
306
|
enums: 'garmentPart:jacket/pants; craftModule/fieldKey 见 schema;labelType/positionSide 仍用字典 erp_label_*',
|
|
296
|
-
constraint: '全量替换:按 styleId 先删该款全部工艺再插入。jacket+pants 必须放进同一次 crafts;分部位连调会互相覆盖。返回 data=写入条数。清空传 crafts:[]',
|
|
307
|
+
constraint: '全量替换:按 styleId 先删该款全部工艺再插入。jacket+pants 必须放进同一次 crafts;分部位连调会互相覆盖。返回 data=写入条数。清空传 crafts:[];processNote 为工艺备注(订单页会传);色卡选料不在本接口,走 style_save colors[].colorCardJson',
|
|
297
308
|
next: 'erp_order action=craft_get 校验 → erp_order_change_status 推进后再 erp_production_create_from_order'
|
|
298
309
|
},
|
|
299
310
|
erp_order_style_size_chart_save: {
|
|
@@ -310,7 +321,7 @@ export const WORKFLOW_META = {
|
|
|
310
321
|
step: '填写结构化工艺',
|
|
311
322
|
summary: '生产单草稿阶段保存款式工艺(同订单工艺模板与 JSON 存值)',
|
|
312
323
|
prerequisite: '生产单 poStatus=draft,款式已存在',
|
|
313
|
-
payload: '
|
|
324
|
+
payload: '同订单 craft_save 的 crafts/craftModule/labelPositions;生产页通常不传 processNote',
|
|
314
325
|
constraint: '同订单 craft_save:全量替换,返回写入条数',
|
|
315
326
|
next: 'erp_production action=craft_get 校验 → erp_production_check'
|
|
316
327
|
},
|
|
@@ -327,10 +338,11 @@ export const WORKFLOW_META = {
|
|
|
327
338
|
erp_order_attachment_add: {
|
|
328
339
|
module: '订单管理',
|
|
329
340
|
step: '登记订单附件',
|
|
330
|
-
summary: '新增订单附件元数据(须已有真实 ossId
|
|
341
|
+
summary: '新增订单附件元数据(须已有真实 ossId);不再写入订单时间线',
|
|
331
342
|
prerequisite: '订单已创建;先 erp_oss_upload(或页面上传)拿到 ossId',
|
|
332
343
|
payload: '{orderId, styleId?, attachType, fileName, ossId, fileSize?, source?, remark?}',
|
|
333
|
-
enums: 'attachType:pi/tech_drawing/customer_file/other/size_chart/production_order;尺寸表细分靠 remark=原始|归一xlsx|归一json'
|
|
344
|
+
enums: 'attachType:pi/tech_drawing/customer_file/other/size_chart/production_order/color_card/craft;尺寸表细分靠 remark=原始|归一xlsx|归一json',
|
|
345
|
+
constraint: '时间线查询已过滤 eventType=attachment'
|
|
334
346
|
},
|
|
335
347
|
erp_order_attachment_remove: {
|
|
336
348
|
module: '订单管理',
|
|
@@ -341,36 +353,36 @@ export const WORKFLOW_META = {
|
|
|
341
353
|
},
|
|
342
354
|
erp_order_sample_add: {
|
|
343
355
|
module: '订单管理',
|
|
344
|
-
step: '
|
|
345
|
-
summary: '
|
|
356
|
+
step: '记录轮次',
|
|
357
|
+
summary: '新增订单轮次(状态固定 pending;页面 Tab「轮次」)',
|
|
346
358
|
prerequisite: '订单已创建',
|
|
347
|
-
payload: '{orderId, sampleType, sizeName?, colorName?, plannedFinishDate?, remark?}',
|
|
348
|
-
enums: 'sampleType:proto
|
|
349
|
-
constraint: '新建后状态为 pending,不可传 sampleStatus'
|
|
359
|
+
payload: '{orderId, sampleType, styleId?, roundName?, sizeName?, colorName?, plannedFinishDate?, remark?}',
|
|
360
|
+
enums: 'sampleType(类型):proto打样/pre_prod产前样/bulk船样/mass大货;roundName 与 sampleType 独立',
|
|
361
|
+
constraint: '新建后状态为 pending,不可传 sampleStatus;list 回填 styleName'
|
|
350
362
|
},
|
|
351
363
|
erp_order_sample_edit: {
|
|
352
364
|
module: '订单管理',
|
|
353
|
-
step: '
|
|
354
|
-
summary: '
|
|
355
|
-
prerequisite: '
|
|
356
|
-
payload: '{id, orderId, sampleType, sizeName?, colorName?, plannedFinishDate?, shipDate?, trackingNo?, courierCompany?, remark?}',
|
|
365
|
+
step: '更新轮次信息',
|
|
366
|
+
summary: '修改轮次基础信息(不含状态)',
|
|
367
|
+
prerequisite: '轮次已存在',
|
|
368
|
+
payload: '{id, orderId, sampleType, styleId?, roundName?, sizeName?, colorName?, plannedFinishDate?, shipDate?, trackingNo?, courierCompany?, remark?}',
|
|
357
369
|
constraint: '不可通过 edit 改状态,状态走 sample_change_status'
|
|
358
370
|
},
|
|
359
371
|
erp_order_sample_change_status: {
|
|
360
372
|
module: '订单管理',
|
|
361
|
-
step: '
|
|
362
|
-
summary: '
|
|
363
|
-
prerequisite: '
|
|
373
|
+
step: '推进轮次状态',
|
|
374
|
+
summary: '按流转推进轮次状态',
|
|
375
|
+
prerequisite: '轮次已存在',
|
|
364
376
|
payload: '{id, sampleStatus, shipDate?, trackingNo?, courierCompany?, remark?}',
|
|
365
377
|
enums: 'sampleStatus:making/shipped/confirmed/rejected',
|
|
366
378
|
constraint: '流转: pending→making|rejected; making→shipped|rejected; shipped→confirmed|rejected;寄出可带快递信息'
|
|
367
379
|
},
|
|
368
380
|
erp_order_sample_remove: {
|
|
369
381
|
module: '订单管理',
|
|
370
|
-
step: '
|
|
371
|
-
summary: '
|
|
372
|
-
prerequisite: '
|
|
373
|
-
payload: 'ids:
|
|
382
|
+
step: '删除轮次',
|
|
383
|
+
summary: '删除订单轮次',
|
|
384
|
+
prerequisite: '轮次已存在',
|
|
385
|
+
payload: 'ids: 轮次ID,多个逗号分隔'
|
|
374
386
|
},
|
|
375
387
|
erp_order_shipment_add: {
|
|
376
388
|
module: '订单管理',
|
|
@@ -402,12 +414,12 @@ export const WORKFLOW_META = {
|
|
|
402
414
|
prerequisite: '订单已存在、尚无生产单,且 orderStatus 为 quoted/pre_prod_confirmed/po_drafting',
|
|
403
415
|
payload: 'orderId: 订单ID',
|
|
404
416
|
constraint: '仅 quoted/pre_prod_confirmed/po_drafting 可调用;若当前为 quoted/pre_prod_confirmed 会自动改订单为 po_drafting;生产单号=订单号-PO;每单仅一条',
|
|
405
|
-
next: '
|
|
417
|
+
next: '完善交期等主档 → craft_save(可选)→ erp_production_check;辅料来自订单款式配置只读'
|
|
406
418
|
},
|
|
407
419
|
erp_production_save_items: {
|
|
408
420
|
module: '生产管理',
|
|
409
|
-
step: '
|
|
410
|
-
summary: '
|
|
421
|
+
step: '手填生产单明细(可选)',
|
|
422
|
+
summary: '保存生产单物料/工艺明细;页面辅料工艺已改为只读展示款式配置,常规流程不必调',
|
|
411
423
|
prerequisite: '生产单处于draft',
|
|
412
424
|
payload: '{productionOrderId, items:[{itemCategory, itemName, materialId?, spec?, color?, qty?, supplierId?, isRequired?}]}',
|
|
413
425
|
enums: 'itemCategory:button/label/hangtag/zipper/thread/process/other',
|
|
@@ -416,7 +428,7 @@ export const WORKFLOW_META = {
|
|
|
416
428
|
erp_production_check: {
|
|
417
429
|
module: '生产管理',
|
|
418
430
|
step: '人工校验缺项',
|
|
419
|
-
summary: '
|
|
431
|
+
summary: '执行生产单完整性校验(含交期、面料/色卡物料、尺寸表、工艺选项等)',
|
|
420
432
|
prerequisite: '生产单已存在',
|
|
421
433
|
payload: 'id: 生产单ID',
|
|
422
434
|
returns: '校验分数、缺项列表(checkResult: pass/warning/fail)',
|
|
@@ -438,7 +450,7 @@ export const WORKFLOW_META = {
|
|
|
438
450
|
prerequisite: '生产单poStatus=reviewing,需erp:production:review权限',
|
|
439
451
|
payload: 'id: 生产单ID',
|
|
440
452
|
constraint: '退回后poStatus→draft',
|
|
441
|
-
next: '
|
|
453
|
+
next: '改主档/工艺后重新 check → submit_review'
|
|
442
454
|
},
|
|
443
455
|
erp_production_issue: {
|
|
444
456
|
module: '生产管理',
|
|
@@ -463,6 +475,10 @@ export const READ_META = {
|
|
|
463
475
|
erp_workbench_summary: {
|
|
464
476
|
usage: '【入口】建议首先调用,获取待办任务、超期任务、缺项生产单、近期订单概览'
|
|
465
477
|
},
|
|
478
|
+
erp_merchandiser_options: {
|
|
479
|
+
usage: '返回跟单员角色用户列表;建客户/订单或 order.assign 前取 assigneeId(字符串)',
|
|
480
|
+
returns: '[{userId, userName, nickName}]'
|
|
481
|
+
},
|
|
466
482
|
erp_customer_list: {
|
|
467
483
|
usage: '筛选客户类型 direct/trader/foreign_trade,状态 active/inactive'
|
|
468
484
|
},
|
|
@@ -488,6 +504,10 @@ export const READ_META = {
|
|
|
488
504
|
erp_order_style_craft_list: {
|
|
489
505
|
usage: '按 styleId 读已存工艺行,验证 craft_save;也可用 order.style_list 看 styles[].crafts'
|
|
490
506
|
},
|
|
507
|
+
erp_order_style_color_card_list: {
|
|
508
|
+
usage: '按 styleId 读色卡工艺项清单(前端色卡弹窗实际用 style.colorCardJson 展示,本接口可选);写备注用 color_card_save',
|
|
509
|
+
returns: '[{garmentPart, fieldKey, titleCn, colorCardCode, materialCode, materialName, sort}]'
|
|
510
|
+
},
|
|
491
511
|
erp_production_craft_schema: {
|
|
492
512
|
usage: '同 erp_order_craft_schema'
|
|
493
513
|
},
|
|
@@ -496,16 +516,18 @@ export const READ_META = {
|
|
|
496
516
|
},
|
|
497
517
|
erp_order_timeline_list: { usage: '查订单状态变更、生产事件等跟进时间线' },
|
|
498
518
|
erp_order_attachment_list: { usage: '查订单附件列表' },
|
|
499
|
-
erp_order_sample_list: { usage: '
|
|
519
|
+
erp_order_sample_list: { usage: '查订单轮次(含 styleId/styleName/roundName);可不建轮次' },
|
|
500
520
|
erp_order_shipment_list: { usage: '查订单出货记录,按 shipSeq 升序;一单可多批' },
|
|
501
521
|
erp_production_list: { usage: '生产单状态 draft/reviewing/issued/superseded' },
|
|
502
|
-
erp_production_get: { usage: '
|
|
522
|
+
erp_production_get: { usage: '查生产单主档、styles(含 colors.colorCardJson)及缺项;辅料展示读款式配置已选面料与色卡' },
|
|
503
523
|
erp_production_check_list: { usage: '查生产单历次校验记录及得分' },
|
|
504
524
|
erp_task_list: { usage: '任务状态 pending/in_progress/completed/cancelled' },
|
|
505
525
|
erp_task_get: { usage: '查任务详情' },
|
|
506
526
|
erp_material_category_list: { usage: '查物料分类树,新建物料前先查 categoryId' },
|
|
507
|
-
erp_material_list: {
|
|
508
|
-
|
|
527
|
+
erp_material_list: {
|
|
528
|
+
usage: '分页查物料;款式配置选面料/色卡前先查;可按分类/编码/名称筛选'
|
|
529
|
+
},
|
|
530
|
+
erp_material_get: { usage: '查物料详情;拿到 id/materialCode/color 再写入款式配置或色卡' },
|
|
509
531
|
erp_material_supplier_list: { usage: '查某物料下可议价供应商清单' },
|
|
510
532
|
erp_material_price_snapshot_list: { usage: '分页查比价快照,可按品名/编码/口径筛选' },
|
|
511
533
|
erp_material_price_snapshot_get: { usage: '查比价快照详情(含 quotes 明细)' },
|
|
@@ -521,29 +543,30 @@ export const READ_META = {
|
|
|
521
543
|
};
|
|
522
544
|
/** ERP 业务流程文档 */
|
|
523
545
|
export const ERP_BUSINESS_FLOW = {
|
|
524
|
-
overview: '外贸服装ERP:客户建档 → PI形式发票 → 订单(款式/附件/跟单) → 生产单(校验/审核/下发)
|
|
546
|
+
overview: '外贸服装ERP:客户建档 → PI形式发票 → 订单(款式/附件/跟单) → 生产单(校验/审核/下发)。物料/供应商为主数据,招标为物料询价,邮件/任务为协同手段。客户/供应商/分类/品牌/生产单/招标等编号后端发号;materialCode/订单号/款号手填(复制订单按年+缩写+序号发号)。',
|
|
525
547
|
mainFlow: [
|
|
526
|
-
'1. erp_customer action=customer.add 建客户(勿传customerCode)',
|
|
527
|
-
'2. erp_customer action=contact.add / address.add / brand.add 补全资料',
|
|
528
|
-
'3. erp_pi action=add 创建PI(需customerId, sourceType
|
|
529
|
-
'4. erp_order action=add
|
|
530
|
-
'5. erp_order action=link_pi 关联PI',
|
|
531
|
-
'6. erp_order action=style_save
|
|
532
|
-
'7. erp_order action=craft_schema
|
|
533
|
-
'8. (可选)erp_order action=
|
|
534
|
-
'9. erp_order action=
|
|
535
|
-
'10.
|
|
536
|
-
'11. erp_production action=
|
|
537
|
-
'12. erp_production action=
|
|
538
|
-
'13. erp_production action=
|
|
539
|
-
'14. erp_production action=
|
|
540
|
-
'15.
|
|
548
|
+
'1. erp_customer action=customer.add 建客户(勿传customerCode;可传 taxNo/shortCode)',
|
|
549
|
+
'2. erp_customer action=contact.add / address.add / brand.add 补全资料(brand 可传 shortCode)',
|
|
550
|
+
'3. erp_pi action=add 创建PI(需customerId, sourceType, piNo;可选 orderId 直接关联订单)',
|
|
551
|
+
'4. erp_workbench action=merchandiser_options 取跟单员,再 erp_order action=add(需 orderNo,customerId,bizLine,assigneeId,默认inquiry;复制订单号规则26SB01)',
|
|
552
|
+
'5. 若 PI 未带 orderId:erp_order action=link_pi 关联PI',
|
|
553
|
+
'6. erp_material list/add 选或新增面料(fabric 必填色号 color)→ erp_order action=style_save(colors[].fabricMaterialId/colorCode/colorName/colorCardJson + 尺码)',
|
|
554
|
+
'7. erp_order action=craft_schema → craft_save 写工艺选项(jacket+pants 一次全量)→ craft_get 校验',
|
|
555
|
+
'8. (可选)erp_order action=color_card_save 写色卡页脚备注(常规 {styleId,colorCardNote,items:[]});选料已在 style_save.colorCardJson',
|
|
556
|
+
'9. (可选)erp_order action=size_chart_save 写入尺寸表视图;erp_oss action=upload 拿 ossId 后 attachment_add×3 留底',
|
|
557
|
+
'10. erp_order action=change_status 按规则推进状态',
|
|
558
|
+
'11. erp_production action=create_from_order 生成生产单草稿(订单须 quoted/pre_prod_confirmed/po_drafting 且无生产单;成功后订单→po_drafting)',
|
|
559
|
+
'12. erp_production action=craft_save 补工艺(辅料工艺只读展示款式配置已选面料与色卡物料,不必 save_items 手录)',
|
|
560
|
+
'13. erp_production action=check 人工校验(含面料/色卡物料/sizeChart 缺项)',
|
|
561
|
+
'14. erp_production action=submit_review 提交审核',
|
|
562
|
+
'15. erp_production action=issue 下发(订单→po_issued)',
|
|
563
|
+
'16. erp_bid action=add 对物料发起明/暗标(materialId,qty,bidMode,openTime,closeTime)'
|
|
541
564
|
],
|
|
542
565
|
bidStatus: {
|
|
543
566
|
default: 'draft',
|
|
544
567
|
transitions: {
|
|
545
568
|
draft: ['collecting', 'cancelled'],
|
|
546
|
-
collecting: ['closed', 'cancelled'
|
|
569
|
+
collecting: ['closed', 'cancelled'],
|
|
547
570
|
closed: ['awarded', 'cancelled'],
|
|
548
571
|
awarded: [],
|
|
549
572
|
cancelled: []
|
|
@@ -555,33 +578,37 @@ export const ERP_BUSINESS_FLOW = {
|
|
|
555
578
|
awarded: '已中标',
|
|
556
579
|
cancelled: '已取消'
|
|
557
580
|
},
|
|
558
|
-
note: '
|
|
581
|
+
note: 'openTime 已到可直接 collecting;手动 close 仅 collecting;手动 award 仅 closed;到期懒刷新先 closed 再 autoAward'
|
|
559
582
|
},
|
|
560
583
|
orderStatus: {
|
|
561
584
|
default: 'inquiry',
|
|
562
585
|
transitions: {
|
|
563
586
|
inquiry: ['sampling', 'doc_preparing', 'quoted'],
|
|
564
|
-
sampling: ['
|
|
587
|
+
sampling: ['sample_shipped'],
|
|
588
|
+
sample_shipped: ['sample_confirmed'],
|
|
565
589
|
sample_confirmed: ['quoted'],
|
|
566
590
|
quoted: ['po_drafting'],
|
|
567
591
|
doc_preparing: ['pre_prod_sample'],
|
|
568
592
|
pre_prod_sample: ['pre_prod_confirmed'],
|
|
569
593
|
pre_prod_confirmed: ['po_drafting'],
|
|
570
594
|
po_drafting: ['po_ai_checking'],
|
|
571
|
-
po_ai_checking: ['
|
|
595
|
+
po_ai_checking: ['color_card_confirmed', 'po_drafting'],
|
|
596
|
+
color_card_confirmed: ['po_reviewing'],
|
|
572
597
|
po_reviewing: ['po_issued'],
|
|
573
598
|
po_issued: []
|
|
574
599
|
},
|
|
575
600
|
labels: {
|
|
576
601
|
inquiry: '询盘沟通',
|
|
577
602
|
sampling: '打样中',
|
|
603
|
+
sample_shipped: '样衣寄出',
|
|
578
604
|
sample_confirmed: '样衣确认',
|
|
579
605
|
quoted: '报价签约',
|
|
580
606
|
doc_preparing: '资料整理',
|
|
581
607
|
pre_prod_sample: '产前样',
|
|
582
608
|
pre_prod_confirmed: '产前样确认',
|
|
583
609
|
po_drafting: '制单中',
|
|
584
|
-
po_ai_checking: '
|
|
610
|
+
po_ai_checking: '完整性校验',
|
|
611
|
+
color_card_confirmed: '色卡确认',
|
|
585
612
|
po_reviewing: '人工审核',
|
|
586
613
|
po_issued: '已下发'
|
|
587
614
|
}
|
|
@@ -614,9 +641,10 @@ export const ERP_BUSINESS_FLOW = {
|
|
|
614
641
|
customer_file: '客户文件',
|
|
615
642
|
other: '其他',
|
|
616
643
|
size_chart: '尺寸表',
|
|
617
|
-
production_order: '生产单'
|
|
644
|
+
production_order: '生产单',
|
|
645
|
+
color_card: '色卡'
|
|
618
646
|
},
|
|
619
|
-
sampleType: { proto: '打样', pre_prod: '产前样', bulk: '
|
|
647
|
+
sampleType: { proto: '打样', pre_prod: '产前样', bulk: '船样', mass: '大货' },
|
|
620
648
|
sampleStatus: { pending: '待制作', making: '制作中', shipped: '已寄出', confirmed: '已确认', rejected: '已驳回' },
|
|
621
649
|
poItemCategory: {
|
|
622
650
|
button: '纽扣',
|
|
@@ -664,7 +692,7 @@ export const ERP_BUSINESS_FLOW = {
|
|
|
664
692
|
constraints: [
|
|
665
693
|
'客户存在关联PI时不可删除',
|
|
666
694
|
'每订单仅一条生产单(erp_production_create_from_order)',
|
|
667
|
-
'erp_production_create_from_order 仅 orderStatus=quoted|pre_prod_confirmed|po_drafting
|
|
695
|
+
'erp_production_create_from_order 仅 orderStatus=quoted|pre_prod_confirmed|po_drafting 且尚无生产单时可调用;成功后订单强制 orderStatus=po_drafting',
|
|
668
696
|
'生产单仅draft可修改/编辑明细',
|
|
669
697
|
'生产单submit_review: draft→reviewing',
|
|
670
698
|
'生产单reject_review: reviewing→draft(需review权限)',
|
|
@@ -673,13 +701,16 @@ export const ERP_BUSINESS_FLOW = {
|
|
|
673
701
|
'工艺选项与怎么选见 erp_order_craft_schema.selectionGuide 或资源 yindie://erp/craft-guide',
|
|
674
702
|
'工艺选项固定模板(对齐打样单),不用 sys_dict;fieldValue 存 JSON(见 craftValueJson / fieldValueExample)',
|
|
675
703
|
'工艺 fieldKey/craftModule 以 erp_order_craft_schema.fields 为准,勿再用旧字典码如 single_1',
|
|
704
|
+
'款式面料色号:material.list/add → style_save colors[].fabricMaterialId,colorCode=物料 color,colorName 必填;勿传 fabricColorNo',
|
|
705
|
+
'色卡选料:material.list(category_code=fieldKey)/add → style_save colors[].colorCardJson;色卡备注:color_card_save(常规 items:[]);PDF/工艺 Excel 导出无 MCP,走前端',
|
|
706
|
+
'物料删除:有绑定订单/生产单引用/比价快照时不可删',
|
|
676
707
|
'craft_save 全量替换:同 styleId 的 jacket+pants 必须一次写入;分次调用后一次会删前一次',
|
|
677
708
|
'craft_save 键名 crafts/craftModule;兼容历史 craft/module;旁框用 note;保存后 craft_get 校验',
|
|
678
709
|
'商标位置 labelType/positionSide 仍用系统字典',
|
|
679
|
-
'
|
|
710
|
+
'轮次可选:询盘可 inquiry→quoted 跳过打样(返单/大货);记在 erp_order action=sample_*,不强制每单建轮次',
|
|
680
711
|
'返单用 erp_order action=copy:复制主档+款式工艺,不复制PI/样衣/生产单,新单 parentOrderId 指向源单',
|
|
681
|
-
'
|
|
682
|
-
'招标仅 draft 可改/可删(cancelled 可删);collecting 可 close/cancel;closed 可 award/cancel;awarded
|
|
712
|
+
'单据编号:customerCode/supplierCode/categoryCode/brandCode/supplierMaterialCode/poNo/bidNo 后端发号勿传;materialCode 手填必传;piNo/orderNo 手填必传(订单复制发26SB01);styleNo 可省略则默认订单号-序号',
|
|
713
|
+
'招标仅 draft 可改/可删(cancelled 可删);collecting 可 close/cancel;closed 可 award/cancel;awarded 不可取消;collecting 不可直接 award',
|
|
683
714
|
'招标 MCP 为内部接口,不含供应商门户 portal/login、portal/quote',
|
|
684
715
|
'所有雪花 ID 入参必须字符串,禁止 number(否则精度丢失导致静默空结果/挂错父对象)'
|
|
685
716
|
],
|
|
@@ -689,14 +720,18 @@ export const ERP_BUSINESS_FLOW = {
|
|
|
689
720
|
/** MCP 服务端内置说明,连接时注入模型上下文 */
|
|
690
721
|
export const ERP_MCP_INSTRUCTIONS = `银蝶 ERP MCP(域工具 + action 模式)。
|
|
691
722
|
|
|
692
|
-
【开场】用户问待办/订单/我是谁 → erp_workbench action=summary 或 current_user。
|
|
723
|
+
【开场】用户问待办/订单/我是谁 → erp_workbench action=summary 或 current_user;需跟单员 ID → action=merchandiser_options。
|
|
693
724
|
【先读资源】复杂写操作前读 yindie://erp/usage-guide(工具用法)和 yindie://erp/business-flow(状态机/约束);写工艺再读 yindie://erp/craft-guide 或 erp_order action=craft_schema;不确定可用 action 时读 yindie://erp/modules。
|
|
694
725
|
|
|
695
726
|
【调用格式】选域工具(erp_customer/erp_order/erp_material 等),必填 action。有子实体时 action 写 target.action,如 customer.add、material.add、price_snapshot.list、thread.link。写操作用 payload 传 JSON 字符串;删用 ids;单条查改 id。所有雪花 ID 必须字符串。
|
|
696
727
|
|
|
697
|
-
【主链路】customer.add → pi.add → order.add → order.link_pi
|
|
728
|
+
【主链路】customer.add → pi.add → order.add → order.link_pi →(面料 material.list/add)order.style_save(colors.fabricMaterialId/colorCode/colorName/colorCardJson) → order.craft_schema → order.craft_save(processNote?) →(可选)order.color_card_save(备注) →(尺寸表)order.size_chart_save + oss.upload×N + attachment_add×3 → order.change_status → production.create_from_order(订单→po_drafting)→ production.check → production.submit_review → production.issue。
|
|
729
|
+
|
|
730
|
+
【工艺】先 craft_schema 拿 fieldKey 与 fieldValueExample,fieldValue 存 JSON 字符串;色卡选料写在 style_save colors[].colorCardJson;色卡页脚备注走 color_card_save(items:[]);商标位置 labelType/positionSide 用系统字典。
|
|
731
|
+
|
|
732
|
+
【物料】新增 material.add(materialCode 手填;fabric 必填 color 色号;lining 必填 composition,前后端均校验);选已有 material.list → 面料色号行填 colors[].fabricMaterialId(colorCode=color,colorName=materialName),色卡选料填 colorCardJson。
|
|
698
733
|
|
|
699
|
-
|
|
734
|
+
【制单】create_from_order(成功后订单强制 po_drafting)→ 补交期等 → check(校验面料/色卡物料)→ submit_review → issue;辅料工艺只读,来自订单 style_save 已选面料与 colorCardJson,一般不调 save_items。
|
|
700
735
|
|
|
701
736
|
【权限】无权限 action 会报错;以 yindie://erp/modules 返回的 actions 为准。`;
|
|
702
737
|
/** 合并工具用法资源 */
|
|
@@ -711,7 +746,10 @@ export const ERP_USAGE_GUIDE = {
|
|
|
711
746
|
{ uri: 'yindie://erp/current-user', when: '问「我是谁」「我的任务」' }
|
|
712
747
|
],
|
|
713
748
|
domains: {
|
|
714
|
-
erp_workbench: {
|
|
749
|
+
erp_workbench: {
|
|
750
|
+
actions: ['summary', 'current_user', 'merchandiser_options'],
|
|
751
|
+
note: '入口,优先 summary;建单/分派前 merchandiser_options 取 assigneeId'
|
|
752
|
+
},
|
|
715
753
|
erp_customer: {
|
|
716
754
|
actions: ['customer.*', 'contact.*', 'address.*', 'brand.*'],
|
|
717
755
|
note: 'action 示例 customer.add、contact.list;list/get 用 customerId 等筛选'
|
|
@@ -735,8 +773,11 @@ export const ERP_USAGE_GUIDE = {
|
|
|
735
773
|
'style_list',
|
|
736
774
|
'style_save',
|
|
737
775
|
'craft_schema',
|
|
776
|
+
'craft_get',
|
|
738
777
|
'craft_save',
|
|
739
778
|
'size_chart_save',
|
|
779
|
+
'color_card_list',
|
|
780
|
+
'color_card_save',
|
|
740
781
|
'timeline_list',
|
|
741
782
|
'sample_list',
|
|
742
783
|
'sample_add',
|
|
@@ -761,6 +802,7 @@ export const ERP_USAGE_GUIDE = {
|
|
|
761
802
|
'edit',
|
|
762
803
|
'remove',
|
|
763
804
|
'craft_schema',
|
|
805
|
+
'craft_get',
|
|
764
806
|
'craft_save',
|
|
765
807
|
'create_from_order',
|
|
766
808
|
'save_items',
|
|
@@ -770,7 +812,7 @@ export const ERP_USAGE_GUIDE = {
|
|
|
770
812
|
'reject_review',
|
|
771
813
|
'issue'
|
|
772
814
|
],
|
|
773
|
-
note: 'create_from_order 用 orderId;issue 需 reviewing 且 issue 权限'
|
|
815
|
+
note: 'create_from_order 用 orderId,成功后订单→po_drafting;issue 需 reviewing 且 issue 权限'
|
|
774
816
|
},
|
|
775
817
|
erp_task: { actions: ['list', 'get', 'add', 'edit', 'remove'] },
|
|
776
818
|
erp_material: {
|
|
@@ -792,6 +834,10 @@ export const ERP_USAGE_GUIDE = {
|
|
|
792
834
|
intent: '查工作台',
|
|
793
835
|
call: { tool: 'erp_workbench', action: 'summary' }
|
|
794
836
|
},
|
|
837
|
+
{
|
|
838
|
+
intent: '查跟单员下拉',
|
|
839
|
+
call: { tool: 'erp_workbench', action: 'merchandiser_options' }
|
|
840
|
+
},
|
|
795
841
|
{
|
|
796
842
|
intent: '新建贸易商客户',
|
|
797
843
|
call: {
|
|
@@ -807,7 +853,22 @@ export const ERP_USAGE_GUIDE = {
|
|
|
807
853
|
action: 'style_save',
|
|
808
854
|
payload: {
|
|
809
855
|
orderId: '字符串',
|
|
810
|
-
styles: [
|
|
856
|
+
styles: [
|
|
857
|
+
{
|
|
858
|
+
sampleNo: '样板号',
|
|
859
|
+
shipSampleTip: '每款每色48件单独拿出,出货前 18 天',
|
|
860
|
+
fabricMaterialId: '面料物料ID',
|
|
861
|
+
colors: [
|
|
862
|
+
{
|
|
863
|
+
fabricMaterialId: '面料物料ID',
|
|
864
|
+
colorCode: '物料色号',
|
|
865
|
+
colorName: '颜色名称(必填)',
|
|
866
|
+
colorCardJson: '{"lining":{"materialCode":"LIN-01","materialName":"里布","titleCn":"里布"}}',
|
|
867
|
+
sizes: [{ sizeName: 'M', qty: 120 }]
|
|
868
|
+
}
|
|
869
|
+
]
|
|
870
|
+
}
|
|
871
|
+
]
|
|
811
872
|
}
|
|
812
873
|
}
|
|
813
874
|
},
|
|
@@ -858,6 +919,8 @@ export const ERP_USAGE_GUIDE = {
|
|
|
858
919
|
'order.craft_get': READ_META.erp_order_style_craft_list,
|
|
859
920
|
'order.craft_save': WORKFLOW_META.erp_order_style_craft_save,
|
|
860
921
|
'order.size_chart_save': WORKFLOW_META.erp_order_style_size_chart_save,
|
|
922
|
+
'order.color_card_list': READ_META.erp_order_style_color_card_list,
|
|
923
|
+
'order.color_card_save': WORKFLOW_META.erp_order_style_color_card_save,
|
|
861
924
|
'oss.upload': WORKFLOW_META.erp_oss_upload,
|
|
862
925
|
'order.sample_add': WORKFLOW_META.erp_order_sample_add,
|
|
863
926
|
'order.sample_edit': WORKFLOW_META.erp_order_sample_edit,
|
package/dist/tools-merged.js
CHANGED
|
@@ -16,7 +16,8 @@ const DOMAIN_TEMPLATES = [
|
|
|
16
16
|
hasTarget: false,
|
|
17
17
|
routes: {
|
|
18
18
|
summary: { oldName: 'erp_workbench_summary' },
|
|
19
|
-
current_user: { oldName: 'erp_current_user' }
|
|
19
|
+
current_user: { oldName: 'erp_current_user' },
|
|
20
|
+
merchandiser_options: { oldName: 'erp_merchandiser_options' }
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
{
|
|
@@ -73,7 +74,7 @@ const DOMAIN_TEMPLATES = [
|
|
|
73
74
|
},
|
|
74
75
|
{
|
|
75
76
|
name: 'erp_order',
|
|
76
|
-
summary: '【订单管理】订单 CRUD
|
|
77
|
+
summary: '【订单管理】订单 CRUD、状态、款式工艺、轮次、附件',
|
|
77
78
|
hasTarget: false,
|
|
78
79
|
routes: {
|
|
79
80
|
list: { oldName: 'erp_order_list' },
|
|
@@ -91,6 +92,8 @@ const DOMAIN_TEMPLATES = [
|
|
|
91
92
|
craft_get: { oldName: 'erp_order_style_craft_list' },
|
|
92
93
|
craft_save: { oldName: 'erp_order_style_craft_save' },
|
|
93
94
|
size_chart_save: { oldName: 'erp_order_style_size_chart_save' },
|
|
95
|
+
color_card_list: { oldName: 'erp_order_style_color_card_list' },
|
|
96
|
+
color_card_save: { oldName: 'erp_order_style_color_card_save' },
|
|
94
97
|
timeline_list: { oldName: 'erp_order_timeline_list' },
|
|
95
98
|
sample_list: { oldName: 'erp_order_sample_list' },
|
|
96
99
|
sample_add: { oldName: 'erp_order_sample_add' },
|
|
@@ -108,7 +111,7 @@ const DOMAIN_TEMPLATES = [
|
|
|
108
111
|
},
|
|
109
112
|
{
|
|
110
113
|
name: 'erp_production',
|
|
111
|
-
summary: '【生产管理】生产单 CRUD
|
|
114
|
+
summary: '【生产管理】生产单 CRUD、工艺、校验审核下发;辅料只读来自订单款式配置',
|
|
112
115
|
hasTarget: false,
|
|
113
116
|
routes: {
|
|
114
117
|
list: { oldName: 'erp_production_list' },
|
|
@@ -351,7 +354,7 @@ function inputSchemaFor(tpl, allowed) {
|
|
|
351
354
|
if (tpl.name === 'erp_material') {
|
|
352
355
|
return {
|
|
353
356
|
...base,
|
|
354
|
-
materialCode: z.string().optional().describe('
|
|
357
|
+
materialCode: z.string().optional().describe('物料编码(面料分类即面料号)'),
|
|
355
358
|
materialName: z.string().optional().describe('物料名称'),
|
|
356
359
|
categoryId: optionalId.describe('分类 ID'),
|
|
357
360
|
materialId: optionalId.describe('物料 ID'),
|
package/dist/tools-write.js
CHANGED
|
@@ -87,6 +87,7 @@ export const WRITE_TOOLS = [
|
|
|
87
87
|
}),
|
|
88
88
|
workflowTool('erp_order_style_craft_save', 'erp:order:edit', { payload: z.string().describe(WORKFLOW_META.erp_order_style_craft_save.payload) }, (client, args) => client.post('/erp/order/style/craft/save', normalizeCraftSavePayload(parsePayload(args)))),
|
|
89
89
|
workflowTool('erp_order_style_size_chart_save', 'erp:order:edit', { payload: z.string().describe(WORKFLOW_META.erp_order_style_size_chart_save.payload) }, (client, args) => client.post('/erp/order/style/size-chart', parsePayload(args))),
|
|
90
|
+
workflowTool('erp_order_style_color_card_save', 'erp:order:edit', { payload: z.string().describe(WORKFLOW_META.erp_order_style_color_card_save.payload) }, (client, args) => client.post('/erp/order/style/color-card/save', parsePayload(args))),
|
|
90
91
|
workflowTool('erp_production_craft_save', 'erp:production:edit', { payload: z.string().describe(WORKFLOW_META.erp_production_craft_save.payload) }, (client, args) => client.post('/erp/production/craft/save', normalizeCraftSavePayload(parsePayload(args)))),
|
|
91
92
|
workflowTool('erp_order_sample_add', 'erp:order:edit', { payload: z.string().describe(WORKFLOW_META.erp_order_sample_add.payload) }, (client, args) => client.post('/erp/order/sample', parsePayload(args))),
|
|
92
93
|
workflowTool('erp_order_sample_edit', 'erp:order:edit', { payload: z.string().describe(WORKFLOW_META.erp_order_sample_edit.payload) }, (client, args) => client.put('/erp/order/sample', parsePayload(args))),
|
package/dist/tools.js
CHANGED
|
@@ -60,6 +60,13 @@ const READ_TOOLS = [
|
|
|
60
60
|
inputSchema: {},
|
|
61
61
|
handler: (client) => client.get('/erp/workbench/summary')
|
|
62
62
|
},
|
|
63
|
+
{
|
|
64
|
+
name: 'erp_merchandiser_options',
|
|
65
|
+
description: '查询跟单员下拉选项(userId/userName/nickName),建单/分派前取 assigneeId',
|
|
66
|
+
permission: null,
|
|
67
|
+
inputSchema: {},
|
|
68
|
+
handler: (client) => client.get('/erp/common/merchandiserOptions')
|
|
69
|
+
},
|
|
63
70
|
{
|
|
64
71
|
name: 'erp_customer_list',
|
|
65
72
|
description: '分页查询客户列表,可按客户编码、名称、类型、状态筛选',
|
|
@@ -223,6 +230,15 @@ const READ_TOOLS = [
|
|
|
223
230
|
},
|
|
224
231
|
handler: (client, args) => client.get('/erp/order/style/craft/list', { styleId: asId(args.styleId) })
|
|
225
232
|
},
|
|
233
|
+
{
|
|
234
|
+
name: 'erp_order_style_color_card_list',
|
|
235
|
+
description: '按 styleId 打开色卡编号清单(工艺项 + colorCardCode/materialCode)',
|
|
236
|
+
permission: 'erp:order:query',
|
|
237
|
+
inputSchema: {
|
|
238
|
+
styleId: idField.describe('款式 ID,字符串')
|
|
239
|
+
},
|
|
240
|
+
handler: (client, args) => client.get('/erp/order/style/color-card', { styleId: asId(args.styleId) })
|
|
241
|
+
},
|
|
226
242
|
{
|
|
227
243
|
name: 'erp_production_craft_schema',
|
|
228
244
|
description: '生产单工艺 schema + selectionGuide(同订单)',
|
|
@@ -259,7 +275,7 @@ const READ_TOOLS = [
|
|
|
259
275
|
},
|
|
260
276
|
{
|
|
261
277
|
name: 'erp_order_sample_list',
|
|
262
|
-
description: '
|
|
278
|
+
description: '查询订单轮次(可为空,可不建轮次)',
|
|
263
279
|
permission: 'erp:order:query',
|
|
264
280
|
inputSchema: {
|
|
265
281
|
orderId: idField.describe('订单 ID,字符串')
|
|
@@ -351,7 +367,7 @@ const READ_TOOLS = [
|
|
|
351
367
|
permission: 'erp:material:list',
|
|
352
368
|
inputSchema: {
|
|
353
369
|
...pageShape,
|
|
354
|
-
materialCode: z.string().optional().describe('
|
|
370
|
+
materialCode: z.string().optional().describe('物料编码(面料分类即面料号)'),
|
|
355
371
|
materialName: z.string().optional().describe('物料名称'),
|
|
356
372
|
categoryId: optionalId.describe('分类 ID,字符串')
|
|
357
373
|
},
|
|
@@ -393,7 +409,7 @@ const READ_TOOLS = [
|
|
|
393
409
|
inputSchema: {
|
|
394
410
|
...pageShape,
|
|
395
411
|
productName: z.string().optional().describe('品名'),
|
|
396
|
-
materialCode: z.string().optional().describe('
|
|
412
|
+
materialCode: z.string().optional().describe('物料编码(面料分类即面料号)'),
|
|
397
413
|
categoryName: z.string().optional().describe('品类'),
|
|
398
414
|
domain: z.string().optional().describe('比价口径 domestic/export')
|
|
399
415
|
},
|