* Finish task #30261.

This commit is contained in:
Yagami
2022-11-25 10:50:22 +08:00
parent 50998cbe13
commit 7fbcb9b13e
2 changed files with 9 additions and 7 deletions
+4 -3
View File
@@ -150,11 +150,12 @@ function loadBranches(product)
/* When selecting a product, delete a plan that is empty by default. */
$("#planDefault").remove();
var chosenProducts = 0;
var chosenProducts = [];
$("#productsBox select[name^='products']").each(function()
{
var $product = $(product);
if($(this).val() > 0) chosenProducts ++;
var productID = $(this).val();
if(productID > 0 && chosenProducts.indexOf(productID) == -1) chosenProducts.push(productID);
if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()])
{
bootbox.alert(errorSameProducts);
@@ -164,7 +165,7 @@ function loadBranches(product)
}
});
chosenProducts > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide');
chosenProducts.length > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide');
if($('#productsBox .input-group:last select:first').val() != 0)
{
+5 -4
View File
@@ -294,11 +294,12 @@ function loadBranches(product)
/* When selecting a product, delete a plan that is empty by default. */
$("#planDefault").remove();
var chosenProducts = 0;
var chosenProducts = [];
$("#productsBox select[name^='products']").each(function()
{
var $product = $(product);
if($(this).val() > 0) chosenProducts ++;
var $product = $(product);
var productID = $(this).val();
if(productID > 0 && chosenProducts.indexOf(productID) == -1) chosenProducts.push(productID);
if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()])
{
bootbox.alert(errorSameProducts);
@@ -308,7 +309,7 @@ function loadBranches(product)
}
});
(chosenProducts > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide');
(chosenProducts.length > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide');
if($('#productsBox .row .input-group:last select:first').val() != 0)
{