OpenObjectBatchAdd.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //刷新
  2. function reload() {
  3. $("#dgSchoolyearNumDicNoAddList").cmsXDataTable("load", $.getDataGridParams("dgSchoolyearNumDicNoAddList"));
  4. }
  5. //获取选中的数据
  6. function validChoose() {
  7. var d = [];
  8. $.each($("#dgSchoolyearNumDicNoAddList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this.Value);
  10. });
  11. return d;
  12. }
  13. //获取选中的数据All
  14. function validChooseAll() {
  15. var d = [];
  16. $.each($("#dgSchoolyearNumDicNoAddList").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 StudentEditObjectBatchAdd_Confirm() {
  34. var educationID = $("#EducationID").combogridX("getValue");
  35. if (educationID == "" || educationID == "-1" || educationID == null) {
  36. $.messager.alert("系统提示", "请选择" + educationName + "。");
  37. return;
  38. }
  39. var startDate = $("#Starttime").val();
  40. var endDate = $("#Endtime").val();
  41. if (startDate == "" || startDate == null) {
  42. $.messager.alert("系统提示", "开始时间不能为空。");
  43. return;
  44. }
  45. if (endDate == "" || endDate == null) {
  46. $.messager.alert("系统提示", "结束时间不能为空。");
  47. return;
  48. }
  49. var sd = new Date(startDate.replace(/\-/g, "\/"));
  50. var ed = new Date(endDate.replace(/\-/g, "\/"));
  51. if (startDate != "" && endDate != "" && sd >= ed) {
  52. $.messager.alert("系统提示", "结束时间不能小于开始时间。");
  53. return;
  54. }
  55. var d = validChoose();
  56. if (d.length == 0) {
  57. $.messager.alert("系统提示", "请选择您要新增的开放学年信息。");
  58. return;
  59. }
  60. $("#schoolyearNumIDList").val(JSON.stringify(d));
  61. $(document.forms[0]).submit();
  62. }