lhsqmain.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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, '80%');
  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.fz = function(data) {
  34. location.href = $.app + "/xkzxx/editLhxkz?status=111&id=" + data;
  35. }
  36. lhsq.main.back = function(data) {
  37. location.href = $.app + "/gklhsq/editmain?flag=th&id=" + data;
  38. }
  39. lhsq.main.view = function(data) {
  40. location.href = $.app + "/lhsq/view?id=" + data;
  41. }
  42. lhsq.main.del = function(data) {
  43. $.confirm({
  44. title : '确认框',
  45. content : '确认删除吗',
  46. confirm : function() {
  47. $.post($.app + "/lhsq/delete", {
  48. id : data
  49. }, function(data) {
  50. if (data.success) {
  51. $.alert({
  52. title : '提示',
  53. content : '删除成功',
  54. confirm : function() {
  55. $("#lhsqform").submit();
  56. }
  57. });
  58. } else {
  59. $.alert({
  60. title : '提示',
  61. content : data.message,
  62. confirm : function() {
  63. }
  64. });
  65. }
  66. }, "json");
  67. },
  68. cancel : function() {
  69. }
  70. });
  71. }
  72. //新增
  73. lhsq.main.add = function() {
  74. $.ajax({
  75. async : true,
  76. url : $.app + "/xkzxx/findByjyrid",
  77. type : "post",
  78. dataType : "json",
  79. data:{
  80. flag :1
  81. },
  82. success : function(data) {// ajax返回的数据
  83. if (data.success) {
  84. location.href = $.app + "/lhsq/add";
  85. } else {
  86. $.alert({
  87. title : '提示',
  88. content : data.message,
  89. confirm : function() {
  90. }
  91. });
  92. }
  93. }
  94. });
  95. }
  96. lhsq.main.banli=function(data){
  97. location.href=$.app+"/lhsq/view?flag=audit&id="+data;
  98. }
  99. lhsq.main.submit=function(data){
  100. $.post($.app + "/lhsq/saveTbzt", {
  101. id : data
  102. }, function(data) {
  103. if (data.success) {
  104. $.alert({
  105. title: '提示',
  106. content: '转办省级成功',
  107. confirm: function(){
  108. $("#lhsqform").submit();
  109. }
  110. });
  111. } else {
  112. $.alert({
  113. title: '提示',
  114. content: data.message,
  115. confirm: function(){
  116. }
  117. });
  118. }
  119. }, "json");
  120. }