var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 290, 400); $('#DeptNo').lrselect({ allowSearch: true, value: "deptno", text: "deptname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', select: function (item) { if (item) { $('#MajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } }); } else { $('#MajorNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: "1=1 AND CheckMark=1" } }); } } }); $('#MajorNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', value: "majorno", text: "majorname", param: { strWhere: "1=1 AND CheckMark=1" }, select: function (item) { var Grades = $("#Grade").lrselectGet(); if (Grades != null && Grades != "" && Grades != "undefined") { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } else { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } } }); $('#Grade').lrselect({ url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', value: "value", text: "text", select: function (item) { var MajorNos = $("#MajorNo").lrselectGet(); if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } else { if (item) { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc" } }); } else { $('#ClassNo').lrselectRefresh({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" } }); } } } }); $('#ClassNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }, value: "classno", text: "classname" }); $('#FinishSchoolMark').lrselect({ data: [{ text: "已毕业", value: "2" }, { text: "准许毕业", value: "1" }, { text: "待准许", value: "0" }], text: "text", value: "value" }) // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); //毕业证领取 $('#lr_getcard').on('click', function () { var keyValue = $('#gridtable').jfGridValue('StuId'); var DiplomaReceiveStatus = $('#gridtable').jfGridValue('DiplomaReceiveStatus'); if (learun.checkrow(keyValue)) { //if (DiplomaReceiveStatus.indexOf('1') != -1) { // return learun.alert.warning("选中项包括已领取数据!"); //} //learun.layerConfirm('是否确认领取毕业证!', function (res) { // if (res) { // learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetCard', { keyValue: keyValue, status: '1' }, function () { // refreshGirdData(); // }); // } //}); if (keyValue.split(',').length > 1) { return learun.alert.warning("只能选择一条记录进行操作!"); } if (DiplomaReceiveStatus == "1") { return learun.alert.warning("当前记录毕业证已领取!"); } learun.layerForm({ id: 'form', title: '毕业证领取', url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GraduateDiplomaReceiveForm?keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }) //取消毕业证领取 $('#lr_cancelgetcard').on('click', function () { var keyValue = $('#gridtable').jfGridValue('StuId'); var DiplomaReceiveStatus = $('#gridtable').jfGridValue('DiplomaReceiveStatus'); if (learun.checkrow(keyValue)) { for (var i = 0; i < DiplomaReceiveStatus.split(',').length; i++) { if (DiplomaReceiveStatus.split(',')[i] != 1) { return learun.alert.warning("选中项包括未领取数据!"); } } learun.layerConfirm('是否确认取消领取毕业证!', function (res) { if (res) { learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetCard', { keyValue: keyValue, status: '0' }, function () { refreshGirdData(); }); } }); } }) }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList', headData: [ { label: "学号", name: "StuNo", width: 130, align: "left" }, { label: "姓名", name: "StuName", width: 100, align: "left" }, { label: "性别", name: "GenderNo", width: 50, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "男" : "女"; } }, { 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: 50, 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: "DiplomaNo", width: 100, align: "left" }, { label: '毕业状态', name: 'FinishSchoolMark', width: 100, align: "left", formatter: function (val) { if (val == '0') { return '待准许'; } else if (val == "1") { return '准许毕业'; } else if (val == '2') { return '已毕业'; } else { return '待准许'; } } }, { label: "毕业时间", name: "FinishSchoolDate", width: 130, align: "left" }, { label: "毕业证领取状态", name: "DiplomaReceiveStatus", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == "1" ? "已领取" : "未领取" } }, { label: "毕业证领取时间", name: "DiplomaReceiveDate", width: 120, align: "left" }, { label: "领取人签名", name: "DiplomaReceiveSign", width: 100, align: "left" }, { label: "代领人身份证号", name: "DiplomaReceiveIdcard", width: 130, align: "left" }, { label: "代领备注", name: "DiplomaReceiveRemark", width: 100, align: "left" }, ], mainId: 'StuId', isPage: true, rows: 100, isMultiselect: true, }); page.search(); }, search: function (param) { param = param || {}; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }