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.
 
 
 
 
 
 

274 lines
13 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-01-22 16:32
  5. * 描 述:专业信息管理
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  20. $('#Area').lrDataSourceSelect({ code: 'DIC_AREA', value: 'acode', text: 'aname' });
  21. $('#City').lrDataSourceSelect({ code: 'DIC_CITY', value: 'ccode', text: 'cname' });
  22. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. learun.layerForm({
  30. id: 'form',
  31. title: '新增',
  32. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/Form',
  33. width: 1000,
  34. height: 600,
  35. callBack: function (id) {
  36. return top[id].acceptClick(refreshGirdData);
  37. }
  38. });
  39. });
  40. // 编辑
  41. $('#lr_edit').on('click', function () {
  42. var keyValue = $('#gridtable').jfGridValue('ID');
  43. if (learun.checkrow(keyValue)) {
  44. if (keyValue.indexOf(',') != -1) {
  45. learun.alert.warning("只能选择一条记录进行编辑!");
  46. return;
  47. }
  48. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  49. if (CheckMark === "true") {
  50. learun.alert.warning("当前项目已启用不能编辑!");
  51. return;
  52. }
  53. learun.layerForm({
  54. id: 'form',
  55. title: '编辑',
  56. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/Form?keyValue=' + keyValue,
  57. width: 1000,
  58. height: 600,
  59. callBack: function (id) {
  60. return top[id].acceptClick(refreshGirdData);
  61. }
  62. });
  63. }
  64. });
  65. // 删除
  66. $('#lr_delete').on('click', function () {
  67. var keyValue = $('#gridtable').jfGridValue('ID');
  68. if (learun.checkrow(keyValue)) {
  69. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  70. if (CheckMark.indexOf('true') != -1) {
  71. learun.alert.warning("选中记录中包含已启用项目,已启用不能删除!");
  72. return;
  73. }
  74. //if (CheckMark === true) {
  75. // learun.alert.warning("当前项目已审核不能删除!");
  76. // return;
  77. //}
  78. learun.layerConfirm('是否确认删除该项!', function (res) {
  79. if (res) {
  80. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/CdMajor/DeleteForm', { keyValue: keyValue }, function () {
  81. refreshGirdData();
  82. });
  83. }
  84. });
  85. }
  86. });
  87. //审核
  88. $('#lr_lock').on('click', function () {
  89. var keyValue = $('#gridtable').jfGridValue('ID');
  90. if (learun.checkrow(keyValue)) {
  91. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  92. if (CheckMark.indexOf('true') != -1) {
  93. learun.alert.warning("选中记录中包含已启用项目!");
  94. return;
  95. }
  96. //if (CheckMark === true) {
  97. // learun.alert.warning("当前项目已审核无需再审!");
  98. // return;
  99. //}
  100. learun.layerConfirm('是否确认启用该项!', function (res) {
  101. if (res) {
  102. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/CdMajor/Lock', { keyValue: keyValue }, function () {
  103. refreshGirdData();
  104. });
  105. }
  106. });
  107. }
  108. });
  109. //去审核
  110. $('#lr_unlock').on('click', function () {
  111. var keyValue = $('#gridtable').jfGridValue('ID');
  112. if (learun.checkrow(keyValue)) {
  113. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  114. if (CheckMark.indexOf('false') != -1) {
  115. learun.alert.warning("选中记录中包含已停用项目!");
  116. return;
  117. }
  118. //if (CheckMark === false) {
  119. // learun.alert.warning("当前项目还未审核不需要去审核!");
  120. // return;
  121. //}
  122. learun.layerConfirm('是否确认停用该项!', function (res) {
  123. if (res) {
  124. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/CdMajor/UnLock', { keyValue: keyValue }, function () {
  125. refreshGirdData();
  126. });
  127. }
  128. });
  129. }
  130. });
  131. },
  132. // 初始化列表
  133. initGird: function () {
  134. $('#gridtable').jfGrid({
  135. url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetPageList',
  136. headData: [
  137. { label: "专业名称", name: "MajorName", width: 200, align: "left" },
  138. { label: "专业编号", name: "MajorNo", width: 100, align: "left" },
  139. { label: "学制", name: "LengthOfSchooling", width: 100, align: "left" },
  140. {
  141. label: "学科门类", name: "SubjectSpeciesNo", width: 150, align: "left",
  142. formatterAsync: function (callback, value, row, op, $cell) {
  143. learun.clientdata.getAsync('dataItem', {
  144. key: value,
  145. code: 'SubjectSpecies',
  146. callback: function (_data) {
  147. callback(_data.text);
  148. }
  149. });
  150. }
  151. },
  152. {
  153. label: "校区", name: "F_SchoolId", width: 200, align: "left",
  154. formatterAsync: function (callback, value, row, op, $cell) {
  155. learun.clientdata.getAsync('custmerData', {
  156. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
  157. key: value,
  158. keyId: 'f_companyid',
  159. callback: function (_data) {
  160. callback(_data['f_fullname']);
  161. }
  162. });
  163. }
  164. },
  165. {
  166. label: "系别", name: "DeptNo", width: 200, 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. //{ label: "名称缩写", name: "MajorNameBrief", width: 100, align: "left" },
  179. //{ label: "英文名称", name: "MajorNameEn", width: 100, align: "left" },
  180. { label: "教委专业代码", name: "GovMajorNo", width: 100, align: "left" },
  181. { label: "教委专业名称", name: "GovMajorName", width: 200, align: "left" },
  182. {
  183. label: "本专科", name: "GraduateNo", width: 100, align: "left",
  184. formatterAsync: function (callback, value, row, op, $cell) {
  185. learun.clientdata.getAsync('dataItem', {
  186. key: value,
  187. code: 'CollegeType',
  188. callback: function (_data) {
  189. callback(_data.text);
  190. }
  191. });
  192. }
  193. },
  194. {
  195. label: "是否启用", name: "CheckMark", width: 100, align: "center",
  196. formatter: function (cellvalue) {
  197. return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  198. }
  199. },
  200. {
  201. label: "负责人", name: "MajorDirector", width: 100, align: "left",
  202. formatterAsync: function (callback, value, row, op, $cell) {
  203. learun.clientdata.getAsync('custmerData', {
  204. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo',
  205. key: value,
  206. keyId: 'f_encode',
  207. callback: function (_data) {
  208. callback(_data['f_realname']);
  209. }
  210. });
  211. }
  212. },
  213. //{
  214. // label: "考试科目", name: "SubjectNo", width: 100, align: "left",
  215. // formatterAsync: function (callback, value, row, op, $cell) {
  216. // learun.clientdata.getsAsync('custmerData',
  217. // {
  218. // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ExamSubject',
  219. // key: value,
  220. // keyId: 'subjectno',
  221. // textId: 'subjectname',
  222. // callback: function (text) {
  223. // callback(text);
  224. // }
  225. // });
  226. // }
  227. //},
  228. { label: "年度", name: "Year", width: 100, align: "left" },
  229. {
  230. label: "地市", name: "City", width: 100, align: "left",
  231. formatterAsync: function (callback, value, row, op, $cell) {
  232. learun.clientdata.getAsync('custmerData', {
  233. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY',
  234. key: value,
  235. keyId: 'ccode',
  236. callback: function (_data) {
  237. callback(_data['cname']);
  238. }
  239. });
  240. }
  241. },
  242. {
  243. label: "县区", name: "Area", width: 100, align: "left",
  244. formatterAsync: function (callback, value, row, op, $cell) {
  245. learun.clientdata.getAsync('custmerData', {
  246. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA',
  247. key: value,
  248. keyId: 'acode',
  249. callback: function (_data) {
  250. callback(_data['aname']);
  251. }
  252. });
  253. }
  254. }
  255. ],
  256. mainId: 'ID',
  257. isMultiselect: true,
  258. isPage: true,
  259. sidx: 'MajorNo',
  260. sord: 'ASC'
  261. });
  262. page.search();
  263. },
  264. search: function (param) {
  265. param = param || {};
  266. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  267. }
  268. };
  269. refreshGirdData = function () {
  270. page.search();
  271. };
  272. page.init();
  273. }