Aucune description

salesindex.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ;
  2. spa_define(function() {
  3. return $.use(["spa", "pagedatagrid", "util"], function(spa, pdgf, util) {
  4. return {
  5. main: function() {
  6. var root = spa.findInMain(".sys_customer_salesindex");
  7. var pdg = pdgf.build(root);
  8. pdg.code.shell("showDay", function(env) {
  9. if (env.cd && env.cd[this.k]) {
  10. var day = env.cd[this.k];
  11. return day.substring(0, 4) + "-" + day.substring(4, 6) + "-" + day.substring(6, 8);
  12. }
  13. return "";
  14. });
  15. pdg.code.listen($.dict.doTransfer);
  16. root.find(".opt-query").on("click", function() {
  17. pdg.load();
  18. });
  19. pdg.load();
  20. root.on("click", ".icon-edit", function() {
  21. var $this = $(this);
  22. var powerId = $this.parent().attr("powerId");
  23. util.get("../ajax/sys/mycustomer/id/" + powerId, null, function(rd) {
  24. if (rd) {
  25. spa.showModal("sys_customer_salesedit", {
  26. data: rd,
  27. hand: function() {
  28. pdg.load()
  29. }
  30. })
  31. } else {
  32. util.alert("机构已不存在", function() {
  33. pdg.load();
  34. });
  35. }
  36. }, {});
  37. });
  38. root.on("click",".table-opt a.name", function () {
  39. var professorId = $(this).parent().attr("professorId");
  40. window.open('http://www.ekexiu.com/information-brow.html?professorId=' + professorId);
  41. });
  42. }
  43. };
  44. });
  45. });