TunnelIndex.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 + '/PTManager/SysCon/RemarkIndex',
  43. width: 700,
  44. height: 300,
  45. callBack: function (id) {
  46. return top[id].acceptClick(refreshGirdData);
  47. }
  48. });
  49. //learun.layerConfirm('是否确认启用该巷道!', function (res) {
  50. // if (res) {
  51. // learun.postForm(top.$.rootUrl + '/PTManager/SysCon/EnableTunnel', { ids: JSON.stringify(postData.map((item) => item.Id)) }, function () {
  52. // refreshGirdData();
  53. // });
  54. // }
  55. //});
  56. });
  57. // 禁用
  58. $('#lr_disable').on('click', function () {
  59. postData = $('#gridtable').jfGridGet("rowdata");
  60. if (postData.length == 0) {
  61. learun.alert.error('未选择行!');
  62. return false;
  63. }
  64. learun.layerForm({
  65. id: 'form2',
  66. title: '禁用填写备注框',
  67. url: top.$.rootUrl + '/PTManager/SysCon/StopIndex',
  68. width: 700,
  69. height: 300,
  70. callBack: function (id) {
  71. return top[id].acceptClick(refreshGirdData);
  72. }
  73. });
  74. //learun.layerConfirm('是否确认禁用该巷道!', function (res) {
  75. // if (res) {
  76. // learun.postForm(top.$.rootUrl + '/PTManager/SysCon/DisableTunnel', { ids: JSON.stringify(postData.map((item) => item.Id)) }, function () {
  77. // refreshGirdData();
  78. // });
  79. // }
  80. //});
  81. });
  82. },
  83. // 初始化列表
  84. initGird: function () {
  85. $('#gridtable').jfGrid({
  86. url: top.$.rootUrl + '/PTManager/SysCon/GetTunnelList',
  87. headData: [
  88. { label: "仓库", name: "WareHouseName", width: 80, align: "left" },
  89. { label: "巷道", name: "Tunnel", width: 50, align: "left" },
  90. { label: "名称", name: "Name", width: 100, align: "left" },
  91. { label: "状态", name: "StatuName", width: 50, align: "left" },
  92. { label: "备注", name: "Memo", width: 120, align: "left" },
  93. { label: "创建时间", name: "AddTime", width: 130, align: "left" },
  94. { label: "更新时间", name: "EditTime", width: 130, align: "left" },
  95. ],
  96. mainId: 'Id',
  97. isPage: true,
  98. reloadSelected: true,
  99. autowWidth: true,
  100. sidx: 'AddTime',
  101. sord: 'DESC',
  102. isMultiselect: true,
  103. });
  104. page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });
  105. },
  106. search: function (param) {
  107. param = param || { queryJson: JSON.stringify({ InvStateCode: 3 }) };
  108. $('#gridtable').jfGridSet('reload', param);
  109. }
  110. };
  111. refreshGirdData = function () {
  112. page.search();
  113. };
  114. page.init();
  115. }