123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/Staff/Edit";
- var mnu = "";
- //url个性化配置
- var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='StaffEdit']");
- if (customerUrl.attr("value")) {
- url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value");
- }
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgStaffList").cmsXDataTable("load", $.getDataGridParams("dgStaffList"));
- }
- //获取选中的数据UserID
- function validChoose() {
- var d = [];
- $.each($("#dgStaffList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.UserID);
- });
- return d;
- }
- //获取选中的数据LoginID
- function validChooseLoginID() {
- var d = [];
- $.each($("#dgStaffList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.StaffCode);
- });
- return d;
- }
- //新增
- function Staff_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('教师信息复制新增', url + '?newUserID=' + d[0] + '&MNU=' + mnu + '&type=copyAdd', 650, 540, null, null);
- } else {
- var redirectTo = url + "?MNU=" + mnu + "&type=add";
- $.popupTopWindow('教师信息新增', redirectTo, 650, 540, null, null);
- }
- }
- //修改按钮
- function Staff_Update() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?newUserID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('教师信息修改', redirectTo, 650, 540, null, null);
- }
- //明细查看
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?newUserID=" + rowdata.UserID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('教师信息明细', redirectTo, 650, 540, null, null);
- }
- //删除
- function Staff_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Staff/Delete', { userIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgStaffList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //删除照片
- function Staff_PicDelete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除照片的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息对应的照片?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Staff/PicDelete', { userIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgStaffList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //教师对应的角色信息明细
- function editRoleCount(rowindex, rowdata) {
- redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Staff/RoleList?userID=" + rowdata.UserID + "&MNU=" + mnu;
- $.popupTopWindow('角色信息明细', redirectTo, 1024, 540, null, null);
- }
- //模拟登录
- function Staff_SimulateLogin() {
- var d = validChooseLoginID();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要模拟登录的教师。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择一个教师进行模拟登录。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要进行模拟登录?", function (r) {
- if (r) {
- var loginID = d.toString();
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SimulateLogin/Login', { LoginID: loginID }, function (data) {
- parent.location.reload();
- });
- }
- });
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //Excel导出
- function Staff_Export() {
- $("#formQuery").submit();
- }
- //导入照片
- function Staff_PicImport() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Staff/PicImport?MNU=' + mnu;
- $.popupTopWindow('导入照片', redirectTo, 420, 300, reload);
- }
- //Excel导入
- function Staff_Import() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Staff/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));
- $("#DepartmentDropdown").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 + "|@|'})";
- $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- reload();
- }
|