* When repairing the project and execution linked products, the branch judgment problem.

This commit is contained in:
tianshujie
2021-11-11 09:42:37 +08:00
parent 16251869b4
commit 5582354037
4 changed files with 48 additions and 64 deletions
+12 -16
View File
@@ -10,33 +10,29 @@ $().ready(function()
/* Determine whether the products of the same branch are linked. */
$("#productsBox select[name^='products']").each(function()
{
var productID = $(this).val();
products[productID] = new Array();
var productID = $(this).val();
if(typeof(products[productID]) == 'undefined') products[productID] = new Array();
if(multiBranchProducts[productID])
{
$("#productsBox select[name^='branch']").each(function()
var branchID = $(this).closest('.input-group').find("select[id^=branch]").val();
if(products[productID][branchID])
{
var branchID = $(this).val();
if(products[productID][branchID])
{
existedBranch = true;
return false;
}
else
{
products[productID][branchID] = branchID;
}
})
existedBranch = true;
}
else
{
products[productID][branchID] = branchID;
}
if(existedBranch) return false;
}
})
});
if(existedBranch)
{
bootbox.alert(errorSameBranches);
return false;
}
})
});
});
$(function()