var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var Class, ClassName; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { // 初始化左侧树形数据 $('#dataTree').lrtree({ url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetTree', nodeClick: function (item) { Class = item.value; ClassName = item.text; 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 () { if (!Class) { learun.alert.warning("请选择左侧班级!"); return } let params = { ClassName, Class, } learun.layerForm({ id: 'QueryBasicInfo', title: '学生方向确认', url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/DirectionPrint?' + $.param(params), width: 1102, height: 800, btn: null }); //$('.printTitle').text((ClassName || '')+'学生方向确认') //$('.printTitle').css('display', 'block'); //$('#gridtable').css('zoom', '94%') //let p5Width = $('.jfgrid-head-cell[path=5]').css('width') //$('.jfgrid-head-cell[path=5]').css('width', '480px') //let p10Width = $('.jfgrid-head-cell[path=10]').css('width') //$('.jfgrid-head-cell[path=10]').css('width', '82px') ////$('#gridtable').jqprintTable(); //$('#printBox').jqprint(); //$('.jfgrid-head-cell[path=5]').css('width', p5Width) //$('.jfgrid-head-cell[path=10]').css('width', p10Width) //$('#gridtable').css('zoom', '100%') //$('.printTitle').css('display', 'none'); }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGridLei({ url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList', headData: [ { label: "姓名", name: "StuName", width: 100, align: "center" }, { label: "性别", name: "GenderNo", width: 40, align: "center", formatter: function (cellvalue) { return cellvalue == true ? "男" : "女"; } }, { label: "身份证号", name: "IdentityCardNo", width: 150, align: "center" }, { label: "民族", name: "NationalityNo", width: 100, align: "center", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'National', callback: function (_data) { callback(_data.text); } }); } }, { label: "学籍号", name: "StuCode", width: 160, align: "center" , }, { label: '选择方向', name: '选择方向', align: "center", statistics: true, width: 460, children: [ { label: "技能高考", name: "GK", width: 100, align: "center" }, { label: "高职单招", name: "DZ", width: 100, align: "center" }, { label: "3+2高职转段", name: "ZD", width: 100, align: "center" }, { label: "就业", name: "JY", width: 80, align: "center"}, { label: "签名", name: "QM", width: 80, align: "center" }, ] }, ], mainId: 'StuId', isPage: true, rows: 100, isShowNum: 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) }, { page: request('page') || 1}); } }; refreshGirdData = function () { page.search(); }; page.init(); }