| 
-                                    
-                                     
+                                    
                                         
                                             
                                                 | @@ -596,7 +581,7 @@ |  
-                            | + |  | 2 | 11120250719145684803694 | 2025-07-19 14:56:21@@ -617,29 +602,7 @@ |  
                             | 
-                                    
-                                     
+                                    
                                         
                                             
                                                 | @@ -694,7 +657,7 @@ |  
-                            | + |  | 3 | 21120250718172950560206 | 2025-07-18 17:29:48@@ -715,29 +678,7 @@ |  
                             | 
-                                    
-                                     
+                                    
                                         
                                             
                                                 | @@ -792,7 +733,7 @@ |  
-                            | + |  | 4 | 21120250718172950562355 | 2025-07-18 17:29:23@@ -813,29 +754,7 @@ |  
                             | 
-                                    
-                                     
+                                    
                                         
                                             
                                                 | @@ -890,7 +809,7 @@ |  
-                            | + |  | 5 | 21120250717120850567740 | 2025-07-17 12:08:07@@ -911,29 +830,7 @@ |  
                             | 
-                                    
-                                     
+                                    
                                         
                                             
                                                 | @@ -1068,22 +965,44 @@
             }
         }
 
-        // 店铺订单展开功能(店铺订单展开商品订单)
+        // 订单展开功能
         function toggleShopExpand(btn) {
             const currentRow = btn.closest('tr');
+
+            // 如果是结算订单行(主表格中的行),展开/收起店铺订单表格
+            if (currentRow.closest('table').classList.contains('order-table')) {
+                const nextRow = currentRow.nextElementSibling;
+                if (nextRow && nextRow.classList.contains('expandable-row')) {
+                    const isVisible = nextRow.style.display !== 'none';
+
+                    if (isVisible) {
+                        nextRow.style.display = 'none';
+                        btn.innerHTML = '▼';
+                    } else {
+                        nextRow.style.display = 'table-row';
+                        btn.innerHTML = '▲';
+                    }
+                }
+                return;
+            }
+
+            // 如果是店铺订单行(子表格中的行),展开/收起商品订单表格
             const tableWrapper = currentRow.closest('.nested-table-wrapper');
-            const tables = tableWrapper.querySelectorAll('.sub-table');
-            let productTable = tables[tables.length - 1]; // 获取最后一个表格(商品订单表格)
+            if (tableWrapper) {
+                // 查找商品订单表格(第二个sub-table)
+                const subTables = tableWrapper.querySelectorAll('.sub-table');
+                const productTable = subTables[1]; // 第二个表格是商品订单表格
 
-            if (productTable) {
-                const isVisible = productTable.style.display !== 'none';
+                if (productTable) {
+                    const isVisible = productTable.style.display === 'table';
 
-                if (isVisible) {
-                    productTable.style.display = 'none';
-                    btn.innerHTML = '▼';
-                } else {
-                    productTable.style.display = 'table';
-                    btn.innerHTML = '▲';
+                    if (isVisible) {
+                        productTable.style.display = 'none';
+                        btn.innerHTML = '▼';
+                    } else {
+                        productTable.style.display = 'table';
+                        btn.innerHTML = '▲';
+                    }
                 }
             }
         } |  |  |  |  |  |