123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/Misconduct/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- function reload() {
- $("#dgMisconductList").cmsXDataTable("load", $.getDataGridParams("dgMisconductList"));
- }
- function view(rowindex, rowdata) {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Misconduct/View?misconductID=" + rowdata.MisconductID + "&MNU=" + mnu;
- $.popupTopWindow('违纪名单', redirectTo, 600, 400, null, null);
- }
- //缓考名单导出
- function Misconduct_Export() {
- $("#formQuery").submit();
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgMisconductList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //新增
- function Misconduct_Add() {
- var redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow('违纪名单', redirectTo, 600, 400, null, null);
- }
- //修改
- function Misconduct_Update() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要修改的违纪名单。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var recordstatus = d[0].RecordStatus;
- if (recordstatus != startStatusID) {
- $.messager.alert("系统提示", "该违纪名单已经提交,无法修改。");
- return;
- }
- var redirectTo = url + "?misconductID=" + d[0].MisconductID + "&MNU=" + mnu;
- $.popupTopWindow('违纪名单', redirectTo, 600, 400, null, null);
- }
- //提交
- function Misconduct_Submit() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要提交的违纪名单。");
- return;
- }
- if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
- $.messager.alert("系统提示", "所选的违纪名单有部分已经提交,无法再次提交。");
- return;
- }
- var misconductIDs = $.map(d, function (x) { return x.MisconductID; }).join(',');
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Misconduct/Submit', { misconductIDs: misconductIDs }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", "提交成功!");
- $("#dgMisconductList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- //审核
- function Misconduct_Approve() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要审核的违纪名单。");
- return;
- }
- var recordstatus = d[0].RecordStatus;
- if ($.grep(d, function (v, i) { return v.RecordStatus != recordstatus; }).length > 0) {
- $.messager.alert("系统提示", "请选择相同状态的记录进行审核。");
- return;
- }
- if (recordstatus == startStatusID) {
- $.messager.alert("系统提示", "选中的记录未提交,请先提交后再进行审核。");
- return;
- }
- for (var i = 0; i < d.length; i++) {
- if (d[i].RecordStatus == 3) {
- $.messager.alert("系统提示", "违纪名单已审核如要撤销请点击撤销按钮!");
- return;
- }
- if (d[i].RecordStatus == 4) {
- $.messager.alert("系统提示", "违纪名单已撤销请勿重复操作!");
- return;
- }
- }
- var firstID = d[0].MisconductID;
- $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=ER_Misconduct&FormID=' + firstID,
- 400, 300, Misconduct_Approve_Confirm);
- }
- function Misconduct_Approve_Confirm(action) {
- if (!action) return;
- if (action.ActionID == "") return;
- var d = $.map(validChoose(), function (x) { return x.MisconductID; }).join(',');
- $.post(CMS_SystemConfig.VirtualDirectoryPath + "/Misconduct/Approve", { misconductIDs: d, actionID: action.Action, comment: action.Comment },
- function (data) {
- $.messager.alert("系统提示", data.Message);
- if (data.IsSuccess) {
- reload();
- }
- }, 'json');
- }
- //撤销
- function Misconduct_Cancel() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要审核的违纪名单。");
- return;
- }
- var recordstatus = d[0].RecordStatus;
- if ($.grep(d, function (v, i) { return v.RecordStatus != recordstatus; }).length > 0) {
- $.messager.alert("系统提示", "请选择相同状态的记录进行审核。");
- return;
- }
- if (recordstatus == startStatusID) {
- $.messager.alert("系统提示", "选中的记录未提交,请先提交后再进行审核。");
- return;
- }
- for (var i = 0; i < d.length; i++) {
- if (d[i].RecordStatus < 3) {
- $.messager.alert("系统提示", "只能撤销完成审核的违纪名单!");
- return;
- }
- if (d[i].RecordStatus == 4) {
- $.messager.alert("系统提示", "违纪名单已撤销请勿重复操作!");
- return;
- }
- }
- var approveIDs = $.map(d, function (x) { return x.MisconductID; }).join(',');
- $.messager.confirm("系统提示", "您确定要撤销该违纪名单信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/Misconduct/Cancel", { misconductIDs: approveIDs, comment: $("[name='Comment']").val() },
- function (data) {
- $.messager.alert("系统提示", data.Message);
- if (data.IsSuccess) {
- reload();
- }
- }, 'json');
- }
- });
- }
- function Misconduct_Approve_Confirms(action) {
- if (!action) return;
- if (action.ActionID == "") return;
- var d = $.map(validChoose(), function (x) { return x.MisconductID; }).join(',');
- $.post(CMS_SystemConfig.VirtualDirectoryPath + "/Misconduct/Cancel", { misconductIDs: d, actionID: action.Action, comment: action.Comment },
- function (data) {
- $.messager.alert("系统提示", data.Message);
- if (data.IsSuccess) {
- reload();
- }
- }, 'json');
- }
- function Misconduct_Delete() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要删除的违纪名单。");
- return;
- }
- var recordstatus = d[0].RecordStatus;
- if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
- $.messager.alert("系统提示", "所选的违纪名单有部分已经提交,无法删除。");
- return;
- }
- var misconductIDs = $.map(d, function (x) { return x.MisconductID; }).join(',');
- $.messager.confirm("系统提示", "您确定要删除该违纪名单信息?", function (r) {
- if (r) {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Misconduct/Delete', { misconductIDs: misconductIDs },
- function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", "删除成功。");
- $("#dgMisconductList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- function queryStandard() {
- if ($.data($("#cbgCollege")[0], "combogridX") && $.data($("#ddlYear")[0], "combobox")) {
- var parameterString = "";
- var collegeID = $("#cbgCollege").combogridX("getValue");
- var year = $("#ddlYear").combobox("getValue");
- if (collegeID != nonSelect && collegeID != "") parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (year != nonSelect) parameterString += "DictionaryGrade|*|" + year + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#cbgStandard").combogridX("reload", eval(jsonString));
- } else {
- $("#cbgStandard").combogridX("reload");
- }
- }
- }
- function queryClassmajor() {
- if ($.data($("#cbgCollege")[0], "combogridX") && $.data($("#ddlYear")[0], "combobox") && $.data($("#cbgStandard")[0], "combogridX")) {
- var parameterString = "";
- var collegeID = $("#cbgCollege").combogridX("getValue");
- var year = $("#ddlYear").combobox("getValue");
- var standard = $("#cbgStandard").combogridX("getValue");
- var educationID = $("#DictionaryEducation").combobox("getValue");
- var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
- var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
- if (collegeID != nonSelect && collegeID != "") parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (year != nonSelect) parameterString += "DictionaryGrade|*|" + year + "|@|";
- if (standard != nonSelect && standard != "") parameterString += "DictionaryStandard|*|" + standard + "|@|";
- if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
- if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
- if (LearnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + LearnSystem + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#cbgClassmajor").combogridX("reload", eval(jsonString));
- } else {
- $("#cbgClassmajor").combogridX("reload");
- }
- }
- }
|