From f30715c420bc39ef7e33063f62e7eaeaefa1bc52 Mon Sep 17 00:00:00 2001 From: Default User Date: Sun, 11 Jan 2026 17:40:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA=E5=92=8C?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E8=B4=A7=E6=BA=90=E6=97=B6=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E9=99=90=E5=88=B6=E7=9A=84=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply.html | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/supply.html b/supply.html index 0a6d988..b3ed115 100644 --- a/supply.html +++ b/supply.html @@ -2961,7 +2961,7 @@ // 限制最多只能创建三个规格对 if (pairs.length >= 3) { - alert('最多只能创建三个规格对'); + alert('最多只能添加3条规格信息'); return; } @@ -2979,16 +2979,6 @@ `; container.appendChild(pair); - - // 检查是否已达到最大数量,如果是则禁用添加按钮 - const newPairCount = container.querySelectorAll('.spec-quantity-pair').length; - if (newPairCount >= 3) { - const addButton = document.querySelector('.add-spec-quantity-btn'); - if (addButton) { - addButton.disabled = true; - addButton.className = 'add-spec-quantity-btn btn-disabled'; - } - } } // 删除规格和件数对 @@ -3009,16 +2999,6 @@ if (quantityInput) quantityInput.value = ''; if (costpriceInput) costpriceInput.value = ''; } - - // 检查当前数量,如果少于三个则启用添加按钮 - const newPairCount = container.querySelectorAll('.spec-quantity-pair').length; - if (newPairCount < 3) { - const addButton = document.querySelector('.add-spec-quantity-btn'); - if (addButton) { - addButton.disabled = false; - addButton.className = 'add-spec-quantity-btn'; - } - } } // 为规格和件数对显示规格选择弹窗 @@ -5107,6 +5087,9 @@ specQuantityPairs.appendChild(pair); } } + + // 不再禁用添加按钮,而是在点击时检查数量并弹出提示 + // 确保添加按钮始终可用,以便用户可以点击并看到提示信息 } } @@ -5250,6 +5233,9 @@ addSpecQuantityPair(); } + // 不再禁用添加按钮,而是在点击时检查数量并弹出提示 + // 确保添加按钮始终可用,以便用户可以点击并看到提示信息 + // 重置自定义选择状态 const regionDisplayText = document.getElementById('regionDisplayText'); if (regionDisplayText) { @@ -5465,6 +5451,9 @@ } console.log('已加载保存的表单数据'); + + // 不再禁用添加按钮,而是在点击时检查数量并弹出提示 + // 确保添加按钮始终可用,以便用户可以点击并看到提示信息 } catch (e) { console.error('加载保存的表单数据失败:', e); // 如果加载失败,重置表单 @@ -5486,6 +5475,9 @@ document.getElementById('createSupplyModal').classList.remove('active'); // 恢复body滚动条 document.body.style.overflow = 'auto'; + + // 不再禁用添加按钮,而是在点击时检查数量并弹出提示 + // 确保添加按钮始终可用,以便用户可以点击并看到提示信息 } // 触发图片上传