OutInPationIndex.js 3.8 KB

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