|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2022-04-14 18:12
- * 描 述:考试记录表
- */
- 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);
- $('#AcademicYearNo').lrselect({
- placeholder: "学年",
- allowSearch: false,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
- value: 'value',
- text: 'text'
- });
- //学期
- $('#Semester').lrselect({
- placeholder: "学期",
- allowSearch: false,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
- value: 'value',
- text: 'text'
- });
- $('#PlanType').lrDataItemSelect({ code: 'StudentType' });
- $('#EPRandom').lrDataItemSelect({ code: 'YesOrNoBit' });
- $('#EPGenarate').lrDataItemSelect({ code: 'YesOrNoBit' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- //是否生成
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("已生成排考名单,不可编辑!");
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- //是否生成
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("已生成排考名单,不可删除!");
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- // 生成排考名单
- $('#lr_generate').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认生成排考名单!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/Generate', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 清除排考名单
- $('#lr_cleargenerate').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认清除排考名单!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/ClearGenerate', { keyValue: keyValue, type: 1 }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //清除排考记录
- $('#lr_cleardata').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认清除所有排考记录!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/ClearGenerate', { keyValue: keyValue, type: 2 }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- // 安排时间
- $('#lr_examtime').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formtime',
- title: '安排时间',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/FormTime?keyValue=' + keyValue,
- width: 850,
- height: 550,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 安排考试
- $('#lr_planks').on('click',
- function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- var PlanName = $('#gridtable').jfGridValue('PlanName');
- if (learun.checkrow(keyValue))
- learun.frameTab.open({
- F_ModuleId: keyValue,
- F_Icon: 'fa magic',
- F_FullName: PlanName + '--安排考试',
- F_UrlAddress: '/EducationalAdministration/Exam_ExamPlanLesson/Index?EPId=' + keyValue
- });
- });
- //一键安排课程
- $('#lr_examlesson').on('click',
- function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认安排课程!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanLessonByEPId', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- //一键安排班级
- $('#lr_examclass').on('click',
- function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认安排班级!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanClassByEPId', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- //一键安排考场
- $('#lr_examroom').on('click',
- function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认安排考场!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanRoomByEPId', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- //自动生成排考时间
- $('#lr_examlessontime').on('click',
- function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认生成排考时间!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanLessonTimeByEPId', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- //一键安排监考老师
- $('#lr_examteacher').on('click',
- function () {
- var keyValue = $('#gridtable').jfGridValue('EPId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认安排监考老师!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanTeacherByEPId', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
-
- //老师时间管理
- $('#lr_teacherTimeManage').on('click', function () {
- learun.layerForm({
- id: 'form_teacherTimeManage',
- title: '老师时间管理',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamTeacherTime/Index',
- width: 1000,
- height: 600,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
-
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGridLei({
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/GetPageList',
- headData: [
- { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
- { label: "学期", name: "Semester", width: 100, align: "left" },
- { label: "排考名称", name: "PlanName", width: 300, align: "left" },
- {
- label: "排考类型", name: "PlanType", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'StudentType',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "排考编号", name: "PlanCode", width: 200, align: "left" },
- { label: "排考总人数", name: "EPStuCount", width: 100, align: "left" },
- {
- label: "是否随机座位", name: "EPRandom", width: 100, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == true ? "是" : "否";
- }
- },
- {
- label: "是否生成", name: "EPGenarate", width: 100, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- { label: "排序号", name: "EPOrder", width: 100, align: "left", },
- ],
- mainId: 'EPId',
- isPage: true,
- sidx: "EPOrder asc "
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|