processinquiry.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. var turnAll = function(gridId,condition){//全部采纳
  2. setLoading(true);
  3. $.ajax({
  4. url:basePath+"common/vastAgreeAllTurnPrice.action?_noc=1",
  5. type: 'POST',
  6. data: {caller:'ToPrice',id:current.jp_keyValue},
  7. success: function(result){
  8. setLoading(false);
  9. $.showtip("全部采纳成功!", 2000);
  10. loadNewGridStore(gridId,condition);
  11. },
  12. error:function(){
  13. setLoading(false);
  14. }
  15. });
  16. };
  17. var unTurn = function(gridId,s,condition){//不采纳
  18. setLoading(true);
  19. $.ajax({
  20. url:basePath+"common/vastNotAgreeTurnPrice.action?_noc=1",
  21. type: 'POST',
  22. data: {caller:'ToPrice',id:s.toString()},
  23. success: function(result){
  24. setLoading(false);
  25. $.showtip("处理成功!", 2000);
  26. loadNewGridStore(gridId,condition);
  27. },
  28. error:function(){
  29. setLoading(false);
  30. }
  31. });
  32. };
  33. var turnVast = function(gridId,s,condition){//根据勾选结果进行采纳操作
  34. setLoading(true);
  35. $.ajax({
  36. url:basePath+"common/vastAgreeTurnPrice.action?_noc=1",
  37. type: 'POST',
  38. data: {caller:'ToPrice',id:s.toString()},
  39. success: function(result){
  40. setLoading(false);
  41. $.showtip("处理成功!", 2000);
  42. loadNewGridStore(gridId,condition);
  43. },
  44. error:function(){
  45. setLoading(false);
  46. }
  47. });
  48. }
  49. function inquirydetail (i,data,colModel,condition){
  50. jQuery('#grid'+i).jqGrid({
  51. "hoverrows":false,
  52. "viewrecords":true,
  53. "gridview":true,
  54. "data": data,
  55. "scrollPaging":true,
  56. "shrinkToFit":false,
  57. "autoScroll": true,
  58. "width":$('#topToolbar').width(),
  59. "rowNum":data.lenght,
  60. "datatype": "local",
  61. "colModel":colModel,
  62. "pgbuttons":false,//是否显示翻页按钮
  63. "pginput":false,//是否显示跳转页面的输入框
  64. "multiselect" : true,//自定义多选
  65. gridComplete:function(){
  66. var grid = $(this);
  67. var ids = grid.getDataIDs();
  68. for (var i = 0; i < ids.length; i++) {
  69. grid.setRowData( ids[i], false, {height: 35} );
  70. }
  71. },
  72. "pager":"#pager"+i
  73. });
  74. jQuery('#grid'+i).jqGrid('navGrid','#pager'+i,{add:false,edit:false,del:false,refresh:false},{reloadAfterSubmit:false},{},{},{multipleSearch:true});
  75. jQuery('#grid'+i).navGrid('#pager'+i,{add:false,edit:false,del:false,refresh:false},{reloadAfterSubmit:false},{},{},{multipleSearch:true}
  76. ).navButtonAdd('#pager'+i,{
  77. caption : "不采纳",
  78. id:'unturn',
  79. buttonicon:'glyphicon glyphicon-remove-sign',
  80. position:'first',
  81. onClickButton : function() {
  82. var s = jQuery("#grid"+i).jqGrid('getGridParam', 'selarrrow');
  83. console.log(s);
  84. if(s.length != 0){
  85. unTurn('grid'+i,s,condition);
  86. }else{
  87. $.showtip("请勾选需要处理的明细行!", 500);
  88. }
  89. }
  90. }).navButtonAdd('#pager'+i,{
  91. caption : "全部采纳",
  92. id:'turn',
  93. buttonicon:'glyphicon glyphicon-ok-sign',
  94. position:'first',
  95. onClickButton : function() {
  96. turnAll('grid'+i,condition);
  97. }
  98. }).navButtonAdd('#pager'+i,{
  99. caption : "采纳",
  100. id:'turnVast',
  101. buttonicon:'glyphicon glyphicon-ok-sign',
  102. position:'first',
  103. onClickButton : function() {
  104. var s = jQuery("#grid"+i).jqGrid('getGridParam', 'selarrrow');
  105. if(s.length != 0){
  106. turnVast('grid'+i,s,condition);
  107. }else{
  108. $.showtip("请勾选需要处理的明细行!", 500);
  109. }
  110. }
  111. });
  112. $('#pager'+i+'_left').width("60%");
  113. $('#pager'+i+'_center').width("0%");
  114. $('#pager'+i+'_right').width("40%");
  115. $("#turn div span").removeClass("ui-icon");
  116. $("#unturn div span").removeClass("ui-icon");
  117. $("#turnVast div span").removeClass("ui-icon");
  118. //增加采纳和不采纳按钮
  119. /*$("#t_grid"+i).height(35).append(
  120. "<button type='button' id='turn' style='height:30px;margin:2px 5px 2px 10px;border-radius:8px;vertical-align: middle;'>" +
  121. "<span class='glyphicon glyphicon-ok-sign'></span>&nbsp;全部采纳</button>" +
  122. "<button type='button' id='unturn' style='height:30px;margin:2px 5px 2px 10px;border-radius:8px;vertical-align: middle;'>" +
  123. "<span class='glyphicon glyphicon-remove-sign'></span>&nbsp;不采纳</button>");*/
  124. }