manageproducts.ui.js 978 B

1234567891011121314151617181920212223242526272829
  1. window.checkUnlink = function()
  2. {
  3. const $elem = $(this);
  4. if($elem.prop('checked')) return true;
  5. const productID = +$elem.val();
  6. if(unmodifiableProducts.includes(productID))
  7. {
  8. const $branch = $elem.closest('.product-block').find('.pick-value[name^=branch]');
  9. if($branch.length)
  10. {
  11. const branchID = +$branch.val();
  12. if(unmodifiableBranches.includes(branchID) && linkedStoryIDList[productID][branchID])
  13. {
  14. zui.Modal.confirm(unLinkProductTip.replace("%s", allProducts[productID] + branchGroups[productID][branchID])).then((result) =>
  15. {
  16. if(!result) $elem.prop('checked', true);
  17. });
  18. }
  19. }
  20. else
  21. {
  22. zui.Modal.confirm(unLinkProductTip.replace("%s", allProducts[productID])).then((result) =>
  23. {
  24. if(!result) $elem.prop('checked', true);
  25. });
  26. }
  27. }
  28. }