@besile/scm-cli 2026.3.32 → 2026.3.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besile/scm-cli",
3
- "version": "2026.3.32",
3
+ "version": "2026.3.33",
4
4
  "description": "SCM CLI — Supply Chain Management CLI Tool",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -15,57 +15,57 @@ export const MaterialOrdersList = {
15
15
  scopes: [],
16
16
  hasFormat: true,
17
17
  flags: [
18
- { name: 'open-id', type: 'string', required: true, description: '飞书用户 openId' },
19
- { name: 'page-no', type: 'number', default: 1, description: '页码' },
20
- { name: 'page-size', type: 'number', default: 20, description: '每页条数' },
18
+ { name: 'openId', type: 'string', required: true, description: '飞书用户 openId' },
19
+ { name: 'pageNo', type: 'number', default: 1, description: '页码' },
20
+ { name: 'pageSize', type: 'number', default: 20, description: '每页条数' },
21
21
  // 订单信息
22
- { name: 'order-no', type: 'string', description: '物料订单号' },
22
+ { name: 'orderNo', type: 'string', description: '物料订单号' },
23
23
  { name: 'status', type: 'string', description: '物料订单状态: 0-待采购|1-采购中|2-部分到货|3-已到货|4-已取消' },
24
- { name: 'cooperation-mode', type: 'string', description: '合作模式: 0-CMT|1-FOB' },
24
+ { name: 'cooperationMode', type: 'string', description: '合作模式: 0-CMT|1-FOB' },
25
25
  // 商品信息
26
- { name: 'goods-full-code', type: 'string', description: '大货款号' },
27
- { name: 'goods-batch', type: 'string', description: '大货批次' },
28
- { name: 'goods-type', type: 'string', description: '大货类型: 0-首单|1-加单|2-翻单' },
26
+ { name: 'goodsFullCode', type: 'string', description: '大货款号' },
27
+ { name: 'goodsBatch', type: 'string', description: '大货批次' },
28
+ { name: 'goodsType', type: 'string', description: '大货类型: 0-首单|1-加单|2-翻单' },
29
29
  // 供应商
30
- { name: 'supplier-name', type: 'string', description: '供应商名称' },
30
+ { name: 'supplierName', type: 'string', description: '供应商名称' },
31
31
  // 人员
32
- { name: 'purchaser-id-list', type: 'string', description: '采购员 ID 列表 (逗号分隔)' },
33
- { name: 'pd-user-id-list', type: 'string', description: 'PD ID 列表 (逗号分隔)' },
34
- { name: 'designer-name', type: 'string', description: '设计师名称' },
32
+ { name: 'purchaserIdList', type: 'string', description: '采购员 ID 列表 (逗号分隔)' },
33
+ { name: 'pdUserIdList', type: 'string', description: 'PD ID 列表 (逗号分隔)' },
34
+ { name: 'designerName', type: 'string', description: '设计师名称' },
35
35
  // 时间
36
36
  { name: 'type', type: 'string', description: '时间查询类型: 0-上市|1-下单|2-交期|3-调整|4-关单|5-生产下单|6-工厂接单|7-计划到货|8-实际到货|9-需求到货' },
37
- { name: 'start-time', type: 'string', description: '开始时间 (ISO 8601)' },
38
- { name: 'end-time', type: 'string', description: '结束时间 (ISO 8601)' },
37
+ { name: 'startTime', type: 'string', description: '开始时间 (ISO 8601)' },
38
+ { name: 'endTime', type: 'string', description: '结束时间 (ISO 8601)' },
39
39
  ],
40
40
 
41
41
  async execute(internal, runtime) {
42
42
  const f = runtime.flags;
43
- const openId = f['open-id'];
43
+ const openId = f['openId'];
44
44
  const token = await scmClient.getToken(openId, null, null);
45
45
 
46
46
  const filter = {
47
- pageNo: parseInt(f['page-no']) || 1,
48
- pageSize: Math.min(parseInt(f['page-size']) || 20, 100),
47
+ pageNo: parseInt(f['pageNo']) || 1,
48
+ pageSize: Math.min(parseInt(f['pageSize']) || 20, 100),
49
49
  };
50
50
 
51
51
  // 订单信息
52
- if (f['order-no']) filter.orderNo = f['order-no'];
52
+ if (f['orderNo']) filter.orderNo = f['orderNo'];
53
53
  if (f['status'] !== undefined) filter.status = parseInt(f['status']);
54
- if (f['cooperation-mode'] !== undefined) filter.cooperationMode = parseInt(f['cooperation-mode']);
54
+ if (f['cooperationMode'] !== undefined) filter.cooperationMode = parseInt(f['cooperationMode']);
55
55
  // 商品信息
56
- if (f['goods-full-code']) filter.goodsFullCode = f['goods-full-code'];
57
- if (f['goods-batch']) filter.goodsBatch = f['goods-batch'];
58
- if (f['goods-type'] !== undefined) filter.goodsType = parseInt(f['goods-type']);
56
+ if (f['goodsFullCode']) filter.goodsFullCode = f['goodsFullCode'];
57
+ if (f['goodsBatch']) filter.goodsBatch = f['goodsBatch'];
58
+ if (f['goodsType'] !== undefined) filter.goodsType = parseInt(f['goodsType']);
59
59
  // 供应商
60
- if (f['supplier-name']) filter.supplierName = f['supplier-name'];
60
+ if (f['supplierName']) filter.supplierName = f['supplierName'];
61
61
  // 人员
62
- if (f['purchaser-id-list']) filter.purchaserIdList = f['purchaser-id-list'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
63
- if (f['pd-user-id-list']) filter.pdUserIdList = f['pd-user-id-list'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
64
- if (f['designer-name']) filter.designerName = f['designer-name'];
62
+ if (f['purchaserIdList']) filter.purchaserIdList = f['purchaserIdList'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
63
+ if (f['pdUserIdList']) filter.pdUserIdList = f['pdUserIdList'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
64
+ if (f['designerName']) filter.designerName = f['designerName'];
65
65
  // 时间
66
66
  if (f['type'] !== undefined) filter.type = parseInt(f['type']);
67
- if (f['start-time']) filter.startTime = f['start-time'];
68
- if (f['end-time']) filter.endTime = f['end-time'];
67
+ if (f['startTime']) filter.startTime = f['startTime'];
68
+ if (f['endTime']) filter.endTime = f['endTime'];
69
69
 
70
70
  const body = { domain: 'goods_material', action: 'query', filter };
71
71
  const endpoint = '/admin-api/api/ai-scm/execute';
@@ -18,13 +18,13 @@ export const ProductionOrdersList = {
18
18
  scopes: [],
19
19
  hasFormat: true,
20
20
  flags: [
21
- { name: 'open-id', type: 'string', required: true, description: '飞书用户 openId' },
22
- { name: 'page-no', type: 'number', default: 1, description: '页码,从 1 开始' },
23
- { name: 'page-size', type: 'number', default: 20, description: '每页条数,最大 100' },
21
+ { name: 'openId', type: 'string', required: true, description: '飞书用户 openId' },
22
+ { name: 'pageNo', type: 'number', default: 1, description: '页码,从 1 开始' },
23
+ { name: 'pageSize', type: 'number', default: 20, description: '每页条数,最大 100' },
24
24
  ],
25
25
 
26
26
  async execute(internal, runtime) {
27
- const { 'open-id': openId, 'page-no': pageNo, 'page-size': pageSize } = runtime.flags;
27
+ const { 'openId': openId, 'pageNo': pageNo, 'pageSize': pageSize } = runtime.flags;
28
28
  const token = await scmClient.getToken(openId, null, null);
29
29
 
30
30
  const body = {
@@ -18,62 +18,62 @@ export const ProductionOrdersQuery = {
18
18
  scopes: [],
19
19
  hasFormat: true,
20
20
  flags: [
21
- { name: 'open-id', type: 'string', required: true, description: '飞书用户 openId' },
22
- { name: 'page-no', type: 'number', default: 1, description: '页码' },
23
- { name: 'page-size', type: 'number', default: 20, description: '每页条数' },
21
+ { name: 'openId', type: 'string', required: true, description: '飞书用户 openId' },
22
+ { name: 'pageNo', type: 'number', default: 1, description: '页码' },
23
+ { name: 'pageSize', type: 'number', default: 20, description: '每页条数' },
24
24
  // 订单状态
25
- { name: 'prod-status', type: 'string', description: '生产订单状态: -1-全部|0-待确定|1-待同步|2-在途中|3-已完成|100-已取消' },
26
- { name: 'confirm-supplier', type: 'string', description: '确认供应商: 0-未确认|1-已确认' },
27
- { name: 'supplier-order-status', type: 'string', description: '供应商订单状态' },
28
- { name: 'quotation-status', type: 'string', description: '报价单状态' },
29
- { name: 'wash-status', type: 'string', description: '洗唛订单状态' },
25
+ { name: 'prodStatus', type: 'string', description: '生产订单状态: -1-全部|0-待确定|1-待同步|2-在途中|3-已完成|100-已取消' },
26
+ { name: 'confirmSupplier', type: 'string', description: '确认供应商: 0-未确认|1-已确认' },
27
+ { name: 'supplierOrderStatus', type: 'string', description: '供应商订单状态' },
28
+ { name: 'quotationStatus', type: 'string', description: '报价单状态' },
29
+ { name: 'washStatus', type: 'string', description: '洗唛订单状态' },
30
30
  // 商品信息
31
- { name: 'goods-full-code', type: 'string', description: '大货款号' },
32
- { name: 'goods-batch', type: 'string', description: '大货批次' },
33
- { name: 'goods-type', type: 'string', description: '大货类型: 0-首单|1-加单|2-翻单' },
31
+ { name: 'goodsFullCode', type: 'string', description: '大货款号' },
32
+ { name: 'goodsBatch', type: 'string', description: '大货批次' },
33
+ { name: 'goodsType', type: 'string', description: '大货类型: 0-首单|1-加单|2-翻单' },
34
34
  // 供应商
35
- { name: 'supplier-name', type: 'string', description: '供应商名称' },
36
- { name: 'cooperation-mode', type: 'string', description: '合作模式: 0-CMT|1-FOB' },
35
+ { name: 'supplierName', type: 'string', description: '供应商名称' },
36
+ { name: 'cooperationMode', type: 'string', description: '合作模式: 0-CMT|1-FOB' },
37
37
  // 人员
38
- { name: 'designer-name', type: 'string', description: '设计师名称' },
38
+ { name: 'designerName', type: 'string', description: '设计师名称' },
39
39
  // 时间
40
40
  { name: 'type', type: 'string', description: '时间类型: 0-上市|1-下单|2-交期...' },
41
- { name: 'start-time', type: 'string', description: '开始时间 (ISO 8601)' },
42
- { name: 'end-time', type: 'string', description: '结束时间 (ISO 8601)' },
41
+ { name: 'startTime', type: 'string', description: '开始时间 (ISO 8601)' },
42
+ { name: 'endTime', type: 'string', description: '结束时间 (ISO 8601)' },
43
43
  // 状态标识
44
- { name: 'qc-inspection', type: 'string', description: 'QC 质检结果' },
44
+ { name: 'qcInspection', type: 'string', description: 'QC 质检结果' },
45
45
  // 分类
46
- { name: 'sale-area', type: 'string', description: '销售地区 ID 列表(逗号分隔)' },
46
+ { name: 'saleArea', type: 'string', description: '销售地区 ID 列表(逗号分隔)' },
47
47
  ],
48
48
 
49
49
  async execute(internal, runtime) {
50
50
  const f = runtime.flags;
51
- const openId = f['open-id'];
51
+ const openId = f['openId'];
52
52
 
53
53
  const token = await scmClient.getToken(openId, null, null);
54
54
 
55
55
  const filter = {
56
- pageNo: parseInt(f['page-no']) || 1,
57
- pageSize: Math.min(parseInt(f['page-size']) || 20, 100),
56
+ pageNo: parseInt(f['pageNo']) || 1,
57
+ pageSize: Math.min(parseInt(f['pageSize']) || 20, 100),
58
58
  };
59
59
 
60
60
  // Optional filters
61
- if (f['prod-status'] !== undefined) filter.prodStatus = parseInt(f['prod-status']);
62
- if (f['confirm-supplier'] !== undefined) filter.confirmSupplier = parseInt(f['confirm-supplier']);
63
- if (f['supplier-order-status'] !== undefined) filter.supplierOrderStatus = parseInt(f['supplier-order-status']);
64
- if (f['quotation-status'] !== undefined) filter.quotationStatus = parseInt(f['quotation-status']);
65
- if (f['wash-status'] !== undefined) filter.washStatus = parseInt(f['wash-status']);
66
- if (f['goods-full-code']) filter.goodsFullCode = f['goods-full-code'];
67
- if (f['goods-batch']) filter.goodsBatch = f['goods-batch'];
68
- if (f['goods-type'] !== undefined) filter.goodsType = parseInt(f['goods-type']);
69
- if (f['supplier-name']) filter.supplierName = f['supplier-name'];
70
- if (f['cooperation-mode'] !== undefined) filter.cooperationMode = parseInt(f['cooperation-mode']);
71
- if (f['designer-name']) filter.designerName = f['designer-name'];
61
+ if (f['prodStatus'] !== undefined) filter.prodStatus = parseInt(f['prodStatus']);
62
+ if (f['confirmSupplier'] !== undefined) filter.confirmSupplier = parseInt(f['confirmSupplier']);
63
+ if (f['supplierOrderStatus'] !== undefined) filter.supplierOrderStatus = parseInt(f['supplierOrderStatus']);
64
+ if (f['quotationStatus'] !== undefined) filter.quotationStatus = parseInt(f['quotationStatus']);
65
+ if (f['washStatus'] !== undefined) filter.washStatus = parseInt(f['washStatus']);
66
+ if (f['goodsFullCode']) filter.goodsFullCode = f['goodsFullCode'];
67
+ if (f['goodsBatch']) filter.goodsBatch = f['goodsBatch'];
68
+ if (f['goodsType'] !== undefined) filter.goodsType = parseInt(f['goodsType']);
69
+ if (f['supplierName']) filter.supplierName = f['supplierName'];
70
+ if (f['cooperationMode'] !== undefined) filter.cooperationMode = parseInt(f['cooperationMode']);
71
+ if (f['designerName']) filter.designerName = f['designerName'];
72
72
  if (f['type'] !== undefined) filter.type = parseInt(f['type']);
73
- if (f['start-time']) filter.startTime = f['start-time'];
74
- if (f['end-time']) filter.endTime = f['end-time'];
75
- if (f['qc-inspection'] !== undefined) filter.qcInspection = parseInt(f['qc-inspection']);
76
- if (f['sale-area']) filter.saleArea = f['sale-area'].split(',').map(Number);
73
+ if (f['startTime']) filter.startTime = f['startTime'];
74
+ if (f['endTime']) filter.endTime = f['endTime'];
75
+ if (f['qcInspection'] !== undefined) filter.qcInspection = parseInt(f['qcInspection']);
76
+ if (f['saleArea']) filter.saleArea = f['saleArea'].split(',').map(Number);
77
77
 
78
78
  const body = { domain: 'production_order', action: 'query', filter };
79
79
 
@@ -15,59 +15,59 @@ export const QcOrdersList = {
15
15
  scopes: [],
16
16
  hasFormat: true,
17
17
  flags: [
18
- { name: 'open-id', type: 'string', required: true, description: '飞书用户 openId' },
19
- { name: 'page-no', type: 'number', default: 1, description: '页码' },
20
- { name: 'page-size', type: 'number', default: 10, description: '每页条数' },
18
+ { name: 'openId', type: 'string', required: true, description: '飞书用户 openId' },
19
+ { name: 'pageNo', type: 'number', default: 1, description: '页码' },
20
+ { name: 'pageSize', type: 'number', default: 10, description: '每页条数' },
21
21
  // 订单状态
22
- { name: 'qc-order-status', type: 'string', description: 'QC 订单状态: -1-全部|0-待分配|1-已分配|2-已完成|3-已取消' },
22
+ { name: 'qcOrderStatus', type: 'string', description: 'QC 订单状态: -1-全部|0-待分配|1-已分配|2-已完成|3-已取消' },
23
23
  // 商品信息
24
- { name: 'goods-full-code', type: 'string', description: '大货款号' },
25
- { name: 'goods-type', type: 'string', description: '大货类型: 1-大货|2-翻单|3-补料' },
26
- { name: 'goods-grade-list', type: 'string', description: '商品分级列表 (逗号分隔)' },
24
+ { name: 'goodsFullCode', type: 'string', description: '大货款号' },
25
+ { name: 'goodsType', type: 'string', description: '大货类型: 1-大货|2-翻单|3-补料' },
26
+ { name: 'goodsGradeList', type: 'string', description: '商品分级列表 (逗号分隔)' },
27
27
  // 供应商
28
- { name: 'supplier-name', type: 'string', description: '供应商名称' },
28
+ { name: 'supplierName', type: 'string', description: '供应商名称' },
29
29
  // 人员
30
- { name: 'mid-manager', type: 'string', description: '中查管理人员' },
31
- { name: 'check-goods', type: 'string', description: '查货人员' },
32
- { name: 'tail-manager', type: 'string', description: '尾查管理人员' },
33
- { name: 'qc-user-id-list', type: 'string', description: 'QC 用户 ID 列表 (逗号分隔)' },
34
- { name: 'prod-manager-id-list', type: 'string', description: '生产经理 ID 列表 (逗号分隔)' },
35
- { name: 'purchaser-id-list', type: 'string', description: '采购员 ID 列表 (逗号分隔)' },
30
+ { name: 'midManager', type: 'string', description: '中查管理人员' },
31
+ { name: 'checkGoods', type: 'string', description: '查货人员' },
32
+ { name: 'tailManager', type: 'string', description: '尾查管理人员' },
33
+ { name: 'qcUserIdList', type: 'string', description: 'QC 用户 ID 列表 (逗号分隔)' },
34
+ { name: 'prodManagerIdList', type: 'string', description: '生产经理 ID 列表 (逗号分隔)' },
35
+ { name: 'purchaserIdList', type: 'string', description: '采购员 ID 列表 (逗号分隔)' },
36
36
  // 时间
37
- { name: 'time-type', type: 'string', description: '时间类型: 0-预约验货|1-下单|2-接单|3-分配|4-完成|5-交期' },
38
- { name: 'start-time', type: 'string', description: '开始时间 (ISO 8601)' },
39
- { name: 'end-time', type: 'string', description: '结束时间 (ISO 8601)' },
37
+ { name: 'timeType', type: 'string', description: '时间类型: 0-预约验货|1-下单|2-接单|3-分配|4-完成|5-交期' },
38
+ { name: 'startTime', type: 'string', description: '开始时间 (ISO 8601)' },
39
+ { name: 'endTime', type: 'string', description: '结束时间 (ISO 8601)' },
40
40
  ],
41
41
 
42
42
  async execute(internal, runtime) {
43
43
  const f = runtime.flags;
44
- const openId = f['open-id'];
44
+ const openId = f['openId'];
45
45
  const token = await scmClient.getToken(openId, null, null);
46
46
 
47
47
  const filter = {
48
- pageNo: parseInt(f['page-no']) || 1,
49
- pageSize: Math.min(parseInt(f['page-size']) || 10, 100),
48
+ pageNo: parseInt(f['pageNo']) || 1,
49
+ pageSize: Math.min(parseInt(f['pageSize']) || 10, 100),
50
50
  };
51
51
 
52
52
  // 订单状态
53
- if (f['qc-order-status'] !== undefined) filter.qcOrderStatus = parseInt(f['qc-order-status']);
53
+ if (f['qcOrderStatus'] !== undefined) filter.qcOrderStatus = parseInt(f['qcOrderStatus']);
54
54
  // 商品信息
55
- if (f['goods-full-code']) filter.goodsFullCode = f['goods-full-code'];
56
- if (f['goods-type'] !== undefined) filter.goodsType = parseInt(f['goods-type']);
57
- if (f['goods-grade-list']) filter.goodsGradeList = f['goods-grade-list'].split(',').map(s => s.trim());
55
+ if (f['goodsFullCode']) filter.goodsFullCode = f['goodsFullCode'];
56
+ if (f['goodsType'] !== undefined) filter.goodsType = parseInt(f['goodsType']);
57
+ if (f['goodsGradeList']) filter.goodsGradeList = f['goodsGradeList'].split(',').map(s => s.trim());
58
58
  // 供应商
59
- if (f['supplier-name']) filter.supplierName = f['supplier-name'];
59
+ if (f['supplierName']) filter.supplierName = f['supplierName'];
60
60
  // 人员
61
- if (f['mid-manager']) filter.midManager = f['mid-manager'];
62
- if (f['check-goods']) filter.checkGoods = f['check-goods'];
63
- if (f['tail-manager']) filter.tailManager = f['tail-manager'];
64
- if (f['qc-user-id-list']) filter.qcUserIdList = f['qc-user-id-list'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
65
- if (f['prod-manager-id-list']) filter.prodManagerIdList = f['prod-manager-id-list'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
66
- if (f['purchaser-id-list']) filter.purchaserIdList = f['purchaser-id-list'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
61
+ if (f['midManager']) filter.midManager = f['midManager'];
62
+ if (f['checkGoods']) filter.checkGoods = f['checkGoods'];
63
+ if (f['tailManager']) filter.tailManager = f['tailManager'];
64
+ if (f['qcUserIdList']) filter.qcUserIdList = f['qcUserIdList'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
65
+ if (f['prodManagerIdList']) filter.prodManagerIdList = f['prodManagerIdList'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
66
+ if (f['purchaserIdList']) filter.purchaserIdList = f['purchaserIdList'].split(',').map(s => parseInt(s.trim())).filter(n => !isNaN(n));
67
67
  // 时间
68
- if (f['time-type'] !== undefined) filter.timeType = parseInt(f['time-type']);
69
- if (f['start-time']) filter.startTime = f['start-time'];
70
- if (f['end-time']) filter.endTime = f['end-time'];
68
+ if (f['timeType'] !== undefined) filter.timeType = parseInt(f['timeType']);
69
+ if (f['startTime']) filter.startTime = f['startTime'];
70
+ if (f['endTime']) filter.endTime = f['endTime'];
71
71
 
72
72
  const body = { domain: 'qc_order', action: 'query', filter };
73
73
  const endpoint = '/admin-api/api/ai-scm/execute';