weaver-work-cli 0.1.25 → 0.1.28

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.
Files changed (173) hide show
  1. package/README.md +35 -30
  2. package/dist/cmd/root.js +1 -0
  3. package/dist/cmd/setup/index.js +1 -1
  4. package/dist/core/runtime-agent.js +19 -0
  5. package/dist/internal/e10/auth/commands.js +48 -33
  6. package/dist/internal/e10/auth/messages.js +3 -0
  7. package/dist/internal/e10/auth/session.js +8 -0
  8. package/dist/internal/e10/auth/xiaoe.js +62 -43
  9. package/dist/internal/e10/auth-recovery.js +148 -0
  10. package/dist/internal/e10/client.js +47 -15
  11. package/dist/internal/e10/context.js +9 -31
  12. package/dist/internal/e10/index.js +1 -0
  13. package/dist/internal/e10/request-runtime.js +51 -9
  14. package/dist/shortcuts/archive/host.js +3 -2
  15. package/dist/shortcuts/archive/manifest.js +1 -1
  16. package/dist/shortcuts/archive-oa/constants.js +66 -0
  17. package/dist/shortcuts/archive-oa/continuation.js +70 -0
  18. package/dist/shortcuts/archive-oa/errors.js +53 -0
  19. package/dist/shortcuts/archive-oa/host.js +158 -0
  20. package/dist/shortcuts/archive-oa/index.js +225 -0
  21. package/dist/shortcuts/archive-oa/manifest.js +62 -0
  22. package/dist/shortcuts/archive-oa/operations/borrow-car.js +159 -0
  23. package/dist/shortcuts/archive-oa/operations/borrow-url.js +108 -0
  24. package/dist/shortcuts/archive-oa/operations/confirm.js +48 -0
  25. package/dist/shortcuts/archive-oa/operations/contract.js +120 -0
  26. package/dist/shortcuts/archive-oa/operations/locate.js +50 -0
  27. package/dist/shortcuts/archive-oa/operations/registry.js +40 -0
  28. package/dist/shortcuts/archive-oa/operations/shared.js +181 -0
  29. package/dist/shortcuts/archive-oa/operations/types.js +45 -0
  30. package/dist/shortcuts/archive-oa/operations.js +13 -0
  31. package/dist/shortcuts/asset/host.js +7 -6
  32. package/dist/shortcuts/blog/host.js +4 -3
  33. package/dist/shortcuts/caizhilian/host.js +3 -2
  34. package/dist/shortcuts/caizhilian/manifest.js +1 -1
  35. package/dist/shortcuts/calendar/host.js +2 -1
  36. package/dist/shortcuts/contract/host.js +34 -59
  37. package/dist/shortcuts/ehr/host.js +2 -1
  38. package/dist/shortcuts/esb/host.js +2 -1
  39. package/dist/shortcuts/fna/host.js +6 -3
  40. package/dist/shortcuts/fna/manifest.js +10 -5
  41. package/dist/shortcuts/fna/operations/expense-chart.js +162 -0
  42. package/dist/shortcuts/fna/operations/registry.js +2 -0
  43. package/dist/shortcuts/hrm/host.js +2 -1
  44. package/dist/shortcuts/im/host.js +3 -2
  45. package/dist/shortcuts/index.js +2 -0
  46. package/dist/shortcuts/invoice/host.js +9 -7
  47. package/dist/shortcuts/invoice/manifest.js +38 -47
  48. package/dist/shortcuts/invoice/operations/issuing-qys.js +328 -0
  49. package/dist/shortcuts/invoice/operations/registry.js +2 -3
  50. package/dist/shortcuts/jiuchuanhui/host.js +2 -1
  51. package/dist/shortcuts/mail/host.js +2 -1
  52. package/dist/shortcuts/meeting/host.js +2 -1
  53. package/dist/shortcuts/meeting/operations/eb/conflict.js +78 -12
  54. package/dist/shortcuts/okr/host.js +2 -1
  55. package/dist/shortcuts/plan/host.js +2 -1
  56. package/dist/shortcuts/project/host.js +2 -1
  57. package/dist/shortcuts/workflow/endpoints.js +11 -0
  58. package/dist/shortcuts/workflow/host.js +5 -7
  59. package/dist/shortcuts/workflow/index.js +6 -36
  60. package/dist/shortcuts/workflow/operations/chatscene.js +252 -0
  61. package/dist/shortcuts/workflow/operations/form.js +1047 -191
  62. package/dist/shortcuts/workflow/operations/read.js +137 -8
  63. package/dist/shortcuts/workflow/operations/sign-input.js +106 -0
  64. package/dist/shortcuts/workflow/operations/write.js +9 -1
  65. package/dist/shortcuts/workflow/stdout-compact.js +16 -1
  66. package/docs/SKILL.md +1 -1
  67. package/docs/_catalog.md +1 -1
  68. package/docs/agent-invoice.md +1 -1
  69. package/docs/archive-oa.md +79 -0
  70. package/docs/caizhilian.md +1 -1
  71. package/docs/e10-auth.md +7 -6
  72. package/docs/fna.md +7 -3
  73. package/docs/invoice.md +4 -6
  74. package/package.json +1 -1
  75. package/skill-template/business-info.json +20 -1
  76. package/skill-template/domains/archive-oa.md +19 -0
  77. package/skill-template/domains/caizhilian.md +2 -1
  78. package/skill-template/domains/qiyecheng.md +1 -0
  79. package/skill-template/domains/yepiaotong.md +8 -4
  80. package/skill-template/skill-template.md +1 -0
  81. package/skills/weaver-e10-archive-oa/SKILL.md +159 -0
  82. package/skills/weaver-e10-archive-oa/references/archive-locate.md +49 -0
  83. package/skills/weaver-e10-archive-oa/references/borrow-car.md +76 -0
  84. package/skills/weaver-e10-archive-oa/references/borrow-flow.md +53 -0
  85. package/skills/weaver-e10-archive-oa/references/contract-search.md +63 -0
  86. package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +29 -0
  87. package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +47 -0
  88. package/skills/weaver-e10-archive-oa/references/source-manifest.json +400 -0
  89. package/skills/weaver-e10-blog/SKILL.md +6 -1
  90. package/skills/weaver-e10-blog/references/blog-query.md +3 -1
  91. package/skills/weaver-e10-builder/SKILL.md +22 -0
  92. package/skills/weaver-e10-caizhilian/SKILL.md +47 -16
  93. package/skills/weaver-e10-caizhilian/references/action-flow.md +70 -0
  94. package/skills/weaver-e10-caizhilian/references/agent-entry.md +12 -4
  95. package/skills/weaver-e10-caizhilian/references/auth-and-install.md +207 -0
  96. package/skills/weaver-e10-caizhilian/references/collaboration.md +5 -3
  97. package/skills/weaver-e10-caizhilian/references/document.md +33 -11
  98. package/skills/weaver-e10-caizhilian/references/file-collection.md +57 -54
  99. package/skills/weaver-e10-caizhilian/references/file-upload.md +5 -6
  100. package/skills/weaver-e10-caizhilian/references/files.md +9 -3
  101. package/skills/weaver-e10-caizhilian/references/folder.md +48 -16
  102. package/skills/weaver-e10-caizhilian/references/host-executor-prompt.md +32 -0
  103. package/skills/weaver-e10-caizhilian/references/host-platform-integration.md +46 -0
  104. package/skills/weaver-e10-caizhilian/references/rule-index.md +56 -0
  105. package/skills/weaver-e10-caizhilian/references/setting-attach.md +17 -54
  106. package/skills/weaver-e10-caizhilian/references/setting-backup.md +16 -63
  107. package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +24 -64
  108. package/skills/weaver-e10-caizhilian/references/setting-storage-docs-summary.md +126 -0
  109. package/skills/weaver-e10-caizhilian/references/setting-storage-field-map.md +57 -0
  110. package/skills/weaver-e10-caizhilian/references/setting-storage.md +143 -548
  111. package/skills/weaver-e10-caizhilian/references/source-manifest.json +7 -7
  112. package/skills/weaver-e10-caizhilian/references/task-workflow.md +87 -0
  113. package/skills/weaver-e10-caizhilian/references/withheld.md +21 -45
  114. package/skills/weaver-e10-caizhilian/references/write-protocol.md +7 -0
  115. package/skills/weaver-e10-calendar/SKILL.md +6 -1
  116. package/skills/weaver-e10-esb/SKILL.md +8 -0
  117. package/skills/weaver-e10-esb/references/input-format.md +3 -1
  118. package/skills/weaver-e10-esb/references/source-manifest.json +5 -5
  119. package/skills/weaver-e10-hrm/SKILL.md +6 -1
  120. package/skills/weaver-e10-hrm/references/employee.md +1 -1
  121. package/skills/weaver-e10-hrm/references/org.md +1 -1
  122. package/skills/weaver-e10-hrm/references/position.md +1 -1
  123. package/skills/weaver-e10-jinchengda/SKILL.md +2 -1
  124. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +1 -1
  125. package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -1
  126. package/skills/weaver-e10-jucailin/SKILL.md +6 -1
  127. package/skills/weaver-e10-jucailin/references/hr-contact.md +1 -1
  128. package/skills/weaver-e10-jucailin/references/salary.md +1 -1
  129. package/skills/weaver-e10-mail/SKILL.md +6 -1
  130. package/skills/weaver-e10-meeting/SKILL.md +11 -6
  131. package/skills/weaver-e10-meeting/references/meeting-eb.md +7 -3
  132. package/skills/weaver-e10-meeting/references/meeting-queries.md +3 -1
  133. package/skills/weaver-e10-meeting/references/meeting-verification.md +4 -2
  134. package/skills/weaver-e10-okr/SKILL.md +6 -1
  135. package/skills/weaver-e10-okr/references/source-manifest.json +5 -5
  136. package/skills/weaver-e10-plan/SKILL.md +6 -1
  137. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +3 -1
  138. package/skills/weaver-e10-plan/references/plan-report-query.md +3 -1
  139. package/skills/weaver-e10-plan/references/source-manifest.json +7 -7
  140. package/skills/weaver-e10-qiyecheng/SKILL.md +16 -6
  141. package/skills/weaver-e10-qiyecheng/references/catalog.md +6 -3
  142. package/skills/weaver-e10-qiyecheng/references/expense-center.md +2 -0
  143. package/skills/weaver-e10-qiyecheng/references/expense-chart.md +78 -0
  144. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +87 -33
  145. package/skills/weaver-e10-shared/SKILL.md +53 -28
  146. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +22 -20
  147. package/skills/weaver-e10-shared/references/non-interactive-environment.md +13 -13
  148. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +3 -1
  149. package/skills/weaver-e10-wenshuding/SKILL.md +6 -1
  150. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  151. package/skills/weaver-e10-workflow/references/source-manifest.json +33 -24
  152. package/skills/weaver-e10-workflow/references/workflow-create.md +41 -26
  153. package/skills/weaver-e10-yepiaotong/SKILL.md +23 -18
  154. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +87 -45
  155. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +152 -0
  156. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +210 -0
  157. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +59 -36
  158. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +63 -512
  159. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +205 -346
  160. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -5
  161. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +231 -344
  162. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +5 -5
  163. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +201 -162
  164. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +121 -145
  165. package/skills/weaver-e10-yimiaoban/SKILL.md +9 -2
  166. package/skills/weaver-e10-yimiaoban/references/file-user-i18n.md +1 -1
  167. package/skills/weaver-e10-yimiaoban/references/msg-read.md +1 -1
  168. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
  169. package/skills/weaver-e10-ziguanjia/SKILL.md +6 -1
  170. package/dist/shortcuts/invoice/operations/issuing.js +0 -198
  171. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +0 -161
  172. package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +0 -107
  173. package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +0 -119
@@ -1,7 +1,8 @@
1
1
  # 报销 CLI operation 参考文档
2
2
 
3
- > 本文件说明各报销 CLI operation 的入参、返回字段和填单用法。
3
+ > 本文件说明报销**数据准备**阶段各 CLI operation 的入参、返回字段和填单用法。
4
4
  > 实际调用必须通过 `weaver-work-cli --json invoice run <operation>` 执行。认证由 `weaver-work-cli auth` 管理,不要手动传 token / eteamsId。
5
+ > 报销单的创建与修改不在本文件:统一走 `weaver-e10-workflow` 的 `workflow.createForm` / `workflow.createRequest` / `workflow.edit*`,见第 6 节。
5
6
 
6
7
  ---
7
8
 
@@ -66,7 +67,7 @@ weaver-work-cli --json invoice run invoice.reim.file-ocr.preview --input-json '{
66
67
  | `invoiceId` | 发票唯一ID(后续匹配和填单使用) |
67
68
  | `invoiceType` | 发票类型名称 |
68
69
  | `invoiceTypeCode` | 发票类型编码 |
69
- | `amount` | 发票金额 |
70
+ | `amount` | 发票金额(价税合计) |
70
71
  | `consumeContent` | 消费内容/商品名称 |
71
72
  | `invoiceDate` | 开票日期(yyyy-MM-dd) |
72
73
  | `invoiceNumber` | 发票号码 |
@@ -226,8 +227,10 @@ CLI 信封中列表在 `data.items`。下面是单条发票的票面结构(对
226
227
  | `info.comm_info.pro.type` | `invoiceTypeCode` | 发票类型编码(见下方分类说明) |
227
228
  | `info.comm_info.pro.date` | `invoiceDate` | 开票日期(yyyy-MM-dd) |
228
229
  | `info.comm_info.pro.status` | — | 发票状态(**8=全额红冲,必须过滤掉**) |
229
- | `info.comm_info.price.total` | `amount` | 价税合计(发票金额) |
230
- | `info.comm_info.price.amount` | — | 不含税金额 |
230
+ | `info.comm_info.price.total` | `amount` | **价税合计(发票金额)**——报销金额一律用它 |
231
+ | `info.comm_info.price.amount` | — | 不含税金额,**不要拿来填报销金额**(字段名虽叫 `amount`) |
232
+
233
+ > ⚠️ 原始返回里叫 `amount` 的字段**不一定是价税合计**:`invoice.list` / `invoice.get` 的 `price.amount`、`invoice.get` 里的 `amount` 都是**不含税**金额(实测滴滴票 `price.amount=48.61`、`price.total=50.07`)。本技能文档里说的「发票 `amount`」专指上表映射后的**价税合计 `price.total`**。
231
234
  | `info.comm_info.buyer.company` | `buyerName` | 购方公司名称 |
232
235
  | `info.comm_info.payer.company` | `sellerName` | 销方公司名称 |
233
236
  | `info.fylx` | — | 费用类型 ID(需根据 ID 查找对应 `expenseType` 名称) |
@@ -296,8 +299,8 @@ CLI 信封中列表在 `data.items`。下面是单条发票的票面结构(对
296
299
 
297
300
  | 分类 | type 值 | 说明 | 填单位置 |
298
301
  | --- | --- | --- | --- |
299
- | **发票** | 除 17/18/57/58 以外的所有值 | 正式发票,每张独立成一行明细 | `EinvoiceComponent` + `single=false`(相关发票字段) |
300
- | **相关凭证** | 17, 18, 57, 58 | 行程单、小票/水单、电子支付凭证、其他支付凭证,不能独立成行 | `EinvoiceComponent` + `single=true`(相关凭证字段) |
302
+ | **发票** | 除 17/18/57/58 以外的所有值 | 正式发票,每张独立成一行明细 | 明细「相关发票」(`EinvoiceComponent`) |
303
+ | **相关凭证** | 17, 18, 57, 58 | 行程单、小票/水单、电子支付凭证、其他支付凭证,不能独立成行 | 明细「相关凭证」(`EinvoiceComponent`),每行最多 1 张 |
301
304
 
302
305
  **关键规则:相关凭证必须与发票配对,放在同一行明细中,不能单独成行。**
303
306
 
@@ -363,6 +366,33 @@ CLI 信封中列表在 `data.items`。下面是单条发票的票面结构(对
363
366
 
364
367
  ---
365
368
 
369
+ ## 1b. 报销候选发票分类
370
+
371
+ CLI operation:`invoice.reim.candidates.list`(read)
372
+
373
+ 自动翻页拉取未报销(sreim=3)发票,并按 `oreim.list_reim` / 红冲状态分组,**不再需要手动翻页和逐条剔重**。
374
+
375
+ macOS/Linux(bash/zsh):
376
+
377
+ ```bash
378
+ weaver-work-cli --json invoice run invoice.reim.candidates.list --input-json '{"date_begin":"2026-09-14","date_end":"2026-09-21"}'
379
+ ```
380
+
381
+ Windows PowerShell:
382
+
383
+ ```powershell
384
+ weaver-work-cli --json invoice run invoice.reim.candidates.list --input-json '{"date_begin":"2026-09-14","date_end":"2026-09-21"}'
385
+ ```
386
+
387
+ - 入参(全部可选):`date_begin`/`date_end`(YYYY-MM-DD,开票日期范围)、`page_size`(10-200,默认 50)、`max_items`(1-500,默认 200,超出截断并产生 warning)、`include_red_reversed`(默认 `false`)。
388
+ - **红冲票默认已过滤**:全额红冲发票(`status=8`)不出现在任何一组,被过滤的张数由 `summary.filteredRedReversedCount` 告知。需要看红冲票时传 `include_red_reversed: true`,此时它们进 `redReversed` 组。
389
+ - 输出:`available` / `assigned` / `redReversed` 三组,每组元素含 `fid`、`number`、`date`、`total`、`buyer`、`payer`、`typeName`、`status`、`valid`、`reimRequests`;`summary` 给出三组的张数与金额合计;`warnings` 含截断与金额解析告警。
390
+ - **报销范围永远从 `available` 里选**;`assigned` 是已挂在报销单上的(再报 = 重复报销)。
391
+ - `sreim="3"`(未报销)**不会**排除已挂单的发票,判断是否已挂单必须看分组结果(即 `list_reim`)。
392
+ - 两次查询之间发票从 `assigned` 翻到 `available`,通常是原报销单被删除、发票被真实释放,分类本身是准的;只有对某张票的归属存疑时,才用 `weaver-work-cli workflow run workflow.detail --input-json '{"requestId":"<id>"}'` 核实原单是否还在,不要每次报销都逐张复核。
393
+
394
+ ---
395
+
366
396
  ## 2. 查询事前申请流程列表
367
397
 
368
398
  CLI operation:`invoice.reim.requests.list`
@@ -477,241 +507,6 @@ weaver-work-cli --json invoice run invoice.reim.requests.list --input-json '{"pa
477
507
  | `nodeid` | 当前节点ID |
478
508
 
479
509
 
480
- ---
481
-
482
- ## 3. 获取报销单表单字段结构
483
-
484
- CLI operation:`invoice.reim.form.structure`
485
-
486
- ### 入参
487
-
488
-
489
- | 参数 | 类型 | 必填 | 说明 |
490
- | ------------ | ------ | --- | ------------ |
491
- | `workflowId` | String | 是 | 工作流ID |
492
- | `nodeId` | String | 否 | 节点ID,默认 `1` |
493
-
494
-
495
- ### 命令
496
-
497
- Windows PowerShell:
498
-
499
- ```powershell
500
- weaver-work-cli --json invoice run invoice.reim.form.structure --input-json '{"workflowId":"1181057526276915214"}'
501
- ```
502
-
503
- macOS/Linux(bash/zsh):
504
-
505
- ```bash
506
- weaver-work-cli --json invoice run invoice.reim.form.structure --input-json '{"workflowId":"1181057526276915214"}'
507
- ```
508
-
509
- ### 返回示例
510
-
511
- ```json
512
- {
513
- "code": 200,
514
- "msg": "接口返回成功",
515
- "status": true,
516
- "data": {
517
- "mainFormId": "1181057741029226975",
518
- "mainFields": [
519
- {
520
- "fieldId": "1181057741029227445",
521
- "fieldName": "申请人",
522
- "fieldType": "Employee",
523
- "single": true,
524
- "marked": true
525
- },
526
- {
527
- "fieldId": "1181057741029227446",
528
- "fieldName": "部门",
529
- "fieldType": "Department",
530
- "single": true,
531
- "marked": true
532
- },
533
- {
534
- "fieldId": "1181057741029227447",
535
- "fieldName": "报销日期",
536
- "fieldType": "DateComponent",
537
- "single": true,
538
- "marked": false
539
- },
540
- {
541
- "fieldId": "1181057741029227448",
542
- "fieldName": "相关人员",
543
- "fieldType": "Text",
544
- "single": true,
545
- "marked": false
546
- },
547
- {
548
- "fieldId": "1181057741029227454",
549
- "fieldName": "报销方式",
550
- "fieldType": "Select",
551
- "single": true,
552
- "marked": false,
553
- "options": [
554
- {"optionId": "1181057741029227903", "optionName": "银行(个人报销)", "optionValue": "7"},
555
- {"optionId": "1181057741029227900", "optionName": "冲销借款", "optionValue": "4"},
556
- {"optionId": "1181057741029227904", "optionName": "银行(付公司)", "optionValue": "6"}
557
- ]
558
- },
559
- {
560
- "fieldId": "1181057741029227456",
561
- "fieldName": "报销事由",
562
- "fieldType": "TextArea",
563
- "single": false,
564
- "marked": false
565
- },
566
- {
567
- "fieldId": "1181057741029227470",
568
- "fieldName": "相关流程",
569
- "fieldType": "Workflow",
570
- "single": false,
571
- "marked": true
572
- }
573
- ],
574
- "subTables": [
575
- {
576
- "subFormId": "1181057741029227992",
577
- "subFormName": "费用明细",
578
- "subFields": [
579
- {
580
- "fieldId": "1181057741029227449",
581
- "fieldName": "相关客户",
582
- "fieldType": "Ebuilder",
583
- "single": true,
584
- "marked": true
585
- },
586
- {
587
- "fieldId": "1181057741029227450",
588
- "fieldName": "相关项目",
589
- "fieldType": "Ebuilder",
590
- "single": true,
591
- "marked": true
592
- },
593
- {
594
- "fieldId": "1181057741029227459",
595
- "fieldName": "实报金额",
596
- "fieldType": "Money",
597
- "single": true,
598
- "marked": false
599
- },
600
- {
601
- "fieldId": "1181057741029227463",
602
- "fieldName": "费用类型(科目)",
603
- "fieldType": "RelateBrowser",
604
- "single": true,
605
- "marked": true
606
- },
607
- {
608
- "fieldId": "1181057741029227464",
609
- "fieldName": "费用说明",
610
- "fieldType": "Text",
611
- "single": false,
612
- "marked": false
613
- },
614
- {
615
- "fieldId": "1181057741029227465",
616
- "fieldName": "附件数",
617
- "fieldType": "NumberComponent",
618
- "single": true,
619
- "marked": false
620
- },
621
- {
622
- "fieldId": "1181057741029227467",
623
- "fieldName": "费用日期",
624
- "fieldType": "DateComponent",
625
- "single": true,
626
- "marked": false
627
- }
628
- ]
629
- }
630
- ]
631
- },
632
- "fail": false
633
- }
634
- ```
635
-
636
- ### 字段类型对照表
637
-
638
-
639
- | fieldType | 说明 | fieldValue 格式 | 示例 |
640
- | ----------------- | ---------- | ------------- | ----------------------- |
641
- | `Employee` | 员工选择 | 用户ID | `"1201729946891231232"` |
642
- | `Department` | 部门选择 | 部门ID | `"1201729461554241537"` |
643
- | `DateComponent` | 日期 | yyyy-MM-dd | `"2026-08-04"` |
644
- | `Text` | 单行文本 | 文本字符串 | `"差旅报销"` |
645
- | `TextArea` | 多行文本 | 文本字符串 | `"详细说明..."` |
646
- | `Select` | 下拉选择 | optionValue 值 | `"7"` |
647
- | `Money` | 金额 | 数字字符串 | `"820.00"` |
648
- | `NumberComponent` | 数字 | 数字字符串 | `"5"` |
649
- | `Workflow` | 关联流程 | 流程requestId | `"1298294241967177729"` |
650
- | `RelateBrowser` | 关联浏览 | 关联数据ID | `"2087459027187551811"` |
651
- | `Ebuilder` | Ebuilder关联 | 关联数据ID | `"2087459027187551811"` |
652
-
653
-
654
- ---
655
-
656
- ## 4. 模糊搜索字段关联值
657
-
658
- CLI operation:`invoice.reim.field.search`
659
-
660
- 用于 `marked = true` 的字段,通过名称关键词查找对应的数据ID。
661
-
662
- ### 入参
663
-
664
-
665
- | 参数 | 类型 | 必填 | 说明 |
666
- | -------------- | ------ | --- | ------------- |
667
- | `keywords` | String | 是 | 搜索关键词 |
668
- | `fieldId` | String | 是 | 目标字段的 fieldId |
669
- | `workflowId` | String | 是 | 工作流ID |
670
- | `nodeId` | String | 否 | 默认由 CLI 填充 |
671
-
672
-
673
- ### 命令
674
-
675
- Windows PowerShell:
676
-
677
- ```powershell
678
- weaver-work-cli --json invoice run invoice.reim.field.search --input-json '{"keywords":"强","fieldId":"1250065066476052720","workflowId":"1250064959163990031"}'
679
- ```
680
-
681
- macOS/Linux(bash/zsh):
682
-
683
- ```bash
684
- weaver-work-cli --json invoice run invoice.reim.field.search --input-json '{"keywords":"强","fieldId":"1250065066476052720","workflowId":"1250064959163990031"}'
685
- ```
686
-
687
- ### 返回示例
688
-
689
- ```json
690
- {
691
- "code": 200,
692
- "msg": "接口返回成功",
693
- "status": true,
694
- "data": [
695
- {
696
- "name": "袁强强",
697
- "id": "2765669800318484102",
698
- "value": "2765669800318484102"
699
- }
700
- ],
701
- "fail": false
702
- }
703
- ```
704
-
705
- ### 使用策略
706
-
707
-
708
- | 返回结果数 | 处理方式 |
709
- | ----- | -------------------------------------- |
710
- | 1个 | 直接使用 `value` 作为 `fieldValue` |
711
- | 多个 | 展示候选列表让用户选择 |
712
- | 0个 | 缩短关键词重试;仍无结果则 `fieldValue` 留空,提示用户手动填写 |
713
-
714
-
715
510
  ---
716
511
 
717
512
  ## 5. 获取报销单工作流ID
@@ -769,7 +564,7 @@ weaver-work-cli --json invoice run invoice.reim.workflow.resolve --input-json '{
769
564
  | 字段 | 说明 |
770
565
  | -------------------------------------------- | ----------------------------------------------- |
771
566
  | `requestWorkflowMap` | 事前申请ID → 对应报销单工作流的映射 |
772
- | `requestWorkflowMap[requestId].workFlowId` | 对应的报销单工作流ID(用于 `invoice.reim.form.structure` 和 work_flow_id) |
567
+ | `requestWorkflowMap[requestId].workFlowId` | 对应的报销单工作流ID(与 `workFlowName` 拼成 `名称(ID)` 传给 `workflow.createForm`) |
773
568
  | `requestWorkflowMap[requestId].workFlowName` | 报销单流程名称 |
774
569
 
775
570
 
@@ -839,7 +634,7 @@ weaver-work-cli --json invoice run invoice.reim.workflow.resolve --input-json '{
839
634
 
840
635
  CLI operation:`invoice.reim.employee-superiors`
841
636
 
842
- 获取当前登录人员的基本信息及其所有上级人员列表。**用于填写表单中"报销人上级"、"承担人直接上级"和"承担人所有上级"字段(均为必填)。**
637
+ 获取当前登录人员的基本信息及其所有上级人员列表。**兜底用**:承担主体、报销人上级、承担人直接上级、承担人所有上级通常由报销表单默认值带出;只有 `workflow.createForm` 的 `fields` 里这些字段没有 `initialValue`,或 `createRequest` 的 `missingFields` 列出它们时才调用(见 [reim-workflow.md](reim-workflow.md) Step 3.7)。
843
638
 
844
639
  ### 命令
845
640
 
@@ -904,9 +699,9 @@ weaver-work-cli --json invoice run invoice.reim.employee-superiors --input-json
904
699
 
905
700
  | 表单字段 | 取值方式 |
906
701
  | --- | --- |
907
- | 报销人上级 | `directSuperior.id`(直接上级 ID,直接赋值;**不是 `allSuperiors[0]`**) |
908
- | 承担人直接上级 | `directSuperior.id`(同上) |
909
- | 承担人所有上级 | `allSuperiors` 中所有 `id` 用逗号拼接(如 `"id1,id2,id3"`) |
702
+ | 承担主体 / 申请人 | `{currentEmployee.name}({currentEmployee.id})` |
703
+ | 报销人上级 / 承担人直接上级 | `{directSuperior.name}({directSuperior.id})`(**不是 `allSuperiors[0]`**) |
704
+ | 承担人所有上级 | `allSuperiors` 每项写成 `名称(ID)` 组成的数组 |
910
705
 
911
706
  ---
912
707
 
@@ -947,8 +742,12 @@ weaver-work-cli --json invoice run invoice.reim.row-info --input-json '{"invoice
947
742
  | ----------- | ---------------- | ---------------------------------------- |
948
743
  | `date` | 费用日期 | 费用日期/发生日期 |
949
744
  | `fysm` | 费用说明 | 费用说明/摘要 |
950
- | `itinerary` | 关联凭证 ID(多个用逗号拼接) | 相关凭证(`EinvoiceComponent`, `single=true`) |
745
+ | `itinerary` | 关联凭证 ID(多个用逗号拼接) | 相关凭证(`EinvoiceComponent`,每行最多 1 张) |
951
746
  | `subjectId` | 费用科目 ID | 费用类型(科目) |
747
+ | `subjectName` | 费用科目名称 | 与 `subjectId` 拼成 `名称(ID)` |
748
+ | `sqje` / `sbje` | 整张发票的申请金额 | 仅参考;金额字段填发票价税合计(`price.total`) |
749
+ | `containsItinerary` | 是否关联了行程单 | — |
750
+ | `itineraryData` | **行程单逐段明细**数组,每段含 `date`、`sqje`(该段金额)、`fysm`(`{起点} - {终点}`)、`subjectId` / `subjectName`、`itinerary`(凭证 ID)、`invoiceId` | **暂不拆行**;只在 `invoice.get` 取不到起止点时给费用说明兜底,见 [reim-form-fill-rules.md](reim-form-fill-rules.md#4-行程单多段行程暂不拆行) |
952
751
 
953
752
 
954
753
  ### 返回示例
@@ -971,7 +770,8 @@ weaver-work-cli --json invoice run invoice.reim.row-info --input-json '{"invoice
971
770
  - **调用时机**:Step 4 组装明细行时,对每张发票调用 `invoice.reim.row-info`
972
771
  - **优先级**:此 CLI 返回的 `date`、`fysm`、`itinerary`、`subjectId` 四个值**优先于 AI 自行推断的值**
973
772
  - **容错**:如果某个字段为空/null,则回退到 AI 推断逻辑
974
- - **itinerary 处理**:如果 `itinerary` 有值(可能逗号分隔多个 ID),直接填入相关凭证字段(`EinvoiceComponent`+`single=true`),**替代原有的凭证配对逻辑**
773
+ - **itinerary 处理**:如果 `itinerary` 有值,直接作为该行的配对凭证,**替代原有的凭证配对逻辑**;先用 `invoice.browse-field.data` 取凭证对象再填入「相关凭证」。逗号分隔返回多个时,每行只挂最匹配的 1 张(规则见 [reim-form-fill-rules.md](reim-form-fill-rules.md#3-凭证与发票配对))
774
+ - **itineraryData 处理**:暂不拆行,不管几段都是一张发票一行;只用来给费用说明兜底(第一段起点 - 最后一段终点)
975
775
 
976
776
  ---
977
777
 
@@ -1045,8 +845,6 @@ weaver-work-cli --json invoice run invoice.reim.row-info-batch --input-json '{"i
1045
845
 
1046
846
  - **手工组装报销单时**(Step 3.5),用 `row-info-batch` 替代 N 次 `row-info` 调用
1047
847
  - 部分失败不影响其他发票,失败的回退到 AI 推断逻辑
1048
- - 快速路径(`template.build`/`auto-prepare`)内部已自带批量获取,无需额外调用
1049
-
1050
848
  ---
1051
849
 
1052
850
  ## 5.7 获取发票详情(交通类发票行程信息)
@@ -1139,281 +937,34 @@ weaver-work-cli --json invoice run invoice.get --input-json '{"fid":"13019569599
1139
937
 
1140
938
  ---
1141
939
 
1142
- ## 6. 生成报销单流程
1143
-
1144
- CLI operation:`invoice.reim.flow.create.prepare` → 用户确认 → `invoice.reim.flow.create.apply`
1145
-
1146
- > **⚠️ 禁止重复创建:同一组发票数据只能创建一次。创建成功后,修改报销单请用 `invoice.reim.flow.update.prepare/apply`,不要再次调用 create。**
940
+ ## 5.8 取发票字段对象
1147
941
 
1148
- 将填单结构化 JSON 作为 operation 顶层入参提交到 CLI,生成报销单流程。不要再包一层通用 `payload`。
942
+ CLI operation:`invoice.browse-field.data`(read)
1149
943
 
1150
- ### 入参
1151
-
1152
- 入参即 Step 4 组装的完整填单 JSON(结构定义见 [form-fill-rules.md](reim-form-fill-rules.md#最终输出结构)),字段会在 `inputSchema.properties` 中逐项暴露,并作为请求体(JSON Body)提交到 E10。
1153
-
1154
-
1155
- | 字段 | 类型 | 必填 | 说明 |
1156
- | ------------------- | ------ | --- | -------------------------------- |
1157
- | `work_flow_id` | String | 是 | 目标报销流程的工作流ID |
1158
- | `mainFormId` | String | 是 | 报销单主表formId(来自 `invoice.reim.form.structure`) |
1159
- | `request_name` | String | 是 | 流程标题 |
1160
- | `main_fields` | Array | 是 | 主表字段值列表 |
1161
- | `detail_rows` | Array | 是 | 明细表行数据 |
1162
- | `need_user_confirm` | Array | 否 | 需用户确认的字段 |
1163
- | `unable_to_fill` | Array | 否 | 无法自动填写的字段 |
1164
-
1165
-
1166
- ### 命令
1167
-
1168
- 将 Step 4 的 JSON 作为 operation 顶层输入写入文件,先 prepare,用户确认后再 apply。
1169
-
1170
- Windows PowerShell:
1171
-
1172
- ```powershell
1173
- weaver-work-cli --json invoice run invoice.reim.flow.create.prepare --input .\reim-create.json
1174
- ```
944
+ 报销单明细的「相关发票」「相关凭证」都是 `EinvoiceComponent`,**只接受发票对象,不接受文本或裸 ID**。一次传入本组全部发票与配对凭证的 `fid`,按 `fid` 把返回对象放进对应行。入参与对象结构见 [invoice-browse-field-data.md](invoice-browse-field-data.md)。
1175
945
 
1176
946
  macOS/Linux(bash/zsh):
1177
947
 
1178
948
  ```bash
1179
- weaver-work-cli --json invoice run invoice.reim.flow.create.prepare --input ./reim-create.json
1180
- ```
1181
-
1182
- 顶层输入示例:
1183
-
1184
- ```json
1185
- {
1186
- "work_flow_id": "1181057526276915214",
1187
- "mainFormId": "1181057741029226975",
1188
- "request_name": "交通费报销-后端开发111-2026-08-04(共1笔)",
1189
- "main_fields": [
1190
- {"fieldId": "1181057741029227445", "value": "1201729946891231232", "fieldName": "申请人"},
1191
- {"fieldId": "1181057741029227447", "value": "2026-08-04", "fieldName": "报销日期"},
1192
- {"fieldId": "1181057741029227454", "optionValue": "7", "fieldName": "报销方式"}
1193
- ],
1194
- "detail_rows": [
1195
- {
1196
- "dataIndex": 1,
1197
- "subFormId": "1181057741029227992",
1198
- "invoiceId": "1295366637717012482",
1199
- "fields": [
1200
- {"fieldId": "1181057741029227459", "value": "108.2", "fieldName": "实报金额"},
1201
- {"fieldId": "1181057741029227467", "value": "2026-07-30", "fieldName": "费用日期"}
1202
- ]
1203
- }
1204
- ],
1205
- "need_user_confirm": [],
1206
- "unable_to_fill": []
1207
- }
1208
- ```
1209
-
1210
- ### 返回示例
1211
-
1212
- ```json
1213
- {
1214
- "code": 200,
1215
- "msg": "接口返回成功",
1216
- "status": true,
1217
- "data": {
1218
- "requestId": "1300266422434136064"
1219
- }
1220
- }
949
+ weaver-work-cli --json invoice run invoice.browse-field.data --input-json '{"fids":["1295366637717012482","1298798990831518001"]}'
1221
950
  ```
1222
951
 
1223
- ### 返回字段说明
1224
-
1225
-
1226
- | 字段 | 说明 |
1227
- | ---------------- | -------------------- |
1228
- | `data.requestId` | 创建成功的报销单流程 requestId |
1229
-
1230
-
1231
- ### 创建成功后
1232
-
1233
- `invoice.reim.flow.create.apply` 返回 `requestId`、`requestName` 和 `viewUrl`。用 Markdown 链接展示给用户,锚文本用流程标题,链接用 CLI 返回的 `viewUrl`,不要自己拼接地址。
952
+ Windows PowerShell:
1234
953
 
1235
- ```markdown
1236
- 报销单已创建成功!点击查看:[交通费报销-后端开发111-2026-08-04(共1笔)](viewUrl)
954
+ ```powershell
955
+ weaver-work-cli --json invoice run invoice.browse-field.data --input-json '{"fids":["1295366637717012482","1298798990831518001"]}'
1237
956
  ```
1238
957
 
1239
958
  ---
1240
959
 
1241
- ## 7. 更新报销单流程
1242
-
1243
- CLI operation:`invoice.reim.flow.update.prepare` → 用户确认 → `invoice.reim.flow.update.apply`
1244
-
1245
- 更新已创建的报销流程表单。支持三种操作的任意组合,互不阻断:
1246
-
1247
- - **修改主表字段** — 更新主表中的字段值
1248
- - **修改/新增明细行字段** — 更新或新增明细表中的行数据
1249
- - **删除指定明细行** — 按明细表ID + 行号删除
1250
-
1251
- ### 入参
1252
-
1253
-
1254
- | 字段 | 类型 | 必填 | 说明 |
1255
- | ------------------ | ----------- | --- | --------------------------------------------- |
1256
- | `requestId` | Long | 是 | 要更新的流程 requestId(`invoice.reim.flow.create.apply` 返回的 requestId) |
1257
- | `mainFormId` | String | 是 | 报销单主表ID(来自 `invoice.reim.form.structure` 返回的 `mainFormId`) |
1258
- | `deleteDetailRows` | Array | 否 | 要删除的明细行,见下方格式 |
1259
- | `main_fields` | ArrayObject | 否 | 需要更新的主表字段列表 |
1260
- | `detail_rows` | ArrayObject | 否 | 需要更新/新增的明细行数据 |
1261
-
1262
-
1263
- #### deleteDetailRows 格式
1264
-
1265
- **推荐使用对象数组**(精确指定明细表):
1266
-
1267
- ```json
1268
- "deleteDetailRows": [
1269
- {"subFormId": "1169534588649275663", "dataIndex": 1},
1270
- {"subFormId": "1169534588649275663", "dataIndex": 3}
1271
- ]
1272
- ```
1273
-
1274
-
1275
- | 字段 | 类型 | 说明 |
1276
- | ----------- | ------- | ------------------------------ |
1277
- | `subFormId` | String | 明细表ID,指定从哪个明细表删除 |
1278
- | `dataIndex` | Integer | 行号(1-based),传 `-1` 表示删除该明细表全部行 |
1279
-
1280
-
1281
- 也支持**简写整数数组**(删除所有明细表中对应行):`[1, 3]` 或 `[-1]`(删全部)
1282
-
1283
- #### 字段对象(main_fields / detail_rows.fields 通用)
1284
-
960
+ ## 6. 创建 / 修改报销单(`weaver-e10-workflow`)
1285
961
 
1286
- | 字段 | 类型 | 必填 | 说明 |
1287
- | ---------------- | ------- | --- | ---------------------------- |
1288
- | `fieldId` | String | 是 | 字段ID |
1289
- | `fieldName` | String | 否 | 字段名称(便于理解,不参与逻辑) |
1290
- | `value` | String | 否 | 字段值(与 optionValue 二选一) |
1291
- | `optionValue` | String | 否 | 选项型字段的 optionId(与 value 二选一) |
1292
- | `unable_to_fill` | Boolean | 否 | `true` 表示该字段无法填写,跳过 |
1293
- | `need_search` | Boolean | 否 | `true` 表示该字段需要搜索确认,跳过 |
962
+ 报销单创建与修改不再使用本技能的 operation,统一调用 `weaver-e10-workflow` 技能:
1294
963
 
964
+ | 动作 | 命令 | 契约 |
965
+ | --- | --- | --- |
966
+ | 载入报销表单 | `workflow.createForm`(`workflow` 传 `{workFlowName}({workFlowId})`) | [`workflow-create.md`](../../weaver-e10-workflow/references/workflow-create.md) |
967
+ | 创建报销单(固定存草稿) | `workflow.createRequest`(`context` + `data` + `action` + `requestName`) | 同上 |
968
+ | 修改已创建的报销单 | `workflow.editLoad` → `workflow.editPrepare` → `workflow.editApply` | [`workflow-edit.md`](../../weaver-e10-workflow/references/workflow-edit.md) |
1295
969
 
1296
- #### detail_rows 行对象
1297
-
1298
-
1299
- | 字段 | 类型 | 必填 | 说明 |
1300
- | ----------- | ----------- | --- | ----------------- |
1301
- | `subFormId` | String | 是 | 明细表ID,表示该行属于哪个明细表 |
1302
- | `dataIndex` | Long | 是 | 明细行号(1-based),第几行 |
1303
- | `fields` | ArrayObject | 是 | 该行中要更新的字段列表 |
1304
-
1305
-
1306
- ### 执行顺序
1307
-
1308
- > **删除操作先于表单更新执行,但删除失败不会阻断表单更新。**
1309
-
1310
- ### 命令
1311
-
1312
- 将以下 JSON 作为 operation 顶层输入写入文件,先 `invoice.reim.flow.update.prepare`,用户确认后再 `.apply`。
1313
-
1314
- ### 顶层输入示例
1315
-
1316
- #### 场景1:同时删除明细第2行 + 修改主表 + 更新第1行明细
1317
-
1318
- ```json
1319
- {
1320
- "requestId": 1300266422434136064,
1321
- "mainFormId": "1169534588649275463",
1322
- "deleteDetailRows": [
1323
- {"subFormId": "1169534588649275663", "dataIndex": 2}
1324
- ],
1325
- "main_fields": [
1326
- {"fieldId": "1169534588649275901", "fieldName": "申请日期", "value": "2026-08-05"}
1327
- ],
1328
- "detail_rows": [
1329
- {
1330
- "subFormId": "1169534588649275663",
1331
- "dataIndex": 1,
1332
- "fields": [
1333
- {"fieldId": "1169534588649275988", "fieldName": "货物或应税劳务、服务名称", "value": "1297537820896575492"},
1334
- {"fieldId": "1169534588649275989", "fieldName": "金额", "value": "500.00"}
1335
- ]
1336
- }
1337
- ]
1338
- }
1339
- ```
1340
-
1341
- #### 场景2:仅删除某个明细表的第1行和第3行
1342
-
1343
- ```json
1344
- {
1345
- "requestId": 1300266422434136064,
1346
- "mainFormId": "1169534588649275463",
1347
- "deleteDetailRows": [
1348
- {"subFormId": "1169534588649275663", "dataIndex": 1},
1349
- {"subFormId": "1169534588649275663", "dataIndex": 3}
1350
- ]
1351
- }
1352
- ```
1353
-
1354
- #### 场景3:删除某个明细表全部行
1355
-
1356
- ```json
1357
- {
1358
- "requestId": 1300266422434136064,
1359
- "mainFormId": "1169534588649275463",
1360
- "deleteDetailRows": [
1361
- {"subFormId": "1169534588649275663", "dataIndex": -1}
1362
- ]
1363
- }
1364
- ```
1365
-
1366
- #### 场景4:仅修改明细行
1367
-
1368
- ```json
1369
- {
1370
- "requestId": 1300266422434136064,
1371
- "mainFormId": "1169534588649275463",
1372
- "detail_rows": [
1373
- {
1374
- "subFormId": "1169534588649275663",
1375
- "dataIndex": 1,
1376
- "fields": [
1377
- {"fieldId": "1169534588649275988", "fieldName": "货物或应税劳务、服务名称", "value": "1297537820896575492"}
1378
- ]
1379
- }
1380
- ]
1381
- }
1382
- ```
1383
-
1384
- ### 返回示例
1385
-
1386
- ```json
1387
- {
1388
- "code": 200,
1389
- "status": true,
1390
- "msg": "更新成功",
1391
- "data": {
1392
- "requestId": "1300266422434136064",
1393
- "deleteDetailSuccess": true,
1394
- "updateFormSuccess": true
1395
- }
1396
- }
1397
- ```
1398
-
1399
- ### 返回字段说明
1400
-
1401
-
1402
- | 字段 | 说明 |
1403
- | -------------------------- | ----------------------------------------- |
1404
- | `data.requestId` | 流程 requestId |
1405
- | `data.deleteDetailSuccess` | 明细行删除结果(仅当传了 deleteDetailRows 时返回) |
1406
- | `data.deleteDetailMsg` | 删除失败原因(仅失败时返回) |
1407
- | `data.updateFormSuccess` | 表单更新结果(仅当有 main_fields 或 detail_rows 时返回) |
1408
- | `data.updateFormMsg` | 更新失败原因(仅失败时返回) |
1409
-
1410
-
1411
- ### 注意事项
1412
-
1413
- - `mainFormId` 来自 `invoice.reim.form.structure` 返回的 `mainFormId`,每次调用 `invoice.reim.flow.update.prepare/apply` 必传
1414
- - `dataIndex` 是 **1-based**(从1开始),对应明细表中的第1行、第2行...
1415
- - `subFormId` 是明细表ID,一个流程表单可能有多个明细表,需准确指定
1416
- - 删除操作先于表单更新执行,删除失败不阻断表单更新
1417
- - `fieldName` 仅用于可读性,不参与业务逻辑
1418
- - 如果只删除不修改,只传 `requestId` + `deleteDetailRows` 即可
1419
- - `value` 为空、`unable_to_fill=true`、`need_search=true` 的字段会被自动跳过
970
+ `data` 的组装规则见 [reim-form-fill-rules.md](reim-form-fill-rules.md),编排顺序见 [reim-workflow.md](reim-workflow.md) Step 3 ~ Step 6。