|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-10-11 16:46
- * 描 述:助学金及审核
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- $('#SchoolType').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/EducationalAdministration/Scholarship/GetList?queryJson=' + JSON.stringify({ IsType: 1, IsValid :0}),
- value: "Id",
- text: "ItemName"
- });
- $('#State').lrselect({
- data: [{ text: "待审核", value: "0" }, { text: "审核通过", value: "1" }, { text: "不通过", value: "2" }],
- text: "text",
- value: "value"
- })
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/Scholarshipxj/Formzxj',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(",") != -1) {
- learun.alert.warning("只能选择一条记录进行操作!");
- return false;
- }
- var State = $('#gridtable').jfGridValue('State');
- if (State != 0) {
- learun.alert.warning("当前项不可进行编辑!");
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/Scholarshipxj/Formzxj?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var State = $('#gridtable').jfGridValue('State');
- if (State != 0) {
- learun.alert.warning("当前项不可进行删除!");
- return false;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Scholarshipxj/DeleteForm', { keyValue: keyValue}, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 导入
- $('#lr_import').on('click', function () {
- learun.layerForm({
- id: 'ImportForm',
- title: '导入模板',
- url: top.$.rootUrl + '/LR_NewWorkFlow/NWFScheme/ImportForm',
- width: 600,
- height: 400,
- maxmin: true,
- btn: null
- });
- });
- // 导出
- $('#lr_export').on('click', function () {
- learun.layerForm({
- id: "ExcelExportForm",
- title: '导出Excel数据',
- url: top.$.rootUrl + '/Utility/ExcelExportForm?gridId=gridtable&filename=log',
- width: 500,
- height: 380,
- callBack: function (id) {
- return top[id].acceptClick();
- },
- btn: ['导出Excel', '关闭']
- });
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/Scholarshipxj/GetPageList',
- headData: [
- { label: "学生", name: "StuName", width: 200, align: "left"},
- { label: "学生学号", name: "StuNo", width: 200, align: "left" },
- { label: "身份证号", name: "IdentityCardNo", width: 200, align: "left" },
- { label: "班级", name: "ClassNo", width: 200, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
- key: value,
- keyId: 'classno',
- callback: function (_data) {
- callback(_data['classname']);
- }
- });
- }
- },
- {
- label: "助学金类型", name: "SchoolType", width: 200, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/EducationalAdministration/Scholarship/GetList?queryJson=' + JSON.stringify({ IsType: 1, IsValid: 0 }),
- key: value,
- keyId: 'Id',
- callback: function (_data) {
- callback(_data['ItemName']);
- }
- });
- }
- },
- { label: "申请时间", name: "GetTime", width: 200, align: "left",
- formatter: function (cellvalue) {
- return learun.formatDate(cellvalue, 'yyyy-MM-dd');
- }
- },
- { label: "审核状态", name: "State", width: 200, align: "left" ,
- formatter: function(cellvalue) {
- if (cellvalue == '0') {
- return '<span class=\"label label-warning\">待审核</span>';
- } else if (cellvalue == '1') {
- return '<span class=\"label label-success\">审核通过</span>';
- } else if (cellvalue == '2') {
- return '<span class=\"label label-danger\">不通过</span>';
- }
- }
- },
- {
- label: "审核时间", name: "AuditTime", width: 200, align: "left",
- formatter: function (cellvalue) {
- return learun.formatDate(cellvalue, 'yyyy-MM-dd');
- }
- },
- ],
- mainId:'Id',
- isPage: true,
- isMultiselect: true,//复选框
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.IsType = 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 () {
- $('#gridtable').jfGridSet('reload');
- };
- 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' });
- }
|