feat: sort outbound selection list by warehouse location to optimize pick path
This commit is contained in:
@ -314,8 +314,21 @@ const bomSets = ref(1)
|
||||
const currentTime = ref('')
|
||||
|
||||
// --- 计算属性 ---
|
||||
// ★ 优化:按库位排序,空库位排最后
|
||||
const validSelectedItems = computed(() => {
|
||||
return selectedItems.value.filter(item => item.export_quantity > 0)
|
||||
const filtered = selectedItems.value.filter(item => item.export_quantity > 0)
|
||||
return [...filtered].sort((a, b) => {
|
||||
const locA = a.warehouse_location || a.warehouse_loc || '';
|
||||
const locB = b.warehouse_location || b.warehouse_loc || '';
|
||||
|
||||
// 空库位沉底
|
||||
if (!locA && locB) return 1;
|
||||
if (locA && !locB) return -1;
|
||||
if (!locA && !locB) return 0;
|
||||
|
||||
// 自然排序(支持 A-10 排在 A-2 后面)
|
||||
return locA.localeCompare(locB, 'zh-CN', { numeric: true });
|
||||
});
|
||||
})
|
||||
|
||||
const totalExportCount = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user