From 482d947ae101acaf44e02da06918b56eaa9fafd5 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 19 Feb 2025 09:25:15 +0800 Subject: [PATCH] Revert "+ [task#137378,dong,1h] add updateItems." This reverts commit 6b3642b02fdbcf336b9823317cfbe14dd897e302. --- lib/zin/wg/productcharterbox/js/v1.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lib/zin/wg/productcharterbox/js/v1.js b/lib/zin/wg/productcharterbox/js/v1.js index 67045e187a..0fc32febbd 100644 --- a/lib/zin/wg/productcharterbox/js/v1.js +++ b/lib/zin/wg/productcharterbox/js/v1.js @@ -209,17 +209,6 @@ window.updateItems = function(currentProduct = '', currentBranch = '') { if($('[name^=product][value="' + productID + '"]').length > 0) { - const $branch = $('[name^=product][value="' + productID + '"]').closest('.productBox').find('[name^="branch"]'); - const branchItems = $branch.zui('picker').options.items - - if(!chosenBranches[productID]) chosenBranches[productID] = []; - $('[name^=product][value="' + productID + '"]').closest('.productBox').find('[name^="branch"]').each(function() - { - const branchID = $(this).val().toString(); - if(!isNaN(branchID) && !chosenBranches[productID].includes(branchID) && branchID !== '') chosenBranches[productID].push(branchID); - }); - - if(chosenBranches[productID].length != branchItems.length) allItems[i].disabled = false; } else { @@ -227,15 +216,4 @@ window.updateItems = function(currentProduct = '', currentBranch = '') } } } - - $(".productsBox [name^='product']").each(function() - { - const $product = $(this).zui('picker'); - const productID = $(this).val(); - let currentProductItems = JSON.parse(JSON.stringify(allItems)); - - if(productID != 0) currentProductItems[productItems[productID].i].disabled = false; - - $product.render({items: currentProductItems}); - }); }