weaver-work-cli 0.1.25 → 0.1.26
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/README.md +30 -30
- package/dist/cmd/root.js +1 -0
- package/dist/core/runtime-agent.js +19 -0
- package/dist/internal/e10/auth/commands.js +47 -27
- package/dist/internal/e10/auth/xiaoe.js +62 -43
- package/dist/internal/e10/context.js +5 -27
- package/dist/shortcuts/archive-oa/constants.js +66 -0
- package/dist/shortcuts/archive-oa/continuation.js +70 -0
- package/dist/shortcuts/archive-oa/errors.js +53 -0
- package/dist/shortcuts/archive-oa/host.js +157 -0
- package/dist/shortcuts/archive-oa/index.js +225 -0
- package/dist/shortcuts/archive-oa/manifest.js +62 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +159 -0
- package/dist/shortcuts/archive-oa/operations/borrow-url.js +108 -0
- package/dist/shortcuts/archive-oa/operations/confirm.js +48 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +120 -0
- package/dist/shortcuts/archive-oa/operations/locate.js +50 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +40 -0
- package/dist/shortcuts/archive-oa/operations/shared.js +181 -0
- package/dist/shortcuts/archive-oa/operations/types.js +45 -0
- package/dist/shortcuts/archive-oa/operations.js +13 -0
- package/dist/shortcuts/index.js +2 -0
- package/dist/shortcuts/invoice/host.js +2 -1
- package/dist/shortcuts/invoice/manifest.js +111 -0
- package/dist/shortcuts/invoice/operations/issuing-qys.js +361 -0
- package/dist/shortcuts/invoice/operations/issuing.js +5 -5
- package/dist/shortcuts/invoice/operations/registry.js +4 -0
- package/dist/shortcuts/workflow/endpoints.js +11 -0
- package/dist/shortcuts/workflow/host.js +2 -2
- package/dist/shortcuts/workflow/index.js +6 -36
- package/dist/shortcuts/workflow/operations/chatscene.js +270 -0
- package/dist/shortcuts/workflow/operations/form.js +899 -158
- package/dist/shortcuts/workflow/operations/read.js +111 -6
- package/dist/shortcuts/workflow/operations/sign-input.js +106 -0
- package/dist/shortcuts/workflow/operations/write.js +9 -1
- package/dist/shortcuts/workflow/stdout-compact.js +9 -1
- package/docs/archive-oa.md +79 -0
- package/docs/e10-auth.md +7 -6
- package/package.json +1 -1
- package/skill-template/business-info.json +16 -0
- package/skill-template/domains/archive-oa.md +19 -0
- package/skill-template/domains/yepiaotong.md +2 -2
- package/skills/weaver-e10-archive-oa/SKILL.md +159 -0
- package/skills/weaver-e10-archive-oa/references/archive-locate.md +49 -0
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +76 -0
- package/skills/weaver-e10-archive-oa/references/borrow-flow.md +53 -0
- package/skills/weaver-e10-archive-oa/references/contract-search.md +63 -0
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +29 -0
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +47 -0
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +400 -0
- package/skills/weaver-e10-builder/SKILL.md +22 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +37 -15
- package/skills/weaver-e10-caizhilian/references/agent-entry.md +7 -3
- package/skills/weaver-e10-caizhilian/references/collaboration.md +5 -3
- package/skills/weaver-e10-caizhilian/references/document.md +33 -11
- package/skills/weaver-e10-caizhilian/references/file-collection.md +4 -3
- package/skills/weaver-e10-caizhilian/references/file-upload.md +2 -3
- package/skills/weaver-e10-caizhilian/references/files.md +9 -3
- package/skills/weaver-e10-caizhilian/references/folder.md +48 -16
- package/skills/weaver-e10-caizhilian/references/setting-attach.md +13 -39
- package/skills/weaver-e10-caizhilian/references/setting-backup.md +13 -51
- package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +20 -51
- package/skills/weaver-e10-caizhilian/references/setting-storage.md +82 -147
- package/skills/weaver-e10-caizhilian/references/withheld.md +20 -44
- package/skills/weaver-e10-shared/SKILL.md +22 -20
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +14 -15
- package/skills/weaver-e10-shared/references/non-interactive-environment.md +10 -10
- package/skills/weaver-e10-workflow/references/source-manifest.json +32 -22
- package/skills/weaver-e10-workflow/references/workflow-create.md +68 -28
- package/skills/weaver-e10-yepiaotong/SKILL.md +10 -7
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +49 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-qys-ledger.md +66 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +59 -36
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +54 -509
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +182 -345
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -5
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +153 -345
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +182 -154
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +96 -0
- package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +0 -119
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 完整端到端示例
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 数据准备通过 `weaver-work-cli --json invoice run <operation> --input-json '<json>'` 执行;报销单创建/修改通过 `weaver-work-cli --json workflow run workflow.createForm|createRequest|editLoad|editPrepare|editApply` 执行(`weaver-e10-workflow` 技能)。
|
|
4
4
|
> 认证由 `weaver-work-cli auth` 管理,无需手动传 token/eteamsId。
|
|
5
5
|
> 复杂 JSON 建议先写入 UTF-8 文件再用 `--input <path>` 传入。
|
|
6
6
|
|
|
@@ -253,7 +253,7 @@ weaver-work-cli --json invoice run invoice.reim.requests.list --input-json '{"pa
|
|
|
253
253
|
}
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
### Step 2.5: 获取报销单工作流
|
|
256
|
+
### Step 2.5: 获取报销单工作流
|
|
257
257
|
|
|
258
258
|
**命令:**
|
|
259
259
|
|
|
@@ -277,217 +277,172 @@ weaver-work-cli --json invoice run invoice.reim.workflow.resolve --input-json '{
|
|
|
277
277
|
"data": {
|
|
278
278
|
"requestWorkflowMap": {
|
|
279
279
|
"1298294241967177729": {
|
|
280
|
-
"workFlowId": "
|
|
281
|
-
"workFlowName": "
|
|
280
|
+
"workFlowId": "100003460000000060",
|
|
281
|
+
"workFlowName": "总部费用报销"
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
**决策:** 有事前申请 →
|
|
288
|
+
**决策:** 有事前申请 → 用 `总部费用报销(100003460000000060)` 载入表单。
|
|
289
289
|
|
|
290
|
-
### Step 3:
|
|
290
|
+
### Step 3: 并行载入表单 + 预填信息 + 发票对象
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
Windows PowerShell:
|
|
295
|
-
|
|
296
|
-
```powershell
|
|
297
|
-
weaver-work-cli --json invoice run invoice.reim.form.structure --input-json '{"workflowId":"1181057526276915214"}'
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
macOS/Linux(bash/zsh):
|
|
301
|
-
|
|
302
|
-
```bash
|
|
303
|
-
weaver-work-cli --json invoice run invoice.reim.form.structure --input-json '{"workflowId":"1181057526276915214"}'
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
**返回(简化):**
|
|
307
|
-
|
|
308
|
-
```json
|
|
309
|
-
{
|
|
310
|
-
"code": 200,
|
|
311
|
-
"data": {
|
|
312
|
-
"mainFormId": "1181057741029226975",
|
|
313
|
-
"mainFields": [
|
|
314
|
-
{"fieldId": "1181057741029227445", "fieldName": "申请人", "fieldType": "Employee", "single": true, "marked": true},
|
|
315
|
-
{"fieldId": "1181057741029227446", "fieldName": "部门", "fieldType": "Department", "single": true, "marked": true},
|
|
316
|
-
{"fieldId": "1181057741029227447", "fieldName": "报销日期", "fieldType": "DateComponent", "single": true, "marked": false},
|
|
317
|
-
{"fieldId": "1181057741029227454", "fieldName": "报销方式", "fieldType": "Select", "single": true, "marked": false, "options": [
|
|
318
|
-
{"optionId": "1181057741029227903", "optionName": "银行(个人报销)", "optionValue": "7"},
|
|
319
|
-
{"optionId": "1181057741029227900", "optionName": "冲销借款", "optionValue": "4"},
|
|
320
|
-
{"optionId": "1181057741029227904", "optionName": "银行(付公司)", "optionValue": "6"}
|
|
321
|
-
]},
|
|
322
|
-
{"fieldId": "1181057741029227456", "fieldName": "报销事由", "fieldType": "TextArea", "single": false, "marked": false},
|
|
323
|
-
{"fieldId": "1181057741029227470", "fieldName": "相关流程", "fieldType": "Workflow", "single": false, "marked": true}
|
|
324
|
-
],
|
|
325
|
-
"subTables": [
|
|
326
|
-
{
|
|
327
|
-
"subFormId": "1181057741029227992",
|
|
328
|
-
"subFormName": "费用明细",
|
|
329
|
-
"subFields": [
|
|
330
|
-
{"fieldId": "1181057741029227449", "fieldName": "相关客户", "fieldType": "Ebuilder", "single": true, "marked": true},
|
|
331
|
-
{"fieldId": "1181057741029227450", "fieldName": "相关项目", "fieldType": "Ebuilder", "single": true, "marked": true},
|
|
332
|
-
{"fieldId": "1181057741029227459", "fieldName": "实报金额", "fieldType": "Money", "single": true, "marked": false},
|
|
333
|
-
{"fieldId": "1181057741029227463", "fieldName": "费用类型(科目)", "fieldType": "RelateBrowser", "single": true, "marked": true},
|
|
334
|
-
{"fieldId": "1181057741029227464", "fieldName": "费用说明", "fieldType": "Text", "single": false, "marked": false},
|
|
335
|
-
{"fieldId": "1181057741029227465", "fieldName": "附件数", "fieldType": "NumberComponent", "single": true, "marked": false},
|
|
336
|
-
{"fieldId": "1181057741029227467", "fieldName": "费用日期", "fieldType": "DateComponent", "single": true, "marked": false},
|
|
337
|
-
{"fieldId": "1181057741029227468", "fieldName": "相关发票", "fieldType": "EinvoiceComponent", "single": false, "marked": false},
|
|
338
|
-
{"fieldId": "1181057741029227469", "fieldName": "相关凭证", "fieldType": "EinvoiceComponent", "single": true, "marked": false}
|
|
339
|
-
]
|
|
340
|
-
}
|
|
341
|
-
]
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
### Step 3.5: 获取预填信息 + 费用科目匹配
|
|
347
|
-
|
|
348
|
-
> **自动填单时不调用 `invoice.reim.field.search`**,费用科目通过 `invoice.reim.row-info` 返回的 subjectId 或静态科目列表匹配获取。
|
|
292
|
+
以下四条命令互相独立,**同时发起**。
|
|
349
293
|
|
|
350
|
-
|
|
294
|
+
**① 载入报销表单(`weaver-e10-workflow`):**
|
|
351
295
|
|
|
352
296
|
Windows PowerShell:
|
|
353
297
|
|
|
354
298
|
```powershell
|
|
355
|
-
weaver-work-cli --json
|
|
299
|
+
weaver-work-cli --json workflow run workflow.createForm --input-json '{"workflow":["总部费用报销(100003460000000060)"]}'
|
|
356
300
|
```
|
|
357
301
|
|
|
358
302
|
macOS/Linux(bash/zsh):
|
|
359
303
|
|
|
360
304
|
```bash
|
|
361
|
-
weaver-work-cli --json
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
**返回:**
|
|
365
|
-
|
|
366
|
-
```json
|
|
367
|
-
{
|
|
368
|
-
"code": 200,
|
|
369
|
-
"status": true,
|
|
370
|
-
"data": {
|
|
371
|
-
"date": "2026-07-30",
|
|
372
|
-
"fysm": "交通运输服务",
|
|
373
|
-
"itinerary": "",
|
|
374
|
-
"subjectId": "100502270000000006"
|
|
375
|
-
}
|
|
376
|
-
}
|
|
305
|
+
weaver-work-cli --json workflow run workflow.createForm --input-json '{"workflow":["总部费用报销(100003460000000060)"]}'
|
|
377
306
|
```
|
|
378
307
|
|
|
379
|
-
`
|
|
380
|
-
|
|
381
|
-
> 如果 `subjectId` 为空,则按 [expense-subject-rules.md](reim-expense-subject-rules.md) 静态科目列表匹配:
|
|
382
|
-
> `sellerName` 含"滴滴" → `"100502270000000173"`;`expenseType`="市内交通" → `"100502270000000006"`;匹配不到 → 兜底 `"100502270000000104"`。
|
|
383
|
-
|
|
384
|
-
### Step 4: 组装填单 JSON
|
|
308
|
+
**返回(`fields` 节选,2026-10-21 真实表单):**
|
|
385
309
|
|
|
386
310
|
```json
|
|
387
311
|
{
|
|
388
|
-
"
|
|
389
|
-
"
|
|
390
|
-
"
|
|
391
|
-
"
|
|
392
|
-
{"
|
|
393
|
-
{"
|
|
394
|
-
{"
|
|
395
|
-
{"
|
|
396
|
-
{"
|
|
397
|
-
{"
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
{
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
{"fieldId": "1181057741029227464", "value": "交通运输服务", "fieldName": "费用说明"},
|
|
409
|
-
{"fieldId": "1181057741029227465", "value": "1", "fieldName": "附件数"},
|
|
410
|
-
{"fieldId": "1181057741029227468", "value": "1295366637717012482", "fieldName": "相关发票"},
|
|
411
|
-
{"fieldId": "1181057741029227449", "value": "100504500000311504", "fieldName": "相关客户"}
|
|
412
|
-
]
|
|
413
|
-
}
|
|
414
|
-
],
|
|
415
|
-
"need_user_confirm": [],
|
|
416
|
-
"unable_to_fill": [
|
|
417
|
-
{"fieldId": "1181057741029227450", "fieldName": "相关项目", "reason": "事前申请中无相关项目信息"}
|
|
312
|
+
"status": "FORM_READY",
|
|
313
|
+
"continuation": "wc-9834fa828b86aed3",
|
|
314
|
+
"requestName": "总部费用报销-后端开发111-2026-08-04",
|
|
315
|
+
"fields": [
|
|
316
|
+
{"id": "1256786432515129369", "name": "事前申请流程", "componentKey": "Workflow", "isBrowser": true},
|
|
317
|
+
{"id": "100003720000008409", "name": "承担主体", "componentKey": "Employee", "initialValue": "后端开发111", "isBrowser": true},
|
|
318
|
+
{"id": "100003720000000088", "name": "报销事由", "componentKey": "TextArea"},
|
|
319
|
+
{"id": "100003720000000073", "name": "申请人", "componentKey": "Employee", "initialValue": "后端开发111", "isBrowser": true},
|
|
320
|
+
{"id": "100003720000001376", "name": "合同号", "componentKey": "Text", "initialValue": "20260999"},
|
|
321
|
+
{"id": "100003720000076596", "name": "报销人直接上级", "componentKey": "Employee", "initialValue": "直属主管王五", "isBrowser": true},
|
|
322
|
+
{"id": "100003720000000084", "name": "报销方式", "componentKey": "Select", "initialValue": "银行(个人报销)", "isSelect": true},
|
|
323
|
+
{"id": "100003720000000687", "name": "相关客户", "componentKey": "Ebuilder", "isBrowser": true},
|
|
324
|
+
{"id": "100003720000016373", "name": "申请金额", "subFormId": "100003690000000011", "componentKey": "NumberComponent"},
|
|
325
|
+
{"id": "100003720000000684", "name": "相关流程", "subFormId": "100003690000000011", "componentKey": "Workflow", "isBrowser": true},
|
|
326
|
+
{"id": "100003720000000360", "name": "费用类型(科目)", "subFormId": "100003690000000011", "componentKey": "RelateBrowser", "isBrowser": true},
|
|
327
|
+
{"id": "100003720000077896", "name": "相关发票", "subFormId": "100003690000000011", "componentKey": "EinvoiceComponent", "isEinvoice": true},
|
|
328
|
+
{"id": "100003720000052200", "name": "币种", "subFormId": "100003690000000011", "componentKey": "RelateBrowser", "initialValue": "人民币", "isBrowser": true},
|
|
329
|
+
{"id": "100003720000000361", "name": "费用说明", "subFormId": "100003690000000011", "componentKey": "Text"},
|
|
330
|
+
{"id": "100003720000000419", "name": "费用日期", "subFormId": "100003690000000011", "componentKey": "DateComponent"},
|
|
331
|
+
{"id": "100003720000079682", "name": "相关凭证", "subFormId": "100003690000000011", "componentKey": "EinvoiceComponent", "isEinvoice": true}
|
|
418
332
|
]
|
|
419
333
|
}
|
|
420
334
|
```
|
|
421
335
|
|
|
422
|
-
|
|
336
|
+
> 承担主体、申请人、报销人直接上级、合同号、报销方式都带 `initialValue` → **不传**。明细「币种」虽然也有默认值,但**每行必须显式传** `人民币(100001050000000001)`,否则「申请金额」联动会失效。实报金额、附件数、承担人所有上级等不在 `fields` 里 → **不传**。
|
|
423
337
|
|
|
424
|
-
|
|
338
|
+
**② 批量预填信息:**
|
|
425
339
|
|
|
426
340
|
Windows PowerShell:
|
|
427
341
|
|
|
428
342
|
```powershell
|
|
429
|
-
weaver-work-cli --json invoice run invoice.reim.
|
|
343
|
+
weaver-work-cli --json invoice run invoice.reim.row-info-batch --input-json '{"invoiceIds":["1295366637717012482"],"requestid":"1298294241967177729"}'
|
|
430
344
|
```
|
|
431
345
|
|
|
432
346
|
macOS/Linux(bash/zsh):
|
|
433
347
|
|
|
434
348
|
```bash
|
|
435
|
-
weaver-work-cli --json invoice run invoice.reim.
|
|
349
|
+
weaver-work-cli --json invoice run invoice.reim.row-info-batch --input-json '{"invoiceIds":["1295366637717012482"],"requestid":"1298294241967177729"}'
|
|
436
350
|
```
|
|
437
351
|
|
|
438
|
-
|
|
352
|
+
返回 `results[0].data`:`{"date":"2026-07-30","fysm":"交通运输服务","itinerary":"1298798990831518001","subjectId":"100502270000000006","subjectName":"市内交通费"}`
|
|
439
353
|
|
|
440
|
-
|
|
354
|
+
**③ 交通类发票取行程:** `invoice.get`(`{"fid":"1295366637717012482"}`)→ `from`=「仁济医院南院区门诊部(南门)南侧」、`to`=「浦江瑞和城柒街区30号」。
|
|
355
|
+
|
|
356
|
+
**④ 取发票对象:** 发票 + `itinerary` 返回的凭证一起传。
|
|
441
357
|
|
|
442
358
|
Windows PowerShell:
|
|
443
359
|
|
|
444
360
|
```powershell
|
|
445
|
-
weaver-work-cli --json invoice run invoice.
|
|
361
|
+
weaver-work-cli --json invoice run invoice.browse-field.data --input-json '{"fids":["1295366637717012482","1298798990831518001"]}'
|
|
446
362
|
```
|
|
447
363
|
|
|
448
364
|
macOS/Linux(bash/zsh):
|
|
449
365
|
|
|
450
366
|
```bash
|
|
451
|
-
weaver-work-cli --json invoice run invoice.
|
|
367
|
+
weaver-work-cli --json invoice run invoice.browse-field.data --input-json '{"fids":["1295366637717012482","1298798990831518001"]}'
|
|
452
368
|
```
|
|
453
369
|
|
|
454
|
-
>
|
|
370
|
+
> `itinerary` 与 `browse-field.data` 同时发起时还不知道凭证 ID:先只传发票 `fid`,`row-info-batch` 返回新的凭证 ID 后再补调一次只传凭证。
|
|
455
371
|
|
|
456
|
-
|
|
372
|
+
### Step 4: 组装 `data`
|
|
457
373
|
|
|
458
374
|
```json
|
|
459
375
|
{
|
|
460
|
-
"
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
376
|
+
"main": {
|
|
377
|
+
"1256786432515129369": "交通费报销-后端开发111-2026-07-25(1298294241967177729)",
|
|
378
|
+
"100003720000000088": "2026-07-30 市内交通 - 滴滴出行",
|
|
379
|
+
"100003720000000687": "泛微上海(100504500000311504)"
|
|
380
|
+
},
|
|
381
|
+
"details": {
|
|
382
|
+
"100003690000000011": [
|
|
383
|
+
{
|
|
384
|
+
"100003720000000419": "2026-07-30",
|
|
385
|
+
"100003720000016373": "108.2",
|
|
386
|
+
"100003720000052200": "人民币(100001050000000001)",
|
|
387
|
+
"100003720000000360": "市内交通费(100502270000000006)",
|
|
388
|
+
"100003720000000361": "仁济医院南院-浦江瑞和城",
|
|
389
|
+
"100003720000000684": "交通费报销-后端开发111-2026-07-25(1298294241967177729)",
|
|
390
|
+
"100003720000077896": [{"optionId": "1295366637717012482", "id": "1295366637717012482", "fid": "1295366637717012482", "content": "增值税电子普通发票-36901189", "...": "browse-field.data 返回的其余键原样保留"}],
|
|
391
|
+
"100003720000079682": [{"optionId": "1298798990831518001", "id": "1298798990831518001", "fid": "1298798990831518001", "content": "滴滴行程单-...", "...": "browse-field.data 返回的其余键原样保留"}]
|
|
392
|
+
}
|
|
393
|
+
]
|
|
465
394
|
}
|
|
466
395
|
}
|
|
467
396
|
```
|
|
468
397
|
|
|
469
|
-
|
|
398
|
+
### Step 5: 预览确认 → 创建
|
|
399
|
+
|
|
400
|
+
**AI 先展示预览:**
|
|
470
401
|
|
|
471
402
|
```markdown
|
|
472
|
-
|
|
403
|
+
即将创建报销单「交通费报销-后端开发111-2026-08-04」,请确认:
|
|
473
404
|
|
|
474
|
-
|
|
405
|
+
| 项目 | 值 |
|
|
406
|
+
| --- | --- |
|
|
407
|
+
| 报销工作流 | 总部费用报销 |
|
|
408
|
+
| 报销事由 | 2026-07-30 市内交通 - 滴滴出行 |
|
|
409
|
+
| 相关客户 | 泛微上海(100504500000311504) |
|
|
410
|
+
| 事前申请 | 交通费报销-后端开发111-2026-07-25(1298294241967177729) |
|
|
411
|
+
| 合计金额 | ¥108.20 |
|
|
475
412
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
**查看链接**:[点击查看报销单](viewUrl)
|
|
413
|
+
| # | 发票号码 | 金额 | 费用日期 | 费用类型 | 费用说明 | 相关凭证 |
|
|
414
|
+
|---|----------|------|----------|----------|----------|----------|
|
|
415
|
+
| 1 | 36901189 | ¥108.20 | 2026-07-30 | 市内交通费(100502270000000006) | 仁济医院南院-浦江瑞和城 | ✅ 滴滴行程单 |
|
|
480
416
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
417
|
+
申请人、承担主体、上级、部门、合同号、报销方式由表单按当前登录人默认带出;币种为人民币。
|
|
418
|
+
请回复「存草稿」或「提交审批」;需要修改请直接告诉我。
|
|
419
|
+
```
|
|
484
420
|
|
|
485
|
-
|
|
421
|
+
用户回复「提交审批」→ 写入 `reim-create-request.json` 并调用:
|
|
486
422
|
|
|
487
|
-
|
|
488
|
-
|
|
423
|
+
```json
|
|
424
|
+
{
|
|
425
|
+
"context": "wc-9834fa828b86aed3",
|
|
426
|
+
"requestName": "交通费报销-后端开发111-2026-08-04",
|
|
427
|
+
"action": "submit",
|
|
428
|
+
"data": {"main": {"...": "Step 4 的 main"}, "details": {"...": "Step 4 的 details"}}
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Windows PowerShell:
|
|
433
|
+
|
|
434
|
+
```powershell
|
|
435
|
+
weaver-work-cli --json workflow run workflow.createRequest --input .\reim-create-request.json
|
|
489
436
|
```
|
|
490
437
|
|
|
438
|
+
macOS/Linux(bash/zsh):
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
weaver-work-cli --json workflow run workflow.createRequest --input ./reim-create-request.json
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
**返回 `CREATED_SUBMITTED`** → 把返回的 `finalMarkdown` **原样粘贴**作为回复(已含流程编号、链接、已填内容、明细表),不要自己重拼。
|
|
445
|
+
|
|
491
446
|
---
|
|
492
447
|
|
|
493
448
|
## 示例2:多张发票 + 有事前申请(要点说明)
|
|
@@ -503,42 +458,29 @@ weaver-work-cli --json invoice run invoice.reim.flow.create.apply --input ./reim
|
|
|
503
458
|
当前为出差报销,必须填写相关客户。请提供本次出差对应的具体客户名称,否则无法继续报销。
|
|
504
459
|
```
|
|
505
460
|
|
|
506
|
-
用户给出客户名称(如「XX科技」)→ `
|
|
507
|
-
用户不提供 → **不允许报销,不创建报销单**。
|
|
461
|
+
用户给出客户名称(如「XX科技」)→ 直接把 `"XX科技"` 填进「相关客户」,由 `createRequest` 解析;唯一命中即可,多候选按 `ambiguities` 让用户选。用户不提供 → **不允许报销,不创建报销单**。
|
|
508
462
|
|
|
509
|
-
|
|
463
|
+
**`data` 关键点**:
|
|
510
464
|
|
|
511
465
|
```json
|
|
512
466
|
{
|
|
513
|
-
"
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
{"fieldId": "...", "value": "INV001", "fieldName": "相关发票(EinvoiceComponent+single=false)"},
|
|
524
|
-
{"fieldId": "...", "value": "76.80", "fieldName": "实报金额"}
|
|
525
|
-
]
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
"dataIndex": 2, "subFormId": "...", "invoiceId": "INV002",
|
|
529
|
-
"fields": [
|
|
530
|
-
{"fieldId": "...", "value": "INV002", "fieldName": "相关发票(EinvoiceComponent+single=false)"},
|
|
531
|
-
{"fieldId": "...", "value": "480.00", "fieldName": "实报金额"}
|
|
532
|
-
]
|
|
533
|
-
}
|
|
534
|
-
]
|
|
467
|
+
"main": {
|
|
468
|
+
"<事前申请流程id>": "北京出差申请-张三-2026-07-20(1299854672520364033)",
|
|
469
|
+
"<相关客户id>": "XX科技"
|
|
470
|
+
},
|
|
471
|
+
"details": {
|
|
472
|
+
"<费用明细subFormId>": [
|
|
473
|
+
{"<申请金额id>": "76.80", "<币种id>": "人民币(100001050000000001)", "<相关发票id>": [{"fid": "INV001", "...": "..."}]},
|
|
474
|
+
{"<申请金额id>": "480.00", "<币种id>": "人民币(100001050000000001)", "<相关发票id>": [{"fid": "INV002", "...": "..."}]}
|
|
475
|
+
]
|
|
476
|
+
}
|
|
535
477
|
}
|
|
536
478
|
```
|
|
537
479
|
|
|
538
480
|
**要点**:
|
|
539
|
-
-
|
|
540
|
-
-
|
|
541
|
-
-
|
|
481
|
+
- 一张发票一行,数组顺序就是明细行顺序
|
|
482
|
+
- 两行都绑定同一个事前申请(明细「相关流程」同值)
|
|
483
|
+
- 每行「相关发票」只放该行发票的 1 个对象
|
|
542
484
|
|
|
543
485
|
---
|
|
544
486
|
|
|
@@ -548,65 +490,33 @@ weaver-work-cli --json invoice run invoice.reim.flow.create.apply --input ./reim
|
|
|
548
490
|
|
|
549
491
|
**差异点**:
|
|
550
492
|
- 候选只有1个 → 直接使用;多个 → 自动匹配最相关的
|
|
551
|
-
-
|
|
493
|
+
- 「事前申请流程」「相关流程」不传
|
|
552
494
|
- 其他流程与示例1 一致
|
|
553
495
|
|
|
554
496
|
---
|
|
555
497
|
|
|
556
|
-
## 示例4
|
|
557
|
-
|
|
558
|
-
> **注意:非出差流程的相关客户固定填 `"100504500000311504"`(泛微上海)。出差/差旅流程必须先让用户提供具体客户,未提供则不允许报销。以下以"相关项目"字段为例说明多候选处理。**
|
|
559
|
-
|
|
560
|
-
当搜索"相关项目"字段返回多个结果时:
|
|
561
|
-
|
|
562
|
-
**搜索命令:**
|
|
563
|
-
|
|
564
|
-
Windows PowerShell:
|
|
565
|
-
|
|
566
|
-
```powershell
|
|
567
|
-
weaver-work-cli --json invoice run invoice.reim.field.search --input-json '{"keywords":"智慧园区","fieldId":"1181057741029227450","workflowId":"1181057526276915214"}'
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
macOS/Linux(bash/zsh):
|
|
571
|
-
|
|
572
|
-
```bash
|
|
573
|
-
weaver-work-cli --json invoice run invoice.reim.field.search --input-json '{"keywords":"智慧园区","fieldId":"1181057741029227450","workflowId":"1181057526276915214"}'
|
|
574
|
-
```
|
|
575
|
-
|
|
576
|
-
**返回:**
|
|
577
|
-
|
|
578
|
-
```json
|
|
579
|
-
{
|
|
580
|
-
"code": 200,
|
|
581
|
-
"data": [
|
|
582
|
-
{"name": "智慧园区一期", "id": "P001", "value": "P001"},
|
|
583
|
-
{"name": "智慧园区二期", "id": "P002", "value": "P002"},
|
|
584
|
-
{"name": "智慧园区运维", "id": "P003", "value": "P003"}
|
|
585
|
-
]
|
|
586
|
-
}
|
|
587
|
-
```
|
|
498
|
+
## 示例4:浏览按钮返回多个候选
|
|
588
499
|
|
|
589
|
-
|
|
500
|
+
`createRequest` 返回 `NEEDS_CONFIRMATION`,`ambiguities` 里 `kind = "BROWSER"`、`reason = "MULTIPLE_MATCHES"`(例如「相关项目」填了 `"智慧园区"`):
|
|
590
501
|
|
|
591
502
|
```json
|
|
592
503
|
{
|
|
593
|
-
"
|
|
504
|
+
"status": "NEEDS_CONFIRMATION",
|
|
505
|
+
"ambiguities": [
|
|
594
506
|
{
|
|
595
|
-
"
|
|
507
|
+
"kind": "BROWSER",
|
|
596
508
|
"fieldName": "相关项目",
|
|
597
|
-
"
|
|
598
|
-
"reason": "模糊搜索返回多个候选",
|
|
509
|
+
"reason": "MULTIPLE_MATCHES",
|
|
599
510
|
"candidates": [
|
|
600
511
|
{"id": "P001", "name": "智慧园区一期"},
|
|
601
|
-
{"id": "P002", "name": "智慧园区二期"}
|
|
602
|
-
{"id": "P003", "name": "智慧园区运维"}
|
|
512
|
+
{"id": "P002", "name": "智慧园区二期"}
|
|
603
513
|
]
|
|
604
514
|
}
|
|
605
515
|
]
|
|
606
516
|
}
|
|
607
517
|
```
|
|
608
518
|
|
|
609
|
-
|
|
519
|
+
**处理方式**:把候选原样列给用户选;用户选「智慧园区一期」后,该字段改为 `{"id":"P001","name":"智慧园区一期"}`,用**同一 `context`** 重发 `createRequest`。不要向用户索取 ID。
|
|
610
520
|
|
|
611
521
|
---
|
|
612
522
|
|
|
@@ -623,134 +533,56 @@ weaver-work-cli --json invoice run invoice.reim.field.search --input-json '{"key
|
|
|
623
533
|
|
|
624
534
|
---
|
|
625
535
|
|
|
626
|
-
## 示例6
|
|
627
|
-
|
|
628
|
-
假设 Step 5 `invoice.reim.flow.create.apply` 成功,返回 `requestId = "1250065066476052001"`。
|
|
536
|
+
## 示例6:创建后修改报销单(Step 6)
|
|
629
537
|
|
|
630
|
-
|
|
538
|
+
假设 Step 5 `workflow.createRequest` 返回 `requestId = "1300266422434136064"`,用户说"报销事由改成 7 月份上海出差交通费"。
|
|
631
539
|
|
|
632
|
-
|
|
540
|
+
**① 加载当前表单:**
|
|
633
541
|
|
|
634
|
-
|
|
542
|
+
Windows PowerShell:
|
|
635
543
|
|
|
636
|
-
```
|
|
637
|
-
{
|
|
638
|
-
"need_user_confirm": [
|
|
639
|
-
{
|
|
640
|
-
"fieldId": "1181057741029227450",
|
|
641
|
-
"fieldName": "相关项目",
|
|
642
|
-
"dataIndex": 1,
|
|
643
|
-
"reason": "模糊搜索返回多个候选",
|
|
644
|
-
"candidates": [
|
|
645
|
-
{"id": "P001", "name": "智慧园区一期"},
|
|
646
|
-
{"id": "P002", "name": "智慧园区二期"}
|
|
647
|
-
]
|
|
648
|
-
}
|
|
649
|
-
]
|
|
650
|
-
}
|
|
544
|
+
```powershell
|
|
545
|
+
weaver-work-cli --json workflow run workflow.editLoad --input-json '{"requestId":"1300266422434136064"}'
|
|
651
546
|
```
|
|
652
547
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
> 将以下 JSON 写入 `reim-update.json`,然后执行 `weaver-work-cli --json invoice run invoice.reim.flow.update.prepare --input ./reim-update.json`,用户确认后再执行 `.apply`(传入顶层更新字段 + continuation + confirm:true)。
|
|
548
|
+
macOS/Linux(bash/zsh):
|
|
656
549
|
|
|
657
|
-
```
|
|
658
|
-
{
|
|
659
|
-
"requestId": 1300266422434136064,
|
|
660
|
-
"mainFormId": "1181057741029226975",
|
|
661
|
-
"detail_rows": [
|
|
662
|
-
{
|
|
663
|
-
"subFormId": "1181057741029227992",
|
|
664
|
-
"dataIndex": 1,
|
|
665
|
-
"fields": [
|
|
666
|
-
{"fieldId": "1181057741029227450", "fieldName": "相关项目", "value": "P001"}
|
|
667
|
-
]
|
|
668
|
-
}
|
|
669
|
-
]
|
|
670
|
-
}
|
|
550
|
+
```bash
|
|
551
|
+
weaver-work-cli --json workflow run workflow.editLoad --input-json '{"requestId":"1300266422434136064"}'
|
|
671
552
|
```
|
|
672
553
|
|
|
673
|
-
|
|
554
|
+
**② 准备修改**(只传要改的字段,字段须在 `editableFields` 里):
|
|
674
555
|
|
|
675
|
-
|
|
556
|
+
Windows PowerShell:
|
|
676
557
|
|
|
677
|
-
```
|
|
678
|
-
{
|
|
679
|
-
"requestId": 1300266422434136064,
|
|
680
|
-
"mainFormId": "1181057741029226975",
|
|
681
|
-
"deleteDetailRows": [
|
|
682
|
-
{"subFormId": "1181057741029227992", "dataIndex": 2}
|
|
683
|
-
],
|
|
684
|
-
"detail_rows": [
|
|
685
|
-
{
|
|
686
|
-
"subFormId": "1181057741029227992",
|
|
687
|
-
"dataIndex": 1,
|
|
688
|
-
"fields": [
|
|
689
|
-
{"fieldId": "1181057741029227459", "fieldName": "实报金额", "value": "120.00"}
|
|
690
|
-
]
|
|
691
|
-
}
|
|
692
|
-
]
|
|
693
|
-
}
|
|
558
|
+
```powershell
|
|
559
|
+
weaver-work-cli --json workflow run workflow.editPrepare --input-json '{"context":"<editLoad返回的context>","data":{"main":{"100003720000000088":"7月份上海出差交通费"}}}'
|
|
694
560
|
```
|
|
695
561
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
Step 5 创建时,"报销事由"无法自动推断:
|
|
562
|
+
macOS/Linux(bash/zsh):
|
|
699
563
|
|
|
700
|
-
```
|
|
701
|
-
|
|
564
|
+
```bash
|
|
565
|
+
weaver-work-cli --json workflow run workflow.editPrepare --input-json '{"context":"<editLoad返回的context>","data":{"main":{"100003720000000088":"7月份上海出差交通费"}}}'
|
|
702
566
|
```
|
|
703
567
|
|
|
704
|
-
|
|
568
|
+
修改明细行(金额、科目、发票等)时,`data.details` 的结构与行定位以 [`workflow-edit.md`](../../weaver-e10-workflow/references/workflow-edit.md) 为准,并对照 `editLoad` 返回的 `currentValues` 确认要改的是哪一行。
|
|
705
569
|
|
|
706
|
-
|
|
707
|
-
{
|
|
708
|
-
"requestId": 1300266422434136064,
|
|
709
|
-
"mainFormId": "1181057741029226975",
|
|
710
|
-
"main_fields": [
|
|
711
|
-
{"fieldId": "1181057741029227456", "fieldName": "报销事由", "value": "7月份上海出差交通费"}
|
|
712
|
-
]
|
|
713
|
-
}
|
|
714
|
-
```
|
|
570
|
+
**③ 向用户展示 `changedFields` 与 `linkageResult`,确认后保存:**
|
|
715
571
|
|
|
716
|
-
|
|
572
|
+
Windows PowerShell:
|
|
717
573
|
|
|
718
|
-
```
|
|
719
|
-
{
|
|
720
|
-
"requestId": 1300266422434136064,
|
|
721
|
-
"mainFormId": "1181057741029226975",
|
|
722
|
-
"deleteDetailRows": [
|
|
723
|
-
{"subFormId": "1181057741029227992", "dataIndex": -1}
|
|
724
|
-
],
|
|
725
|
-
"detail_rows": [
|
|
726
|
-
{
|
|
727
|
-
"subFormId": "1181057741029227992",
|
|
728
|
-
"dataIndex": 1,
|
|
729
|
-
"fields": [
|
|
730
|
-
{"fieldId": "1181057741029227467", "fieldName": "费用日期", "value": "2026-07-30"},
|
|
731
|
-
{"fieldId": "1181057741029227459", "fieldName": "实报金额", "value": "108.20"},
|
|
732
|
-
{"fieldId": "1181057741029227468", "fieldName": "相关发票", "value": "1295366637717012482"}
|
|
733
|
-
]
|
|
734
|
-
}
|
|
735
|
-
]
|
|
736
|
-
}
|
|
574
|
+
```powershell
|
|
575
|
+
weaver-work-cli --json workflow run workflow.editApply --input-json '{"context":"<同一context>","confirm":true}'
|
|
737
576
|
```
|
|
738
577
|
|
|
739
|
-
|
|
578
|
+
macOS/Linux(bash/zsh):
|
|
740
579
|
|
|
741
|
-
```
|
|
742
|
-
{
|
|
743
|
-
"code": 200,
|
|
744
|
-
"status": true,
|
|
745
|
-
"msg": "更新成功",
|
|
746
|
-
"data": {
|
|
747
|
-
"requestId": "1300266422434136064",
|
|
748
|
-
"deleteDetailSuccess": true,
|
|
749
|
-
"updateFormSuccess": true
|
|
750
|
-
}
|
|
751
|
-
}
|
|
580
|
+
```bash
|
|
581
|
+
weaver-work-cli --json workflow run workflow.editApply --input-json '{"context":"<同一context>","confirm":true}'
|
|
752
582
|
```
|
|
753
583
|
|
|
584
|
+
返回 `EDIT_SAVED` 即成功。流程已流转到不可编辑节点时返回"失去操作权限",如实转述。
|
|
585
|
+
|
|
754
586
|
---
|
|
755
587
|
|
|
756
588
|
## 示例7-10:多轮对话与组合条件(精简)
|
|
@@ -815,32 +647,37 @@ AI 操作:
|
|
|
815
647
|
|
|
816
648
|
---
|
|
817
649
|
|
|
650
|
+
## 示例12:用户给了合同号(以合同联动为准)
|
|
651
|
+
|
|
652
|
+
用户说:"帮我报销一下去重庆的发票,承担主体:边宝,合同编号:20250104933"
|
|
653
|
+
|
|
654
|
+
- 合同号传 `"20250104933"`;**承担主体、相关客户、相关项目都不传**(「边宝」也不传),预览里这三项写「由合同 20250104933 联动带出」
|
|
655
|
+
- 创建后 `linkageResult` 返回(2026-10-21 真机):`字段联动带出:…实报金额=50.07、承担主体=朱洪磊、相关客户=中国航空集团有限公司、合同号=20250104933、相关项目=中航集团办公平台改造及升级项目。`
|
|
656
|
+
- 原样粘贴 `finalMarkdown` 后补一句:「承担主体、相关客户、相关项目已按合同 20250104933 联动带出:朱洪磊 / 中国航空集团有限公司 / 中航集团办公平台改造及升级项目;你提到的承担主体「边宝」与合同不一致,已按合同联动为准。」
|
|
657
|
+
|
|
658
|
+
---
|
|
659
|
+
|
|
818
660
|
## 关键检查清单
|
|
819
661
|
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
1. [ ] `
|
|
823
|
-
2. [ ] `
|
|
824
|
-
3. [ ] `
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
14. [ ] `detail_rows` 中每行必须包含 `subFormId`(明细表ID)
|
|
843
|
-
15. [ ] `dataIndex` 是 1-based,`-1` 表示删除该明细表全部行
|
|
844
|
-
16. [ ] 只传需要更新的字段,无需传完整表单
|
|
845
|
-
17. [ ] `fieldName` 仅用于可读性,不影响逻辑
|
|
846
|
-
18. [ ] `value` 为空 / `unable_to_fill=true` / `need_search=true` 的字段会被跳过
|
|
662
|
+
调用 `workflow.createRequest` 前确认:
|
|
663
|
+
|
|
664
|
+
1. [ ] `context` 是本组 `workflow.createForm` 返回的 `continuation`,没有复用别的报销单的句柄
|
|
665
|
+
2. [ ] `workflow.createForm` 传的是 Step 2.5 得到的 `{workFlowName}({workFlowId})`
|
|
666
|
+
3. [ ] `requestName` 按规则生成,不超过30字
|
|
667
|
+
4. [ ] `data` 的键全部来自本次 `createForm` 的 `fields[].id`,没有 `fields` 之外的字段(实报金额、附件数、承担人所有上级等不传)
|
|
668
|
+
5. [ ] 带 `initialValue` 且不需改写的字段没有重复传;**例外:每行明细都显式传了「币种」`人民币(100001050000000001)`**(不传会让「申请金额」联动失效)
|
|
669
|
+
6. [ ] 浏览按钮写 `名称(ID)`,没有裸 ID;Select 写选项名,不是 optionValue
|
|
670
|
+
7. [ ] 每行「相关发票」是 `invoice.browse-field.data` 返回的 1 个发票对象;有凭证时「相关凭证」也是 1 个对象,无凭证不传
|
|
671
|
+
8. [ ] 相关凭证(17/18/57/58)没有单独成行
|
|
672
|
+
9. [ ] 每行「费用类型(科目)」有值,匹配不到填 `其他-管理费用(100502270000000104)`
|
|
673
|
+
10. [ ] 文本字段没有 `*` 号
|
|
674
|
+
11. [ ] **出差/差旅流程:相关客户已由用户提供具体名称;未提供则不允许调用 `workflow.createRequest`**
|
|
675
|
+
12. [ ] 非出差流程:相关客户填 `泛微上海(100504500000311504)`;**用户给了合同号时承担主体 / 相关客户 / 相关项目都不传,以合同联动为准**
|
|
676
|
+
13. [ ] 话费报销:金额字段填的是核算后的实报金额
|
|
677
|
+
14. [ ] 已向用户展示预览,并拿到「存草稿 / 提交审批」的明确确认
|
|
678
|
+
|
|
679
|
+
修改报销单前确认:
|
|
680
|
+
|
|
681
|
+
15. [ ] `requestId` 来自 `workflow.createRequest` 的返回结果
|
|
682
|
+
16. [ ] 走 `workflow.editLoad` → `workflow.editPrepare` → 用户确认 → `workflow.editApply`,只传要改的字段
|
|
683
|
+
17. [ ] 只改 `editableFields` 里的字段,遇 `notEditable` 如实转述,不换字段 id 绕过
|