feat(分拣): 新增按区域拣货模式与区域顺序
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

新增拣货模式 zone(订单内按区域拆单,无区域归「未设区域」);兜底默认由 order 改为 zone(仅影响未配置分公司,已有配置不动)。

区域取值:批次实际区优先(可扣库存 FIFO 首个有区域的批次)-> 回退商品默认区;分拣明细读模型 storage_zone 同口径。

区域顺序 picking_zone_order(Web 手动排序 + 手动新增区域名)决定任务列表先后,Web 与小程序同序;Web 明细表按区域分组,小程序 taskGroupKey 认 zone。

拆单现码 order/category/sku 扩为 +zone(picking-freeze 规则与 AGENTS 摘要同步);新增设计文 docs/design/20261105-分拣按区域模式与区域顺序.md。

验证:两端 tsc;门禁 8/8;服务端 33 文件/40 例、前端 3 文件/4 例 = 基线。
This commit is contained in:
雨天
2026-10-12 17:27:46 +08:00
parent b54e0fee94
commit 668413251d
15 changed files with 636 additions and 22 deletions
@@ -64,7 +64,7 @@ function taskScopeType(task) {
function taskGroupKey(task) {
const type = taskScopeType(task);
if (type === 'category' || type === 'sku') {
if (type === 'category' || type === 'sku' || type === 'zone') {
return `${type}:${String(task.scope_key || task.scope_label || '').trim() || 'NA'}`;
}
return `order:${String(task.order_code || task.pick_code || '').trim()}`;
@@ -302,6 +302,8 @@ Component({
tabTitle = `${orderCodeShort || ''}·${task.scope_label || task.scope_key || '分类'}`.replace(/^·/, '');
} else if (scopeType === 'sku') {
tabTitle = `${orderCodeShort || ''}·${task.scope_label || task.scope_key || '商品'}`.replace(/^·/, '');
} else if (scopeType === 'zone') {
tabTitle = `${orderCodeShort || ''}·${task.scope_label || task.scope_key || '区域'}`.replace(/^·/, '');
} else if (scopeType === 'customer') {
tabTitle = task.scope_label || task.company_name || '客户合单';
} else {