/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2021-11-29 11:43 * 描 述:开课计划 */ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var cddeptname = ''; var page = { init: function () { page.inittree(); page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 250, 400); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', value: 'value', text: 'text' }); //年级 $('#Grade').lrselect({ placeholder: "请选择年级", allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData', value: 'value', text: 'text' }); $('#Semester').lrDataItemSelect({ code: 'Semester' }); $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); $("#MajorNo").lrselect(); $('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' }); $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm', width: 800, height: 450, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 设置教师 $('#lr_teach').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { var empno = $('#gridtable').jfGridValue('EmpNo').split(','); var allEmpty = true; for (var i = 0; i < empno.length; i++) { if (empno[i] != '') { allEmpty = false; } } if (allEmpty) { learun.layerForm({ id: 'form', title: '设置教师', url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm?keyValue=' + keyValue, width: 400, height: 300, callBack: function (id) { return top[id].acceptClick(); } }); } else { learun.alert.warning("所选班级已设置教师,不可重复设置!!!"); } } }); // 强制设置教师 $('#lr_qzteach').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', title: '强制设置教师', url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' + keyValue, width: 400, height: 300, callBack: function (id) { return top[id].acceptClick(); } }); } }); }, inittree: function () { $('#cddeptTree').lrtree({ url: top.$.rootUrl + '/EducationalAdministration/CdDept/GetTree', param: { parentId: '0' }, nodeClick: page.treeNodeClick }); //$('#cddeptTree').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681'); }, treeNodeClick: function (item) { cddeptname = item.id; $('#titleinfo').text(item.text); page.search(); var NDeptNo = item.id; if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) { $('#MajorNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" }, value: "majorno", text: "majorname", maxHeight: 200 }); } else { $('#MajorNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " }, value: "majorno", text: "majorname", maxHeight: 200 }); } }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/GetPageList', headData: [ { label: "校区", name: "F_SchoolId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', key: value, keyId: 'f_companyid', callback: function (_data) { callback(_data['f_fullname']); } }); } }, { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, { label: "学期", name: "Semester", width: 50, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'Semester', callback: function (_data) { callback(_data.text); } }); } }, { 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: 200, 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: "Grade", width: 50, align: "left" }, { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, { label: "课程名称", name: "LessonName", width: 200, align: "left" }, //{ // label: "课程名称", name: "LessonNo", width: 200, align: "left", // formatterAsync: function (callback, value, row, op, $cell) { // learun.clientdata.getAsync('custmerData', { // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', // key: value, // keyId: 'lessonno', // callback: function (_data) { // callback(_data['lessonname']); // } // }); // } //}, { label: "人数", name: "StuNum", width: 80, align: "left" }, { label: "上机课时", name: "PracticeHour", width: 80, align: "left" }, { label: "班级编号", name: "TeachClassNo", width: 80, align: "left" }, { label: "班级名称", name: "TeachClassNo", width: 80, 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: "EmpNo", width: 80, align: "left" }, { label: "教师名称", name: "EmpNo", width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', key: value, keyId: 'f_encode', callback: function (_data) { callback(_data['f_realname']); } }); } }, { label: "考试类型", name: "ExamType", width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'ExamType', callback: function (_data) { callback(_data.text); } }); } }, { label: "合上班", name: "RelatedClassNo", width: 80, align: "left" }, { label: "拟开教学班数", name: "LessonSortNo", width: 100, align: "left" }, { label: "备注", name: "Remark", width: 100, align: "left" }, ], mainId: 'ID', sidx: 'ID desc', isMultiselect: true, isPage: true }); page.search(); }, search: function (param) { param = param || {}; param.DeptNo = cddeptname; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }