|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-05-05 11:41
- * 描 述:教师成绩单提交
- */
- 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);
- }, 300, 400);
- //学年
- $('#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'
- });
- $('#ElectronicStatus').lrDataItemSelect({ code: 'YesOrNoInt'});
- $('#PaperStatus').lrDataItemSelect({ code: 'YesOrNoInt'});
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 提交纸质成绩单
- $('#lr_submit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var paperStatus = $('#gridtable').jfGridValue('PaperStatus');
- if (paperStatus != 0) {
- learun.alert.warning("当前教师已提交纸质成绩单!");
- return false;
- }
- learun.layerConfirm('是否确认当前教师已经提交纸质成绩单!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/EmpReportCard/SubmitForm', { keyValue: keyValue, status: 1 }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 撤销纸质成绩单
- $('#lr_cancel').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var paperStatus = $('#gridtable').jfGridValue('PaperStatus');
- if (paperStatus != 1) {
- learun.alert.warning("当前教师未提交纸质成绩单!");
- return false;
- }
- learun.layerConfirm('是否确认撤销纸质成绩单!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/EmpReportCard/SubmitForm', { keyValue: keyValue, status: 0 }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/EmpReportCard/GetPageList',
- headData: [
- { 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: "ClassNo", width: 100, align: "left" },
- { label: "班级名称", name: "ClassName", width: 100, align: "left" },
- { label: "教师号", name: "EmpNo", width: 100, align: "left" },
- { label: "教师名称", name: "EmpName", width: 100, align: "left" },
- { label: "上课教室号", name: "ClassRoomNo", width: 100, align: "left" },
- { label: "上课教室名称", name: "ClassRoomName", width: 100, align: "left" },
- { label: "上课节次(如11代表星期一第一节课)", name: "LessonSection", width: 100, align: "left" },
- {
- label: "类型", name: "LessonSortNo", width: 100, align: "left",
- formatter: function (cellvalue, rowObject) {
- return cellvalue == 1 ? "<span>必修课</span>" : "<span>选修课</span>";
- }
- },
- {
- label: "电子成绩单提交", name: "ElectronicStatus", width: 100, align: "left",
- formatter: function (cellvalue, rowObject) {
- return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- { label: "电子成绩单提交时间", name: "ElectronicTime", width: 130, align: "left" },
- {
- label: "纸质成绩单提交", name: "PaperStatus", width: 100, align: "left",
- formatter: function (cellvalue, rowObject) {
- return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- { label: "纸质成绩单提交时间", name: "PaperTime", width: 130, align: "left" },
- ],
- mainId: 'Id',
- isPage: 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();
- }
|