feat: add temp storage shelf (B prefix) UI support

Recognize B-prefix location codes as temp storage shelves. Add purple
color scheme, conflict detection for temp_stored status, and updated
submit/dialog logic for temp storage target handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-05-25 22:48:29 +08:00
parent f6bfd8cb10
commit 99ed3bb9ec
9 changed files with 125 additions and 15 deletions

View File

@@ -34,6 +34,23 @@ extension _RegistrationSubmitPart on _RegistrationPageState {
}
}
// For temp storage target: block if any scanned item is transferred or temp_stored
// (on_shelf items are allowed — temp storage acts as shelf change)
if (_isTempStorageTarget) {
final transferredItems = _findTransferredItemsInScanned();
final tempStoredItems = _findTempStoredItemsInScanned();
if (transferredItems.isNotEmpty || tempStoredItems.isNotEmpty) {
setState(() => _isSubmitting = false);
_feedbackService.trigger(FeedbackEvent.submitFailure);
_showLocationConflictDialog(
onShelfItems: [],
transferredItems: transferredItems,
tempStoredItems: tempStoredItems,
);
return;
}
}
if (_mode == RegistrationMode.multiCode && _zongpaiNos.length > 1) {
if (_isTransitTarget && !await _ensureBatchSamePaicha(baseUrl)) {
if (!mounted) return;
@@ -47,7 +64,7 @@ extension _RegistrationSubmitPart on _RegistrationPageState {
return;
}
// Pre-check: block entire batch if any item already has a location binding
if (!_isTransitTarget) {
if (!_isTransitTarget && !_isTempStorageTarget) {
final onShelfItems = _findOnShelfItemsInScanned();
final transferredItems = _findTransferredItemsInScanned();
if (onShelfItems.isNotEmpty || transferredItems.isNotEmpty) {
@@ -117,13 +134,15 @@ extension _RegistrationSubmitPart on _RegistrationPageState {
}
setState(() {
_zongpaiNos.remove(zongpaiNo);
if (_mode == RegistrationMode.singleCode) {
if (_mode == RegistrationMode.singleCode && !_isTempStorageTarget) {
_locationCode = null;
_locationType = null;
}
});
final msg = result.isOffShelfSuccess
? '下架成功'
: _isTempStorageTarget
? '变更货架成功'
: (_mode == RegistrationMode.multiCode ? '多码上架模式,请扫描下一张执行卡' : '上架成功');
_showStatusOverride(
msg,