lhbgmain.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /**
  2. * 理货变更
  3. *
  4. */
  5. $.namespace("lhbg.main");
  6. lhbg.main.szd = null;
  7. lhbg.main.szgq = null;
  8. lhbg.main.szgk = null;
  9. lhbg.main.init = function() {
  10. lhbg.main.sel();
  11. // 把form传入,构造翻页控件
  12. pageinfo($("#lhbgform"));
  13. }
  14. lhbg.main.sel = function(){
  15. initszdSelect('szdsel', lhbg.main.szd, 'showgk', '80%');
  16. initgkSelect('gksel', lhbg.main.szgk, lhbg.main.szd,'showgq', '80%');
  17. initgqSelect('gqsel', lhbg.main.szgq, lhbg.main.szd,lhbg.main.szgk, null, '80%');
  18. }
  19. function showgk() {
  20. initgqSelect('gqsel','','','',null,'80%');
  21. initgkSelect('gksel', lhbg.main.szgk, $('.szdselectpicker').val(),
  22. 'showgq', '80%');
  23. }
  24. function showgq() {
  25. initgqSelect('gqsel', lhbg.main.szgq, $('.szdselectpicker').val(),
  26. $('.gkselectpicker').val(), null, '80%');
  27. }
  28. //新增
  29. lhbg.main.add = function() {
  30. $.ajax({
  31. async : true,
  32. url : $.app + "/xkzxx/findByjyrid",
  33. type : "post",
  34. dataType : "json",
  35. success : function(data) {// ajax返回的数据
  36. if (data.success) {
  37. location.href=$.app+"/lhbg/add";
  38. } else {
  39. $.alert({
  40. title : '提示',
  41. content : data.message,
  42. confirm : function() {
  43. }
  44. });
  45. }
  46. }
  47. });
  48. }
  49. lhbg.main.search=function(){
  50. $('#pagejump').val(1);
  51. $("#lhbgform").submit();
  52. }
  53. lhbg.main.del=function(data){
  54. $.confirm({
  55. title: '确认框',
  56. content: '确认删除吗',
  57. confirm: function(){
  58. $.post($.app + "/lhbg/delete", {
  59. id : data
  60. }, function(data) {
  61. if (data.success) {
  62. $.alert({
  63. title: '提示',
  64. content: '删除成功',
  65. confirm: function(){
  66. $("#lhbgform").submit();
  67. }
  68. });
  69. } else {
  70. $.alert({
  71. title: '提示',
  72. content: data.message,
  73. confirm: function(){
  74. }
  75. });
  76. }
  77. }, "json");
  78. },
  79. cancel: function(){
  80. }
  81. });
  82. }
  83. lhbg.main.edit=function(data){
  84. location.href=$.app+"/lhbg/edit?id="+data;
  85. }
  86. lhbg.main.back=function(data){
  87. location.href=$.app+"/lhbg/edit?flag=th&id="+data;
  88. }
  89. lhbg.main.banli=function(data){
  90. location.href=$.app+"/lhbg/view?flag=audit&id="+data;
  91. }
  92. lhbg.main.view=function(data){
  93. location.href=$.app+"/lhbg/view?id="+data;
  94. }
  95. lhbg.main.submit=function(data){
  96. $.post($.app + "/lhbg/saveTbzt", {
  97. id : data
  98. }, function(data) {
  99. if (data.success) {
  100. $.alert({
  101. title: '提示',
  102. content: '转办省级成功',
  103. confirm: function(){
  104. $("#lhbgform").submit();
  105. }
  106. });
  107. } else {
  108. $.alert({
  109. title: '提示',
  110. content: data.message,
  111. confirm: function(){
  112. }
  113. });
  114. }
  115. }, "json");
  116. }