123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/CollegeClassroom/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgCollegeClassroomList").cmsXDataTable("load", $.getDataGridParams("dgCollegeClassroomList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgCollegeClassroomList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.CollegeClassroomID);
- });
- return d;
- }
- //新增
- function CollegeClassroom_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('院系教室复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/CollegeClassroom/CopyAdd?collegeClassroomID=' + d[0] + '&MNU=' + mnu, 750, 320, null, null);
- } else {
- //var redirectTo = url + "?MNU=" + mnu;
- //$.popupTopWindow('院系教室新增', redirectTo, 750, 320, null, null);
- //采用以下方式新增
- //根据院系所信息选择教室信息新增BatchAdd
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/CollegeClassroom/BatchAdd" + "?MNU=" + mnu;
- $.popupTopWindow('院系教室新增', redirectTo, 1080, 530, reload, null);
- ////根据院系教室信息新增CollegeClassroomBatchAdd
- //var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/CollegeClassroom/CollegeClassroomBatchAdd" + "?MNU=" + mnu;
- //$.popupTopWindow('院系教室新增', redirectTo, 1080, 530, reload, null);
- }
- }
- //修改按钮
- function CollegeClassroom_Edit() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统信息", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?collegeClassroomID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('院系教室修改', redirectTo, 750, 320, null, null);
- }
- //查看明细
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?collegeClassroomID=" + rowdata.CollegeClassroomID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('院系教室明细', redirectTo, 750, 320, null, null);
- }
- //删除
- function CollegeClassroom_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/CollegeClassroom/Delete', { collegeClassroomIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgCollegeClassroomList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //设置相应的行颜色为红色
- function SetRedGrid(rowIndex, rowData) {
- if (rowData.IsAvailable != true || rowData.IsReserve == true) {
- return "color: red;";
- } else {
- return "";
- }
- }
- //导出Excel
- function CollegeClassroom_Export() {
- $("#formQuery").submit();
- }
- //联动查询
- function queryCollegeCampus(data) {
- var campusID = $("#CollegeCampusDropdown").combogridX("getValue");
- if (campusID != nonSelect) {
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- }
- else {
- $("#CollegeDropdown").combogridX("reload");
- }
- reload();
- }
|