|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2018 上海力软信息技术有限公司
- * 创建人:超级管理员
- * 日 期:2019-09-24 15:32
- * 描 述:内控管理
- */
- var refreshGirdData;
- var MPUploaderTwo = request('MPUploaderTwo');
- var ParentId = request('ParentId');
-
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
-
- page.bind();
-
- },
- bind: function () {
- if (MPUploaderTwo) {
- $("#lr_qualified").hide();
- $("#lr_noqualified").hide();
- } else {
- $('#lr_upload').hide();
- $('#lr_againupload').hide();
- $('#lr_delete').hide();
- }
-
- $('#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' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
-
- // 上传资料
- $('#lr_upload').on('click', function () {
- learun.layerForm({
- id: 'formupload',
- title: '提交材料',
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/UploadForm?ParentId=' + ParentId,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 重新上传
- $('#lr_againupload').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);
- }
- });
- }
- });
-
- // 删除
- $('#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_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();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetPageList',
- headData: [
- {
- label: "上传材料", name: "MPFileTwo", width: 200, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- console.log(value);
- $.ajax({
- url: '/LR_SystemModule/Annexes/GetAnnexesFileList',
- data: { folderId: value },
- type: 'GET',
- dataType: "json",
- async: false,
- cache: false,
- success: function (res) {
- console.log(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: "MPDepartment", width: 250, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/Department/GetDepartmentList?listId=' + value, function (res) {
- console.log(res);
- if (res.code == learun.httpCode.success) {
- callback(res.data);
- }
- });
- }
- },
- {
- label: "上传者", name: "MPUploaderTwo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData',
- {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
- key: value,
- keyId: 'f_userid',
- sync: true,
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- },
- { label: "上传时间", name: "MPUploadTimes", width: 100, align: "left" },
- {
- label: "状态", name: "MPStatus", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'SubmissionState',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "是否合格", name: "MPConclusion", width: 100, align: "left", formatter: function (val) {
- if (val) {
- return "合格";
- } else {
- return "不合格";
- }
- }
- },
- { label: "修改次数", name: "SUpdateTime", width: 100, align: "left" },
- { label: "提交说明", name: "MPFileTwoRemark", width: 200, align: "left" },
- ],
- mainId: 'MPId',
- isPage: true
- })
- page.search();
- },
- search: function (param) {
- param = param || {};
- if (MPUploaderTwo) {
- param.MPUploaderTwo = MPUploaderTwo;
- }
- param.ParentId = ParentId;
- $('#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' });
- }
|