vps-work 2.6.0 → 2.7.0
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/USAGE.md +22 -0
- package/dist/vps-work.cjs +12 -1
- package/package.json +1 -1
package/USAGE.md
CHANGED
|
@@ -326,3 +326,25 @@ vps-work store +inventory --store "上海国金" --product "METAVERTU" --group-b
|
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
参数和库存统计口径见 [门店查询说明](skills/vps-store-management/references/store-analytics.md)。
|
|
329
|
+
|
|
330
|
+
### 团单客户完整名单
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
vps-work sales +group-customers
|
|
334
|
+
vps-work sales +group-customers --start-date 2026-01-01 --end-date 2026-10-31 --min-quantity 5 --min-unit-price 8000
|
|
335
|
+
vps-work sales +group-customers --page 2 --limit 100
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
需要有效内部成员身份、`execute:read` 和独立权限 `sales.group_customers:read`。该权限明确开放全域销售数据与完整客户姓名、手机号、地址,不受个人/部门销售数据范围约束,不再要求 `sales.pii:read`。普通销售、管理员或通配权限不自动获得该能力。
|
|
339
|
+
|
|
340
|
+
默认时间为上海时区今天往前一个日历年(首尾日期包含;闰日按上一年月底对齐)。同一订单内,只累计人民币成交单价**严格大于**5000元的商品件数,合计**至少3件**即命中;同款多件可累计,不跨订单凑件数。数量和价格阈值均可调整。排除定金、赠品和退换货行,沿用现有销售有效状态及成交单价汇率折算规则。业绩分摊不重复计算同一订单明细。
|
|
341
|
+
|
|
342
|
+
结果按客户档案 ID 去重并附命中订单;客户信息取最近命中订单,订单中保留各自客户信息。无档案 ID 的订单分别返回,不根据同名或手机号猜测合并;旧历史记录无原始明细 ID 时沿用原销售行计数。分页单位为客户条目,返回 `total_customers`、`page`、`limit`。
|
|
343
|
+
|
|
344
|
+
接口复用 `POST /v1/execute`,请求体:
|
|
345
|
+
|
|
346
|
+
```json
|
|
347
|
+
{"skill_key":"vps-daily-sales-report","script_key":"group_customers","params":{"min_quantity":3,"min_unit_price":5000}}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
可选参数:`start_date`、`end_date`、`period`、`days`、`min_quantity`、`min_unit_price`、`page`、`limit`。`--validate-only` 仅预览请求。本地权限迁移文件仅登记权限及权限组,不为现有账号或角色自动授权。
|
package/dist/vps-work.cjs
CHANGED
|
@@ -54666,6 +54666,7 @@ function userHasVpsScope(scopes, required4) {
|
|
|
54666
54666
|
if (scope === "sales.pii:read") {
|
|
54667
54667
|
return scopes.includes(scope) || scopes.includes("sales.pii:*");
|
|
54668
54668
|
}
|
|
54669
|
+
if (scope === "sales.group_customers:read") return scopes.includes(scope);
|
|
54669
54670
|
if (scope === "sales.customer_region.all:read") {
|
|
54670
54671
|
return scopes.includes(scope) || scopes.includes("sales.customer_region.all:*");
|
|
54671
54672
|
}
|
|
@@ -60259,6 +60260,16 @@ function addAgentFilter(params, opts) {
|
|
|
60259
60260
|
}
|
|
60260
60261
|
function attachSalesShortcuts(parent) {
|
|
60261
60262
|
const skill = dailySalesSkillKey();
|
|
60263
|
+
attachSharedShortcutOptions(
|
|
60264
|
+
parent.command("+group-customers").description("\u56E2\u5355\u5BA2\u6237\u5B8C\u6574\u540D\u5355\uFF08\u9ED8\u8BA4\u8FC7\u53BB\u4E00\u5E74\uFF1B\u540C\u5355\u81F3\u5C113\u4EF6\u5355\u4EF7\u9AD8\u4E8E5000\u5143\u7684\u5546\u54C1\uFF09").option("--start-date <date>", "\u5F00\u59CB\u65E5\u671F YYYY-MM-DD").option("--end-date <date>", "\u7ED3\u675F\u65E5\u671F YYYY-MM-DD\uFF08\u542B\u5F53\u5929\uFF09").option("--period <name>", "\u5DF2\u6709\u9500\u552E\u65F6\u95F4\u8303\u56F4\uFF0C\u5982 this_year / last_n_days").option("--days <n>", "period=last_n_days \u7684\u5929\u6570").option("--min-quantity <n>", "\u7B26\u5408\u5355\u4EF7\u6761\u4EF6\u7684\u5546\u54C1\u4EF6\u6570\u4E0B\u9650\uFF08\u542B\uFF09", "3").option("--min-unit-price <amount>", "\u4EBA\u6C11\u5E01\u6210\u4EA4\u5355\u4EF7\u4E0B\u9650\uFF08\u4E0D\u542B\uFF09", "5000").option("--page <n>", "\u5BA2\u6237\u540D\u5355\u9875\u7801", "1").option("--limit <n>", "\u6BCF\u9875\u5BA2\u6237\u6570\uFF0C\u6700\u591A1000", "100")
|
|
60265
|
+
).action(async (opts, cmd) => {
|
|
60266
|
+
const p = buildSalesPeriodParams(opts);
|
|
60267
|
+
p.min_quantity = parseOptionalInt(opts.minQuantity, "--min-quantity");
|
|
60268
|
+
p.min_unit_price = parseOptionalFloat(opts.minUnitPrice, "--min-unit-price");
|
|
60269
|
+
p.page = parseOptionalInt(opts.page, "--page");
|
|
60270
|
+
if (Number(p.min_quantity) < 1 || Number(p.min_unit_price) < 0 || Number(p.page) < 1) throw new VertuError("\u4EF6\u6570\u548C\u9875\u7801\u5FC5\u987B\u5927\u4E8E0\uFF0C\u5355\u4EF7\u4E0D\u80FD\u4E3A\u8D1F\u6570\u3002");
|
|
60271
|
+
await runSkillShortcutExecute(skill, "group_customers", p, opts, cmd);
|
|
60272
|
+
});
|
|
60262
60273
|
attachSharedShortcutOptions(
|
|
60263
60274
|
parent.command("+order-finance").alias("+finance-detail").description("\u6309\u9500\u552E\u5355\u53F7\u6C47\u603B\u8BA2\u5355\u3001\u5F00\u7968\u7533\u8BF7\u3001\u6B63\u5F0F\u53D1\u7968\u548C\u5173\u8054\u4F1A\u8BA1\u51ED\u8BC1").requiredOption("--order-no <no>", "\u9500\u552E\u5355\u53F7\uFF0C\u7CBE\u786E\u5339\u914D").option("--invoice-no <no>", "\u53D1\u7968/\u51ED\u8BC1\u53F7\u5305\u542B\u5339\u914D")
|
|
60264
60275
|
).action(async (opts, cmd) => {
|
|
@@ -65597,7 +65608,7 @@ function rewriteLongFlag(tok) {
|
|
|
65597
65608
|
}
|
|
65598
65609
|
|
|
65599
65610
|
// src/bin/vps-work.ts
|
|
65600
|
-
var PKG_VERSION = "2.
|
|
65611
|
+
var PKG_VERSION = "2.7.0" ? "2.7.0" : "0.0.0-dev";
|
|
65601
65612
|
function smartFlagSuggest(flag, candidates) {
|
|
65602
65613
|
if (!flag.startsWith("--") || flag.length < 4) return "";
|
|
65603
65614
|
const word = flag.slice(2);
|