chore: release client-v1.1.13
Deploy Client / build-windows (push) Successful in 4m43s
Deploy Client / build-client-web (push) Successful in 6m22s
Deploy Client / build-macos (push) Successful in 7m36s
Deploy Client / build-android (push) Successful in 7m54s
Deploy Client / build-ios (push) Failing after 13m2s
Deploy Client / release-deploy-client (push) Has been skipped

扫码出库免回车(120ms 防抖自动加入明细)+ 热敏标签重写为光栅化,
消除字体重叠/与预览失真/底部重复店名(原型+画布+PDF+Web 同步)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bupi8Kdqkfx2N5acFsHTx5
This commit is contained in:
wangjia
2026-08-27 21:48:47 +08:00
parent c3a127485f
commit 7025ccd1b5
5 changed files with 100 additions and 161 deletions
@@ -185,6 +185,8 @@ class _StockOutFormScreenState extends ConsumerState<StockOutFormScreen> {
Map<String, _PickerItem> _codeIndex = {};
String _lastScanCode = '';
int _lastScanMs = 0;
// 扫码枪=HID键盘极快连打字符后停顿;停顿 120ms 无新输入即自动触发,免手动回车。
Timer? _scanDebounce;
static const _fields = ['qty', 'sale'];
@@ -265,6 +267,7 @@ class _StockOutFormScreenState extends ConsumerState<StockOutFormScreen> {
_remarkCtrl.dispose();
_partnerFocus.dispose();
_warehouseFocus.dispose();
_scanDebounce?.cancel();
_scanCtrl.dispose();
_scanFocus.dispose();
for (final item in _items) {
@@ -354,6 +357,7 @@ class _StockOutFormScreenState extends ConsumerState<StockOutFormScreen> {
/// 扫码枪回车触发。解析编码→本地整仓索引命中(已加载项)→未命中再走服务端
/// 按编码精确查(覆盖库存超本地加载上限 1000 的大仓)→加行/累加数量。
Future<void> _onScan(String raw) async {
_scanDebounce?.cancel();
// 立即清空并保持聚焦,承接下一次扫码
_scanCtrl.clear();
_scanFocus.requestFocus();
@@ -697,6 +701,14 @@ class _StockOutFormScreenState extends ConsumerState<StockOutFormScreen> {
controller: _scanCtrl,
focusNode: _scanFocus,
hintText: '扫码枪扫码…',
onChanged: (v) {
// 扫码枪整串打完会停顿,停顿 120ms 视为一次完整扫入 → 自动触发。
// 带回车后缀的枪仍走 onSubmitted_onScan 内 300ms 同码去重防重复入单。
_scanDebounce?.cancel();
if (v.trim().isEmpty) return;
_scanDebounce = Timer(
const Duration(milliseconds: 120), () => _onScan(v));
},
onSubmitted: _onScan,
suffix: Icon(LucideIcons.scanLine,
size: 16, color: context.tokens.muted),