PlanApplication.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplication/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgPlanApplicationList").cmsXDataTable("load", $.getDataGridParams("dgPlanApplicationList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgPlanApplicationList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.PlanApplicationID);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据All
  20. function validChooseAll() {
  21. var d = [];
  22. $.each($("#dgPlanApplicationList").cmsXDataTable("getSelections"), function (index) {
  23. d.push(this);
  24. });
  25. return d;
  26. }
  27. //新增
  28. function PlanApplication_Add() {
  29. var d = validChoose();
  30. if (d.length > 0) {
  31. $.popupTopWindow('计划申请复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplication/CopyAdd?planApplicationID=' + d[0] + '&MNU=' + mnu, 685, 540, null, null);
  32. } else {
  33. //var redirectTo = url + "?MNU=" + mnu;
  34. //$.popupTopWindow('计划申请新增', redirectTo, 685, 540, null, null);
  35. //采用以下方式申请
  36. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplication/PlanApplicationBatchAdd" + "?MNU=" + mnu;
  37. $.popupTopWindow('计划申请新增', redirectTo, 1200, 540, reload, null);
  38. }
  39. }
  40. //修改
  41. function PlanApplication_Edit() {
  42. var d = validChoose();
  43. if (d.length == 0) {
  44. $.messager.alert("系统信息", "请选择您要修改的信息。");
  45. return;
  46. }
  47. if (d.length > 1) {
  48. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  49. return;
  50. }
  51. var redirectTo = url + "?planApplicationID=" + d + "&MNU=" + mnu + "&type=edit";
  52. $.popupTopWindow('计划申请修改', redirectTo, 685, 540, null, null);
  53. }
  54. //查看明细
  55. function edit(rowindex, rowdata) {
  56. var redirectTo = url + "?planApplicationID=" + rowdata.PlanApplicationID + "&MNU=" + mnu + "&type=detail";
  57. $.popupTopWindow('计划申请信息', redirectTo, 685, 540, null, null);
  58. }
  59. //删除
  60. function PlanApplication_Delete() {
  61. var id = validChoose().join(',');
  62. if (id == "") {
  63. $.messager.alert("系统提示", "请选择您要删除的信息。");
  64. return;
  65. }
  66. //var d = validChooseAll();
  67. //if ($.grep(d, function (v, i) { return v.RecordStatus != startStatusID; }).length > 0) {
  68. // $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行删除。");
  69. // return;
  70. //}
  71. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  72. if (r) {
  73. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplication/Delete', { planApplicationIDs: id }, function (data) {
  74. if (data.IsSuccess) {
  75. $.messager.alert("系统提示", data.Message);
  76. $("#dgPlanApplicationList").cmsXDataTable('load');
  77. } else {
  78. $.messager.alert("系统提示", data.Message);
  79. }
  80. });
  81. }
  82. });
  83. }
  84. //申请表打印
  85. function PlanApplication_Print() {
  86. //暂不考虑
  87. $.messager.alert("系统提示", "");
  88. }
  89. //提交
  90. function PlanApplication_Submit() {
  91. var id = validChoose().join(',');
  92. if (id.length == 0) {
  93. $.messager.alert("系统提示", "请选择您要提交的信息。");
  94. return;
  95. }
  96. //var d = validChooseAll();
  97. //if ($.grep(d, function (v, i) { return v.RecordStatus == endStatusID; }).length > 0) {
  98. // $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行提交。");
  99. // return;
  100. //}
  101. $.messager.confirm("系统提示", "您确定要对选择的信息进行提交?", function (r) {
  102. if (r) {
  103. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplication/PlanApplicationSubmit', { planApplicationIDs: id }, function (data) {
  104. if (data.IsSuccess == true) {
  105. $.messager.alert("系统提示", data.Message);
  106. $("#dgPlanApplicationList").cmsXDataTable('load');
  107. } else {
  108. $.messager.alert("系统提示", data.Message);
  109. }
  110. });
  111. }
  112. });
  113. }
  114. //设置列颜色为红色
  115. function SetRedColumn(index, row, value) {
  116. return " <span style=\"color: red;\">" + value + "</span>";
  117. }
  118. //Excel导出
  119. function PlanApplication_Export() {
  120. $("#formQuery").submit();
  121. }
  122. //联动查询
  123. function queryCampus(data) {
  124. var campusID = $("#CampusDropdown").combogridX("getValue");
  125. if (campusID != nonSelect) {
  126. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  127. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  128. }
  129. else {
  130. $("#CollegeDropdown").combogridX("reload");
  131. }
  132. queryClass();
  133. }
  134. function queryCollege(data) {
  135. var campusID = $("#CampusDropdown").combogridX("getValue");
  136. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  137. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  138. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  139. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  140. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  141. queryClass();
  142. }
  143. function querySchoolyear(data) {
  144. queryClass();
  145. }
  146. function queryStandard(data) {
  147. queryClass();
  148. }
  149. function queryGrademajor(data) {
  150. queryClass();
  151. }
  152. function queryClass() {
  153. var jsonString = "";
  154. var parameterString = "";
  155. var campusID = $("#CampusDropdown").combogridX("getValue");
  156. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  157. var schoolYearID = $("#DictionarySchoolyear").combogridX("getValue"); //combobox
  158. var standardID = $("#DictionaryStandard").combogridX("getValue");
  159. var educationID = $("#DictionaryEducation").combogridX("getValue");
  160. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  161. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  162. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  163. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  164. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  165. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  166. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  167. if (parameterString != "") {
  168. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  169. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  170. $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  171. }
  172. else {
  173. $("#DictionaryStandard").combogridX("reload");
  174. $("#GrademajorComboGrid").combogridX("reload");
  175. }
  176. reload();
  177. }