ExamProjectControlEdit.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //联动批次
  2. function cgopSchoolYearSelect(data) {
  3. var SchoolyearID = $("#SchoolYearCode").combogridX("getValue");
  4. //$("#ExaminationBatchID").combogridX("setValue", "-1");
  5. $('#ProjectName').val("");
  6. $('#ExaminationType').val("");
  7. var jsonString = "({'QueryParamsDatas':'SchoolyearID|*|" + SchoolyearID + "|@|'})";
  8. $("#ExaminationBatchID").combogridX("reload", eval(jsonString));
  9. }
  10. function cgopBatchSelect(data) {
  11. var ExaminationBatchID = $("#ExaminationBatchID").combogridX("getValue");
  12. //$("#ExaminationTypeID").combogridX("setValue", "-1");
  13. //$("#ExaminationBatchProjectID").combogridX("setValue", "-1");
  14. var jsonString = "({'QueryParamsDatas':'ExaminationBatchID|*|" + ExaminationBatchID + "|@|'})";
  15. $("#ExaminationTypeID").combogridX("reload", eval(jsonString));
  16. }
  17. function cgopExamTypeSelect(data) {
  18. var ExaminationTypeID = $("#ExaminationTypeID").combogridX("getValue");
  19. //$("#ExaminationBatchProjectID").combogridX("setValue", "-1");
  20. var ExaminationBatchID = $("#ExaminationBatchID").combogridX("getValue");
  21. var jsonString = "({'QueryParamsDatas':'ExaminationTypeID|*|" + ExaminationTypeID + "|@|ExaminationBatchID|*|" + ExaminationBatchID + "|@|'})";
  22. $("#ExaminationProjectID").combogridX("reload", eval(jsonString));
  23. }
  24. function cgopBatchProjectSelect(data) {
  25. var ExaminationProjectID = $("#ExaminationProjectID").combogridX("getValue");
  26. var ExaminationBatchID = $("#ExaminationBatchID").combogridX("getValue");
  27. //$("#ExaminationProjectFeeID").combogridX("setValue", "-1");
  28. var jsonString = "({'QueryParamsDatas':'cgExaminationProject|*|" + ExaminationProjectID + "|@|cgExaminationBatch|*|" + ExaminationBatchID + "|@|'})";
  29. $("#ExaminationProjectFeeID").combogridX("reload", eval(jsonString));
  30. }
  31. function Save() {
  32. $(document.forms[0]).submit();
  33. }
  34. function Add() {
  35. var mnu = $.SystemGeneral.getUrlParam("MNU");
  36. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExamProjectControl/Select' + '?MNU=' + mnu + "&key=StandardID";
  37. $.popupTopWindow('选择标准专业', redirectTo, 600, 400, function (data) {
  38. if (data == null || data.length == 0)
  39. return;
  40. Add_Confirm(data);
  41. }, null);
  42. }
  43. function Add_Confirm(studentList) {
  44. if (!studentList) return;
  45. var studentViewList = $("#dgStandardList").cmsXDataTable("getRows");
  46. var addedStudentViewList = $.map(
  47. $.grep(studentList, function (x) { return $.grep(studentViewList, function (y) { return y.StandardID == x.StandardID; }).length == 0; }),
  48. function (x) {
  49. return {
  50. CollegeCode: x.CollegeCode,
  51. CollegeID: x.CollegeID,
  52. SchoolyearID: x.SchoolyearID,
  53. StandardCode: x.StandardCode,
  54. StandardName: x.StandardName,
  55. StandardID: x.StandardID,
  56. CollegeName: x.CollegeName
  57. };
  58. });
  59. var addedStudentIDs = $.map(addedStudentViewList, function (x) { return x.StandardID; }).join(',');
  60. var newStudentViewList = addedStudentViewList.concat(studentViewList);
  61. $("#dgStandardList").cmsXDataTable("loadData", { rows: newStudentViewList, total: newStudentViewList.length });
  62. }
  63. function validChooseUser() {
  64. var d = [];
  65. $.each($("#dgStandardList").cmsXDataTable("getSelections"), function (index) {
  66. d.push(this.StandardID);
  67. });
  68. return d;
  69. }
  70. function Delete() {
  71. var selectrows = $("#dgStandardList").cmsXDataTable("getSelections");
  72. if (selectrows.length == "") {
  73. $.messager.alert("系统信息", "请选择您要删除的信息。");
  74. return;
  75. }
  76. var studentViewList = $("#dgStandardList").cmsXDataTable("getRows");
  77. var i, j;
  78. var len = studentViewList.length;
  79. for (i = len - 1; i >= 0; i--) {
  80. for (j = 0; j < selectrows.length; j++) {
  81. if (studentViewList[i].StandardID == selectrows[j].StandardID && studentViewList[i].SchoolyearID == selectrows[j].SchoolyearID && studentViewList[i].CollegeID == selectrows[j].CollegeID) {
  82. studentViewList.splice(i, 1);
  83. break;
  84. }
  85. }
  86. }
  87. $("#dgStandardList").cmsXDataTable("loadData", { rows: studentViewList, total: studentViewList.length });
  88. }