hxhbtjmain.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. *
  3. **/
  4. $.namespace("hxhbtj.main");
  5. hxhbtj.main.path=null;
  6. hxhbtj.main.init=function(){
  7. };
  8. hxhbtj.main.search=function(){
  9. $("#hxhbtjform").submit();
  10. };
  11. hxhbtj.main.view=function(id){
  12. location.href=$.app+"/hxhbtj/view?id="+id;
  13. };
  14. hxhbtj.main.del=function(data){
  15. $.confirm({
  16. title: '确认框',
  17. content: '确认删除吗',
  18. confirm: function(){
  19. $.post($.app + "/hxhbtj/delete", {
  20. id : data
  21. }, function(data) {
  22. if (data.success) {
  23. $.alert({
  24. title: '提示',
  25. content: '操作成功',
  26. confirm: function(){
  27. $("#hxhbtjform").submit();
  28. }
  29. });
  30. } else {
  31. $.alert({
  32. title: '提示',
  33. content: data.message,
  34. confirm: function(){
  35. }
  36. });
  37. }
  38. }, "json");
  39. },
  40. cancel: function(){
  41. }
  42. });
  43. };
  44. hxhbtj.main.back=function(){
  45. if( hxhbtj.main.path!=null&& hxhbtj.main.path!='') {
  46. location.href=$.app+ hxhbtj.main.path;
  47. } else {
  48. location.href=$.app+"/hxhbtj/main";
  49. }
  50. };
  51. hxhbtj.main.add=function(){
  52. location.href=$.app+"/hxhbtj/add";
  53. };
  54. hxhbtj.main.edit=function(data){
  55. location.href=$.app+"/hxhbtj/edit?id="+data;
  56. };