CollegePriorityBatchAdd.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //刷新
  2. function reload() {
  3. $("#dgCollegeNoAddList").cmsXDataTable("load", $.getDataGridParams("dgCollegeNoAddList"));
  4. }
  5. //获取选中的数据
  6. function validChoose() {
  7. var d = [];
  8. $.each($("#dgCollegeNoAddList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this.CollegeID);
  10. });
  11. return d;
  12. }
  13. //获取选中的数据All
  14. function validChooseAll() {
  15. var d = [];
  16. $.each($("#dgCollegeNoAddList").cmsXDataTable("getSelections"), function (index) {
  17. d.push(this);
  18. });
  19. return d;
  20. }
  21. //确定生成成功后不关闭弹出页面
  22. function formSuccessReloadNoClose(data) {
  23. if (data.IsSuccess == true) {
  24. reload();
  25. }
  26. $.messager.alert("系统提示", data.Message);
  27. }
  28. //设置列颜色为红色
  29. function SetRedColumn(index, row, value) {
  30. return " <span style=\"color: red;\">" + value + "</span>";
  31. }
  32. //联动查询
  33. function queryCampus(data) {
  34. var campusID = $("#CampusDropdown").combogridX("getValue");
  35. if (campusID != nonSelect) {
  36. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  37. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  38. }
  39. else {
  40. $("#CollegeDropdown").combogridX("reload");
  41. }
  42. reload();
  43. }
  44. //确定
  45. function CollegePriorityBatchAdd_Confirm() {
  46. var priority = $("#Priority").val();
  47. if (priority == "" || priority == null) {
  48. $.messager.alert("系统提示", "优先级不能为空。");
  49. return;
  50. }
  51. var startDate = $("#StartDate").val();
  52. var endDate = $("#EndDate").val();
  53. if (startDate == "" || startDate == null) {
  54. $.messager.alert("系统提示", "开始日期不能为空。");
  55. return;
  56. }
  57. if (endDate == "" || endDate == null) {
  58. $.messager.alert("系统提示", "结束日期不能为空。");
  59. return;
  60. }
  61. var sd = new Date(startDate.replace(/\-/g, "\/"));
  62. var ed = new Date(endDate.replace(/\-/g, "\/"));
  63. if (startDate != "" && endDate != "" && sd >= ed) {
  64. $.messager.alert("系统提示", "结束日期不能小于开始日期。");
  65. return;
  66. }
  67. var d = validChoose();
  68. if (d.length == 0) {
  69. $.messager.alert("系统提示", "请选择您要新增的" + college + "信息。");
  70. return;
  71. }
  72. $("#collegeIDList").val(JSON.stringify(d));
  73. $(document.forms[0]).submit();
  74. }