瀏覽代碼

fleat: update add product btn to bottom

igb 11 小時之前
父節點
當前提交
28d9b9ab85
共有 2 個文件被更改,包括 16 次插入8 次删除
  1. 7 3
      order_add.php
  2. 9 5
      order_edit.php

+ 7 - 3
order_add.php

@@ -369,8 +369,6 @@ if ($customerId > 0) {
             <tr>
                 <th width="8%" valign="top" nowrap>产品列表</th>
                 <td>
-                    <button type="button" id="add-product-btn" class="add-product-btn">添加产品</button>
-                    
                     <div class="product-list-header" style="display: flex; background-color: #eee; padding: 8px 15px; margin-bottom: 10px; border-radius: 4px; font-weight: bold; color: #555; font-size: 13px; gap: 20px;">
                         <div style="flex: 3; min-width: 200px;">产品</div>
                         <div style="flex: 1; min-width: 80px;">数量</div>
@@ -384,6 +382,12 @@ if ($customerId > 0) {
                             <i class="fa fa-info-circle"></i> 请点击"添加产品"按钮添加产品
                         </div>
                     </div>
+                    
+                    <!-- 在订单总额上方添加的新按钮 -->
+                    <div style="text-align: center; margin-bottom: 15px;">
+                        <button type="button" id="add-product-btn-bottom" class="add-product-btn">添加产品</button>
+                    </div>
+                    
                     <div class="total-section" style="margin-top: 20px; padding: 15px; background-color: #f5f5f5; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
                         <div style="display: flex; justify-content: flex-end; align-items: center;">
                             <label style="font-size: 16px; margin-right: 10px;">订单总额:</label>
@@ -428,7 +432,7 @@ if ($customerId > 0) {
             updateNoProductsMessage();
             
             // 添加产品行按钮点击事件
-            $('#add-product-btn').on('click', function() {
+            $('#add-product-btn-bottom').on('click', function() {
                 addEmptyProductRow();
                 updateNoProductsMessage();
             });

+ 9 - 5
order_edit.php

@@ -382,8 +382,6 @@ if (!empty($id) && is_numeric($id)) {
             <tr>
                 <th width="8%" valign="top">产品列表</th>
                 <td>
-                    <button type="button" id="add-product-btn" class="add-product-btn">添加产品</button>
-                    
                     <div class="product-list-header" style="display: flex; background-color: #eee; padding: 8px 15px; margin-bottom: 10px; border-radius: 4px; font-weight: bold; color: #555; font-size: 13px; gap: 20px;">
                         <div style="flex: 3; min-width: 200px;">产品</div>
                         <div style="flex: 1; min-width: 80px;">数量</div>
@@ -438,6 +436,12 @@ if (!empty($id) && is_numeric($id)) {
                         </div>
                         <?php endif; ?>
                     </div>
+                    
+                    <!-- 在订单总额上方添加的新按钮 -->
+                    <div style="text-align: center; margin-bottom: 15px;">
+                        <button type="button" id="add-product-btn-bottom" class="add-product-btn">添加产品</button>
+                    </div>
+                    
                     <div class="total-section" style="margin-top: 20px; padding: 15px; background-color: #f5f5f5; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
                         <div style="display: flex; justify-content: flex-end; align-items: center;">
                             <label style="font-size: 16px; margin-right: 10px;">订单总额:</label>
@@ -604,7 +608,7 @@ if (!empty($id) && is_numeric($id)) {
             });
             
             // 添加产品行按钮点击事件
-            $('#add-product-btn').on('click', function() {
+            $('#add-product-btn-bottom').on('click', function() {
                 addEmptyProductRow();
                 updateNoProductsMessage();
             });
@@ -990,7 +994,7 @@ if (!empty($id) && is_numeric($id)) {
             // 检查是否有产品行
             if ($('.product-row').length === 0) {
                 alert('请至少添加一个产品');
-                $('#add-product-btn').focus();
+                $('#add-product-btn-bottom').focus();
                 return false;
             }
 
@@ -1049,7 +1053,7 @@ if (!empty($id) && is_numeric($id)) {
                 if (firstInvalidField) {
                     firstInvalidField.focus();
                 } else {
-                    $('#add-product-btn').focus();
+                    $('#add-product-btn-bottom').focus();
                 }
                 return false;
             }