Index.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * 描 述:库区管理
  3. */
  4. var selectedRow;
  5. var refreshGirdData;
  6. var typnum = 1;
  7. var bootstrap = function ($, learun) {
  8. "use strict";
  9. var ds = {};
  10. var page = {
  11. init: function () {
  12. page.inittree();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#save').on('click', function () {
  17. if (ds["ID"] != '') {
  18. learun.httpAsyncPost(top.$.rootUrl + '/SysManager/UpAlctPolicy/UpEdit', ds, function (res) {
  19. page.search(ds);
  20. });
  21. }
  22. else {
  23. learun.alert.error('此选项不允许操作');
  24. }
  25. })
  26. },
  27. inittree: function () {
  28. $('#policyType').lrtree({
  29. url: top.$.rootUrl + '/SysManager/UpAlctPolicy/GetTree',
  30. param: { parentId: '0' },
  31. nodeClick: page.treeNodeClick
  32. });
  33. $('#policyType').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681');
  34. },
  35. treeNodeClick: function (item) {
  36. if (item.parentId != '0' && item.parentId != '00') {
  37. var value = item.id;
  38. ds["ID"] = value;
  39. page.search(ds);
  40. }
  41. else {
  42. ds["ID"] = '';
  43. $("#F_WHERE").text('');
  44. $("#F_ORDER").text('');
  45. $('#txt_ISEDIT').text("");
  46. }
  47. },
  48. search: function (param) {
  49. if (param["ID"] != '') {
  50. learun.httpAsyncPost(top.$.rootUrl + '/SysManager/UpAlctPolicy/GetPolicyItem', param, function (res) {
  51. var entity = eval(res.data);
  52. $("#F_WHERE").text(entity.WHERESTR);
  53. $("#F_ORDER").text(entity.ORDERSTR);
  54. if (entity.ISEDIT == 0) {
  55. $('#txt_ISEDIT').text("启用");
  56. $("#txt_ISEDIT").css('color', "red");
  57. }
  58. else {
  59. $('#txt_ISEDIT').text("禁用");
  60. $("#txt_ISEDIT").css('color', "black");
  61. }
  62. });
  63. }
  64. }
  65. };
  66. page.init();
  67. }