|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360 |
- /* * 版 本 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)) {
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("选中记录已生成排考名单!");
- }
- 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)) {
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("选中记录已生成排考名单!");
- }
- 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)) {
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("选中记录已生成排考名单!");
- }
- 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)) {
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("选中记录已生成排考名单!");
- }
- 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)) {
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("选中记录已生成排考名单!");
- }
- 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)) {
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("选中记录已生成排考名单!");
- }
- 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)) {
- var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
- if (EPGenarate == true) {
- return learun.alert.warning("选中记录已生成排考名单!");
- }
- learun.layerConfirm('是否确认安排监考老师!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanTeacherByEPId', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- //一键审核所有考试课程
- $('#lr_checkAll').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.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/CheckAllPlanLesson', { 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 || {};
- if (IsTwoDept)
- param.ImportDeptNo = CurrentDeptNo;
- else
- param.ImportDeptNo = "0";
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|