Browse Source

修复创建和复制货源时规格数量限制的提示问题

Boss3
Default User 2 months ago
parent
commit
f30715c420
  1. 34
      supply.html

34
supply.html

@ -2961,7 +2961,7 @@
// 限制最多只能创建三个规格对
if (pairs.length >= 3) {
alert('最多只能创建三个规格对');
alert('最多只能添加3条规格信息');
return;
}
@ -2979,16 +2979,6 @@
<button type="button" class="remove-quantity-btn" onclick="removeSpecQuantityPair(this)">×</button>
`;
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';
// 不再禁用添加按钮,而是在点击时检查数量并弹出提示
// 确保添加按钮始终可用,以便用户可以点击并看到提示信息
}
// 触发图片上传

Loading…
Cancel
Save