/* * 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2018 上海力软信息技术有限公司 * 创建人:超级管理员 * 日 期:2019-09-24 15:32 * 描 述:内控管理 */ var refreshGirdData; var isUser = request('isUser'); 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' }); $('#MPDepartment').lrselect({ type: 'tree', // 展开最大高度 maxHeight: 200, // 是否允许搜索 allowSearch: true, // 访问数据接口地址 url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', select: function (val) { console.log(val); var departmentIds = val.id; $('#MPReceiveUser').lrselectRefresh({ url: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByDepartmentIds?departmentId=' + departmentIds }) } }); $('#MPReceiveUser').lrselect({ type: 'default', allowSearch: true, value: 'F_UserId', text: 'F_RealName' }) // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Form', width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('MPId'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Form?keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 查看提交材料 $('#lr_uploadView').on('click', function () { var keyValue = $('#gridtable').jfGridValue('MPId'); if (learun.checkrow(keyValue)) { learun.layerFormForPercent({ id: 'form', title: '提交材料', url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/IndexChildren?ParentId=' + keyValue, width: '80%', height: '80%', callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('MPId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); //访问情况统计 $("#lr_statistics").on('click', function () { var keyValue = $('#gridtable').jfGridValue('MPId'); if (learun.checkrow(keyValue)) { learun.layerFormForPercent({ id: 'form', title: '访问情况统计', url: top.$.rootUrl + '/PersonnelManagement/MP_BrowseRecord/Index?keyValue=' + keyValue, width: '70%', height: '70%', btn: null }); } }); // 合格 $('#lr_qualified').on('click', function () { var keyValue = $('#gridtable').jfGridValue('MPId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认合格!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: true }, function () { refreshGirdData(); }); } }); } }); // 不合格 $('#lr_noqualified').on('click', function () { var keyValue = $('#gridtable').jfGridValue('MPId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认不合格!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/Qqualified', {keyValue:keyValue, status: false }, function () { refreshGirdData(); }); } }); } }); // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); }, // 初始化列表 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) { learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) { if (res.code == learun.httpCode.success) { callback(res.data); } }); } }, { label: "接收人", name: "MPReceiveUser", width: 250, align: "left", 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 += '' + item.F_FileName + ',   '; }) callback(bb); } }); } }, { label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) { if (val===1) { return "合格"; } else if (val===0) { return "不合格"; } else { return ""; } } }, ], mainId: 'MPId', isPage: true }) page.search(); }, search: function (param) { param = param || {}; if (isUser) { param.isUser = 'true'; } $('#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' }); }