|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-08-21 17:28
- * 描 述:班级成绩比例设置
- */
- var acceptClick;
- var F_SchoolId = request('F_SchoolId');
- var AcademicYearNo = request('AcademicYearNo');
- var Semester = request('Semester');
- var LessonNo = request('LessonNo');
- var ClassNo = request('ClassNo');
- var ClassRoomNo = request('ClassRoomNo');
- var LessonSection = request('LessonSection');
- var param = {};
- if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo) {
- param.F_SchoolId = F_SchoolId;
- param.AcademicYearNo = AcademicYearNo;
- param.Semester = Semester;
- param.LessonNo = LessonNo;
- param.ClassNo = ClassNo;
-
- }
- if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassRoomNo && !!LessonSection) {
- param.F_SchoolId = F_SchoolId;
- param.AcademicYearNo = AcademicYearNo;
- param.Semester = Semester;
- param.LessonNo = LessonNo;
- param.ClassRoomNo = ClassRoomNo;
- param.LessonSection = LessonSection;
-
- }
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- $('.lr-form-wrap').lrscroll();
- page.bind();
- page.initData();
- },
- bind: function () {
-
- },
- initData: function () {
- if (!!param) {
- if (!!ClassNo) {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
- for (var id in data) {
- if (data[id] == null) {
- learun.alert.warning("学生选课数据不存在!");
- return false;
- }
- if (!!data[id].length && data[id].length > 0) {
- $('#' + id).jfGridSet('refreshdata', data[id]);
- }
- else {
- $('[data-table="' + id + '"]').lrSetFormData(data[id]);
- }
- }
- });
- } else {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
- for (var id in data) {
- if (data[id] == null) {
- learun.alert.warning("学生选课数据不存在!");
- return false;
- }
- if (!!data[id].length && data[id].length > 0) {
- $('#' + id).jfGridSet('refreshdata', data[id]);
- }
- else {
- $('[data-table="' + id + '"]').lrSetFormData(data[id]);
- }
- }
- });
- }
- }
- }
- };
- // 保存数据
- acceptClick = function (callBack) {
- if (!$('body').lrValidform()) {
- return false;
- }
- //计算比例
- var OrdinaryScoreScale = $('#OrdinaryScoreScale').val();
- var TermInScoreScale = $('#TermInScoreScale').val();
- var TermEndScoreScale = $('#TermEndScoreScale').val();
- var OtherScoreScale = $('#OtherScoreScale').val();
- var totalScale = Number(OrdinaryScoreScale) + Number(TermInScoreScale) + Number(TermEndScoreScale) + Number(OtherScoreScale);
- if (totalScale !== 100) {
- learun.alert.warning("成绩比例之和必须等于100!");
- return false;
- }
-
- var postData = {
- strEntity: JSON.stringify($('body').lrGetFormData())
- };
- if (!!ClassNo) {
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- } else {
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- }
-
- };
- page.init();
- }
|