lqwhList.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /**
  2. * 加载栏期档案维护列表数据
  3. */
  4. function loadLqwhGrid(lqbh) {
  5. var daxx_lqda_lqxx_czwh_update = $("#daxx_lqda_lqxx_czwh_update").val();
  6. var daxx_lqda_lqxx_czwh_delete = $("#daxx_lqda_lqxx_czwh_delete").val();
  7. jQuery("#lqwhGrid").flexigrid({
  8. url : 'getLqwhList.htm',
  9. dataType : 'json',
  10. method : 'post',
  11. params : [{
  12. name : 'lqid',
  13. value : $('#lqid').val()
  14. }],
  15. title : '<b>栏期档案维护浏览</b>',
  16. usepager : true,
  17. useRp : true,
  18. rp : 10,
  19. singleSelect : true,
  20. hidehead : false,
  21. showInputPage : true,
  22. showSelectRp : false,
  23. showTableToggleBtn : false,
  24. width : '790',
  25. height : '310',
  26. resizable : false,
  27. cache : false, // 清除缓存
  28. colModel : [{
  29. display : '行号',
  30. name : 'hh',
  31. width : 20,
  32. sortable : false,
  33. align : 'center',
  34. process : function(col, record, d) {
  35. jQuery(col).html(d + 1);
  36. }
  37. }, {
  38. display : '猪舍名称',
  39. name : 'zsmc',
  40. width : 80,
  41. sortable : false,
  42. align : 'center'
  43. }, {
  44. display : '栏期名称',
  45. name : 'lqmc',
  46. width : 60,
  47. sortable : false,
  48. align : 'center'
  49. }, {
  50. display : '发生时间',
  51. name : 'fssj',
  52. width : 120,
  53. sortable : true,
  54. align : 'center'
  55. }, {
  56. display : '在栏数',
  57. name : 'zls',
  58. width : 35,
  59. sortable : false,
  60. align : 'center'
  61. }, {
  62. display : '入栏数',
  63. name : 'rls',
  64. width : 35,
  65. sortable : false,
  66. align : 'center'
  67. }, {
  68. display : '入栏平均体重(Kg)',
  69. name : 'rlpjtz',
  70. width : 90,
  71. sortable : false,
  72. align : 'center'
  73. }, {
  74. display : '出栏数',
  75. name : 'cls',
  76. width : 35,
  77. sortable : false,
  78. align : 'center'
  79. }, {
  80. display : '出栏平均体重(Kg)',
  81. name : 'clpjtz',
  82. width : 90,
  83. sortable : false,
  84. align : 'center'
  85. }, {
  86. display : '售出数',
  87. name : 'scs',
  88. width : 35,
  89. sortable : false,
  90. align : 'center'
  91. }, {
  92. display : '售出平均体重(Kg)',
  93. name : 'scpjtz',
  94. width : 90,
  95. sortable : false,
  96. align : 'center'
  97. }, {
  98. display : '隔离数',
  99. name : 'gls',
  100. width : 35,
  101. sortable : false,
  102. align : 'center'
  103. }, {
  104. display : '隔离平均体重(Kg)',
  105. name : 'glpjtz',
  106. width : 90,
  107. sortable : false,
  108. align : 'center'
  109. }, {
  110. display : '死亡数',
  111. name : 'sws',
  112. width : 35,
  113. sortable : false,
  114. align : 'center'
  115. }, {
  116. display : '死亡平均体重(Kg)',
  117. name : 'swpjtz',
  118. width : 90,
  119. sortable : false,
  120. align : 'center'
  121. }, {
  122. display : '淘汰数',
  123. name : 'tts',
  124. width : 35,
  125. sortable : false,
  126. align : 'center'
  127. }, {
  128. display : '淘汰平均体重(Kg)',
  129. name : 'ttpjtz',
  130. width : 90,
  131. sortable : false,
  132. align : 'center'
  133. }, {
  134. display : '操作',
  135. name : 'cz',
  136. width : 50,
  137. sortable : false,
  138. align : 'center'
  139. }, {
  140. display : '修改时间',
  141. name : 'xgsj',
  142. width : 120,
  143. sortable : false,
  144. align : 'center'
  145. }, {
  146. display : '操作维护',
  147. name : '',
  148. width : 85,
  149. sortable : false,
  150. align : 'center',
  151. process : function(col, record, postion, pid) {
  152. jQuery(col).addClass('s');
  153. var str = '';
  154. if (daxx_lqda_lqxx_czwh_delete == "true") {
  155. str += '<a onclick="disableLqwh(\'' + record.id +'\',\'' + record.lqid + '\');">删除</a>&nbsp;&nbsp;&nbsp;';
  156. }
  157. if (daxx_lqda_lqxx_czwh_update == "true") {
  158. str += '<a onclick="editLqwh(\'' + record.id + '\');">修改</a>';
  159. }
  160. jQuery(col).html(str);
  161. }
  162. }]
  163. });
  164. }
  165. loadLqwhGrid($('#lqid'));
  166. /**
  167. * 导出栏期维护
  168. * @param lqid
  169. */
  170. function exportLqwhExcel(lqid) {
  171. if (confirm('是否确认导出为Excel?')) {
  172. var url = 'getLqwhList.htm';
  173. window.open(
  174. url + '?exportExcel=exportExcel&lqid=' +lqid,
  175. 'newwindow',
  176. 'height=630, width=800, top=50, left=250, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
  177. }
  178. }
  179. /**
  180. * 修改栏期维护
  181. * @param id
  182. */
  183. function editLqwh(id) {
  184. huimv.loadPage("lqdaRight", "editLqwh.htm", {
  185. "id" : id,
  186. "from": "view"
  187. });
  188. }
  189. /**
  190. * 删除栏期维护
  191. */
  192. function disableLqwh(id,lqid) {
  193. Dialogs.alert("确定作废当前栏期维护日志?", {
  194. title : '提示信息',
  195. width : 250,
  196. height : 80,
  197. top : 150,
  198. button : {
  199. ok : ['确定',function(){
  200. this.close();
  201. huimv.showProcessModel('处理数据中');
  202. jQuery.ajax({
  203. url : 'disableLqwh.htm',
  204. dataType : 'json',
  205. type : 'post',
  206. cache : false,
  207. data : {"id" : id},
  208. success : function(data) {
  209. huimv.hideProcessModel();
  210. if (data.returnCode > 0) {
  211. viewLqwhList(lqid);
  212. } else {
  213. Dialogs.alert("传入参数有误!", {
  214. width : 300,
  215. height : 50
  216. });
  217. }
  218. },
  219. error : function(data) {
  220. huimv.showError(data.responseText);
  221. }
  222. });
  223. }],
  224. cancel : ['取消',function(){
  225. this.close();
  226. }]
  227. }
  228. });
  229. }