|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 初始化左侧树形数据
- $('#dataTree').lrtree({
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetTree',
- nodeClick: function (item) {
- page.search({ ClassNo: item.value });
- }
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行编辑!");
- return;
- }
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark === "1") {
- learun.alert.warning("当前项目已审核不能编辑!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Form?keyValue=' + keyValue,
- width: 800,
- height: 600,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- //查看
- $('#lr_view').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行查看!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FormView?keyValue=' + keyValue,
- width: 1162,
- height: 600,
- btn: null
- });
- }
- });
- //审核
- $('#check').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark.indexOf('1') != -1) {
- learun.alert.warning("选中记录中包含已审核项目!");
- return;
- }
- learun.layerConfirm('是否确认审核该项?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Check', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //去审
- $('#uncheck').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- var CheckMarkArr = CheckMark.split(',');
- if ($.inArray('0', CheckMarkArr) != -1 || $.inArray('', CheckMarkArr) != -1) {
- learun.alert.warning("选中记录中包含未审核项目!");
- return;
- }
- learun.layerConfirm('是否确认取消审核该项?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/UnCheck', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
- headData: [
- { label: "学号", name: "StuNo", width: 100, align: "left" },
- { label: "学籍号", name: "StuCode", width: 100, align: "left" },
- { label: "姓名", name: "StuName", width: 100, align: "left" },
- {
- label: "性别", name: "GenderNo", width: 80, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == true ? "男" : "女";
- }
- },
- { label: "出生日期", name: "Birthday", width: 100, align: "left" },
- { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
- {
- label: "民族", name: "NationalityNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'National',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "系所", name: "DeptNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
- key: value,
- keyId: 'deptno',
- callback: function (_data) {
- callback(_data['deptname']);
- }
- });
- }
- },
- {
- label: "专业", name: "MajorNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
- key: value,
- keyId: 'majorno',
- callback: function (_data) {
- callback(_data['majorname']);
- }
- });
- }
- },
- {
- label: "班级", name: "ClassNo", width: 100, 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: "Grade", width: 100, align: "left" },
- {
- label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'EduSystem',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "学习形式", name: "StudyModality", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'StudyModality',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "报到日期", name: "RegisterDate", width: 100, align: "left" },
- { label: "入学年月", name: "EntranceDate", width: 100, align: "left" },
- {
- label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center",
- formatter: function (cellvalue) {
- return cellvalue == "1" ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- {
- label: "审核状态", name: "CheckMark", width: 80, align: "center",
- formatter: function (cellvalue) {
- return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
- }
- }
- ],
- mainId: 'StuId',
- isPage: true,
- isMultiselect: true,
- //onSelectRow: function (rowdata) {
- // if (rowdata.CheckMark == "1") {
- // $("#check").hide();
- // $("#uncheck").show();
- // $("#lr_edit").hide();
- // $("#lr_delete").hide();
- // } else {
- // $("#uncheck").hide();
- // $("#check").show();
- // $("#lr_edit").show();
- // $("#lr_delete").show();
- // }
- //}
-
- });
- //page.search();
- },
- search: function (param) {
- param = param || {};
- param.AbmormityMoveMark = 1;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|