/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:超级管理员
* 日 期:2019-08-21 17:28
* 描 述:成绩比例设置
*/
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.initGird();
page.bind();
page.bindSelect();
},
bind: function () {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 250, 400);
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/FormOfElective',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '成绩比例设置',
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/FormOfElective?keyValue=' + keyValue,
width: 600,
height: 400,
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/OpenLessonPlanOfElective/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
},
bindSelect: function () {
//校区
$('#F_SchoolId').lrDataSourceSelect({
code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { }
});
//学年
$('#AcademicYearNo').lrselect({
placeholder: "请选择学年",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetAcademicYearNoData',
value: 'value',
text: 'text'
});
//学期
$('#Semester').lrselect({
placeholder: "请选择学期",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
value: 'value',
text: 'text'
});
$('#LessonNo').lrselect({
placeholder: "请选择课程",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo',
value: 'value',
text: 'text'
});
$('#EmpNo').lrselect({
placeholder: "请选择老师",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetEmpNoData',
value: 'value',
text: 'text'
});
$('#ClassRoomNo').lrselect({
placeholder: "请选择教室",
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveClassRoomNoData',
value: 'value',
text: 'text'
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetPageListElective',
headData: [
{ label: "校区", name: "F_School", width: 150, align: "left" },
{ label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
{ label: "学期", name: "Semester", width: 80, align: "left" },
{ label: "课程编号", name: "LessonNo", width: 100, align: "left" },
{ label: "课程名称", name: "LessonName", width: 150, align: "left" },
{ label: "节次", name: "LessonSection", width: 100, align: "left" },
{ label: "教室编号", name: "ClassRoomNo", width: 100, align: "left" },
{ label: "教室", name: "ClassRoomName", width: 100, align: "left" },
{ label: "教师编号", name: "EmpNo", width: 100, align: "left" },
{ label: "教师名称", name: "EmpName", width: 150, align: "left" },
{ label: "平时成绩占比", name: "OrdinaryScoreScale", width: 100, align: "left" },
{ label: "期中成绩占比", name: "TermInScoreScale", width: 100, align: "left" },
{ label: "期末成绩占比", name: "TermEndScoreScale", width: 100, align: "left" },
{ label: "其他成绩占比", name: "OtherScoreScale", width: 100, align: "left" },
{
label: "是否允许编辑", name: "IsAllowEdit", width: 100, align: "left", formatter: function (cellvalue) {
return (cellvalue === true || cellvalue === "true") ? "" : "";
}
},
],
mainId: 'Id',
isPage: true,
isMultiselect: true,
sidx: 'AcademicYearNo,Semester',
sord: 'desc'
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
page.search();
};
page.init();
}