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.
 
 
 
 
 
 

275 lines
13 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. $('#AcademicYearNo').lrselect({
  22. placeholder: "请选择学年",
  23. allowSearch: true,
  24. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
  25. value: 'value',
  26. text: 'text'
  27. });
  28. //年级
  29. $('#Grade').lrselect({
  30. placeholder: "请选择年级",
  31. allowSearch: true,
  32. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData',
  33. value: 'value',
  34. text: 'text'
  35. });
  36. $('#Semester').lrDataItemSelect({ code: 'Semester' });
  37. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  38. $("#MajorNo").lrselect();
  39. $('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' });
  40. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  41. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  42. // 刷新
  43. $('#lr_refresh').on('click', function () {
  44. location.reload();
  45. });
  46. // 新增
  47. $('#lr_add').on('click', function () {
  48. learun.layerForm({
  49. id: 'form',
  50. title: '新增',
  51. url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm',
  52. width: 800,
  53. height: 450,
  54. callBack: function (id) {
  55. return top[id].acceptClick(refreshGirdData);
  56. }
  57. });
  58. });
  59. // 设置教师
  60. $('#lr_teach').on('click', function () {
  61. var keyValue = $('#gridtable').jfGridValue('ID');
  62. if (learun.checkrow(keyValue)) {
  63. var empno = $('#gridtable').jfGridValue('EmpNo').split(',');
  64. var allEmpty = true;
  65. for (var i = 0; i < empno.length; i++) {
  66. if (empno[i] != '') {
  67. allEmpty = false;
  68. }
  69. }
  70. if (allEmpty) {
  71. learun.layerForm({
  72. id: 'form',
  73. title: '设置教师',
  74. url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm?keyValue=' + keyValue,
  75. width: 400,
  76. height: 300,
  77. callBack: function (id) {
  78. return top[id].acceptClick();
  79. }
  80. });
  81. } else {
  82. learun.alert.warning("所选班级已设置教师,不可重复设置!!!");
  83. }
  84. }
  85. });
  86. // 强制设置教师
  87. $('#lr_qzteach').on('click', function () {
  88. var keyValue = $('#gridtable').jfGridValue('ID');
  89. if (learun.checkrow(keyValue)) {
  90. learun.layerForm({
  91. id: 'form',
  92. title: '强制设置教师',
  93. url: top.$.rootUrl +
  94. '/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' +
  95. keyValue,
  96. width: 400,
  97. height: 300,
  98. callBack: function (id) {
  99. return top[id].acceptClick();
  100. }
  101. });
  102. }
  103. });
  104. },
  105. inittree: function () {
  106. $('#cddeptTree').lrtree({
  107. url: top.$.rootUrl + '/EducationalAdministration/CdDept/GetTree',
  108. param: { parentId: '0' },
  109. nodeClick: page.treeNodeClick
  110. });
  111. //$('#cddeptTree').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681');
  112. },
  113. treeNodeClick: function (item) {
  114. cddeptname = item.id;
  115. $('#titleinfo').text(item.text);
  116. page.search();
  117. var NDeptNo = item.id;
  118. if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) {
  119. $('#MajorNo').lrselectRefresh({
  120. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  121. param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" },
  122. value: "majorno",
  123. text: "majorname",
  124. maxHeight: 200
  125. });
  126. } else {
  127. $('#MajorNo').lrselectRefresh({
  128. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  129. param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " },
  130. value: "majorno",
  131. text: "majorname",
  132. maxHeight: 200
  133. });
  134. }
  135. },
  136. // 初始化列表
  137. initGird: function () {
  138. $('#gridtable').jfGrid({
  139. url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/GetPageList',
  140. headData: [
  141. {
  142. label: "校区", name: "F_SchoolId", width: 200, align: "left",
  143. formatterAsync: function (callback, value, row, op, $cell) {
  144. learun.clientdata.getAsync('custmerData', {
  145. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  146. key: value,
  147. keyId: 'f_companyid',
  148. callback: function (_data) {
  149. callback(_data['f_fullname']);
  150. }
  151. });
  152. }
  153. },
  154. { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
  155. {
  156. label: "学期", name: "Semester", width: 50, align: "left",
  157. formatterAsync: function (callback, value, row, op, $cell) {
  158. learun.clientdata.getAsync('dataItem', {
  159. key: value,
  160. code: 'Semester',
  161. callback: function (_data) {
  162. callback(_data.text);
  163. }
  164. });
  165. }
  166. },
  167. {
  168. label: "系部", name: "DeptNo", width: 100, align: "left",
  169. formatterAsync: function (callback, value, row, op, $cell) {
  170. learun.clientdata.getAsync('custmerData', {
  171. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  172. key: value,
  173. keyId: 'deptno',
  174. callback: function (_data) {
  175. callback(_data['deptname']);
  176. }
  177. });
  178. }
  179. },
  180. {
  181. label: "专业", name: "MajorNo", width: 200, align: "left",
  182. formatterAsync: function (callback, value, row, op, $cell) {
  183. learun.clientdata.getAsync('custmerData', {
  184. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  185. key: value,
  186. keyId: 'majorno',
  187. callback: function (_data) {
  188. callback(_data['majorname']);
  189. }
  190. });
  191. }
  192. },
  193. { label: "年级", name: "Grade", width: 50, align: "left" },
  194. { label: "课程编码", name: "LessonNo", width: 200, align: "left" },
  195. { label: "课程名称", name: "LessonName", width: 200, align: "left" },
  196. //{
  197. // label: "课程名称", name: "LessonNo", width: 200, align: "left",
  198. // formatterAsync: function (callback, value, row, op, $cell) {
  199. // learun.clientdata.getAsync('custmerData', {
  200. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  201. // key: value,
  202. // keyId: 'lessonno',
  203. // callback: function (_data) {
  204. // callback(_data['lessonname']);
  205. // }
  206. // });
  207. // }
  208. //},
  209. { label: "人数", name: "StuNum", width: 80, align: "left" },
  210. { label: "上机课时", name: "PracticeHour", width: 80, align: "left" },
  211. { label: "班级编号", name: "TeachClassNo", width: 80, align: "left" },
  212. {
  213. label: "班级名称", name: "TeachClassNo", width: 80, align: "left",
  214. formatterAsync: function (callback, value, row, op, $cell) {
  215. learun.clientdata.getAsync('custmerData', {
  216. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  217. key: value,
  218. keyId: 'classno',
  219. callback: function (_data) {
  220. callback(_data['classname']);
  221. }
  222. });
  223. }
  224. },
  225. { label: "教师编号", name: "EmpNo", width: 80, align: "left" },
  226. {
  227. label: "教师名称", name: "EmpNo", width: 80, align: "left",
  228. formatterAsync: function (callback, value, row, op, $cell) {
  229. learun.clientdata.getAsync('custmerData', {
  230. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  231. key: value,
  232. keyId: 'f_encode',
  233. callback: function (_data) {
  234. callback(_data['f_realname']);
  235. }
  236. });
  237. }
  238. },
  239. {
  240. label: "考试类型", name: "ExamType", width: 80, align: "left",
  241. formatterAsync: function (callback, value, row, op, $cell) {
  242. learun.clientdata.getAsync('dataItem', {
  243. key: value,
  244. code: 'ExamType',
  245. callback: function (_data) {
  246. callback(_data.text);
  247. }
  248. });
  249. }
  250. },
  251. { label: "合上班", name: "RelatedClassNo", width: 80, align: "left" },
  252. { label: "拟开教学班数", name: "LessonSortNo", width: 100, align: "left" },
  253. { label: "备注", name: "Remark", width: 100, align: "left" },
  254. ],
  255. mainId: 'ID',
  256. sidx: 'ID desc',
  257. isMultiselect: true,
  258. isPage: true
  259. });
  260. page.search();
  261. },
  262. search: function (param) {
  263. param = param || {};
  264. param.DeptNo = cddeptname;
  265. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  266. }
  267. };
  268. refreshGirdData = function () {
  269. $('#gridtable').jfGridSet('reload');
  270. };
  271. page.init();
  272. }