fix: 国际进港装机单修改库位弹框仅单选时自动带出库位号

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-01 18:01:32 +08:00
parent c9625f6bfd
commit 43acf0a2de

View File

@@ -108,13 +108,11 @@ class IntImpLoadingListActivity :
return return
} }
// 如果所有选中项库位相同,则预选该库位 // 单选时自动带出该项的库位号,多选不带出
val commonLocation = selectedItems.map { it.locationTally }.distinct().let { val presetLocation = if (selectedItems.size == 1) selectedItems.first().locationTally ?: "" else ""
if (it.size == 1) it.first() else ""
}
IntImpModifyStorageDialogModel( IntImpModifyStorageDialogModel(
currentLocationName = commonLocation currentLocationName = presetLocation
) { dialog -> ) { dialog ->
val locationName = dialog.locationName val locationName = dialog.locationName
val locationId = dialog.locationId val locationId = dialog.locationId