hxhbtjmain.js 1.4 KB

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