123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/Department/Edit";
- var loadurl = CMS_SystemConfig.VirtualDirectoryPath + "/Department/List";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgDepartmentList").cmsXDataTable("load", $.getDataGridParams("dgDepartmentList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgDepartmentList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.DepartmentID);
- });
- return d;
- }
- //获取菜单Url
- function load() {
- window.location.href = loadurl + "?MNU=" + mnu;
- }
- //新增
- function Department_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('教研室复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Department/CopyAdd?departmentID=' + d[0] + '&MNU=' + mnu, 650, 350, null, null);
- } else {
- var redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow('教研室新增', redirectTo, 650, 350, null, null);
- }
- }
- //修改按钮
- function Department_Update() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统信息", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统信息", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?departmentID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('教研室修改', redirectTo, 650, 350, null, null);
- }
- //查看
- function edit(rowindex, rowdata) {
- window.event.cancelBubble = true;
- var redirectTo = url + "?departmentID=" + rowdata.DepartmentID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('教研室信息', redirectTo, 650, 350, null, null);
- }
- //删除
- function Department_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统信息", "请选择您要删除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Department/Delete', { departmentIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgDepartmentList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //教研室对应的教师明细
- function editStaffCount(rowindex, rowdata) {
- redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Department/StaffList?departmentID=" + rowdata.DepartmentID + "&MNU=" + mnu;
- $.popupTopWindow('教师信息明细', redirectTo, 1024, 540, null, null);
- }
- //Excel导出
- function Department_Export() {
- $("#formQuery").submit();
- }
- //Excel导入
- function Department_Import() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Department/Import?MNU=' + mnu;
- $.popupTopWindow('教研室导入', redirectTo, 420, 300, reload);
- }
- //联动
- function queryCampus() {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- reload();
- }
- function queryCollege(data) {
- reload();
- }
|