var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var Class; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { // 初始化左侧树形数据 $('#dataTree').lrtree({ url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetTree', nodeClick: function (item) { Class = item.value; page.search({ ClassNo: item.value }); } }); $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 200, 400); $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' }); $('#NationalityNo').lrDataSourceSelect({ code: 'BCdNationality', value: 'nationalityno', text: 'nationality' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList', headData: [ { label: "学号", name: "StuNo", width: 200, align: "left" }, { label: "学籍号", name: "StuCode", width: 200, 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", formatter: function (cellvalue) { return learun.formatDate(cellvalue, 'yyyy-MM-dd'); } }, { label: "身份证号", name: "IdentityCardNo", width: 150, 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", formatter: function (cellvalue) { return learun.formatDate(cellvalue, 'yyyy-MM-dd'); } }, { label: "入学年月", name: "EntranceDate", width: 100, align: "left", formatter: function (cellvalue) { return learun.formatDate(cellvalue, 'yyyy-MM-dd'); } }, { label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center", formatter: function (cellvalue) { return cellvalue == "1" ? "" : ""; } }, { label: "审核状态", name: "CheckMark", width: 80, align: "center", formatter: function (cellvalue) { return cellvalue == "1" ? "已审核" : "未审核"; } } ], 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) { if (learun.clientdata.get(['userinfo']).account.toLowerCase() != "system") {//登录用户是system时,列表展示所有学生;其他用户登录时,必须选择左侧班级才能查看学生; if (Class == "" || Class == undefined || Class == null) { learun.alert.warning("请选择左侧班级!"); return false; } } param = param || {}; param.ClassNo = Class; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }