123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgStudentPunishList").cmsXDataTable("load", $.getDataGridParams("dgStudentPunishList"));
- }
- //获取选中的数据All
- function validChooseAll() {
- var d = [];
- $.each($("#dgStudentPunishList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgStudentPunishList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.StudentPunishID);
- });
- return d;
- }
- //获取选中的状态
- function validChooseStatus() {
- var d = [];
- $.each($("#dgStudentPunishList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.ApprovalStatus);
- });
- return d;
- }
- //查看
- function edit(rowindex, rowdata) {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Edit?studentPunishID=" + rowdata.StudentPunishID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('学生处分信息', redirectTo, 620, 365, null, null);
- }
- //新增
- function StudentPunish_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('学生处分复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/StudentPunish/CopyAdd?studentPunishID=' + d[0] + '&MNU=' + mnu, 620, 365, null, null);
- } else {
- var redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow('学生处分新增', redirectTo, 620, 365, null, null);
- }
- }
- //修改
- function StudentPunish_Edit() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var id = validChooseAll();
- if ($.grep(id, function (v, i) { return !(v.ApprovalStatus == startStatusID || v.ApprovalStatus == sendBackStatusID); }).length > 0) {
- $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行修改。");
- return;
- }
- var redirectTo = url + "?studentPunishID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('学生处分修改', redirectTo, 620, 365, null, null);
- }
- //批量修改
- SystemBatchModifyControl.OnSubmit = function () {
- var status = validChooseStatus().join(',');
- for (var i = 0; i < status.split(',').length; i++) {
- if (!(status.split(',')[i] == startStatusID || status.split(',')[i] == sendBackStatusID)) {
- $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行修改。");
- return false;
- }
- }
- }
- //删除
- function StudentPunish_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentPunish/Delete', { studentPunishIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgStudentPunishList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //提交
- function StudentPunish_Submit() {
- var d = validChoose().join(',');
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要提交的信息。");
- return;
- }
- var id = validChooseAll();
- if ($.grep(id, function (v, i) { return !(v.ApprovalStatus == startStatusID || v.ApprovalStatus == sendBackStatusID); }).length > 0) {
- $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行提交。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要对选择的信息进行提交?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentPunish/Submit', { studentPunishIDs: d }, function (data) {
- if (data.IsSuccess == true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgStudentPunishList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //审核
- function StudentPunish_Approve() {
- var d = validChooseAll();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要审核的信息。");
- return;
- }
- if ($.grep(d, function (v, i) { return (v.ApprovalStatus == startStatusID || v.ApprovalStatus == sendBackStatusID || v.ApprovalStatus == passNoEndStatusID || v.ApprovalStatus == endStatusID); }).length > 0) {
- $.messager.alert("系统提示", "只能对待审核的信息进行审核。");
- return;
- }
- var status = d[0].ApprovalStatus;
- if ($.grep(d, function (v, i) { return v.ApprovalStatus != status; }).length > 0) {
- $.messager.alert("系统提示", "只能对相同状态的待审核的信息进行批量审核。");
- return;
- }
- var studentPunishIDs = validChoose();
- if (studentPunishIDs.length > 1) {
- //批量审核
- var approveID = studentPunishIDs[0];
- $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=EM_StudentPunish&FormID=' + approveID,
- 400, 300, StudentPunish_ApproveConfirm);
- }
- else {
- var studentPunishID = studentPunishIDs;
- //单个审核
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Approve?MNU=" + mnu + "&studentPunishID=" + studentPunishID;
- $.popupTopWindow('学生处分审核', redirectTo, 620, 420, null, null);
- }
- }
- //确定(审核)
- function StudentPunish_ApproveConfirm(action) {
- if (!action) {
- return;
- }
- if (action.ActionID == "") {
- return;
- }
- var approveIDs = validChoose().join(',');
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/ApproveConfirm", { studentPunishIDs: approveIDs, actionID: action.Action, comment: action.Comment },
- function (data) {
- if (data.IsSuccess) {
- reload();
- }
- $.messager.alert("系统提示", data.Message);
- }, 'json');
- }
- //撤销
- function StudentPunish_Cancel() {
- var d = validChooseAll();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要撤销的信息。");
- return;
- }
- if ($.grep(d, function (v, i) { return v.ApprovalStatus != passNoEndStatusID; }).length > 0) {
- $.messager.alert("系统提示", "只能对审核通过的信息进行撤销。");
- return;
- }
- var studentPunishIDs = validChoose();
- if (studentPunishIDs.length > 1) {
- //批量撤销
- var approveID = studentPunishIDs[0];
- $.popupTopWindow('撤销信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=EM_StudentPunish&FormID=' + approveID,
- 400, 300, StudentPunish_CancelConfirm);
- }
- else {
- var studentPunishID = studentPunishIDs;
- //单个撤销
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Cancel?MNU=" + mnu + "&studentPunishID=" + studentPunishID;
- $.popupTopWindow('学生处分撤销', redirectTo, 620, 420, null, null);
- }
- }
- //确定(撤销)
- function StudentPunish_CancelConfirm(action) {
- if (!action) {
- return;
- }
- if (action.ActionID == "") {
- return;
- }
- var approveIDs = validChoose().join(',');
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/CancelConfirm", { studentPunishIDs: approveIDs, actionID: action.Action, comment: action.Comment },
- function (data) {
- if (data.IsSuccess) {
- reload();
- }
- $.messager.alert("系统提示", data.Message);
- }, 'json');
- }
- //查看
- function cancel(rowindex, rowdata) {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Cancel?studentPunishID=" + rowdata.StudentPunishID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('学生处分信息', redirectTo, 620, 365, null, null);
- }
- //Excel导出
- function StudentPunish_Export() {
- $("#formQuery").submit();
- }
- //联动查询
- function queryCampus(data) {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- queryClass();
- }
- 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));
- $("#DictionaryStandard").combogridX("reload", eval(jsonString));
- queryClass();
- }
- function queryGrade(data) {
- queryClass();
- }
- function queryStandard(data) {
- queryClass();
- }
- function queryLearnSystem(data) {
- queryClass();
- }
- function queryClass() {
- var jsonString = "";
- var parameterString = "";
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var gradeID = $("#DictionaryGrade").combogridX("getValue");
- var standardID = $("#DictionaryStandard").combogridX("getValue");
- var educationID = $("#DictionaryEducation").combogridX("getValue");
- var learningformID = $("#DictionaryLearningform").combogridX("getValue");
- var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
- if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
- if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
- if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
- if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
- if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
- if (learnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + learnSystem + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#DictionaryStandard").combogridX("reload", eval(jsonString));
- }
- else {
- $("#DictionaryStandard").combogridX("reload");
- }
- reload();
- }
|