lhsqmain.js 2.8 KB

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