説明なし

check.js 3.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * Created by TT on 2017/7/12.
  3. */
  4. ;
  5. spa_define(function () {
  6. return $.use(["spa", "pagedatagrid", "util"], function (spa, pdgf, util) {
  7. return {
  8. main: function () {
  9. var root = spa.findInMain(".sys_userinfo_check");
  10. var pdg = pdgf.build(root);
  11. root.find(".opt-query").on("click", function () {
  12. pdg.load();
  13. });
  14. root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function () {
  15. var $this = $(this);
  16. $this.toggleClass("checked");
  17. if ($this.hasClass("checked")) {
  18. root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked");
  19. } else {
  20. root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked");
  21. }
  22. });
  23. root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function () {
  24. var $this = $(this);
  25. $this.toggleClass("checked");
  26. });
  27. root.find(".opt-examine").on("click", function () {
  28. var $org = root.find("td.opt-check>i.checked");
  29. if ($org.length) {
  30. if ($org.length > 1) {
  31. util.alert("只能选择一个用户");
  32. } else {
  33. util.get("../ajax/userinfo/id/" + $org.attr("userId"), null, function (data) {
  34. if (data) {
  35. spa.showModal("sys_userinfo_examine", {
  36. data: data, hand: function () {
  37. pdg.load()
  38. }
  39. })
  40. } else {
  41. util.alert("用户不存在了", function () {
  42. pdg.load();
  43. });
  44. }
  45. }, {});
  46. }
  47. } else {
  48. util.alert("请选择一个用户");
  49. }
  50. });
  51. root.find(".opt-review").on("click", function () {
  52. var $check = root.find("td.opt-check>i.checked");
  53. if ($check.length) {
  54. if ($check.length > 1) {
  55. util.alert("只能选择一个用户")
  56. } else {
  57. util.get("../ajax/userinfo/id/" + $check.attr("userId"), null, function (data) {
  58. if (data) {
  59. if (data.state == "2") {
  60. spa.showModal("sys_userinfo_review", {
  61. data: data, hand: function () {
  62. pdg.load()
  63. }
  64. })
  65. } else {
  66. util.alert("只有待审核的可以点击");
  67. }
  68. } else {
  69. util.alert("用户不存在了", function () {
  70. pdg.load();
  71. });
  72. }
  73. });
  74. }
  75. } else {
  76. util.alert("请选择一名专家");
  77. }
  78. });
  79. pdg.code.listen($.dict.doTransfer);
  80. pdg.load();
  81. },
  82. mainDestory: function () {
  83. },
  84. };
  85. });
  86. });