Apply.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/DifferentDynamicApply/Edit?a=1";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. //新增
  8. function DifferentDynamicApply_Add() {
  9. showDialog(null, "add");
  10. }
  11. //联动查询
  12. function queryStandard(data) {
  13. queryClass();
  14. reload();
  15. }
  16. function queryCollege(data) {
  17. var campusID = $("#CampusDropdown").combogridX("getValue");
  18. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  19. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  20. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  21. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  22. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  23. // if (campusID != nonSelect) {
  24. // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  25. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  26. // }
  27. queryClass();
  28. reload();
  29. }
  30. function queryClass() {
  31. var jsonString = "";
  32. var parameterString = "";
  33. var campusID = $("#CampusDropdown").combogridX("getValue");
  34. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  35. //var educationID = $("#Education").combobox("getValue");
  36. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  37. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  38. var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
  39. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  40. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  41. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  42. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  43. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  44. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  45. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  46. if (LearnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + LearnSystem + "|@|";
  47. if (parameterString != "") {
  48. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  49. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  50. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  51. } else {
  52. $("#ClassmajorDropdown").combogridX("reload");
  53. $("#StandardDictionaryDropDown").combogridX("reload");
  54. }
  55. reload();
  56. }
  57. function reload() {
  58. $("#dgList").cmsXDataTable("load", $.getDataGridParams("dgList"));
  59. }
  60. //获取选中的数据
  61. function validChoose() {
  62. var d = [];
  63. $.each($("#dgList").cmsXDataTable("getSelections"), function (index) {
  64. d.push(this.EntityID);
  65. });
  66. return d;
  67. }
  68. //点击列表更新
  69. function edit(rowindex, rowdata) {
  70. showDialog(rowdata.EntityID, "look");
  71. }
  72. //修改按钮
  73. function DifferentDynamicApply_Update() {
  74. var d = validChoose();
  75. if (d.length == 0) {
  76. $.messager.alert("系统提示", "请选择您要修改的异动申请信息!");
  77. return;
  78. }
  79. if (d.length > 1) {
  80. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  81. return;
  82. }
  83. showDialog(d, "update");
  84. }
  85. function showDialog(id, type) {
  86. var redirectTo = url;
  87. if (id) {
  88. redirectTo = redirectTo + '&id=' + id;
  89. }
  90. if (type == "look") {
  91. redirectTo = redirectTo + '&MNU=' + mnu + '&isView=1';
  92. }
  93. else {
  94. redirectTo = redirectTo + '&MNU=' + mnu
  95. }
  96. $.popupTopWindow('异动申请信息', redirectTo + '&type=' + type, 800, 520, null, null);
  97. }
  98. //删除
  99. function DifferentDynamicApply_Delete() {
  100. var selected = $("#dgList").cmsXDataTable("getSelections");
  101. if (selected.length == 0) {
  102. $.messager.alert("系统提示", "请选择您要删除的异动申请信息!");
  103. return;
  104. }
  105. var ids = [];
  106. for (var i = 0; i < selected.length; i++) {
  107. // if (selected[i].EntityApprovalStatus != 0 && selected[i].EntityApprovalStatus != 100) {
  108. // $.messager.alert("系统提示", "只能删除未提交、已退回状态的异动申请信息!");
  109. // return;
  110. // }
  111. ids.push(selected[i].EntityID);
  112. }
  113. $.messager.confirm("系统提示", "您确定要删除该异动申请信息?", function (r) {
  114. if (r) {
  115. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/DifferentDynamicApply/Delete', { ids: ids.join(',') }, function (data) {
  116. if (data == "删除成功") {
  117. $.messager.alert("系统提示", "删除成功!");
  118. $("#dgList").cmsXDataTable('load');
  119. } else {
  120. $.messager.alert("系统提示", data);
  121. }
  122. });
  123. }
  124. });
  125. }
  126. //提交
  127. function DifferentDynamicApply_Submit() {
  128. var selected = $("#dgList").cmsXDataTable("getSelections");
  129. if (selected.length == 0) {
  130. $.messager.alert("系统提示", "请选择您要提交的异动申请信息!");
  131. return;
  132. }
  133. var ids = [];
  134. for (var i = 0; i < selected.length; i++) {
  135. //if (selected[i].EntityApprovalStatus != 0) {
  136. // $.messager.alert("系统提示", "只能提交未提交状态的异动申请信息!");
  137. // return;
  138. //}
  139. ids.push(selected[i].EntityID);
  140. }
  141. $.messager.confirm("系统提示", "您确定要提交该异动申请信息?", function (r) {
  142. if (r) {
  143. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/DifferentDynamicApply/Submit', { ids: ids.join(',') }, function (data) {
  144. if (data == "提交成功") {
  145. $.messager.alert("系统提示", "提交成功!");
  146. $("#dgList").cmsXDataTable('load');
  147. } else {
  148. $.messager.alert("系统提示", data);
  149. }
  150. });
  151. }
  152. });
  153. }
  154. function DifferentDynamicApply_Export() {
  155. $("#formQuery").submit();
  156. }
  157. function QueryCampusDropdownList(data) {
  158. $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
  159. reload();
  160. }
  161. function QueryCollegeDropdownList(data) {
  162. reload();
  163. }
  164. function DifferentDynamicApply_Report() {
  165. var d = [];
  166. $.each($("#dgList").cmsXDataTable("getSelections"), function (index) {
  167. d.push(this.EntityID);
  168. });
  169. var selected = $("#dgList").cmsXDataTable("getSelections");
  170. for (var i = 0; i < selected.length; i++) {
  171. if (selected[i].EntityApprovalStatus == 1) {
  172. $.messager.alert("系统提示", "所选数据中含有未提交的数据,该部分数据将不能进行申请表的生成,请先进行提交!");
  173. return;
  174. }
  175. }
  176. //var Attribute = document.getElementsByName("Attribute")[0].value.split("\"Value\":\"")[1].split("\"")[0]; //获取自定义查询的当前字段
  177. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/DifferentDynamicApply/DifferentDynamicApplyReport?MNU=' + mnu;
  178. var DifferentDynamicID = d.join(',');
  179. var SchoolyearID = $("#SchoolYearDropdown").combobox("getValue");
  180. var CollegeID = $("#CollegeDropdown").combogridX("getValue");
  181. var yearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  182. var StandardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  183. var LearningformID = $("#DictionaryLearningform").combobox("getValue");
  184. var EducationID = $("#DictionaryEducation").combobox("getValue");
  185. var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
  186. var ClassmajorID = $("#ClassmajorDropdown").combogridX("getValue");
  187. var DifferentDynamicType = $("#DictionaryDifferentDynamicType").combobox("getValue");
  188. var ApprovalStatus = $("#DictionaryDifferentDynamicStatus").combobox("getValue");
  189. $.popupTopWindow('异动申请表', redirectTo, 750, 650, null,
  190. {
  191. SchoolyearID: SchoolyearID,
  192. CollegeID : CollegeID,
  193. yearID : yearID,
  194. StandardID : StandardID,
  195. LearningformID : LearningformID,
  196. EducationID : EducationID,
  197. LearnSystem:LearnSystem,
  198. ClassmajorID:ClassmajorID,
  199. DifferentDynamicType : DifferentDynamicType,
  200. ApprovalStatus : ApprovalStatus,
  201. DifferentDynamicID :DifferentDynamicID,
  202. UserID: UserID
  203. });
  204. }