1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationExemption/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- function reload() {
- $("#dgExaminationExemptionList").cmsXDataTable("load", $.getDataGridParams("dgExaminationExemptionList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgExaminationExemptionList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //新增
- function ExaminationExemption_Add() {
- var redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow('免考申请', redirectTo, 600, 200, null, null);
- }
- //修改
- function ExaminationExemption_Edit() {
- 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 + "?examinationExemptionID=" + d[0].ExaminationExemptionID + "&MNU=" + mnu;
- $.popupTopWindow('免考申请', redirectTo, 600, 200, null, null);
- }
- //删除
- function ExaminationExemption_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 examinationExemptionIDs = $.map(d, function (x) { return x.ExaminationExemptionID; }).join(',');
- $.messager.confirm("系统提示", "您确定要删除该免考申请信息?", function (r) {
- if (r) {
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationExemption/Delete', { examinationExemptionIDs: examinationExemptionIDs },
- function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", "删除成功。");
- $("#dgExaminationExemptionList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //提交
- function ExaminationExemption_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 examinationExemptionIDs = $.map(d, function (x) { return x.ExaminationExemptionID; }).join(',');
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationExemption/Submit', { examinationExemptionIDs: examinationExemptionIDs }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", "提交成功!");
- $("#dgExaminationExemptionList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
|