123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/RecruitSpecialty/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新列表
- function reload() {
- $("#dgRecruitSpecialtyList").cmsXDataTable("load", $.getDataGridParams("dgRecruitSpecialtyList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgRecruitSpecialtyList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.RecruitSpecialtyID);
- });
- return d;
- }
- //新增(批量)
- function RecruitSpecialty_Add() {
- //var d = validChoose();
- //if (d.length > 0) {
- // $.popupTopWindow('招生专业复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/CopyAdd?recruitSpecialtyID=' + d[0] + '&MNU=' + mnu, 600, 320, null, null);
- //} else {
- // var redirectTo = url + "?MNU=" + mnu;
- // $.popupTopWindow('招生专业新增', redirectTo, 600, 320, null, null);
- //}
- //采用以下方式进行新增
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/RecruitSpecialty/RecruitSpecialtyBatchAdd" + "?MNU=" + mnu;
- $.popupTopWindow('招生专业新增', redirectTo, 950, 540, reload, null);
- }
- //修改按钮
- function RecruitSpecialty_Edit() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?recruitSpecialtyID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('招生专业修改', redirectTo, 600, 320, null, null);
- }
- //查看
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?recruitSpecialtyID=" + rowdata.RecruitSpecialtyID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('招生专业信息', redirectTo, 600, 320, null, null);
- }
- //删除
- function RecruitSpecialty_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/Delete', { recruitSpecialtyIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgRecruitSpecialtyList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //专业班级生成
- function RecruitSpecialty_GenerateClass() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要生成专业班级的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要对选择的信息生成专业班级?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/GenerateClass', { recruitSpecialtyIDs: d }, function (data) {
- if (data.IsSuccess == true) {
- $("#dgRecruitSpecialtyList").cmsXDataTable('load');
- }
- $.messager.alert("系统提示", data.Message);
- });
- }
- });
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //设置相应的行颜色为红色
- function SetRedGrid(rowIndex, rowData) {
- if (rowData.isGenerated != true) {
- return "color: red;";
- } else {
- return "";
- }
- }
- //Excel导出
- function RecruitSpecialty_Export() {
- $("#formQuery").submit();
- }
- //Excel导入
- function RecruitSpecialty_Import() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/Import?MNU=' + mnu;
- $.popupTopWindow('招生专业导入', redirectTo, 420, 300, reload);
- }
- //联动查询
- function queryCampus(data) {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- reload();
- }
- function queryCollege(data) {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
- jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- reload();
- }
- function queryGrade(data) {
- reload();
- }
- function queryStandard(data) {
- reload();
- }
|