海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.6 KiB

4 years ago
  1. function workorderNotice()
  2. {
  3. $('.product_badge').remove();
  4. $.ajax({
  5. url: '/'+window.location.pathname.split('/')[1]+'/product_audit',
  6. type: 'POST',
  7. data: {},
  8. dataType: 'json',
  9. success: function (res) {
  10. let total = res.total ? res.total : '';
  11. let cloud = res.cloud ? res.cloud : '';
  12. let industry = res.industry ? res.industry : '';
  13. let demand = res.demand ? res.demand : '';
  14. if (total > 0) {
  15. $('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("a").append('<span class="product_badge" style="' +
  16. 'display: inline-block; ' +
  17. 'width: 20px; ' +
  18. 'height: 20px; ' +
  19. 'border-radius: 20px; ' +
  20. 'line-height: 20px; ' +
  21. 'text-align: center; ' +
  22. 'font-size: 12px; ' +
  23. 'background-color: red;' +
  24. 'color: white;' +
  25. '">'+total+'</span>');
  26. }
  27. if (cloud > 0) {
  28. $('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("ul").children(":first-child").children("ul").children("li:eq(1)").children(":first-child").append('<span class="product_badge" style="' +
  29. 'display: inline-block; ' +
  30. 'width: 20px; ' +
  31. 'height: 20px; ' +
  32. 'border-radius: 20px; ' +
  33. 'line-height: 20px; ' +
  34. 'text-align: center; ' +
  35. 'font-size: 12px; ' +
  36. 'background-color: red;' +
  37. 'color: white;' +
  38. '">'+cloud+'</span>');
  39. }
  40. if (industry > 0) {
  41. $('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("ul").children(":eq(1)").children("ul").children("li:eq(1)").children(":first-child").append('<span class="product_badge" style="' +
  42. 'display: inline-block; ' +
  43. 'width: 20px; ' +
  44. 'height: 20px; ' +
  45. 'border-radius: 20px; ' +
  46. 'line-height: 20px; ' +
  47. 'text-align: center; ' +
  48. 'font-size: 12px; ' +
  49. 'background-color: red;' +
  50. 'color: white;' +
  51. '">'+industry+'</span>');
  52. }
  53. if (demand > 0) {
  54. $('a[href*="product/audit"] p').parent().parent().parent().parent().parent().parent().children("ul").children(":eq(2)").children(':first-child').append('<span class="product_badge" style="' +
  55. 'display: inline-block; ' +
  56. 'width: 20px; ' +
  57. 'height: 20px; ' +
  58. 'border-radius: 20px; ' +
  59. 'line-height: 20px; ' +
  60. 'text-align: center; ' +
  61. 'font-size: 12px; ' +
  62. 'background-color: red;' +
  63. 'color: white;' +
  64. '">'+demand+'</span>');
  65. }
  66. },
  67. error: function (error) {
  68. }
  69. });
  70. }
  71. $(document).ready(function () {
  72. workorderNotice();
  73. });
  74. // const workordertimer = setInterval(function () {
  75. // workorderNotice()
  76. // }, 5000);