StudentList.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. var jsonString = "";
  6. var parameterString = "";
  7. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  8. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  9. if (parameterString != "") {
  10. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  11. $("#cgExaminationBatch").combogridX("reload", eval(jsonString));
  12. }
  13. })
  14. function queryClass() {
  15. var jsonString = "";
  16. var parameterString = "";
  17. var campusID = $("#CampusDropdown").combogridX("getValue");
  18. var collegeID = $("#cgCollege").combogridX("getValue");
  19. //var educationID = $("#Education").combobox("getValue");
  20. var schoolYearID = $("#ddlYear").combobox("getValue");
  21. //var standardID = $("#ddlStandard").combogridX("getValue");
  22. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  23. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  24. if (collegeID != nonSelect && collegeID != "") parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  25. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  26. if (schoolYearID != nonSelect && schoolYearID != "") parameterString += "DictionarySchoolyear|*|" + schoolYearID + "|@|";
  27. //if (standardID != nonSelect && standardID != "") parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  28. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  29. //if (parameterString != "") {
  30. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  31. //$("#ddlStandard").combogridX("reload", eval(jsonString));
  32. $("#cgCollege").combogridX("reload", eval(jsonString));
  33. $("#cgClassmajor").combogridX("reload", eval(jsonString));
  34. //} else {
  35. // //$("#ddlStandard").combogridX("reload");
  36. // $("#cgClassmajor").combogridX("reload");
  37. //}
  38. reload();
  39. }
  40. function schoolyearSelect() {
  41. try {
  42. schoolyearChange();
  43. reload();
  44. } catch (e) {
  45. }
  46. }
  47. function schoolyearChange() {
  48. try {
  49. var examinationBatchUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationBatch/DropDownList?bindType=0';
  50. var schoolyearID = $("#ddlSchoolyear").combobox('getValue');
  51. if (schoolyearID != nonSelect) {
  52. examinationBatchUrl += "&schoolyearID=" + schoolyearID;
  53. }
  54. $("#ddlExaminationBatch").combobox('reload', examinationBatchUrl);
  55. } catch (e) {
  56. }
  57. }
  58. function examinationBatchSelect() {
  59. try {
  60. examinationBatchChange();
  61. reload();
  62. } catch (e) {
  63. }
  64. }
  65. function examinationBatchChange() {
  66. try {
  67. var examinationTypeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/TypeDropDownList?bindType=0';
  68. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  69. if (examinationBatchID != nonSelect) {
  70. examinationTypeUrl += "&examinationBatchID=" + examinationBatchID;
  71. }
  72. $("#ddlExaminationType").combobox('reload', examinationTypeUrl);
  73. } catch (e) {
  74. }
  75. }
  76. function examinationTypeSelect() {
  77. try {
  78. examinationTypeChange();
  79. reload();
  80. } catch (e) {
  81. }
  82. }
  83. function examinationTypeChange() {
  84. try {
  85. var examinationProjectUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/DropDownList?bindType=0';
  86. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  87. var examinationTypeID = $("#ddlExaminationType").combobox('getValue');
  88. if (examinationBatchID != nonSelect) {
  89. examinationProjectUrl += "&examinationBatchID=" + examinationBatchID;
  90. }
  91. if (examinationTypeID != nonSelect) {
  92. examinationProjectUrl += "&examinationTypeID=" + examinationTypeID;
  93. }
  94. $("#ddlExaminationProject").combobox('reload', examinationProjectUrl);
  95. } catch (e) {
  96. }
  97. }
  98. function querySchoolYear() {
  99. var jsonString = "";
  100. var parameterString = "";
  101. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  102. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  103. if (parameterString != "") {
  104. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  105. $("#cgExaminationBatch").combogridX("reload", eval(jsonString));
  106. }
  107. reload();
  108. }
  109. function queryBatch() {
  110. var jsonString = "";
  111. var parameterString = "";
  112. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  113. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  114. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  115. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  116. var schoolyearID = $("#ddlSchoolyear").combobox("getValue");
  117. if (schoolyearID != nonSelect && schoolyearID != "") parameterString += "SchoolYearDropdown|*|" + schoolyearID + "|@|";
  118. if (parameterString != "") {
  119. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  120. $("#cgExaminationType").combogridX("reload", eval(jsonString));
  121. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  122. }
  123. reload();
  124. }
  125. function queryType() {
  126. var jsonString = "";
  127. var parameterString = "";
  128. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  129. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  130. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  131. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  132. if (parameterString != "") {
  133. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  134. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  135. }
  136. reload();
  137. }
  138. //function reloadClassmajor() {
  139. // if ($("#cgClassmajor").length > 0 && $.data($("#cgClassmajor")[0], "combogridX")) {
  140. // var collegeID = null;
  141. // var yearID = null;
  142. // //var standardID = null;
  143. // if ($("#cgCollege").length > 0 && $.data($("#cgCollege")[0], "combogridX")) {
  144. // collegeID = $("#cgCollege").combogridX("getValue");
  145. // }
  146. // if ($("#ddlYear").length > 0 && $.data($("#ddlYear")[0], "combobox")) {
  147. // yearID = $("#ddlYear").combobox("getValue");
  148. // }
  149. // //if ($("#ddlStandard").length > 0 && $.data($("#ddlStandard")[0], "combogridX")) {
  150. // // standardID = $("#ddlStandard").combogridX("getValue");
  151. // //}
  152. // if (collegeID == nonSelect) {
  153. // collegeID = null;
  154. // }
  155. // if (yearID == nonSelect) {
  156. // yearID = null;
  157. // }
  158. // //if (standardID == nonSelect) {
  159. // // standardID = null;
  160. // //}
  161. // var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID
  162. // + "|@|DictionarySchoolyear|*|" + yearID + "|@|'})";
  163. // $("#cgClassmajor").combogridX("reload", eval(jsonString));
  164. // }
  165. // //queryClass();
  166. //}
  167. function queryCollege() {
  168. var campusID = $("#CampusDropdown").combogridX("getValue");
  169. //var collegeID = $("#cgCollege").combogridX("getValue");
  170. var jsonString = "({'QueryParamsDatas':";
  171. jsonString += "'CollegeDropdown|*|" + campusID + "|@|'})";
  172. //$("#cgCollege").combogridX("reload", eval(jsonString));
  173. //$("#ddlStandard").combogridX("reload", eval(jsonString));
  174. if (campusID != nonSelect) {
  175. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  176. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  177. }
  178. queryClass();
  179. //reload();
  180. }
  181. function queryGrademajor() {
  182. queryClass();
  183. }
  184. function reload() {
  185. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  186. }
  187. function StudentList_Add() {
  188. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationApplayStudentList/Edit" + "?MNU=" + mnu;
  189. $.popupTopWindow('报名名单新增', redirectTo, 860, 530, reload, null);
  190. }
  191. function StudentList_Edit() {
  192. var d = validChoose().join(',');
  193. //var status = validChoosedata().join(',');
  194. if (d == "") {
  195. $.messager.alert("系统提示", "请选择你要修改的信息!");
  196. return;
  197. }
  198. if (validChoose().length > 1) {
  199. $.messager.alert("系统提示", "只能选择单条记录进行修改!");
  200. return;
  201. }
  202. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationApplayStudentList/FeeTypeEdit" + "?MNU=" + mnu + "&examinationRegistrationID=" + d;
  203. $.popupTopWindow('修改', redirectTo, 860, 530, reload, null);
  204. }
  205. function StudentList_Export() {
  206. var d = validChoose().join(',');
  207. $("[name='SelectedID']").val(d);
  208. $("#formQuery").attr("action", "Excel");
  209. $(document.forms[0]).submit();
  210. }
  211. function StudentList_Delete() {
  212. var d = validChoose().join(',');
  213. //var status = validChoosedata().join(',');
  214. if (d == "") {
  215. $.messager.alert("系统提示", "请选择你要删除的信息!");
  216. return;
  217. }
  218. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  219. if (r) {
  220. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/Delete', { examinationRegistrationIDs: d }, function (data) {
  221. if (data == "删除成功") {
  222. $.messager.alert("系统提示", data);
  223. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  224. } else {
  225. $.messager.alert("系统提示", data);
  226. }
  227. });
  228. }
  229. });
  230. }
  231. function StudentList_Change() {
  232. var d = validChoose().join(',');
  233. var data = validChooseAll();
  234. if (d == "") {
  235. $.messager.alert("系统提示", "请选择你要调整费用的信息!");
  236. return;
  237. }
  238. if ($.grep(data, function (v, i) { return v.ExaminationRegistrationConfirmNo != null && v.ExaminationRegistrationConfirmNo != ""; }).length > 0) {
  239. $.messager.alert("系统提示", "选择的数据有已打包数据,不能调整费用。");
  240. return;
  241. }
  242. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/ChangeFee?MNU=' + mnu + '&examinationRegistrationIDs=' + d;
  243. $.popupTopWindow('费用调整', redirectTo, 400, 300, null, null);
  244. }
  245. function StudentList_PicExport() {
  246. var d = validChoose().join(',');
  247. $("[name='SelectedID']").val(d);
  248. $("#formQuery").attr("action", "ExportPictures?MNU=" + mnu);
  249. $("#formQuery").submit();
  250. }
  251. function StudentList_Confirm() {
  252. var d = validChoose().join(',');
  253. //var status = validChoosedata().join(',');
  254. if (d == "") {
  255. $.messager.alert("系统提示", "请选择你要打包确认的信息!");
  256. return;
  257. }
  258. var selectCount = validChoose().length;
  259. $.messager.confirm("系统提示", "您确定要打包确认选中的" + selectCount + "条记录?", function (r) {
  260. if (r) {
  261. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/Confirm', { examinationRegistrationIDs: d }, function (data) {
  262. if (data.IsSuccess) {
  263. $.messager.alert("系统提示", "打包成功");
  264. StudentList_Print(data.Message);
  265. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  266. //$("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  267. } else {
  268. $.messager.alert("系统提示", data.Message);
  269. }
  270. });
  271. }
  272. });
  273. }
  274. function StudentList_CancelConfirm() {
  275. var d = validChoose().join(',');
  276. //var status = validChoosedata().join(',');
  277. if (d == "") {
  278. $.messager.alert("系统提示", "请选择你要取消确认的信息!");
  279. return;
  280. }
  281. $.messager.confirm("系统提示", "取消打包确认时将取消确认单上的所有学生,取消后可重新进行打包,是否确认要取消?", function (r) {
  282. if (r) {
  283. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/CancelConfirm', { examinationRegistrationIDs: d }, function (data) {
  284. if (data.IsSuccess) {
  285. $.messager.alert("系统提示", data.Message);
  286. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  287. } else {
  288. $.messager.alert("系统提示", data.Message);
  289. }
  290. });
  291. }
  292. });
  293. }
  294. function GetDynamicCondition() {
  295. var reg = "/(^/s*)|(/s*$)/g";
  296. var attribute = eval('(' + $("[name='Attribute']").val() + ')').Value;
  297. var conditionString = $("[name='Condition']").val();
  298. var value = $("[name='Condition']").parent().parent().next().find("[name^=" + attribute + "]").val();
  299. value = $.trim(value);
  300. var sql = "";
  301. if (conditionString == "=" || conditionString == ">" || conditionString == "<" || conditionString == "<>") {
  302. sql = attribute + conditionString + value;
  303. } else if (conditionString == "左") {
  304. sql = attribute + " like '" + value + "%'";
  305. } else if (conditionString == "右") {
  306. sql = attribute + " like '%" + value + "'";
  307. } else if (conditionString == "中") {
  308. sql = attribute + " like '%" + value + "%'";
  309. }
  310. return sql;
  311. }
  312. function StudentList_Print(id) {
  313. var d = [];
  314. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  315. d.push(this.LoginID);
  316. });
  317. var s = [];
  318. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  319. s.push(this.ExaminationRegistrationConfirmID);
  320. });
  321. var sql = GetDynamicCondition();
  322. var attribute = document.getElementsByName("Attribute")[0].value.split("\"Value\":\"")[1].split("\"")[0]; //获取自定义查询的当前字段
  323. var schoolYearID = $("#ddlSchoolyear").combobox("getValue");
  324. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  325. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  326. var examinationProjectID = $("#cgExaminationProject").combogridX("getValue");
  327. var collegeID = $("#cgCollege").combogridX("getValue");
  328. var year = $("#ddlYear").combobox("getValue");
  329. var classmajorID = $("#cgClassmajor").combogridX("getValue");
  330. var isPay = $("#PayRecordStatus").combobox("getValue");
  331. var isConfirm = $("#IsConfirm").combobox("getValue");
  332. var loginID = d;
  333. var conditionString = sql;
  334. var condition = document.getElementsByName("Condition")[0].value;
  335. var value = (document.getElementsByName(attribute + "_QueryTextBox")[0] != null ? document.getElementsByName(attribute + "_QueryTextBox")[0].value : document.getElementsByName(attribute + "_QueryDictionaryDropDownList")[0].value)
  336. var ids = id;
  337. if (id == "" || id == null || typeof (id) == "undefined")
  338. {
  339. if (s[0] != null)
  340. {
  341. ids = s.join(',');
  342. } else {
  343. ids = null;
  344. }
  345. }
  346. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/RegistrationConfirmReport?MNU=' + mnu;
  347. $.popupTopWindow('报名确认单', redirectTo, 1100, 700, null, {
  348. Attribute: attribute,
  349. SchoolYearID: schoolYearID,
  350. ExaminationBatchID: examinationBatchID,
  351. ExaminationTypeID: examinationTypeID,
  352. ExaminationProjectID: examinationProjectID,
  353. CollegeID: collegeID,
  354. Year: year,
  355. ClassmajorID: classmajorID,
  356. IsPay: isPay,
  357. ConditionString: conditionString,
  358. Condition: condition,
  359. Value: value,
  360. Ids: ids
  361. });
  362. }
  363. //function StudentList_Import() {
  364. // var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/Import?MNU=' + mnu;
  365. // $.popupTopWindow('学生名单导入', redirectTo, 300, 300, null, null);
  366. //}
  367. function validChoose() {
  368. var d = [];
  369. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  370. d.push(this.ExaminationRegistrationID);
  371. });
  372. return d;
  373. }
  374. function validChooseUserIDs() {
  375. var d = [];
  376. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  377. d.push(this.UserID);
  378. });
  379. return d;
  380. }
  381. function validChooseAll() {
  382. var d = [];
  383. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  384. d.push(this);
  385. });
  386. return d;
  387. }
  388. function SelectExaminationSubjectDropdown(data) {
  389. var jsonString = "({'QueryParamsDatas':'ExaminationTypeDropdown|*|" + data.ExaminationTypeID + "|@|'})";
  390. $("#ddlExaminationSubject").combogridX("reload", eval(jsonString));
  391. reload();
  392. }
  393. function ExamineApply_Cancel() {
  394. var d = validChoose();
  395. if (d.length == 0) {
  396. $.messager.alert("系统提示", "请选择您要撤销报名的考试科目。");
  397. return;
  398. }
  399. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationApplayStudentList/ApplyCancel?ExaminationRegistrationIDs=' + $.map(d, function (x) { return x.ExaminationRegistrationID; }).join(','), function (data) {
  400. if (data == "撤销成功") {
  401. $.messager.alert("系统提示", "撤销成功!");
  402. $("#dgStudentList").cmsXDataTable('load');
  403. } else {
  404. $.messager.alert("系统提示", data);
  405. }
  406. });
  407. }
  408. function queryProject() {
  409. var jsonString = "";
  410. var parameterString = "";
  411. var examinationBatchID = $("#cgExaminationBatch").combogridX("getValue");
  412. var examinationTypeID = $("#cgExaminationType").combogridX("getValue");
  413. if (examinationBatchID != nonSelect && examinationBatchID != "") parameterString += "cgExaminationBatch|*|" + examinationBatchID + "|@|";
  414. if (examinationTypeID != nonSelect && examinationTypeID != "") parameterString += "cgExaminationType|*|" + examinationTypeID + "|@|";
  415. //if (parameterString != "") {
  416. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  417. $("#cgExaminationProject").combogridX("reload", eval(jsonString));
  418. //}
  419. reload();
  420. }
  421. function StudentList_Send() {
  422. var userIDs = validChooseUserIDs();
  423. if (userIDs.length == 0) {
  424. $.messager.alert("系统提示", "请选择您要发送信息的学生报名数据。");
  425. return;
  426. }
  427. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Common/UserAnnouncementSend";
  428. $.popupTopWindow('信息发送', redirectTo, 1024, 768, null, userIDs);
  429. }
  430. //function queryProjectFee() {
  431. // var jsonString = "";
  432. // var parameterString = "";
  433. // var examinationProjectID = $("#cgExaminationProject").combogridX("getValue");
  434. // if (examinationProjectID != nonSelect && examinationProjectID != "") parameterString += "cgExaminationProject|*|" + examinationProjectID + "|@|";
  435. // if (parameterString != "") {
  436. // jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  437. // $("#ExaminationProjectFeeID").combogridX("reload", eval(jsonString));
  438. // }
  439. // reload();
  440. //}