/* * 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2018 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2019-09-24 15:37
* 描 述:质量目标管理计划
*/
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' });
// 刷新
$('#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_QualityObjectives/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_QualityObjectives/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: "MPFile", 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: "MPProjectName", width: 100, 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 "";
}
}
},
//{ label: "截止时间", name: "MPOverTime", width: 100, align: "left" },
//{ label: "说明", name: "MPRemark", width: 200, align: "left" },
],
mainId: 'ID',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
if (isUser) {
param.isUser = 'true';
}
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
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' });
}