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').lrDataSourceSelect({
code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (val) {
var deptno = "";
if (val) {
deptno = val.deptno;
}
$('#MajorNo').lrselectRefresh({
url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetListByDeptNo?DeptNo=' + deptno,
text: "MajorName",
value: "MajorNo"
})
}
});
$('#MajorNo').lrDataSourceSelect({
code: 'CdMajorInfo', value: 'majorno', text: 'majorname', select:
function (val) {
var majorNo = '';
if (val) {
majorNo = val.MajorNo;
}
var nj = $('#Grade').val();
$('#ClassNo').lrselectRefresh({
url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetClassByMajorNo?majorNo=' + majorNo + '&nj=' + nj,
text: "ClassName",
value: "ClassNo"
})
}
});
//$('#ClassNo').lrDataSourceSelect({ code: 'allbjqj', value: 'classno', text: 'classname' });
$('#ClassNo').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=allbjqj',
param: { strWhere: "1=1 AND (CheckMark=1 or (CheckMark != 1 and ClassStatus='1')) order by classname asc" },
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_create').on('click', function () {
// learun.layerForm({
// id: 'form',
// title: '生成毕业证',
// url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/CreateGraduateNoForm',
// width: 800,
// height: 600,
// callBack: function (id) {
// return top[id].acceptClick(refreshGirdData);
// }
// });
//})
//生成毕业证【按学号排序】
$('#lr_create').on('click', function () {
learun.layerConfirm('1.毕业证号的生成规则:年份两位(22)+学校编码十位(3642000004)+顺序号四位(0001)组成;
2.此次操作仅对毕业状态为“准许毕业”和“已毕业”的学生进行操作;
3.生成毕业证号后不可撤消,请谨慎操作!
', function (res) {
if (res) {
learun.httpAsync('post', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/DoCreateGraduateNo', {}, function () {
refreshGirdData();
});
}
});
})
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/StuInfoGraduate/GetPageList',
headData: [
{ label: "学号", name: "StuNo", width: 150, align: "left" },
{ label: "姓名", name: "StuName", width: 100, align: "left" },
{ label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" },
{
label: "性别", name: "GenderNo", width: 80, 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=' + 'allbjqj',
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: '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: 100, align: "left" },
{ label: "毕业证号", name: "DiplomaNo", width: 100, align: "left" },
],
mainId: 'StuId',
isPage: true,
isMultiselect: false,
sidx: "FinishSchoolMark,StuNo",
sord:"asc"
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
page.search();
};
page.init();
}