123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/Staff/Edit";
- var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='StaffEdit']");
- if (customerUrl.attr("value")) {
- url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value");
- }
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //新增
- function Staff_Add() {
- var redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow('教师信息新增', redirectTo, 700, 540, null, null);
- }
- function reload() {
- $("#dgStaffList").cmsXDataTable("load", $.getDataGridParams("dgStaffList"));
- }
- function validChooseLoginID() {
- var d = [];
- $.each($("#dgStaffList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.StaffCode);
- });
- return d;
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgStaffList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.UserID);
- });
- return d;
- }
- //查看
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?userID=" + rowdata.UserID + "&MNU=" + mnu + "&Type=1";
- $.popupTopWindow('教师信息', redirectTo, 700, 540, null, null);
- }
- //修改按钮
- function Staff_Update() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?userID=" + d + "&MNU=" + mnu;
- $.popupTopWindow('教师信息修改', redirectTo, 700, 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 == "删除成功。") {
- $.messager.alert("系统提示", data);
- $("#dgStaffList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- //教师信息Excel导入
- function Staff_Import() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Staff/Import?MNU=' + mnu;
- $.popupTopWindow('教师信息导入', redirectTo, 400, 300, null, null);
- }
- //Excel导出
- function Staff_Export() {
- $("#formQuery").submit();
- }
- function QueryPhotoUrltmentDropdownList(data) {
- reload();
- }
- function QueryCampusComboGridList() {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- if (campusID != nonSelect) {
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- }
- reload();
- }
- function QueryCollegeComboGridList() {
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- if (collegeID != nonSelect) {
- var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})";
- $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
- }
- reload();
- }
- function QueryDepartmentComboGridList() {
- reload();
- }
- 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();
- });
- }
- });
- }
|