You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

130 lines
5.2 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.07.11
  6. * 描 述:公告通知
  7. */
  8. var refreshGirdData; // 更新数据
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var processId = '';
  12. var page = {
  13. init: function () {
  14. page.initGrid();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 220, 400);
  21. //公告类别
  22. $('#F_CategoryId').lrDataItemSelect({
  23. code: 'MessageType'
  24. });
  25. // 刷新
  26. $('#lr_refresh').on('click', function () {
  27. location.reload();
  28. });
  29. // 新增
  30. $('#lr_add').on('click', function () {
  31. learun.layerForm({
  32. id: 'form',
  33. title: '新增',
  34. url: top.$.rootUrl + '/EducationalAdministration/SchoolNews/Form',
  35. width: 1200,
  36. height: 750,
  37. callBack: function (id) {
  38. return top[id].acceptClick(refreshGirdData);
  39. }
  40. });
  41. });
  42. // 编辑
  43. $('#lr_edit').on('click', function () {
  44. var keyValue = $('#gridtable').jfGridValue('F_NewsId');
  45. if (learun.checkrow(keyValue)) {
  46. learun.layerForm({
  47. id: 'form',
  48. title: '编辑',
  49. url: top.$.rootUrl + '/EducationalAdministration/SchoolNews/Form?keyValue=' + keyValue,
  50. width: 1200,
  51. height: 750,
  52. callBack: function (id) {
  53. return top[id].acceptClick(refreshGirdData);
  54. }
  55. });
  56. }
  57. });
  58. // 删除
  59. $('#lr_delete').on('click', function () {
  60. var keyValue = $('#gridtable').jfGridValue('F_NewsId');
  61. if (learun.checkrow(keyValue)) {
  62. learun.layerConfirm('是否确认删除该项!', function (res) {
  63. if (res) {
  64. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SchoolNews/DeleteForm', { keyValue: keyValue }, function () {
  65. refreshGirdData();
  66. });
  67. }
  68. });
  69. }
  70. });
  71. // 打印
  72. $('#lr_print').on('click', function () {
  73. $('#gridtable').jqprintTable();
  74. });
  75. },
  76. initGrid: function () {
  77. $('#gridtable').jfGrid({
  78. url: top.$.rootUrl + '/EducationalAdministration/SchoolNews/GetPageList',
  79. headData: [
  80. { label: '标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' },
  81. { label: '发布人员', name: 'F_CreateUserName', index: 'F_CreateUserName', width: 100, align: 'left' },
  82. { label: '类别', name: 'F_Category', index: 'F_Category', width: 100, align: 'center' },
  83. {
  84. label: "发布时间", name: "F_ReleaseTime", index: "F_ReleaseTime", width: 140, align: "center",
  85. formatter: function (cellvalue) {
  86. return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm');
  87. }
  88. },
  89. { label: '信息来源', name: 'F_SourceName', index: 'F_SourceName', width: 100, align: 'center' },
  90. {
  91. label: "有效", name: "F_EnabledMark", width: 50, align: "center",
  92. formatter: function (cellvalue) {
  93. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  94. }
  95. },
  96. { label: "创建时间", name: "F_CreateDate", index: "F_CreateDate", width: 130, align: "center" }
  97. ],
  98. mainId: 'F_NewsId',
  99. reloadSelected: true,
  100. isMultiselect: true,
  101. isPage: true,
  102. sidx: 'F_CreateDate',
  103. sord: 'desc'
  104. });
  105. page.search();
  106. },
  107. search: function (param) {
  108. param = param || {};
  109. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  110. }
  111. };
  112. // 保存数据后回调刷新
  113. refreshGirdData = function (res, postData) {
  114. if (res && res.code && res.code == 200) {
  115. var postData = {
  116. schemeCode: 'OA_News',// 填写流程对应模板编号
  117. processId: processId,
  118. level: '1',
  119. };
  120. learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
  121. learun.loading(false);
  122. });
  123. }
  124. page.search();
  125. }
  126. page.init();
  127. }