|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2018 上海力软信息技术有限公司
- * 创建人:超级管理员
- * 日 期:2019-09-24 15:32
- * 描 述:内控管理
- */
- var refreshGirdData;
- var isUser = '1';
-
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
-
- page.bind();
-
- },
- bind: function () {
-
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- //学年
- $('#MPAcademicYearNo').lrselect({
- placeholder: "请选择年度",
- allowSearch: true,
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear',
- value: 'value',
- text: 'text'
- });
- //学期
- //$('#MPSemester').lrselect({
- // placeholder: "请选择学期",
- // allowSearch: true,
- // url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterDataTwo',
- // value: 'value',
- // text: 'text'
- //});
- $('#MPMonth').lrDataItemSelect({ code: 'MPMonth' });
- var jsdate = new Date();
- $('#MPAcademicYearNo').lrselectSet(jsdate.getFullYear());
- $('#MPMonth').lrselectSet(jsdate.getMonth() + 1);
-
-
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 查看提交材料
- $('#lr_uploadView').on('click', function () {
- var ParentId = $('#gridtable').jfGridValue('MPId');
- var loginInfo = top.learun.clientdata.get(['userinfo']);
- if (learun.checkrow(ParentId)) {
- learun.layerFormForPercent({
- id: 'form',
- title: '提交材料',
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/IndexChildren?ParentId=' + ParentId + '&&MPUploaderTwo=' + loginInfo.userId,
- width: '80%',
- height: '80%',
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
-
- $('#lr_down').on('click',
- function () {
-
- var FileId = $('#gridtable').jfGridValue('MPFile');
- if (!!FileId) {
-
- var url = top.$.rootUrl + '/LR_SystemModule/Annexes/DownForm?keyVaule=' + FileId;
- learun.layerForm({
- id: 'downform',
- title: '文件下载',
- url: url,
- width: 600,
- height: 400,
- maxmin: true,
- btn: null
- });
- }
- });
-
-
- // 上传
- $('#lr_upload').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('MPId');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formupload',
- title: '上传',
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/UploadForm?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetPageList',
- headData: [
- { label: "年度", name: "MPAcademicYearNo", width: 100, align: "left" },
- //{ label: "学期", name: "MPSemester", width: 100, align: "left" },
- {
- label: "月份", name: "MPMonth", width: 100, align: "left"
- //formatterAsync: function (callback, value, row, op, $cell) {
- // learun.clientdata.getAsync('dataItem',
- // {
- // key: value,
- // code: 'MPMonth',
- // callback: function (_data) {
- // callback(_data.text);
- // }
- // });
- //}
- },
- {
- label: "部门", name: "MPDepartment", width: 250, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- if (value && value.indexOf(',') != -1) {
- var content = '';
- var deptarr = value.split(',');
- for (var i = 0; i < deptarr.length; i++) {
- learun.clientdata.getAsync('custmerData',
- {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: deptarr[i],
- keyId: 'id',
- callback: function (_data) {
- content += _data['name'];
- }
-
- });
- }
- content = content.substring(0, content.length - 1);
- callback(content);
- } else {
- learun.clientdata.getAsync('custmerData',
- {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: value,
- keyId: 'id',
- callback: function (_data) {
- callback(_data['name']);
- }
- });
- }
- }
- },
- {
- label: "上传人", name: "MPUploader", width: 250, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
- key: value,
- keyId: 'f_userid',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- //formatterAsync: function (callback, value, row, op, $cell) {
- // learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds?keyValue=' + value, function (res) {
- // if (res.code == learun.httpCode.success) {
- // callback(res.data);
- // }
- // });
- //}
- },
- { label: "材料名称", name: "MPProjectName", width: 150, align: "left" },
- {
- label: "上传文件",
- name: "MPFileTwo",
- width: 200,
- align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- $.ajax({
- url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
- data: { folderId: value },
- type: 'GET',
- dataType: "json",
- async: false,
- cache: false,
- success: function (res) {
- var bb = '';
- $.each(res.data, function (i, item) {
-
- bb += '<span onclick="downLoad(\'' +
- item.F_Id +
- '\',)" style="color:blue">' +
- item.F_FileName +
- '</span>, ';
- })
- callback(bb);
- }
- });
- }
- },
- {
- label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
-
- if (val === 1) {
- return "合格";
- } else if (val === 0) {
- return "不合格";
- } else {
- return "";
- }
- }
- },
- //{ label: "说明", name: "MPRemark", width: 200, align: "left" },
- ],
- mainId: 'MPId',
- isPage: true
- })
- page.search();
- },
- search: function (param) {
- param = param || {};
- if (isUser) {
- param.isUser = 'true';
- }
- var jsdate = new Date();
- if (!param.MPAcademicYearNo && param.MPAcademicYearNo == undefined) {
- param.MPAcademicYearNo = jsdate.getFullYear();
- }
- if (!param.MPMonth && param.MPMonth == undefined) {
- param.MPMonth = jsdate.getMonth() + 1;
- }
-
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- },
- downLoad: function (fileId) {
- top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
-
-
-
- page.init();
-
- }
- function downLoad(fileId, fileTwo) {
- if (fileTwo) {
-
- top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
-
- });
- }
- top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
- }
|