EducationMissionClass.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgEducationMissionClassList").cmsXDataTable("load", $.getDataGridParams("dgEducationMissionClassList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.EducationMissionClassID);
  15. });
  16. return d;
  17. }
  18. //获取选中的数据
  19. function validChooseObj() {
  20. var d = [];
  21. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  22. d.push(this);
  23. });
  24. return d;
  25. }
  26. //获取选中的数据
  27. function OrderNovalidChoose() {
  28. var d = [];
  29. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  30. d.push(this.OrderNo);
  31. });
  32. return d;
  33. }
  34. //获取选中的状态
  35. function ApprovalStatusvalidChoose() {
  36. var d = [];
  37. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  38. d.push(this.ApprovalStatus);
  39. });
  40. return d;
  41. }
  42. //获取选中的教室类型
  43. function ClassroomTypeNamevalidChoose() {
  44. var d = [];
  45. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  46. d.push(this.ClassroomTypeName);
  47. });
  48. return d;
  49. }
  50. function collegeIDChoose() {
  51. var d = [];
  52. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  53. d.push(this.CollegeID);
  54. });
  55. return d;
  56. }
  57. function SchoolyearIDChoose() {
  58. var d = [];
  59. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  60. d.push(this.SchoolyearID);
  61. });
  62. return d;
  63. }
  64. //排课分班
  65. function EducationMissionClass_Separate() {
  66. var d = validChooseObj();
  67. var idList = validChoose();
  68. var dstate = ApprovalStatusvalidChoose().join(',');
  69. if (d.length == 0) {
  70. $.messager.alert("系统提示", "请选择教学任务进行分班!");
  71. return;
  72. }
  73. if (d.length > 1) {
  74. $.messager.alert("系统提示", "只能选择单个记录进行分班设置!");
  75. return;
  76. }
  77. for (var i = 0; i < dstate.split(',').length; i++) {
  78. if (dstate.split(',')[i] == scheduled) {
  79. $.messager.alert("系统提示", "您选择的排课分班存在状态已排课数据!");
  80. return;
  81. }
  82. if (dstate.split(',')[i] == submitted) {
  83. $.messager.alert("系统提示", "您选择的排课分班存在状态已提交数据!");
  84. return;
  85. }
  86. }
  87. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: idList.join(',') }, function (data) {
  88. if (data.IsSuccess) {
  89. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/DivideIntoClassesEdit?educationMissionClassID=" + d[0].EducationMissionClassID + "&MNU=" + mnu;
  90. $.popupTopWindow('分班设置', redirectTo, 800, 250, null, null);
  91. } else {
  92. $.messager.alert("系统提示", data.Message);
  93. return;
  94. }
  95. });
  96. }
  97. function EducationMissionClass_Add() {
  98. var d = validChooseObj();
  99. var idList = validChoose();
  100. if (d.length == 0) {
  101. $.messager.alert("系统提示", "请选择教学任务!");
  102. return;
  103. }
  104. if (d.length > 1) {
  105. $.messager.alert("系统提示", "只能选择单个记录进行设置!");
  106. return;
  107. }
  108. //var approvalStatus = ApprovalStatusvalidChoose();
  109. //if (approvalStatus != scheduled) {
  110. // $.messager.alert("系统提示", "未进行排课,无法设置任课老师!");
  111. // return;
  112. //}
  113. if (d[0].IsCollegeScheduleSubmitted && d[0].ApprovalStatus == scheduled) {
  114. $.messager.alert("系统提示", "该课程属于" + d[0].CollegeName + ",并且已排课,他们的院系课表已经提交,不能进行设置,请先撤销课表的提交后再进行设置。");
  115. return;
  116. }
  117. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: idList.join(',') }, function (data) {
  118. if (data.IsSuccess) {
  119. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/SetTeacher" + "?educationMissionClassID=" + d[0].EducationMissionClassID + "&MNU=" + mnu;
  120. $.popupTopWindow('设置教师', redirectTo, 800, 600, null, null);
  121. } else {
  122. $.messager.alert("系统提示", data.Message);
  123. return;
  124. }
  125. });
  126. }
  127. function EducationMissionClass_Schedule() {
  128. var d = validChooseObj();
  129. var idList = validChoose();
  130. var dstate = ApprovalStatusvalidChoose();
  131. if (d == "") {
  132. $.messager.alert("系统提示", "请选择教学任务进行排课。");
  133. return;
  134. }
  135. if (d.length > 1) {
  136. $.messager.alert("系统提示", "只能选择单个记录进行排课。");
  137. return;
  138. }
  139. if (dstate[0] == notSubmitted) {
  140. $.messager.alert("系统提示", "任务班未提交,请提交后再进行排课。");
  141. return;
  142. }
  143. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: idList.join(',') }, function (data) {
  144. if (data.IsSuccess) {
  145. var fullUrl = CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/Edit?classmajorID=' + d[0].MainScheduleClassID
  146. + '&grademajorID=' + d[0].MainScheduleClassGrademajorID + '&collegeID=' + d[0].MainScheduleClassCollegeID
  147. + '&schoolyearID=' + d[0].SchoolyearID + '&standardID=' + d[0].StandardID + '&yearID=' + d[0].GradeYearID
  148. + '&FromMNU=' + mnu;
  149. $.popupTopWindow('手动排课', fullUrl, window.screen.availWidth, window.screen.availHeight - 60, reload);
  150. } else {
  151. $.messager.alert("系统提示", data.Message);
  152. return;
  153. }
  154. });
  155. }
  156. function EducationMissionClass_DepartmentSchedule() {
  157. var d = validChooseObj();
  158. var idList = validChoose();
  159. var dstate = ApprovalStatusvalidChoose();
  160. if (d == "") {
  161. $.messager.alert("系统提示", "请选择教学任务进行排课。");
  162. return;
  163. }
  164. if (d.length > 1) {
  165. $.messager.alert("系统提示", "只能选择单个记录进行排课。");
  166. return;
  167. }
  168. if (dstate[0] == notSubmitted) {
  169. $.messager.alert("系统提示", "任务班未提交,请提交后再进行排课。");
  170. return;
  171. }
  172. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: idList.join(',') }, function (data) {
  173. if (data.IsSuccess) {
  174. var fullUrl = CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/DepartmentEdit?collegeID=' + d[0].CollegeID + '&departmentID=' + d[0].DepartmentID
  175. + '&schoolyearID=' + d[0].SchoolyearID + '&handleMode=' + d[0].HandleModeID + '&FromMNU=' + mnu;
  176. $.popupTopWindow('教研室排课', fullUrl, window.screen.availWidth, window.screen.availHeight - 60, reload);
  177. } else {
  178. $.messager.alert("系统提示", data.Message);
  179. return;
  180. }
  181. });
  182. }
  183. function EducationMissionClass_Save() {
  184. var d = $.map(validChooseObj(), function (x) { return x.EducationMissionClassID; }).join(',');
  185. var orderno = OrderNovalidChoose().join(',');
  186. var dstate = ApprovalStatusvalidChoose().join(',');
  187. if (d.length == 0) {
  188. $.messager.alert("系统提示", "请选择保存的教学任务!");
  189. return;
  190. }
  191. for (var i = 0; i < dstate.split(',').length; i++) {
  192. if (dstate.split(',')[i] == scheduled) {
  193. $.messager.alert("系统提示", "保存失败,您选择的教学任务班存在已排课数据!");
  194. return;
  195. }
  196. }
  197. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: d }, function (data) {
  198. if (data.IsSuccess) {
  199. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/TeachingScheduleEdit', { educationMissionClassIDs: d, orderNos: orderno }, function (data) {
  200. if (data == "成功") {
  201. $.messager.alert("系统提示", "保存成功!");
  202. reload();
  203. } else {
  204. $.messager.alert("系统提示", data);
  205. }
  206. });
  207. } else {
  208. $.messager.alert("系统提示", data.Message);
  209. return;
  210. }
  211. });
  212. }
  213. function EducationMissionClass_Arrange() {
  214. var d = validChooseObj();
  215. var idList = validChoose();
  216. if (d.length == 0) {
  217. $.messager.alert("系统提示", "请选择教学任务!");
  218. return;
  219. }
  220. if (d.length > 1) {
  221. $.messager.alert("系统提示", "只能选择单个记录进行教学安排设置!");
  222. return;
  223. }
  224. var redirectTo = url + "?educationMissionClassID=" + d[0].EducationMissionClassID + "&MNU=" + mnu;
  225. $.popupTopWindow('教学安排设置', redirectTo, 800, 600, null, null);
  226. }
  227. function EducationMissionClassSchedule_Delete() {
  228. var d = $.map(validChooseObj(), function (x) { return x.EducationMissionClassID; }).join(',');
  229. var state = ApprovalStatusvalidChoose().join(',');
  230. var classroomTypeName = ClassroomTypeNamevalidChoose().join(',');
  231. if (d.length == 0) {
  232. $.messager.alert("系统提示", "请选择您要撤销的任务班排课!");
  233. return;
  234. }
  235. for (var i = 0; i < state.split(',').length; i++) {
  236. if (state.split(',')[i] != scheduled) {
  237. $.messager.alert("系统提示", "撤销失败,您选择的教学任务班包含未提交或已提交状态!");
  238. return;
  239. }
  240. }
  241. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: d }, function (data) {
  242. if (data.IsSuccess) {
  243. $.messager.confirm("系统提示", "您确定要撤销任务班排课?", function (r) {
  244. if (r) {
  245. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClassSchedule/Delete', { educationMissionClassIDs: d }, function (data) {
  246. if (data.IsSuccess) {
  247. $.messager.alert("系统提示", "撤销成功!");
  248. reload();
  249. } else {
  250. $.messager.alert("系统提示", data.Message);
  251. }
  252. });
  253. }
  254. });
  255. } else {
  256. $.messager.alert("系统提示", data.Message);
  257. return;
  258. }
  259. });
  260. }
  261. function EducationMissionClass_Delete() {
  262. var d = $.map(validChooseObj(), function (x) { return x.EducationMissionClassID; }).join(',');
  263. var state = ApprovalStatusvalidChoose().join(',');
  264. var classroomTypeName = ClassroomTypeNamevalidChoose().join(',');
  265. if (d.length == 0) {
  266. $.messager.alert("系统提示", "请选择您要删除的任务班!");
  267. return;
  268. }
  269. for (var i = 0; i < state.split(',').length; i++) {
  270. if (state.split(',')[i] == submitted) {
  271. $.messager.alert("系统提示", "您选择的任务班存在状态已提交数据!");
  272. return;
  273. }
  274. }
  275. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: d }, function (data) {
  276. if (data.IsSuccess) {
  277. var ExecutableFreeSelectionCouseIDs = [];
  278. $.each($("#dgEducationMissionClassList").cmsXDataTable("getSelections"), function (index) {
  279. ExecutableFreeSelectionCouseIDs.push(this.ExecutableFreeSelectionCouseID);
  280. });
  281. $.messager.confirm("系统提示", "您确定要删除该任务班?", function (r) {
  282. if (r) {
  283. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/Delete', { educationMissionClassIDs: d }, function (data) {
  284. if (data.IsSuccess) {
  285. $.messager.alert("系统提示", "删除成功!");
  286. reload();
  287. } else {
  288. $.messager.alert("系统提示", data.Message);
  289. }
  290. });
  291. }
  292. });
  293. } else {
  294. $.messager.alert("系统提示", data.Message);
  295. return;
  296. }
  297. });
  298. //for (var i = 0; i < state.split(',').length; i++) {
  299. // if (state.split(',')[i] != notSubmitted) {
  300. // $.messager.alert("系统提示", "您选择的任务班存在非未提交数据!");
  301. // return;
  302. // }
  303. //}
  304. }
  305. //提交
  306. function EducationMissionClass_Submit() {
  307. var d = $.map(validChooseObj(), function (x) { return x.EducationMissionClassID; }).join(',');
  308. var state = ApprovalStatusvalidChoose().join(',');
  309. var classroomTypeName = ClassroomTypeNamevalidChoose().join(',');
  310. var collegeID = collegeIDChoose().join(',');
  311. var SchoolyearID = SchoolyearIDChoose().join(',');
  312. if (d.length == 0) {
  313. $.messager.alert("系统提示", "请选择您要提交的任务班!");
  314. return;
  315. }
  316. for (var i = 0; i < classroomTypeName.split(',').length; i++) {
  317. if (classroomTypeName.split(',')[i] == "") {
  318. $.messager.alert("系统提示", "您选择的教学任务班存在教室类型为空数据,请检查!");
  319. return;
  320. }
  321. }
  322. for (var i = 0; i < state.split(',').length; i++) {
  323. if (state.split(',')[i] == submitted) {
  324. $.messager.alert("系统提示", "您选择的任务班存在状态已提交数据!");
  325. return;
  326. }
  327. }
  328. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: d }, function (data) {
  329. if (data.IsSuccess) {
  330. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/EducationMissionClassUpdate', { educationMissionClassIDs: d }, function (data) {
  331. if (data == "成功") {
  332. $.messager.alert("系统提示", "提交成功!");
  333. reload();
  334. } else {
  335. $.messager.alert("系统提示", data);
  336. }
  337. });
  338. } else {
  339. $.messager.alert("系统提示", data.Message);
  340. return;
  341. }
  342. });
  343. }
  344. //撤销
  345. function EducationMissionClass_UnSubmit() {
  346. var d = $.map(validChooseObj(), function (x) { return x.EducationMissionClassID; }).join(',');
  347. var state = ApprovalStatusvalidChoose().join(',');
  348. if (d.length == 0) {
  349. $.messager.alert("系统提示", "请选择您要撤销提交的任务班!");
  350. return;
  351. }
  352. for (var i = 0; i < state.split(',').length; i++) {
  353. if (state.split(',')[i] != submitted) {
  354. $.messager.alert("系统提示", "只能撤销已提交状态的数据!");
  355. return;
  356. }
  357. }
  358. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: d }, function (data) {
  359. if (data.IsSuccess) {
  360. $.messager.confirm("系统提示", "您确定要撤销提交该任务班?", function (r) {
  361. if (r) {
  362. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/UnSubmit', { educationMissionClassIDs: d }, function (data) {
  363. $.messager.alert("系统提示", data);
  364. if (data == "撤销成功。") {
  365. reload();
  366. }
  367. });
  368. }
  369. });
  370. } else {
  371. $.messager.alert("系统提示", data.Message);
  372. return;
  373. }
  374. });
  375. }
  376. //排课班级
  377. function SchedulingClassEdit(rowindex, rowdata) {
  378. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/EducationSchedulingClassList?educationMissionClassID=" + rowdata.EducationMissionClassID + "&MNU=" + mnu;
  379. $.popupTopWindow('排课班信息', redirectTo, 800, 600, null, null);
  380. }
  381. //学生总数
  382. function SchedulingClassStudentEdit(rowindex, rowdata) {
  383. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/EducationSchedulingClassCountStudentList?educationMissionClassID=" + rowdata.EducationMissionClassID + "&MNU=" + mnu + "&ApprovalStatusName=" + rowdata.ApprovalStatusName;
  384. $.popupTopWindow('学生信息', redirectTo, 800, 600, CloseStudentEdit);
  385. }
  386. function CloseStudentEdit() {
  387. reload();
  388. }
  389. function AddStudent_Confirm(studentList) {
  390. alert("这边");
  391. }
  392. //合班
  393. function EducationMissionClass_Conjunction() {
  394. var educationMissionClassList = validChooseObj();
  395. var d = $.map(educationMissionClassList, function (x) { return x.EducationMissionClassID; });
  396. if (d.length < 2) {
  397. $.messager.alert("系统提示", "请至少选择两个以上的任务班进行合并。");
  398. return;
  399. }
  400. for (var i = 0; i < educationMissionClassList.length; i++) {
  401. if (educationMissionClassList[i].ApprovalStatus != notSubmitted) {
  402. $.messager.alert("系统提示", "只有未提交的教学任务才能进行合班。");
  403. return;
  404. }
  405. }
  406. var courseID = educationMissionClassList[0].CoursematerialID;
  407. var schoolyearID = educationMissionClassList[0].SchoolyearID;
  408. var teachModeID = educationMissionClassList[0].TeachingModeID;
  409. var errorList = $.grep(educationMissionClassList, function (x) { return x.CoursematerialID != courseID || x.SchoolyearID != schoolyearID || x.TeachingModeID != teachModeID });
  410. if (errorList.length > 0) {
  411. $.messager.alert("系统提示", "只有同一学年学期上相同课程,授课方式也一致的任务班才可以进行合班。");
  412. return;
  413. }
  414. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: d.join(',') }, function (data) {
  415. if (data.IsSuccess) {
  416. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/EducationMissionClassConjunctionList?MNU=" + mnu;
  417. $.popupTopWindow('合班信息', redirectTo, 900, 300, reload, d);
  418. } else {
  419. $.messager.alert("系统提示", data.Message);
  420. return;
  421. }
  422. });
  423. }
  424. function EducationMissionClass_CourseProcess() {
  425. var d = validChooseObj();
  426. var idList = validChoose();
  427. if (d.length == 0) {
  428. $.messager.alert("系统提示", "请选择修改的教学任务!");
  429. return;
  430. }
  431. if (d.length > 1) {
  432. $.messager.alert("系统提示", "只能选择单个记录进行课程进度设置!");
  433. return;
  434. }
  435. $.popupTopWindow('课程进度', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CourseProcess?MNU=' + mnu + '&educationMissionClassID=' + d[0].EducationMissionClassID, 620, 430);
  436. }
  437. //导出Excel
  438. function EducationMissionClass_Excel() {
  439. var d = validChoose().join(',')
  440. if (d != "") {
  441. document.getElementById("EducationMissionClassIDs").value = d;
  442. }
  443. else {
  444. document.getElementById("EducationMissionClassIDs").value = "";
  445. }
  446. $("#formQuery").submit();
  447. }
  448. function QuerySchoolyearDropdownList(data) {
  449. reload();
  450. }
  451. function QueryComboGridList(data) {
  452. reload();
  453. }
  454. function QueryComboGridCollegeList(data) {
  455. reload();
  456. }
  457. function QueryComboGridCampusList(data) {
  458. reload();
  459. }
  460. function QueryApprovalStatusDropdownList(data) {
  461. reload();
  462. }
  463. function SelectCollegeComboGrid(data) {
  464. CMSFunction.ComboGrid.SetValue($("#GrademajorComboGrid"), "", ""); //清空原有年级专业旧记录
  465. var Year = $("#DictionaryGrade").combobox("getValue");
  466. if (data != null || Year != "-1") {
  467. var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + data.CollegeID + "|@|DictionaryGrade|*|" + Year + "|@|'})";
  468. $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  469. }
  470. reload();
  471. }
  472. function SelectDictionaryGrade(data) {
  473. CMSFunction.ComboGrid.SetValue($("#GrademajorComboGrid"), "", "");
  474. var collegeID = $("#ComboGridCollege").combogridX("getValue");
  475. if (data.Value != "-1" || data != null) {
  476. var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|DictionaryGrade|*|" + data.Value + "|@|'})";
  477. $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  478. }
  479. reload();
  480. }
  481. //点名
  482. function EducationMissionClass_RollCall() {
  483. var educationMissionClassIDs = validChoose().join(',');
  484. educationMissionClassIDs = (educationMissionClassIDs == "-1" || educationMissionClassIDs == "") ? "=" : "=" + educationMissionClassIDs;
  485. var attribute = $("[name='Attribute']").val();
  486. var attributeObj = eval('(' + attribute + ')');
  487. var conditionString = $("[name='Condition']").val();
  488. var value = SystemQueryControl.GetValue();
  489. var condition = '@DynamicAttribute:' + attributeObj.Value + '|@DynamicCondition:' + escape(conditionString) + '|@DynamicValue:' + escape(value);
  490. var schoolYearID = $("#SchoolyearDropdown").combobox("getValue")
  491. schoolYearID = (schoolYearID == "-1" || schoolYearID == "") ? "=" : "=" + schoolYearID;
  492. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  493. collegeID = (collegeID == "-1" || collegeID == "") ? "=" : "=" + collegeID;
  494. var year = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  495. year = (year == "-1" || year == "") ? "=" : "=" + year;
  496. var grademajorID = $("[comboname='StandardDictionaryDropDown']").combogridX("getValue");
  497. grademajorID = (grademajorID == "-1" || grademajorID == "") ? "=" : "=" + grademajorID;
  498. var coursematerialID = $("[comboname='CoursematerialComboGrid']").combogridX("getValue");
  499. coursematerialID = (coursematerialID == "-1" || coursematerialID == "") ? "=" : "=" + coursematerialID;
  500. var teachingMethod = $('[comboname="DictionaryTeachingMode"]').combobox("getValue");
  501. teachingMethod = (teachingMethod == "-1" || teachingMethod == "") ? "=" : "=" + teachingMethod;
  502. var approvalStatus = $('[comboname="ApprovalStatusDropdownList"]').combobox("getValue");
  503. approvalStatus = (approvalStatus == "-1" || approvalStatus == "") ? "=" : "=" + approvalStatus;
  504. var reportUrl = CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fEducationManage%2fStudentRollCallReport&condition_RAP=" + condition
  505. + "&schoolyearID_RAP" + schoolYearID
  506. + "&collegeID_RAP" + collegeID
  507. + "&year_RAP" + year
  508. + "&grademajorID_RAP" + grademajorID
  509. + "&coursematerialID_RAP" + coursematerialID
  510. + "&teachingMethod_RAP" + teachingMethod
  511. + "&educationMissionClassIDs_RAP" + educationMissionClassIDs
  512. + "&approvalStatus_RAP" + approvalStatus
  513. $.popupTopWindowOutsite('点名册', reportUrl, 900, 700);
  514. }
  515. SystemBatchModifyControl.OnSubmit = function () {
  516. var state = ApprovalStatusvalidChoose().join(',');
  517. for (var i = 0; i < state.split(',').length; i++) {
  518. if (state.split(',')[i] == scheduled) {
  519. $.messager.alert("系统提示", "您选择的教学任务班包含已排课状态!");
  520. return false;
  521. }
  522. }
  523. }
  524. function EducationMissionClass_BatchUpdate() {
  525. var d = validChoose().join(',');
  526. if (d == "") {
  527. $.messager.alert("系统提示", "请选择您要修改的教学任务。");
  528. return;
  529. }
  530. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: d }, function (data) {
  531. if (data.IsSuccess) {
  532. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/BatchUpdate?educationMissionClassStr=+' + d + '&MNU=' + mnu;
  533. $.popupTopWindow('批量修改课时类别', redirectTo, 450, 200, null, null);
  534. } else {
  535. $.messager.alert("系统提示", data.Message);
  536. return;
  537. }
  538. });
  539. }
  540. //联动查询
  541. function queryStandard(data) {
  542. queryClass();
  543. reload();
  544. }
  545. function queryCollege(data) {
  546. var campusID = $("#CampusDropdown").combogridX("getValue");
  547. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  548. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  549. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  550. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  551. // $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  552. // if (campusID != nonSelect) {
  553. // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  554. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  555. // }
  556. queryClass();
  557. reload();
  558. }
  559. function queryClass() {
  560. var jsonString = "";
  561. var parameterString = "";
  562. var campusID = $("#CampusDropdown").combogridX("getValue");
  563. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  564. //var educationID = $("#Education").combobox("getValue");
  565. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  566. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  567. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  568. //if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  569. //if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  570. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  571. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  572. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  573. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  574. if (parameterString != "") {
  575. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  576. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  577. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  578. } else {
  579. $("#ClassmajorDropdown").combogridX("reload");
  580. $("#StandardDictionaryDropDown").combogridX("reload");
  581. }
  582. reload();
  583. }
  584. function EducationMissionClass_ClassRoomEdit() {
  585. var d = validChooseObj();
  586. var idList = validChoose();
  587. if (d.length == 0) {
  588. $.messager.alert("系统提示", "请选择教学任务!");
  589. return;
  590. }
  591. if (d.length > 1) {
  592. $.messager.alert("系统提示", "只能选择单个记录进行设置!");
  593. return;
  594. }
  595. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: idList.join(',') }, function (data) {
  596. if (data.IsSuccess) {
  597. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionClass/ClassRoomEdit" + "?educationMissionClassID=" + d[0].EducationMissionClassID + "&MNU=" + mnu;
  598. $.popupTopWindow('修改教室', redirectTo, 800, 200, null, null);
  599. } else {
  600. $.messager.alert("系统提示", data.Message);
  601. return;
  602. }
  603. });
  604. }
  605. function EducationMissionClassStudentList_print() {
  606. var educationMissionClassIDs = validChoose().join(',');
  607. educationMissionClassIDs = (educationMissionClassIDs == "-1" || educationMissionClassIDs == "") ? "=" : "=" + educationMissionClassIDs;
  608. // var attribute = $("[name='Attribute']").val();
  609. // var attributeObj = eval('(' + attribute + ')');
  610. // var conditionString = $("[name='Condition']").val();
  611. // var value = SystemQueryControl.GetValue();
  612. // var condition = '@DynamicAttribute:' + attributeObj.Value + '|@DynamicCondition:' + escape(conditionString) + '|@DynamicValue:' + escape(value);
  613. var schoolYearID = $("#SchoolyearDropdown").combobox("getValue")
  614. schoolYearID = (schoolYearID == "-1" || schoolYearID == "") ? "=" : "=" + schoolYearID;
  615. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  616. collegeID = (collegeID == "-1" || collegeID == "") ? "=" : "=" + collegeID;
  617. var year = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  618. year = (year == "-1" || year == "") ? "=" : "=" + year;
  619. var grademajorID = $("[comboname='StandardDictionaryDropDown']").combogridX("getValue");
  620. grademajorID = (grademajorID == "-1" || grademajorID == "") ? "=" : "=" + grademajorID;
  621. var classmajorID = $("[comboname='ClassmajorDropdown']").combogridX("getValue");
  622. classmajorID = (classmajorID == "-1" || classmajorID == "") ? "=" : "=" + classmajorID;
  623. var coursematerialID = $("[comboname='CoursematerialComboGrid']").combogridX("getValue");
  624. coursematerialID = (coursematerialID == "-1" || coursematerialID == "") ? "=" : "=" + coursematerialID;
  625. var teachingMethod = $('[comboname="DictionaryTeachingMode"]').combobox("getValue");
  626. teachingMethod = (teachingMethod == "-1" || teachingMethod == "") ? "=" : "=" + teachingMethod;
  627. var approvalStatus = $('[comboname="ApprovalStatusDropdownList"]').combobox("getValue");
  628. approvalStatus = (approvalStatus == "-1" || approvalStatus == "") ? "=" : "=" + approvalStatus;
  629. var reportUrl = CMS_SystemConfig.ReportPagePath + "?ReportFolder=%2fEducationManage%2fEducationMissionClassStudentList&SchoolyearID_RAP" + schoolYearID
  630. + "&CollegeID_RAP" + collegeID
  631. + "&YearID_RAP" + year
  632. + "&StandardID_RAP" + grademajorID
  633. + "&ClassmajorID_RAP" + classmajorID
  634. + "&CoursematerialID_RAP" + coursematerialID
  635. + "&TeachingModeID_RAP" + teachingMethod
  636. + "&EducationMissionClassID_RAP" + educationMissionClassIDs
  637. + "&RecordStatus_RAP" + approvalStatus
  638. $.popupTopWindowOutsite('点名表', reportUrl, 900, 700);
  639. }
  640. function EducationMissionClassStudentList_Report() {
  641. var d = validChoose().join(',');
  642. if (d == "") {
  643. $.messager.alert("系统提示", "请选择您要打印考勤表的教学任务。");
  644. return;
  645. }
  646. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/GZMSStudentListReport', { educationMissionClassIDList:d }, function (data) {
  647. if (data.IsSuccess) {
  648. var redirectTo = "../../Scripts/pdf.js/web/viewer.html?file=" + data.Message;
  649. $.popupTopWindow('考勤表', redirectTo, 850, 480, reload);
  650. } else {
  651. $.messager.alert("系统提示", data);
  652. }
  653. });
  654. }