表头全选 + 行内多选;选中后按「按订单/按分类/按商品/按区域」排序,一次生成多页标签并打印,免去逐单进详情逐个点。复用既有文案(无新 key);区域排序遵循分公司区域顺序。商品行 SELECT 补 category_name(纯读,无迁移)。同步更新 mpPickingScopeSelect 断言(2026-10-13 重新加回小程序 BLE 打印,仍不走旧 print_jobs 链路)。
46 lines
2.2 KiB
TypeScript
46 lines
2.2 KiB
TypeScript
import { readFileSync } from 'fs';
|
||
import { describe, expect, it } from 'vitest';
|
||
|
||
const wxml = readFileSync(
|
||
new URL('../../miniprogram/components/picking-panel/index.wxml', import.meta.url),
|
||
'utf8'
|
||
);
|
||
const js = readFileSync(
|
||
new URL('../../miniprogram/components/picking-panel/index.js', import.meta.url),
|
||
'utf8'
|
||
);
|
||
|
||
describe('小程序分拣范围选择框', () => {
|
||
it('页内点击选范围:按订单/分类/商品都走选择框;完成组不占位', () => {
|
||
expect(wxml).not.toContain('scroll-x class="task-tabs"');
|
||
expect(wxml).toContain('toggleScopeMenu');
|
||
expect(wxml).toContain('scope-menu');
|
||
expect(wxml).toContain('wx:if="{{scopeGroups.length}}"');
|
||
expect(wxml).not.toContain('!skuCatalogMode');
|
||
expect(js).toContain('function groupStillOpen');
|
||
expect(js).toContain('onScopeOptionTap');
|
||
expect(js).toContain('scopeMenuOpen');
|
||
expect(js).toContain("if (type === 'category') return String(task.scope_label");
|
||
expect(js).toContain("if (type === 'sku') return String(task.scope_label");
|
||
// 区域模式:选择器/分组标签必须显示区域名,不得落到兜底显示订单号(2026-10-13 修)
|
||
expect(js).toContain("if (type === 'zone') return String(task.scope_label");
|
||
expect(js).toContain("if (type === 'category' || type === 'sku' || type === 'zone')");
|
||
expect(js).toContain('this.selectGroupByKey(activeGroupKey)');
|
||
expect(js).not.toContain('this.applyPickingDayView()');
|
||
});
|
||
|
||
it('日期轴仍在;小程序打印走 BLE 新通道(2026-10-13 起)', () => {
|
||
expect(wxml).toContain('date-axis');
|
||
expect(js).toContain('confirmAllPicks');
|
||
// 2026-10-13 开发者要求重新加回分拣「打印」:走 **BLE 热敏直连**(utils/pickingLabelPrint),
|
||
// 仍**不走**旧 print_jobs / 称重终端链路(无 printPickLabels / 设备下发)。
|
||
expect(wxml).toContain('printCurrentPick');
|
||
expect(wxml).toContain('btn-print-row');
|
||
expect(js).toContain('printCurrentPick');
|
||
expect(js).toContain('pickingLabelPrint');
|
||
expect(js).not.toContain('printPickLabels');
|
||
expect(js).not.toContain('fetchPickingWeighDevices');
|
||
expect(js).not.toContain('createPickingPrintJobs');
|
||
});
|
||
});
|