/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-07-17 11:20
* 描 述:新生录取管理
*/
var refreshGirdData;
var NowGrade;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
var data_grade = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByMaxClass',
{});
NowGrade = data_grade.info;
page.initGird();
page.bind();
//page.refreshMoney();
},
bind: function () {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
//page.refreshMoney();
}, 380, 400);
$("#IsSubsidize1").lrDataItemSelect({ code: "jyYewOrNot" });
$('#Grade').lrselect({
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByClass',
value: "year",
text: "year",
});
$('#Grade').lrselectSet(NowGrade);
$('#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) {
if (item) {
$('#ClassNo').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
});
} else {
$('#ClassNo').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
param: { strWhere: "1=1 AND CheckMark=1" }
});
}
}
});
$('#ClassNo').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
param: { strWhere: "1=1 AND CheckMark=1" },
value: "classno",
text: "classname"
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
$('#lr_view').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('StuId');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '查看',
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/FormView?keyValue=' + keyValue,
width: 800,
height: 600,
btn: null
});
}
});
//上传资料
$('#lr_uploadFile').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('StuId');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/SubsidizeUrl?keyValue=' + keyValue,
width: 600,
height: 200,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});
//确认免学费
$("#lr_help").on('click', function () {
var data = $('#gridtable').jfGridGet('rowdata');
if (data.length > 0) {
var IsManualSubsidize = $('#gridtable').jfGridValue('IsManualSubsidize');
if (IsManualSubsidize.indexOf('true') != -1) {
learun.alert.warning('选中项目包含多次操作免学费的数据!');
return;
}
learun.layerConfirm('是否确认免学费!',
function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Help',
{ stuId: JSON.stringify(data), status: true },
function (res) {
refreshGirdData();
});
}
});
}
});
//全部免学费
$("#lr_allhelp").on('click', function () {
learun.layerConfirm('是否全部免学费!',
function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/AllHelp',
{},
function (res) {
refreshGirdData();
});
}
});
});
//确认不免学费
$("#lr_nohelp").on('click', function () {
var data = $('#gridtable').jfGridGet('rowdata');
if (data.length > 0) {
learun.layerConfirm('是否确认不免学费!',
function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Help',
{ stuId: JSON.stringify(data), status: false },
function (res) {
refreshGirdData();
});
}
});
}
});
//确认资助
$('#lr_support').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('StuId');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认资助?', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Support', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
//学费变更
$("#lr_change").on('click', function () {
var keyValue = $('#gridtable').jfGridValue('StuId');
if (keyValue.indexOf(',') > 0) {
learun.alert.warning("只能选中一条记录变更!");
return;
}
var isSupportChange = $('#gridtable').jfGridValue('IsSupportChange');
//如果已变更,将不能重复变更
if (isSupportChange) {
learun.alert.warning("选中记录中已变更,不可重复变更!");
return;
} else {
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '学费变更',
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/HelpChange?keyValue=' + keyValue,
width: 600,
height: 400,
callBack: function (id) {
var res = false;
// 验证数据
res = top[id].validForm();
// 保存数据
if (res) {
res = top[id].save('', function () {
page.search();
});
}
return res;
}
});
}
}
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageList',
headData: [
{ label: "姓名", name: "StuName", width: 100, align: "left" },
{
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: "Admissions", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'enrollType',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{ label: "学生报名号", name: "RegistrationNo", width: 100, align: "left" },
{
label: "招生类别", name: "EnrollType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'EnrollStudentType',
callback: function (_data) {
if (_data.text == "计划外") {
callback('计划外')
} else {
callback(_data.text);
}
}
});
}
},
{
label: "免学费", name: "IsSubsidize1", width: 100, align: "left", formatter: function (value, row) {
if (row.IsSubsidize1) {
return '是';
} else if (row.IsSubsidize1 == false) {
return '否';
} else {
return "未处理";
}
}
},
{
label: "是否上传资料", name: "SubsidizeUrl", width: 100, align: "left", formatter: function (value) {
if (value) {
return '已上传';
} else {
return '未上传';
}
}
},
{
label: "性别", name: "Gender", width: 100, align: "left", formatter: function (value) {
return value == "1" ? "男" : "女";
}
},
{
label: "民族", name: "Nationals", 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: "Birthday", width: 100, align: "left", formatter: function (val) { return learun.formatDate(val, 'yyyy-MM-dd') } },
{ label: "身份证", name: "IDCard", width: 150, align: "left" },
{
label: "政治面貌", name: "Political", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'BCdPartyFace',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: "届别", name: "FreshType", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'timeType',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: "户别", name: "ResidenceType", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'HouseholdCategory',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: "考生类别", name: "StuType", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'stuType',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{ label: "户口地", name: "ResidenceAddress", width: 100, align: "left" },
{ label: "非京籍报考类", name: "NonNative", width: 100, align: "left" },
{ label: "学籍所在学校", name: "FromSchool", width: 100, align: "left" },
{ label: "家庭住址", name: "HomeAddress", width: 100, align: "left" },
{ label: "第一监护人", name: "FirstGuardian", width: 100, align: "left" },
{ label: "与被监护人关系", name: "FirstRelationship", width: 100, align: "left" },
{ label: "工作单位", name: "FirstUnits", width: 100, align: "left" },
{ label: "联系电话", name: "FirstMobile", width: 100, align: "left" },
{ label: "第二监护人", name: "SecondGuardian", width: 100, align: "left" },
{ label: "与被监护人关系", name: "SecondRelationship", width: 100, align: "left" },
{ label: "工作单位", name: "SecondUnits", width: 100, align: "left" },
{ label: "联系电话", name: "SecondMobile", width: 100, align: "left" },
{ label: "接收通知书地址", name: "Acceptance", width: 100, align: "left" },
{ label: "收件人", name: "Recipient", width: 100, align: "left" },
{ label: "邮政编码", name: "ZipCode", width: 100, align: "left" },
{ label: "既往病史", name: "MedicalHistory", width: 100, align: "left" },
{ label: "加分照顾对象", name: "AdditionalCare", width: 100, align: "left" },
{ label: "录取专业代码", name: "MajorNo", width: 100, align: "left" },
{ label: "录取专业名称", name: "MajorName", width: 100, align: "left" },
{ label: "是否住宿", name: "IsAccommodation", width: 100, align: "left" },
{ label: "准考证号", name: "ExamRegistration", width: 100, align: "left" },
],
isMultiselect: true,
mainId: 'StuId',
isPage: true
});
page.search();
},
refreshMoney: function (queryJson) {
learun.httpAsyncGetWithParam(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetMilitaryStatistics', { queryJson: queryJson,type:2 }, function (res) {
//console.log(res);
$("#allAmount").html(res.data.aa);
$("#isAmount").html(res.data.bb);
});
//$.post(
// top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetHelpStatistics',
// {
// DeptNo: deptNo,
// MajorNo: majorNo,
// ClassNo: classNo
// },
// function (res) {
// $("#allAmount").html(res.data.aa);
// $("#isAmount").html(res.data.bb);
// }, "json");
},
search: function (param) {
param = param || {};
param.SqlParameter = ' AND IsReport=1';
if (!param.Grade && param.Grade == undefined) {
param.Grade = NowGrade;
}
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
page.refreshMoney(JSON.stringify(param));
}
};
refreshGirdData = function () {
page.search();
};
page.init();
}