Nenhuma Descrição

check.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.on("click", ".opt-examine", function () {
  28. var $this = $(this);
  29. var $id = $this.parent().attr("userId");
  30. util.get("../ajax/userinfo/id/" + $id, null, function (data) {
  31. if (data) {
  32. spa.showModal("sys_userinfo_examine", {
  33. data: data, hand: function () {
  34. pdg.load()
  35. }
  36. })
  37. } else {
  38. util.alert("用户不存在了", function () {
  39. pdg.load();
  40. });
  41. }
  42. }, {});
  43. });
  44. root.on("click", ".opt-review", function () {
  45. var $this = $(this);
  46. var $id = $this.parent().attr("userId");
  47. util.get("../ajax/userinfo/id/" + $id, null, function (data) {
  48. if (data) {
  49. if (data.state == "2") {
  50. spa.showModal("sys_userinfo_review", {
  51. data: data, hand: function () {
  52. pdg.reload();
  53. }
  54. })
  55. } else {
  56. util.alert("只有待审核的可以点击");
  57. }
  58. } else {
  59. util.alert("用户不存在了", function () {
  60. pdg.load();
  61. });
  62. }
  63. });
  64. });
  65. pdg.code.listen($.dict.doTransfer);
  66. pdg.load();
  67. },
  68. mainDestory: function () {
  69. },
  70. };
  71. });
  72. });