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:
@@ -5,11 +5,13 @@ class RegistrationOverviewStats {
|
||||
final int totalCount;
|
||||
final int shelvedCount;
|
||||
final int transferredCount;
|
||||
final int tempStoredCount;
|
||||
|
||||
const RegistrationOverviewStats({
|
||||
required this.totalCount,
|
||||
required this.shelvedCount,
|
||||
required this.transferredCount,
|
||||
required this.tempStoredCount,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,17 +33,21 @@ RegistrationOverviewStats overviewStats(PaichaOverviewResult? overview) {
|
||||
totalCount: 0,
|
||||
shelvedCount: 0,
|
||||
transferredCount: 0,
|
||||
tempStoredCount: 0,
|
||||
);
|
||||
}
|
||||
|
||||
var shelvedCount = 0;
|
||||
var transferredCount = 0;
|
||||
var tempStoredCount = 0;
|
||||
for (final item in overview!.items) {
|
||||
switch (item.status) {
|
||||
case 'on_shelf':
|
||||
shelvedCount++;
|
||||
case 'transferred':
|
||||
transferredCount++;
|
||||
case 'temp_stored':
|
||||
tempStoredCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +55,7 @@ RegistrationOverviewStats overviewStats(PaichaOverviewResult? overview) {
|
||||
totalCount: overview.totalCount,
|
||||
shelvedCount: shelvedCount,
|
||||
transferredCount: transferredCount,
|
||||
tempStoredCount: tempStoredCount,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -91,6 +98,17 @@ List<PaichaOverviewItem> findTransferredItemsInScanned({
|
||||
);
|
||||
}
|
||||
|
||||
List<PaichaOverviewItem> findTempStoredItemsInScanned({
|
||||
required PaichaOverviewResult? overview,
|
||||
required Iterable<String> zongpaiNos,
|
||||
}) {
|
||||
return _findScannedItemsByStatus(
|
||||
overview: overview,
|
||||
zongpaiNos: zongpaiNos,
|
||||
status: 'temp_stored',
|
||||
);
|
||||
}
|
||||
|
||||
bool hasAnyLocatedInScanned({
|
||||
required PaichaOverviewResult? overview,
|
||||
required Iterable<String> zongpaiNos,
|
||||
@@ -100,7 +118,9 @@ bool hasAnyLocatedInScanned({
|
||||
return overview!.items.any(
|
||||
(item) =>
|
||||
scannedSet.contains(item.zongpaiNo) &&
|
||||
(item.status == 'on_shelf' || item.status == 'transferred'),
|
||||
(item.status == 'on_shelf' ||
|
||||
item.status == 'transferred' ||
|
||||
item.status == 'temp_stored'),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -108,10 +128,13 @@ Color registrationBarColor({
|
||||
required String status,
|
||||
required bool isScanned,
|
||||
required bool isTransitTarget,
|
||||
bool isTempStorageTarget = false,
|
||||
}) {
|
||||
if (isScanned) {
|
||||
final isConflict = isTransitTarget
|
||||
? status == 'transferred'
|
||||
: isTempStorageTarget
|
||||
? (status == 'transferred' || status == 'temp_stored')
|
||||
: (status == 'on_shelf' || status == 'transferred');
|
||||
return isConflict ? Colors.red : const Color(0xFF43A047);
|
||||
}
|
||||
@@ -119,6 +142,8 @@ Color registrationBarColor({
|
||||
switch (status) {
|
||||
case 'on_shelf':
|
||||
return const Color(0xFF2196F3);
|
||||
case 'temp_stored':
|
||||
return const Color(0xFF7B1FA2);
|
||||
case 'transferred':
|
||||
return const Color(0xFFFF9800);
|
||||
default:
|
||||
@@ -130,10 +155,13 @@ Color registrationRowBgColor({
|
||||
required String status,
|
||||
required bool isScanned,
|
||||
required bool isTransitTarget,
|
||||
bool isTempStorageTarget = false,
|
||||
}) {
|
||||
if (isScanned) {
|
||||
final isConflict = isTransitTarget
|
||||
? status == 'transferred'
|
||||
: isTempStorageTarget
|
||||
? (status == 'transferred' || status == 'temp_stored')
|
||||
: (status == 'on_shelf' || status == 'transferred');
|
||||
return isConflict ? Colors.red.shade50 : const Color(0xFFF1F8E9);
|
||||
}
|
||||
@@ -141,6 +169,8 @@ Color registrationRowBgColor({
|
||||
switch (status) {
|
||||
case 'on_shelf':
|
||||
return const Color(0xFFE3F2FD);
|
||||
case 'temp_stored':
|
||||
return const Color(0xFFF3E5F5);
|
||||
case 'transferred':
|
||||
return const Color(0xFFFFF3E0);
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user