|
- /*
- * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:陈彬彬
- * 日 期:2017.07.11
- * 描 述:通知公告阅读统计
- */
- var refreshGirdData; // 更新数据
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGrid();
- page.bind();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- if (!!queryJson.Year && !!queryJson.Month) {
- queryJson.Year = queryJson.Year;
- queryJson.Month = Number(queryJson.Month) + 1;
- }
- page.search(queryJson);
- }, 200, 400);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- //年度
- $('#Year').lrselect({
- url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear',
- value: 'value',
- text: 'text'
- });
- //$('#Year').lrselectSet(Year);
- //月份
- $('#Month').lrDataItemSelect({ code: 'MPMonth' });
-
- $('#F_Departmentid').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=classdata',
- param: { strWhere: " 1=1 and F_EnabledMark=1 and F_deleteMark=0 order by F_SortCode " },
- value: "id",
- text: "name"
- });
-
- },
- initGrid: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/LR_OAModule/Notice/GetPageListForStatistics',
- headData: [
- { label: '职工编号', name: 'F_Account', width: 100, align: 'left' },
- { label: '姓名', name: 'F_RealName', width: 100, align: 'left' },
- {
- label: '部门', name: 'F_Departmentid', width: 100, align: 'left',
- formatterAsync: function (callback, value, row) {
- learun.clientdata.getAsync('department', {
- key: value,
- callback: function (item) {
- callback(item.name);
- }
- });
- }
- },
- { label: '应阅读总次数', name: 'srnum', width: 100, align: 'left' },
- { label: '完成阅读次数(发起通知7天内)', name: 'rnum', width: 180, align: 'left' },
- {
- label: '完成阅读百分比', name: 'ruserid', width: 100, align: 'left',
- formatter: function (value, row) {
- if (!!row.rnum && !!row.srnum) {
- return GetPercent(row.rnum, row.srnum);
- } else {
- return '';
- }
- }
- },
-
- ],
- mainId: 'F_Encode',
- reloadSelected: true,
- isMultiselect: true,
- isPage: true,
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- // 保存数据后回调刷新
- refreshGirdData = function () {
- page.search();
- }
- page.init();
- }
-
- function GetPercent(num, total) {
- num = parseFloat(num);
- total = parseFloat(total);
- if (isNaN(num) || isNaN(total)) {
- return '-';
- }
- return total <= 0 ? '0%' : Math.round((num / total) * 10000) / 100.0 + '%';
- }
-
|