diff --git a/inventory-web/src/views/stock/stocktake/index.vue b/inventory-web/src/views/stock/stocktake/index.vue
index d5db6c8..b69d8ff 100644
--- a/inventory-web/src/views/stock/stocktake/index.vue
+++ b/inventory-web/src/views/stock/stocktake/index.vue
@@ -233,9 +233,9 @@
-
-
- {{ scope.row.serial_number || scope.row.batch_no || '-' }}
+
+
+ {{ row.serial_number || row.batch_number || row.batch_no || '-' }}
@@ -503,7 +503,14 @@ const syncData = async () => {
if (res.materials) res.materials.forEach((i: any) => { const item = processItem(i, 'material'); if (item) list.push(item) })
if (res.semis) res.semis.forEach((i: any) => { const item = processItem(i, 'semi'); if (item) list.push(item) })
if (res.products) res.products.forEach((i: any) => { const item = processItem(i, 'product'); if (item) list.push(item) })
-
+
+ // ★ 强制按 SKU 数字+字符串升序排序
+ list.sort((a, b) => {
+ const skuA = a.sku || '';
+ const skuB = b.sku || '';
+ return skuA.localeCompare(skuB, undefined, { numeric: true, sensitivity: 'base' });
+ });
+
// 静默更新数据(不触发loading)
allData.value = list
await fetchBorrowedQuantities(list)
@@ -759,6 +766,13 @@ const loadData = async () => {
if (res.semis) res.semis.forEach((i: any) => processItem(i, 'semi'))
if (res.products) res.products.forEach((i: any) => processItem(i, 'product'))
+ // ★ 强制按 SKU 数字+字符串升序排序
+ list.sort((a, b) => {
+ const skuA = a.sku || '';
+ const skuB = b.sku || '';
+ return skuA.localeCompare(skuB, undefined, { numeric: true, sensitivity: 'base' });
+ });
+
allData.value = list
await fetchBorrowedQuantities(list)
} catch (e) {