csjlcsList.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. var csjlcs = new Object();
  2. csjlcs.loadSearchModule = function(p) {
  3. var $div = $("#" + p.id);
  4. if ($div.length > 0) {
  5. $div.load('csszSearchModule.htm', {
  6. from : p.from,
  7. callBackFunName : p.callBackFunName
  8. }, function() {
  9. });
  10. }
  11. };
  12. /**
  13. * 加载参数设置查询模块
  14. */
  15. csjlcs.loadSearchModule({
  16. id : 'csjlcsSearchModule',
  17. from : 'csjlcs',
  18. callBackFunName : 'searchCsjlcsCallBack'
  19. });
  20. /**
  21. * 搜索条件回调函数
  22. *
  23. * @param {搜索条件对象}
  24. * data
  25. * @param {分隔符}
  26. * fgf
  27. */
  28. function searchCsjlcsCallBack(data, fgf) {
  29. huimv.searchGrid("csjlcsGrid", {
  30. url : 'getCsjlcsList.htm',
  31. params : [{
  32. name : 'param',
  33. value : data
  34. }, {
  35. name : 'fgf',
  36. value : fgf
  37. }]
  38. }, '<b>采食计量参数设置搜索结果</b>');
  39. }
  40. /**
  41. * 加载采食计量参数设置列表数据
  42. */
  43. function loadCsjlcsGrid(csjlcsSearchGrid) {
  44. jQuery("#csjlcsGrid").flexigrid({
  45. url : 'getCsjlcsList.htm',
  46. dataType : 'json',
  47. method : 'post',
  48. params : [{
  49. name : 'csjlcsSearchGrid',
  50. value : $('#csjlcsSearchGrid').val()
  51. }, {
  52. name : 'from',
  53. value : $('#from').val()
  54. }],
  55. title : '<b>采食计量参数设置浏览</b>',
  56. usepager : true,
  57. useRp : true,
  58. rp : 10,
  59. singleSelect : true,
  60. hidehead : false,
  61. showInputPage : true,
  62. showSelectRp : false,
  63. showTableToggleBtn : false,
  64. width : '790',
  65. resizable : false,
  66. height : '335',
  67. cache : false,// 清除缓存
  68. colModel : [{
  69. display : '行号',
  70. name : 'hh',
  71. width : 25,
  72. sortable : false,
  73. align : 'center',
  74. process : function(col, record, d) {
  75. jQuery(col).html(d + 1);
  76. }
  77. }, {
  78. display : '机器编号',
  79. name : 'jqid',
  80. width : 100,
  81. sortable : true,
  82. align : 'center',
  83. process : function(col, record, postion, pid) {
  84. jQuery(col).addClass('s');
  85. jQuery(col).html('<a onclick="viewCsjlcs(' + record.id + ');">' + record.jqid + '</a>');
  86. }
  87. }, {
  88. display : '牧场名称',
  89. name : 'mcmc',
  90. width : 140,
  91. sortable : false,
  92. align : 'center'
  93. }, {
  94. display : '猪舍名称',
  95. name : 'zsmc',
  96. width : 100,
  97. sortable : false,
  98. align : 'center'
  99. }, {
  100. display : '下发标志',
  101. name : '',
  102. width : 100,
  103. sortable : true,
  104. align : 'center',
  105. process : function(col, record, postion, pid) {
  106. if (record.xfbz == 1) {
  107. jQuery(col).html("下发中");
  108. } else {
  109. jQuery(col).html("未下发");
  110. }
  111. }
  112. }]
  113. });
  114. }
  115. loadCsjlcsGrid($('#csjlcsSearchGrid'));
  116. /**
  117. * 加载参数设置查看页面
  118. * @param id
  119. */
  120. function viewCsjlcs(id) {
  121. huimv.loadPage('yjsbRight', 'viewCsjlcs.htm', {
  122. "id" : id
  123. });
  124. }