|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2022-04-12 15:47
- * 描 述:考试课程表
- */
- 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);
- }, 320, 400);
- $('#AcademicYearNo').lrselect({
- placeholder: "学年",
- allowSearch: true,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
- value: 'value',
- text: 'text'
- });
- //学期
- $('#Semester').lrselect({
- placeholder: "学期",
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
- value: 'value',
- text: 'text'
- });
- $('#DeptNo').lrselect({
- allowSearch: true,
- value: "deptno",
- text: "deptname",
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
- select: function (item) {
- if (item) {
- $('#MajorNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
- });
- } else {
- $('#MajorNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- param: { strWhere: "1=1 AND CheckMark=1" }
- });
- }
-
- }
- });
- $('#MajorNo').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- value: "majorno",
- text: "majorname",
- param: { strWhere: "1=1 AND CheckMark=1" },
- select: function (item) {
- var Grades = $("#Grade").lrselectGet();
- if (Grades != null && Grades != "" && Grades != "undefined") {
- if (item) {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
- });
- } else {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- } else {
- if (item) {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" }
- });
- } else {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- }
- }
- });
- $('#Grade').lrselect({
- url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
- value: "value",
- text: "text",
- select: function (item) {
- var MajorNos = $("#MajorNo").lrselectGet();
- if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") {
- if (item) {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: {
- strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
- }
- });
- } else {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- } else {
- if (item) {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: {
- strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
- }
- });
- } else {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
- });
- }
- }
-
- }
- });
- $('#ClassNo').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
- value: "classno",
- text: "classname"
- });
- $('#ESType').lrDataItemSelect({ code: 'StudentType' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ESId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行编辑!");
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ESId');
- if (learun.checkrow(keyValue)) {
- var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
- if (ESEnabled.indexOf('true') != -1) {
- learun.alert.warning("选中记录中包含已启用项目!");
- return;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //启用
- $('#lr_lock').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ESId');
- if (learun.checkrow(keyValue)) {
- var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
- if (ESEnabled.indexOf('true') != -1) {
- learun.alert.warning("选中记录中包含已启用项目!");
- return;
- }
- learun.layerConfirm('是否确认启用选中记录!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 1 }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //禁用
- $('#lr_unlock').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('ESId');
- if (learun.checkrow(keyValue)) {
- var ESEnabled = $('#gridtable').jfGridValue('ESEnabled');
- if (ESEnabled.indexOf('false') != -1) {
- learun.alert.warning("选中记录中包含已停用项目!");
- return;
- }
- learun.layerConfirm('是否确认停用选中记录!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/Lock', { keyValue: keyValue, ESEnabled: 0 }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- // 一键生成
- $('#lr_importBy').on('click', function () {
- learun.layerForm({
- id: 'form_import',
- title: '生成考生信息',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormImport',
- width: 500,
- height: 300,
- btn: ['一键生成', '关闭'],
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 导入
- $('#lr_clearBy').on('click', function () {
- learun.layerForm({
- id: 'form_clear',
- title: '按条件清空学生考试信息',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/FormClear',
- width: 500,
- height: 300,
- btn: ['确定', '关闭'],
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/GetPageList',
- headData: [
- { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
- { label: "学期", name: "Semester", width: 100, align: "left" },
- {
- label: "系部", name: "DeptNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
- key: value,
- keyId: 'deptno',
- callback: function (_data) {
- callback(_data['deptname']);
- }
- });
- }
- },
- {
- label: "专业", name: "MajorNo", width: 140, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
- key: value,
- keyId: 'majorno',
- callback: function (_data) {
- callback(_data['majorname']);
- }
- });
- }
- },
- {
- label: "班级", name: "ClassNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
- key: value,
- keyId: 'classno',
- callback: function (_data) {
- callback(_data['classname']);
- }
- });
- }
- },
- { label: "学生编号", name: "StuNo", width: 140, align: "left" },
- { label: "学籍号", name: "StuCode", width: 140, align: "left" },
- { label: "学生姓名", name: "StuName", width: 100, align: "left" },
- { label: "身份证号", name: "IdentityCardNo", width: 140, align: "left" },
- { label: "年级", name: "Grade", width: 100, align: "left" },
- {
- label: "考试类型", name: "ESType", 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: "ESEnabled", width: 100, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- ],
- mainId: 'ESId',
- isMultiselect: true,
- isPage: true,
- sidx: 'AcademicYearNo desc,Semester desc ,Grade desc,DeptNo desc, MajorNo desc, ClassNo desc',
- sord: 'ASC'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|