123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/TeachingMaterialPool/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //function validChooseCoursematerial() {
- // var d = [];
- // $.each($("#dgCoursematerialList").cmsXDataTable("getSelections"), function (index) {
- // d.push(this.CoursematerialID);
- // });
- // return d;
- //}
- //新增
- function TeachingMaterialPool_Add() {
- var redirectTo = url + '?MNU=' + mnu;
- $.popupTopWindow('教材信息新增', redirectTo, 750, 450, null, null);
- }
- function reload() {
- $("#dgTeachingMaterialPoolList").cmsXDataTable("load", $.getDataGridParams("dgTeachingMaterialPoolList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgTeachingMaterialPoolList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.TeachingMaterialPoolID);
- });
- return d;
- }
- function TeachingMaterialPool_Save() {
- alert("保存");
- }
- //点击列表更新
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?teachingMaterialPoolID=" + rowdata.TeachingMaterialPoolID + "&MNU=" + mnu + "&isView=1";
- $.popupTopWindow("教材基本信息详情", redirectTo, 750, 450, null, null);
- }
- //修改按钮
- function TeachingMaterialPool_Update() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要修改的教材信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?teachingMaterialPoolID=" + d + "&MNU=" + mnu;
- $.popupTopWindow("教材基本信息修改", redirectTo, 750, 450, null, null);
- }
- //删除
- function TeachingMaterialPool_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的教材信息!");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除该教材信息?", function (r) {
- if (r) {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/TeachingMaterialPool/Delete', { teachingMaterialPoolIDs: d }, function (data) {
- if (data == "删除成功") {
- $.messager.alert("系统提示", "删除成功!");
- $("#dgTeachingMaterialPoolList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- //导入
- function TeachingMaterialPool_Import() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/TeachingMaterialPool/Import?MNU=' + mnu;
- $.popupTopWindow('教材信息导入', redirectTo, 400, 300, null, null);
- }
- function TeachingMaterialPool_Export() {
- $("#formQuery").submit();
- }
- function QueryPublishDropdownList(data) {
- reload();
- }
- function QueryCourseDropdownList(data) {
- reload();
- }
- function QueryLateDropdownList(data) {
- reload();
- }
- //教材类型
- function QueryTeachingMaterialTypeDropdownList() {
- reload();
- }
- function QueryTeachingMaterialDropdownList() {
- reload();
- }
- function Coursematerial_Add() {
- $.popupTopWindow('课程信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/CoursematerialSelect', 700, 400, CoursematerialSelect_Close);
- }
- function CoursematerialSelect_Close(coursematerialList) {
- if (!coursematerialList) return;
- if (coursematerialList.length == 0) return;
- var coursematerialViewList = $("#dgCoursematerialList").cmsXDataTable("getRows");
- $.each(coursematerialList, function (index, value) {
- if ($.grep(coursematerialViewList, function (row, index) { return value.CoursematerialID == row.CoursematerialID; }).length == 0) {
- coursematerialViewList.push({
- CoursematerialID: value.CoursematerialID,
- ClassGroupingID: value.ClassGroupingID,
- CourseCode: value.CourseCode,
- CourseName: value.CourseName,
- Abbreviation: value.Abbreviation,
- EnglishName: value.EnglishName,
- StandardName: value.StandardName,
- CourseEdition: value.CourseEdition,
- CourseSynopsis: value.CourseSynopsis,
- CourseReserve: value.CourseReserve,
- IsEnable: value.IsEnable,
- IsEnableName: value.IsEnableName,
- CourseLevelID: value.CourseLevelID,
- CourseLevelName: value.CourseLevelName,
- CourseScienceID: value.CourseScienceID,
- CourseScienceName: value.CourseScienceName,
- CreateUserID: value.CreateUserID,
- CreateTime: value.CreateTime,
- Remarks: value.Remarks
- });
- }
- });
- $("#dgCoursematerialList").cmsXDataTable("loadData", { rows: coursematerialViewList, total: coursematerialViewList.length });
- }
- //获取选中的数据
- function validChooseCoursematerial() {
- var d = [];
- $.each($("#dgCoursematerialList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.CoursematerialID);
- });
- return d;
- }
- function Coursematerial_Remove() {
- var d = validChooseCoursematerial();
- var coursematerialViewList = $("#dgCoursematerialList").cmsXDataTable("getRows");
- var i, j;
- var len = coursematerialViewList.length;
- for (i = len - 1; i >= 0; i--) {
- for (j = 0; j < d.length; j++) {
- if (coursematerialViewList[i].CoursematerialID == d[j].toString()) {//修改删除判断
- coursematerialViewList.splice(i, 1);
- break;
- }
- }
- }
- $("#dgCoursematerialList").cmsXDataTable("loadData", { rows: coursematerialViewList, total: coursematerialViewList.length });
- }
- //勾选按钮
- function checkBox() {
- var jsonString = "({'QueryParamsDatas':'IsCheck|*|" + document.getElementById("isCheck").checked + "|@|'})";
- reload();
- }
|