feat: sort outbound selection list by warehouse location to optimize pick path

This commit is contained in:
DXC
2026-03-13 13:52:17 +08:00
parent 403bbe281f
commit 368298a29d

View File

@ -314,8 +314,21 @@ const bomSets = ref(1)
const currentTime = ref('') const currentTime = ref('')
// --- 计算属性 --- // --- 计算属性 ---
// ★ 优化:按库位排序,空库位排最后
const validSelectedItems = computed(() => { 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(() => { const totalExportCount = computed(() => {