123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentChange/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgStudentChangeList").cmsXDataTable("load", $.getDataGridParams("dgStudentChangeList"));
- }
- //获取选中的数据All
- function validChooseAll() {
- var d = [];
- $.each($("#dgStudentChangeList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgStudentChangeList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.StudentChangeID);
- });
- return d;
- }
- //查看明细
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?studentChangeID=" + rowdata.StudentChangeID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('异动申请信息', redirectTo, 720, 550, null, null);
- }
- //申请
- function StudentChange_Add() {
- var redirectTo = url + "?MNU=" + mnu + "&isEnable=" + CMS_SystemConfig.StudentChangeIsEnabled;;
- $.popupTopWindow('异动申请新增', redirectTo, 720, 550, null, null);
- }
- //修改
- function StudentChange_Edit() {
- var d = validChoose();
- if (d.length == 0) {
- $.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 + "?studentChangeID=" + d + "&MNU=" + mnu + "&isEnable=" + CMS_SystemConfig.StudentChangeIsEnabled;
- $.popupTopWindow('异动申请修改', redirectTo, 720, 550, null, null);
- }
- //删除
- function StudentChange_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.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 + '/StudentChange/Delete', { studentChangeIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgStudentChangeList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //提交
- function StudentChange_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 + '/StudentChange/Submit', { studentChangeIDs: d }, function (data) {
- if (data.IsSuccess == true) {
- $.messager.alert("系统提示", data.Message);
- $("#dgStudentChangeList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //申请表打印
- function StudentChange_Report() {
-
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //导出Excel
- function StudentChange_Export() {
- $("#formQuery").submit();
- }
|