You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

256 lines
12 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-11-29 11:43
  5. * 描 述:开课计划
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var cdmajorname = '';
  11. var page = {
  12. init: function () {
  13. page.inittree();
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 250, 400);
  21. $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  22. $('#AcademicYearNo').lrselect({
  23. placeholder: "请选择学年",
  24. allowSearch: true,
  25. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  26. value: 'value',
  27. text: 'text'
  28. });
  29. //年级
  30. $('#Grade').lrselect({
  31. placeholder: "请选择年级",
  32. allowSearch: true,
  33. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData',
  34. value: 'value',
  35. text: 'text'
  36. });
  37. //学期
  38. $('#Semester').lrselect({
  39. placeholder: "请选择学期",
  40. allowSearch: true,
  41. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
  42. value: 'value',
  43. text: 'text'
  44. });
  45. $("#MajorNo").lrselect();
  46. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  47. // 刷新
  48. $('#lr_refresh').on('click', function () {
  49. location.reload();
  50. });
  51. // 新增
  52. $('#lr_add').on('click', function () {
  53. learun.layerForm({
  54. id: 'form',
  55. title: '新增',
  56. url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm',
  57. width: 800,
  58. height: 450,
  59. callBack: function (id) {
  60. return top[id].acceptClick(refreshGirdData);
  61. }
  62. });
  63. });
  64. // 设置教师
  65. $('#lr_teach').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('ID');
  67. if (learun.checkrow(keyValue)) {
  68. var empno = $('#gridtable').jfGridValue('EmpNo').split(',');
  69. var allEmpty = true;
  70. for (var i = 0; i < empno.length; i++) {
  71. if (empno[i] != '') {
  72. allEmpty = false;
  73. }
  74. }
  75. if (allEmpty) {
  76. learun.layerForm({
  77. id: 'form',
  78. title: '设置教师',
  79. url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm?keyValue=' + keyValue,
  80. width: 400,
  81. height: 300,
  82. callBack: function (id) {
  83. return top[id].acceptClick();
  84. }
  85. });
  86. } else {
  87. learun.alert.warning("所选班级已设置教师,不可重复设置!!!");
  88. }
  89. }
  90. });
  91. // 强制设置教师
  92. $('#lr_qzteach').on('click', function () {
  93. var keyValue = $('#gridtable').jfGridValue('ID');
  94. if (learun.checkrow(keyValue)) {
  95. learun.layerConfirm('是否确认强制设置教师,请谨慎操作!!!', function (item) {
  96. if (item) {
  97. learun.layerForm({
  98. id: 'form',
  99. title: '强制设置教师',
  100. url: top.$.rootUrl +
  101. '/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' +
  102. keyValue,
  103. width: 400,
  104. height: 300,
  105. callBack: function (id) {
  106. return top[id].acceptClick();
  107. }
  108. });
  109. }
  110. });
  111. }
  112. });
  113. },
  114. inittree: function () {
  115. $('#cdmajorTree').lrtree({
  116. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetTree',
  117. param: { parentId: '0' },
  118. nodeClick: page.treeNodeClick
  119. });
  120. //$('#cddeptTree').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681');
  121. },
  122. treeNodeClick: function (item) {
  123. cdmajorname = item.id;
  124. $('#titleinfo').text(item.text);
  125. page.search();
  126. var NMajorNo = item.id;
  127. if (NMajorNo != null && NMajorNo != "" && NMajorNo != undefined) {
  128. $('#MajorNo').lrselectRefresh({
  129. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  130. param: { strWhere: " 1=1 and CheckMark=1 and majorno in (" + NMajorNo + ")" },
  131. value: "majorno",
  132. text: "majorname",
  133. maxHeight: 200
  134. });
  135. } else {
  136. $('#MajorNo').lrselectRefresh({
  137. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  138. param: { strWhere: " 1=1 and CheckMark=1 and majorno ='' " },
  139. value: "majorno",
  140. text: "majorname",
  141. maxHeight: 200
  142. });
  143. }
  144. },
  145. // 初始化列表
  146. initGird: function () {
  147. $('#gridtable').lrAuthorizeJfGrid({
  148. url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/GetPageList',
  149. headData: [
  150. {
  151. label: "校区", name: "F_SchoolId", width: 200, align: "left",
  152. formatterAsync: function (callback, value, row, op, $cell) {
  153. learun.clientdata.getAsync('custmerData', {
  154. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  155. key: value,
  156. keyId: 'f_companyid',
  157. callback: function (_data) {
  158. callback(_data['f_fullname']);
  159. }
  160. });
  161. }
  162. },
  163. { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
  164. { label: "学期", name: "Semester", width: 50, align: "left" },
  165. {
  166. label: "系部", name: "DeptNo", width: 100, align: "left",
  167. formatterAsync: function (callback, value, row, op, $cell) {
  168. learun.clientdata.getAsync('custmerData', {
  169. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  170. key: value,
  171. keyId: 'deptno',
  172. callback: function (_data) {
  173. callback(_data['deptname']);
  174. }
  175. });
  176. }
  177. },
  178. {
  179. label: "专业", name: "MajorNo", width: 200, align: "left",
  180. formatterAsync: function (callback, value, row, op, $cell) {
  181. learun.clientdata.getAsync('custmerData', {
  182. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  183. key: value,
  184. keyId: 'majorno',
  185. callback: function (_data) {
  186. callback(_data['majorname']);
  187. }
  188. });
  189. }
  190. },
  191. { label: "年级", name: "Grade", width: 50, align: "left" },
  192. {
  193. label: "课程", name: "LessonNo", width: 200, align: "left",
  194. formatterAsync: function (callback, value, row, op, $cell) {
  195. learun.clientdata.getAsync('custmerData', {
  196. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  197. key: value,
  198. keyId: 'lessonno',
  199. callback: function (_data) {
  200. callback(_data['lessonname']);
  201. }
  202. });
  203. }
  204. },
  205. { label: "人数", name: "StuNum", width: 80, align: "left" },
  206. { label: "上机课时", name: "PracticeHour", width: 80, align: "left" },
  207. { label: "课程区别码", name: "PartCode", width: 80, align: "left" },
  208. {
  209. label: "班级", name: "TeachClassNo", width: 110, align: "left",
  210. formatterAsync: function (callback, value, row, op, $cell) {
  211. learun.clientdata.getAsync('custmerData', {
  212. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  213. key: value,
  214. keyId: 'classno',
  215. callback: function (_data) {
  216. callback(_data['classname']);
  217. }
  218. });
  219. }
  220. },
  221. {
  222. label: "教师", name: "EmpNo", width: 80, align: "left",
  223. formatterAsync: function (callback, value, row, op, $cell) {
  224. learun.clientdata.getAsync('custmerData', {
  225. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  226. key: value,
  227. keyId: 'f_encode',
  228. callback: function (_data) {
  229. callback(_data['f_realname']);
  230. }
  231. });
  232. }
  233. },
  234. { label: "合上班", name: "RelatedClassNo", width: 80, align: "left" },
  235. { label: "拟开教学班数", name: "LessonSortNo", width: 100, align: "left" },
  236. { label: "备注", name: "Remark", width: 100, align: "left" },
  237. ],
  238. mainId: 'ID',
  239. sidx: 'ID desc',
  240. isMultiselect: true,
  241. isPage: true
  242. });
  243. page.search();
  244. },
  245. search: function (param) {
  246. param = param || {};
  247. param.MajorNo = cdmajorname;
  248. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  249. }
  250. };
  251. refreshGirdData = function () {
  252. $('#gridtable').jfGridSet('reload');
  253. };
  254. page.init();
  255. }