|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-09-17 11:30
- * 描 述:学生学期注册
- */
- var selectedRow;
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 查询
- $('#btn_Search').on('click', function () {
- var keyword = $('#txt_Keyword').val();
- page.search({ keyword: keyword });
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- selectedRow = null;
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/Form',
- width: 700,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/Form?keyValue=' + keyValue,
- width: 700,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/DeleteForm', { keyValue: keyValue }, function () {
- });
- }
- });
- }
- });
- //注册
- $('#lr_zhuce').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- console.log(keyValue)
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认注册该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/Zhuce', { keyValue: keyValue, status: "1" }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //取消注册
- $('#lr_cancel').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认取消注册该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/Zhuce', { keyValue: keyValue, status: "0" }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
-
- },
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoSemster/GetPageList',
- headData: [
- { label: '学号', name: 'StuNo', width: 200, align: "left" },
- { label: '姓名', name: 'StuName', width: 200, align: "left" },
- { label: '专业', name: 'MajorNo', width: 200, align: "left" },
- { label: '班级', name: 'ClassNo', width: 200, align: "left" },
- { label: '学年', name: 'AcademicYearNo', width: 200, align: "left" },
- { label: '学期', name: 'Semester', width: 200, align: "left" },
- {
- label: '注册状态', name: 'Status', width: 100, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == "1" ? "<span class=\"label label-success\">已注册</span>"
- : "<span class=\"label label-danger\">未注册</span>";
- }
- },
- { label: '注册时间', name: 'TIME', width: 200, align: "left" },
- ],
- mainId: 'StuId',
- isMultiselect: true,//复选框
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|