jghdmain.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. $.namespace("jghd.main");
  2. jghd.main.init=function(){
  3. //把form传入,构造翻页控件
  4. pageinfo($("#jghdform"));
  5. };
  6. jghd.main.search=function(){
  7. $('#pagejump').val(1);
  8. $("#jghdform").submit();
  9. };
  10. jghd.main.del=function(data){
  11. $.confirm({
  12. title: '确认框',
  13. content: '确认删除吗',
  14. confirm: function(){
  15. $.post($.app + "/jghd/delete", {
  16. id : data
  17. }, function(data) {
  18. if (data.success) {
  19. $.alert({
  20. title: '提示',
  21. content: '删除成功',
  22. confirm: function(){
  23. $("#jghdform").submit();
  24. }
  25. });
  26. } else {
  27. $.alert({
  28. title: '提示',
  29. content: data.message,
  30. confirm: function(){
  31. }
  32. });
  33. }
  34. }, "json");
  35. },
  36. cancel: function(){
  37. }
  38. });
  39. };
  40. jghd.main.edit=function(data){
  41. location.href=$.app+"/jghd/edit?id="+data;
  42. };
  43. jghd.main.view=function(data){
  44. location.href=$.app+"/jghd/view?id="+data;
  45. };
  46. /**
  47. * 弹出新增页面
  48. * */
  49. jghd.main.add=function(){
  50. location.href=$.app+"/jghd/add";
  51. };