Compare commits

...

1 Commits

Author SHA1 Message Date
Misaka_Company
44da2ac6b9 fix: 完成本箱后新箱号基于最大箱号递增而非当前箱号
单码装箱和多码凑箱模式统一优化:完成装箱后,下一个箱号
设置为最大箱号+1,避免在查看历史箱号时产生重复箱号。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 14:46:41 +08:00

View File

@@ -701,7 +701,7 @@ class _BoxingPageState extends State<BoxingPage> with WidgetsBindingObserver {
} else {
setState(() {
_phase = _Phase.scanned;
_boxNoController.text = (boxNo + 1).toString();
_boxNoController.text = (_maxBoxNo + 1).toString();
_quantityController.text = remaining.toString();
_quantityController.selection = TextSelection(
baseOffset: 0,
@@ -846,7 +846,6 @@ class _BoxingPageState extends State<BoxingPage> with WidgetsBindingObserver {
}
void _finishManyToOneBox() {
final currentBoxNo = int.tryParse(_boxNoController.text.trim());
setState(() {
_manyToOnePackedItems.clear();
_editingPackedItemId = null;
@@ -855,9 +854,7 @@ class _BoxingPageState extends State<BoxingPage> with WidgetsBindingObserver {
_zongpaiNo = null;
_phase = _Phase.waiting;
_quantityController.clear();
if (currentBoxNo != null && currentBoxNo > 0) {
_boxNoController.text = (currentBoxNo + 1).toString();
}
_boxNoController.text = (_maxBoxNo + 1).toString();
_statusOverrideText = null;
_statusOverrideDot = null;
});