|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-06-17 14:54
- * 描 述:学生处分管理
- */
- 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();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/Form',
- width: 600,
- height: 450,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/Form?keyValue=' + keyValue,
- width: 600,
- height: 450,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 解除处分
- $('#lr_cancelPunish').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var status = $('#gridtable').jfGridValue('IsCancelPunish');
- if (status == true) {
- learun.alert.warning("该项已解除处分!");
- return false;
- }
- learun.layerConfirm('是否确认解除处分该项!', function (res, index) {
- if (res) {
- learun.layerForm({
- id: 'form',
- title: '解除处分',
- url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/CancelForm?keyValue=' + keyValue,
- width: 600,
- height: 450,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- }
- });
- // 取消解除处分
- $('#lr_cancelPunishNot').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var status = $('#gridtable').jfGridValue('IsCancelPunish');
- if (status != true) {
- learun.alert.warning("该项未解除处分,无法取消解除!");
- return false;
- }
- learun.layerConfirm('是否确认取消解除处分该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: false, File: null }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/GetPageList',
- headData: [
- { label: "学号", name: "StuNo", width: 100, align: "left" },
- { label: "姓名", name: "StuName", width: 100, align: "left" },
- { label: "处分名称", name: "PunishName", width: 100, align: "left" },
- { label: "处分原因", name: "PunishReason", width: 100, align: "left" },
- { label: "处分日期", name: "PunishDate", width: 100, align: "left" },
- { label: "处分文号", name: "FileNo", width: 100, align: "left" },
- {
- label: "是否解除处分", name: "IsCancelPunish", width: 100, align: "left", formatter: function (cellvalue) {
- return cellvalue == true ? "是" : "否";
- }
- },
- { label: "解除文号", name: "CancelFileNo", width: 100, align: "left" },
- { label: "解除处分日期", name: "CancelPunishDate", width: 100, align: "left" },
- ],
- mainId: 'Id',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|