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.
 
 
 
 
 
 

251 lines
11 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 cddeptname = '';
  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. $('#Semester').lrDataItemSelect({ code: 'Semester' });
  38. $("#MajorNo").lrselect();
  39. $('#LessonNo').lrselect({
  40. placeholder: "请选择课程",
  41. allowSearch: true,
  42. url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo',
  43. value: 'value',
  44. text: 'text',
  45. maxHeight: 200
  46. });
  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.layerForm({
  96. id: 'form',
  97. title: '强制设置教师',
  98. url: top.$.rootUrl +
  99. '/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' +
  100. keyValue,
  101. width: 400,
  102. height: 300,
  103. callBack: function (id) {
  104. return top[id].acceptClick();
  105. }
  106. });
  107. }
  108. });
  109. },
  110. inittree: function () {
  111. $('#cddeptTree').lrtree({
  112. url: top.$.rootUrl + '/EducationalAdministration/CdDept/GetTree',
  113. param: { parentId: '0' },
  114. nodeClick: page.treeNodeClick
  115. });
  116. //$('#cddeptTree').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681');
  117. },
  118. treeNodeClick: function (item) {
  119. cddeptname = item.id;
  120. $('#titleinfo').text(item.text);
  121. page.search();
  122. var NDeptNo = item.id;
  123. if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) {
  124. $('#MajorNo').lrselectRefresh({
  125. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  126. param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" },
  127. value: "majorno",
  128. text: "majorname",
  129. maxHeight: 200
  130. });
  131. } else {
  132. $('#MajorNo').lrselectRefresh({
  133. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  134. param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " },
  135. value: "majorno",
  136. text: "majorname",
  137. maxHeight: 200
  138. });
  139. }
  140. },
  141. // 初始化列表
  142. initGird: function () {
  143. $('#gridtable').lrAuthorizeJfGrid({
  144. url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/GetPageList',
  145. headData: [
  146. {
  147. label: "校区", name: "F_SchoolId", width: 200, align: "left",
  148. formatterAsync: function (callback, value, row, op, $cell) {
  149. learun.clientdata.getAsync('custmerData', {
  150. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  151. key: value,
  152. keyId: 'f_companyid',
  153. callback: function (_data) {
  154. callback(_data['f_fullname']);
  155. }
  156. });
  157. }
  158. },
  159. { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
  160. {
  161. label: "学期", name: "Semester", width: 50, align: "left",
  162. formatterAsync: function (callback, value, row, op, $cell) {
  163. learun.clientdata.getAsync('dataItem', {
  164. key: value,
  165. code: 'Semester',
  166. callback: function (_data) {
  167. callback(_data.text);
  168. }
  169. });
  170. }
  171. },
  172. {
  173. label: "系部", name: "DeptNo", width: 100, align: "left",
  174. formatterAsync: function (callback, value, row, op, $cell) {
  175. learun.clientdata.getAsync('custmerData', {
  176. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  177. key: value,
  178. keyId: 'deptno',
  179. callback: function (_data) {
  180. callback(_data['deptname']);
  181. }
  182. });
  183. }
  184. },
  185. {
  186. label: "专业", name: "MajorNo", width: 100, align: "left",
  187. formatterAsync: function (callback, value, row, op, $cell) {
  188. learun.clientdata.getAsync('custmerData', {
  189. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  190. key: value,
  191. keyId: 'id',
  192. callback: function (_data) {
  193. callback(_data['majorname']);
  194. }
  195. });
  196. }
  197. },
  198. { label: "年级", name: "Grade", width: 50, align: "left" },
  199. {
  200. label: "课程", name: "LessonNo", width: 200, align: "left",
  201. formatterAsync: function (callback, value, row, op, $cell) {
  202. learun.clientdata.getAsync('custmerData', {
  203. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  204. key: value,
  205. keyId: 'lessonno',
  206. callback: function (_data) {
  207. callback(_data['lessonname']);
  208. }
  209. });
  210. }
  211. },
  212. { label: "人数", name: "StuNum", width: 80, align: "left" },
  213. { label: "上机课时", name: "PracticeHour", width: 80, align: "left" },
  214. { label: "课程区别码", name: "PartCode", width: 80, align: "left" },
  215. { label: "班级", name: "TeachClassNo", width: 80, align: "left" },
  216. {
  217. label: "教师", name: "EmpNo", width: 80, align: "left",
  218. formatterAsync: function (callback, value, row, op, $cell) {
  219. learun.clientdata.getAsync('custmerData', {
  220. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  221. key: value,
  222. keyId: 'f_encode',
  223. callback: function (_data) {
  224. callback(_data['f_realname']);
  225. }
  226. });
  227. }
  228. },
  229. { label: "合上班", name: "RelatedClassNo", width: 80, align: "left" },
  230. { label: "拟开教学班数", name: "LessonSortNo", width: 100, align: "left" },
  231. { label: "备注", name: "Remark", width: 100, align: "left" },
  232. ],
  233. mainId: 'ID',
  234. sidx: 'ID desc',
  235. isMultiselect: true,
  236. isPage: true
  237. });
  238. page.search();
  239. },
  240. search: function (param) {
  241. param = param || {};
  242. param.DeptNo = cddeptname;
  243. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  244. }
  245. };
  246. refreshGirdData = function () {
  247. $('#gridtable').jfGridSet('reload');
  248. };
  249. page.init();
  250. }