Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

226 linhas
11 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-24 17:03
  5. * 描 述:课程信息管理
  6. */
  7. var refreshGirdData;
  8. var companyId;
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGirdNoMajor();
  14. page.bind();
  15. page.search();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 220, 400);
  21. $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  22. // 刷新
  23. $('#lr_refresh').on('click', function () {
  24. location.reload();
  25. });
  26. // 新增
  27. $('#lr_add').on('click', function () {
  28. learun.layerForm({
  29. id: 'form',
  30. title: '新增',
  31. url: top.$.rootUrl + '/EducationalAdministration/LessonInfo/FormNoMajor',
  32. width: 1000,
  33. height: 800,
  34. callBack: function (id) {
  35. return top[id].acceptClick(refreshGirdData);
  36. }
  37. });
  38. });
  39. // 编辑
  40. $('#lr_edit').on('click', function () {
  41. var keyValue = $('#gridtable').jfGridValue('LessonId');
  42. if (learun.checkrow(keyValue)) {
  43. if (keyValue.indexOf(',') != -1) {
  44. learun.alert.warning("只能选择一条记录进行编辑!");
  45. return;
  46. }
  47. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  48. if (CheckMark === "true") {
  49. learun.alert.warning("当前项目已审核不能编辑!");
  50. return;
  51. }
  52. learun.layerForm({
  53. id: 'form',
  54. title: '编辑',
  55. url: top.$.rootUrl + '/EducationalAdministration/LessonInfo/FormNoMajor?keyValue=' + keyValue,
  56. width: 1000,
  57. height: 800,
  58. callBack: function (id) {
  59. return top[id].acceptClick(refreshGirdData);
  60. }
  61. });
  62. }
  63. });
  64. // 删除
  65. $('#lr_delete').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('LessonId');
  67. if (learun.checkrow(keyValue)) {
  68. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  69. if (CheckMark.indexOf('true') != -1) {
  70. learun.alert.warning("选中记录中包含已启用项目,已启用不能删除!");
  71. return;
  72. }
  73. //if (CheckMark === true) {
  74. // learun.alert.warning("当前项目已审核不能删除!");
  75. // return;
  76. //}
  77. learun.layerConfirm('是否确认删除该项!', function (res) {
  78. if (res) {
  79. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/DeleteForm', { keyValue: keyValue }, function () {
  80. refreshGirdData();
  81. });
  82. }
  83. });
  84. }
  85. });
  86. //审核
  87. $('#lr_lock').on('click', function () {
  88. var keyValue = $('#gridtable').jfGridValue('LessonId');
  89. if (learun.checkrow(keyValue)) {
  90. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  91. if (CheckMark.indexOf('true') != -1) {
  92. learun.alert.warning("选中记录中包含已启用项目!");
  93. return;
  94. }
  95. //if (CheckMark === true) {
  96. // learun.alert.warning("当前项目已审核无需再审!");
  97. // return;
  98. //}
  99. learun.layerConfirm('是否确认审核该项!', function (res) {
  100. if (res) {
  101. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/Lock', { keyValue: keyValue }, function () {
  102. refreshGirdData();
  103. });
  104. }
  105. });
  106. }
  107. });
  108. //去审核
  109. $('#lr_unlock').on('click', function () {
  110. var keyValue = $('#gridtable').jfGridValue('LessonId');
  111. if (learun.checkrow(keyValue)) {
  112. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  113. if (CheckMark.indexOf('false') != -1) {
  114. learun.alert.warning("选中记录中包含已停用项目!");
  115. return;
  116. }
  117. //if (CheckMark === false) {
  118. // learun.alert.warning("当前项目还未审核不需要去审核!");
  119. // return;
  120. //}
  121. learun.layerConfirm('是否确认去审核该项!', function (res) {
  122. if (res) {
  123. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/LessonInfo/UnLock', { keyValue: keyValue }, function () {
  124. refreshGirdData();
  125. });
  126. }
  127. });
  128. }
  129. });
  130. },
  131. initGirdNoMajor: function () {
  132. //$("#gridtable")[0].dfop = undefined;
  133. $('#gridtable').jfGrid({
  134. url: top.$.rootUrl + '/EducationalAdministration/LessonInfo/GetPageList',
  135. headData: [
  136. { label: "课程编号", name: "LessonNo", width: 100, align: "left" },
  137. { label: "课程名称", name: "LessonName", width: 200, align: "left" },
  138. { label: "课程简称", name: "EnName", width: 100, align: "left" },
  139. { label: "学分", name: "StudyScore", width: 50, align: "left" },
  140. { label: "周理论学时", name: "WeekStudyHour", width: 80, align: "left" },
  141. { label: "周实验学时", name: "WeekPracticeHour", width: 80, align: "left" },
  142. { label: "每周课时", name: "TotalStudyHour", width: 80, align: "left" },
  143. {
  144. label: "是否先修", name: "HaveBeforeLesson", width: 80, align: "left",
  145. formatter: function (cellvalue) {
  146. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  147. }
  148. },
  149. {
  150. label: "先修课程", name: "BeforeLesson", width: 100, align: "left",
  151. formatterAsync: function (callback, value, row, op, $cell) {
  152. learun.clientdata.getAsync('custmerData', {
  153. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  154. key: value,
  155. keyId: 'lessonname',
  156. callback: function (_data) {
  157. callback(_data['lessonno']);
  158. }
  159. });
  160. }
  161. },
  162. {
  163. label: "修读对象", name: "WhoStudy", width: 120, align: "left",
  164. formatterAsync: function (callback, value, row, op, $cell) {
  165. learun.clientdata.getAsync('custmerData', {
  166. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  167. key: value,
  168. keyId: 'lessonno',
  169. callback: function (_data) {
  170. callback(_data['lessonname']);
  171. }
  172. });
  173. }
  174. },
  175. {
  176. label: "课程分类", name: "LessonSortNo", width: 150, align: "left",
  177. formatterAsync: function (callback, value, row, op, $cell) {
  178. learun.clientdata.getAsync('custmerData', {
  179. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdLessonSort',
  180. key: value,
  181. keyId: 'lessonsortno',
  182. callback: function (_data) {
  183. callback(_data['lessonsortname']);
  184. }
  185. });
  186. }
  187. },
  188. {
  189. label: "课程分类明细", name: "LessonSortDetailNo", width: 150, align: "left",
  190. formatterAsync: function (callback, value, row, op, $cell) {
  191. learun.clientdata.getAsync('custmerData', {
  192. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdLessonSortDetail',
  193. key: value,
  194. keyId: 'lessonsortdetailno',
  195. callback: function (_data) {
  196. callback(_data['lessonsortdetailname']);
  197. }
  198. });
  199. }
  200. },
  201. {
  202. label: "审核标志", name: "CheckMark", width: 80, align: "center",
  203. formatter: function (cellvalue) {
  204. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  205. }
  206. }
  207. ],
  208. mainId: 'LessonId',
  209. isPage: true,
  210. isMultiselect: true,
  211. sidx: 'LessonNo',
  212. sord: 'ASC'
  213. });
  214. page.search();
  215. },
  216. search: function (param) {
  217. param = param || {};
  218. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  219. }
  220. };
  221. refreshGirdData = function () {
  222. page.search();
  223. };
  224. page.init();
  225. }