/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-12-16 10:14
* 描 述:长阳迎新
*/
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);
}, 220, 400);
$('#Sex').lrDataItemSelect({ code: 'usersex' });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/Form',
width: 800,
height: 600,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
if (keyValue.indexOf(',') != -1) {
learun.alert.warning("只能选择一条记录进行编辑!");
return;
}
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/Form?keyValue=' + keyValue,
width: 800,
height: 600,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});
// 删除
$('#lr_delete').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetPageList',
headData: [
{ label: "县区名称", name: "Address", width: 150, align: "left" },
{ label: "初中毕业学校", name: "BySchool", width: 150, align: "left" },
{ label: "初中学号", name: "H_SchoolNo", width: 150, align: "left" },
{ label: "中考报名号", name: "ApplyNo", width: 150, align: "left" },
{ label: "学号", name: "ProvinceCode", width: 150, align: "left" },
{ label: "学生姓名", name: "StuName", width: 100, align: "left" },
{
label: "性别", name: "Sex", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'usersex',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: "录取意向(本校)", name: "IsCYSchool", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == true ? "是" :
"否";
}
},
{ label: "身份证号", name: "CardNo", width: 150, align: "left" },
{ label: "中考总分", name: "StuScore", width: 100, align: "left" },
{ label: "第一志愿", name: "FirstVolunteer", width: 120, align: "left" },
{ label: "第二志愿", name: "SecondVolunteer", width: 120, align: "left" },
{ label: "第三志愿", name: "ThirdVolunteer", width: 120, align: "left" },
{ label: "第四志愿", name: "FouthVolunteer", width: 120, align: "left" },
{ label: "第五志愿", name: "FifthVolunteer", width: 120, align: "left" },
{ label: "第六志愿", name: "SixthVolunteer", width: 120, align: "left" },
{ label: "第七志愿", name: "SeventhVolunteer", width: 120, align: "left" },
{ label: "第八志愿", name: "EighthVolunteer", width: 120, align: "left" },
{ label: "第九志愿", name: "NinthVolunteer", width: 120, align: "left" },
{ label: "备注", name: "Demo", width: 100, align: "left" },
],
mainId: 'ID',
sidx: 'UpdateTime desc',
isPage: true,
rows: 100,
isMultiselect: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}