lhyxmain.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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, 200);
  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. $("#lhyxform").submit();
  55. }
  56. lhyx.main.del = function(data) {
  57. $.confirm({
  58. title : '确认框',
  59. content : '确认删除吗',
  60. confirm : function() {
  61. $.post($.app + "/lhyx/delete", {
  62. id : data
  63. }, function(data) {
  64. if (data.success) {
  65. $.alert({
  66. title : '提示',
  67. content : '删除成功',
  68. confirm : function() {
  69. $("#lhyxform").submit();
  70. }
  71. });
  72. } else {
  73. $.alert({
  74. title : '提示',
  75. content : data.message,
  76. confirm : function() {
  77. }
  78. });
  79. }
  80. }, "json");
  81. },
  82. cancel : function() {
  83. }
  84. });
  85. }
  86. lhyx.main.edit = function(data) {
  87. location.href = $.app + "/lhyx/edit?id=" + data;
  88. }
  89. lhyx.main.back = function(data) {
  90. location.href = $.app + "/lhyx/edit?flag=th&id=" + data;
  91. }
  92. lhyx.main.banli = function(data) {
  93. location.href = $.app + "/lhyx/view?flag=audit&id=" + data;
  94. }
  95. lhyx.main.view = function(data) {
  96. location.href = $.app + "/lhyx/view?id=" + data;
  97. }
  98. lhyx.main.submit = function(data) {
  99. $.post($.app + "/lhyx/saveTbzt", {
  100. id : data
  101. }, function(data) {
  102. if (data.success) {
  103. $.alert({
  104. title : '提示',
  105. content : '转办省级成功',
  106. confirm : function() {
  107. $("#lhyxform").submit();
  108. }
  109. });
  110. } else {
  111. $.alert({
  112. title : '提示',
  113. content : data.message,
  114. confirm : function() {
  115. }
  116. });
  117. }
  118. }, "json");
  119. }