lhyxmain.js 2.7 KB

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