123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- var url = "/StudentEncourage/Edit";
- var AuthenizationUrl = "/StudentEncourage/Authenization";
- //var UpdateUrl = "/StudentEncourage/Update";
- var bathval = "";
- var mnu;
- //联动查询
- function queryStandard(data) {
- queryClass();
- reload();
- }
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- 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));
- $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
- // if (campusID != nonSelect) {
- // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- // }
- queryClass();
- reload();
- }
- function reload() {
- $("#dgRewardList").cmsXDataTable("load", $.getDataGridParams("dgRewardList"));
- }
- //新增
- function StudentEncourage_Add() {
- var redirectTo = url + '?MNU=' + mnu;
- $.popupTopWindow('学生奖励新增', redirectTo, 650, 300, null, null);
- }
- //删除
- function StudentEncourage_Delete() {
- var selected = $("#dgRewardList").cmsXDataTable("getSelections");
- if (selected.length == 0) {
- $.messager.alert("系统提示", "请选择您要删除的奖励信息!");
- return;
- }
- var ids = [];
- for (var i = 0; i < selected.length; i++) {
- if (selected[i].RecordStatusID != 1) {
- $.messager.alert("系统提示", "只能删除待处理的奖励信息!");
- return;
- }
- ids.push(selected[i].StudentEncourageID);
- }
- $.messager.confirm("系统提示", "您确定要删除该奖励申请信息?", function (r) {
- if (r) {
- $.postWithLoading('/StudentEncourage/Delete', { ids: ids.join(',') }, function (data) {
- if (data == "删除成功") {
- $.messager.alert("系统提示", "删除成功!");
- $("#dgRewardList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- //删除
- function StudentEncourage_Cancel() {
- var selected = $("#dgRewardList").cmsXDataTable("getSelections");
- if (selected.length == 0) {
- $.messager.alert("系统提示", "请选择您要撤销的奖励信息!");
- return;
- }
- var ids = [];
- for (var i = 0; i < selected.length; i++) {
- if (selected[i].RecordStatusID != 2) {
- $.messager.alert("系统提示", "只能撤销待处理的奖励信息!");
- return;
- }
- ids.push(selected[i].StudentEncourageID);
- }
- $.messager.confirm("系统提示", "您确定要撤销选择的信息?", function (r) {
- if (r) {
- $.postWithLoading('/StudentEncourage/Cancel', { StudentEncourageIDs: ids.join(',') }, function (data) {
- if (data == "撤销成功。") {
- $.messager.alert("系统提示", "撤销成功。");
- $("#dgRewardList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- //审核
- function StudentEncourage_Authenization() {
- var selected = $("#dgRewardList").cmsXDataTable("getSelections");
- if (selected.length == 0) {
- $.messager.alert("系统提示", "请选择您要审核的奖励信息!");
- return;
- }
- var ids = [];
- for (var i = 0; i < selected.length; i++) {
- if (selected[i].RecordStatusID != 1) {
- $.messager.alert("系统提示", "只能审核待处理的奖励信息!");
- return;
- }
- ids.push(selected[i].StudentEncourageID);
- }
- $.messager.confirm("系统提示", "您确定要审核该奖励申请信息?", function (r) {
- if (r) {
- $.postWithLoading('/StudentEncourage/Authenization', { ids: ids.join(',') }, function (data) {
- if (data == "审核成功") {
- $.messager.alert("系统提示", "审核成功!");
- $("#dgRewardList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- ////审核
- //function StudentEncourage_Authenization() {
- // var selected = $("#dgRewardList").cmsXDataTable("getSelections");
- // if (selected.length == 0) {
- // $.messager.alert("系统提示", "请选择您要审核的奖励信息!");
- // return;
- // }
- // if (selected.length>1) {
- // $.messager.alert("系统提示", "一次只能审核一条奖励信息!");
- // return;
- // }
- // if (selected[0].RecordStatusID != 1) {
- // $.messager.alert("系统提示", "只能审核待处理的奖励信息!");
- // return;
- // }
- // var redirectTo = AuthenizationUrl;
- // var a = selected[0].StudentEncourageID;
- // if (a) {
- // redirectTo = AuthenizationUrl + '?id=' + a;
- // }
- // redirectTo = redirectTo + '&MNU=' + mnu;
- // $.popupTopWindow('学生奖励审核', redirectTo, 800, 300, null, null);
- //}
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgRewardList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.StudentEncourageID);
- });
- return d;
- }
- //获取批量修改金额
- function validChooseAmount() {
- var d = [];
- $.each($("#dgRewardList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.Amount);
- });
- return d;
- }
- //批量修改前判断
- SystemBatchModifyControl.OnSubmit = function (a) {
- if (document.getElementById("AmountTextBox_div").style.display != "none") {
- var Amount = $("#Amount_TextBox").val();
- var d = validChooseAmount();
- for (var i = 0; i < d.length; i++) {
- var time = new String(d[i]);
- if (Amount < 0) {
- $.messager.alert("系统提示", "输入金额不能为负数");
- return false;
- }
- }
- }
- }
- //查看
- function Authenization(rowindex, rowdata) {
-
- var redirectTo = AuthenizationUrl;
- redirectTo = AuthenizationUrl + '?id=' + rowdata.StudentEncourageID;
- redirectTo = redirectTo + '&MNU=' + mnu+ '&isView=1';
- $.popupTopWindow('学生奖励信息', redirectTo, 650, 300, null, null);
- }
- //修改
- function StudentEncourage_Update() {
- var selected = $("#dgRewardList").cmsXDataTable("getSelections");
- if (selected.length == 0) {
- $.messager.alert("系统提示", "请选择您要修改的奖励信息!");
- return;
- }
- if (selected.length > 1) {
- $.messager.alert("系统提示", "一次只能修改一条奖励信息!");
- return;
- }
- if (selected[0].RecordStatusID != 1) {
- $.messager.alert("系统提示", "只能修改待处理的奖励信息!");
- return;
- }
- var redirectTo = url;
- var a = selected[0].StudentEncourageID;
- if (a) {
- redirectTo = url + '?id=' + a;
- }
- redirectTo = redirectTo + '&MNU=' + mnu;
- $.popupTopWindow('学生奖励修改', redirectTo, 650, 300, null, null);
- }
- //导出
- function StudentEncourage_Export() {
- $("#formQuery").submit();
- }
|