TunnelIndex.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. var refreshGirdData;
  2. var OneInTimebegin = '';
  3. var OneInTimeend = '';
  4. var ProductTimebegin = '';
  5. var ProductTimeend = '';
  6. var logbegin = '';
  7. var logend = '';
  8. var postData;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. // 调用后台查询
  19. // queryJson 查询条件
  20. queryJson["Tunnel"] = $("#Tunnel").val();
  21. page.search({ queryJson: JSON.stringify(queryJson) });
  22. }, 250);
  23. // 查询
  24. $('#btn_Search').on('click', function () {
  25. var keyword = $('#txt_Keyword').val();
  26. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });
  27. });
  28. // 刷新
  29. $('#lr_refresh').on('click', function () {
  30. location.reload();
  31. });
  32. // 启用
  33. $('#lr_enable').on('click', function () {
  34. postData = $('#gridtable').jfGridGet("rowdata");
  35. if (postData.length == 0) {
  36. learun.alert.error('未选择行!');
  37. return false;
  38. }
  39. learun.layerForm({
  40. id: 'form1',
  41. title: '启用巷道备注框',
  42. url: top.$.rootUrl + '/SXManager/SysCon/StartIndex',
  43. width: 700,
  44. height: 300,
  45. callBack: function (id) {
  46. return top[id].acceptClick(refreshGirdData);
  47. }
  48. });
  49. });
  50. // 禁用
  51. $('#lr_disable').on('click', function () {
  52. postData = $('#gridtable').jfGridGet("rowdata");
  53. if (postData.length == 0) {
  54. learun.alert.error('未选择行!');
  55. return false;
  56. }
  57. learun.layerForm({
  58. id: 'form2',
  59. title: '禁用填写备注框',
  60. url: top.$.rootUrl + '/SXManager/SysCon/StopIndex',
  61. width: 700,
  62. height: 300,
  63. callBack: function (id) {
  64. return top[id].acceptClick(refreshGirdData);
  65. }
  66. });
  67. });
  68. },
  69. // 初始化列表
  70. initGird: function () {
  71. $('#gridtable').jfGrid({
  72. url: top.$.rootUrl + '/SXManager/SysCon/GetTunnelList',
  73. headData: [
  74. { label: "仓库", name: "WareHouseName", width: 80, align: "left" },
  75. { label: "巷道", name: "Tunnel", width: 50, align: "left" },
  76. { label: "名称", name: "Name", width: 100, align: "left" },
  77. { label: "状态", name: "StatuName", width: 50, align: "left" },
  78. { label: "备注", name: "Memo", width: 80, align: "left" },
  79. { label: "创建时间", name: "AddTime", width: 130, align: "left" },
  80. { label: "更新时间", name: "EditTime", width: 130, align: "left" },
  81. ],
  82. mainId: 'Id',
  83. isPage: true,
  84. reloadSelected: true,
  85. autowWidth: true,
  86. sidx: 'AddTime',
  87. sord: 'DESC',
  88. isMultiselect: true,
  89. });
  90. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });
  91. },
  92. search: function (param) {
  93. param = param || { queryJson: JSON.stringify({ InvStateCode: 3 }) };
  94. $('#gridtable').jfGridSet('reload', param);
  95. }
  96. };
  97. refreshGirdData = function () {
  98. page.search();
  99. };
  100. page.init();
  101. }