Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

107 řádky
3.9 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 page = {
  12. init: function () {
  13. page.initGrid();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  18. if (!!queryJson.Year && !!queryJson.Month) {
  19. queryJson.Year = queryJson.Year;
  20. queryJson.Month = Number(queryJson.Month) + 1;
  21. }
  22. page.search(queryJson);
  23. }, 200, 400);
  24. // 刷新
  25. $('#lr_refresh').on('click', function () {
  26. location.reload();
  27. });
  28. //年度
  29. $('#Year').lrselect({
  30. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear',
  31. value: 'value',
  32. text: 'text'
  33. });
  34. //$('#Year').lrselectSet(Year);
  35. //月份
  36. $('#Month').lrDataItemSelect({ code: 'MPMonth' });
  37. $('#F_Departmentid').lrselect({
  38. allowSearch: true,
  39. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=classdata',
  40. param: { strWhere: " 1=1 and F_EnabledMark=1 and F_deleteMark=0 order by F_SortCode " },
  41. value: "id",
  42. text: "name"
  43. });
  44. },
  45. initGrid: function () {
  46. $('#gridtable').jfGrid({
  47. url: top.$.rootUrl + '/LR_OAModule/Notice/GetPageListForStatistics',
  48. headData: [
  49. { label: '职工编号', name: 'F_Account', width: 100, align: 'left' },
  50. { label: '姓名', name: 'F_RealName', width: 100, align: 'left' },
  51. {
  52. label: '部门', name: 'F_Departmentid', width: 100, align: 'left',
  53. formatterAsync: function (callback, value, row) {
  54. learun.clientdata.getAsync('department', {
  55. key: value,
  56. callback: function (item) {
  57. callback(item.name);
  58. }
  59. });
  60. }
  61. },
  62. { label: '应阅读总次数', name: 'srnum', width: 100, align: 'left' },
  63. { label: '完成阅读次数(发起通知7天内)', name: 'rnum', width: 180, align: 'left' },
  64. {
  65. label: '完成阅读百分比', name: 'ruserid', width: 100, align: 'left',
  66. formatter: function (value, row) {
  67. if (!!row.rnum && !!row.srnum) {
  68. return GetPercent(row.rnum, row.srnum);
  69. } else {
  70. return '';
  71. }
  72. }
  73. },
  74. ],
  75. mainId: 'F_Encode',
  76. reloadSelected: true,
  77. isMultiselect: true,
  78. isPage: true,
  79. });
  80. page.search();
  81. },
  82. search: function (param) {
  83. param = param || {};
  84. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  85. }
  86. };
  87. // 保存数据后回调刷新
  88. refreshGirdData = function () {
  89. page.search();
  90. }
  91. page.init();
  92. }
  93. function GetPercent(num, total) {
  94. num = parseFloat(num);
  95. total = parseFloat(total);
  96. if (isNaN(num) || isNaN(total)) {
  97. return '-';
  98. }
  99. return total <= 0 ? '0%' : Math.round((num / total) * 10000) / 100.0 + '%';
  100. }