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.

MyClass.js 11 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. var refreshGirdData;
  2. var bootstrap = function ($, learun) {
  3. "use strict";
  4. var page = {
  5. init: function () {
  6. page.initGird();
  7. page.bind();
  8. },
  9. bind: function () {
  10. // 初始化左侧树形数据
  11. $('#dataTree').lrtree({
  12. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetTree',
  13. nodeClick: function (item) {
  14. page.search({ ClassNo: item.value });
  15. }
  16. });
  17. // 刷新
  18. $('#lr_refresh').on('click', function () {
  19. location.reload();
  20. });
  21. // 编辑
  22. $('#lr_edit').on('click', function () {
  23. var keyValue = $('#gridtable').jfGridValue('StuId');
  24. if (learun.checkrow(keyValue)) {
  25. if (keyValue.indexOf(',') != -1) {
  26. learun.alert.warning("只能选择一条记录进行编辑!");
  27. return;
  28. }
  29. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  30. if (CheckMark === "1") {
  31. learun.alert.warning("当前项目已审核不能编辑!");
  32. return;
  33. }
  34. learun.layerForm({
  35. id: 'form',
  36. title: '编辑',
  37. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Form?keyValue=' + keyValue,
  38. width: 800,
  39. height: 600,
  40. callBack: function (id) {
  41. return top[id].acceptClick(refreshGirdData);
  42. }
  43. });
  44. }
  45. });
  46. //查看
  47. $('#lr_view').on('click', function () {
  48. var keyValue = $('#gridtable').jfGridValue('StuId');
  49. if (learun.checkrow(keyValue)) {
  50. if (keyValue.indexOf(',') != -1) {
  51. learun.alert.warning("只能选择一条记录进行查看!");
  52. return;
  53. }
  54. learun.layerForm({
  55. id: 'form',
  56. title: '编辑',
  57. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FormView?keyValue=' + keyValue,
  58. width: 1162,
  59. height: 600,
  60. btn: null
  61. });
  62. }
  63. });
  64. //审核
  65. $('#check').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('StuId');
  67. if (learun.checkrow(keyValue)) {
  68. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  69. if (CheckMark.indexOf('1') != -1) {
  70. learun.alert.warning("选中记录中包含已审核项目!");
  71. return;
  72. }
  73. learun.layerConfirm('是否确认审核该项?', function (res) {
  74. if (res) {
  75. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Check', { keyValue: keyValue }, function () {
  76. refreshGirdData();
  77. });
  78. }
  79. });
  80. }
  81. });
  82. //去审
  83. $('#uncheck').on('click', function () {
  84. var keyValue = $('#gridtable').jfGridValue('StuId');
  85. if (learun.checkrow(keyValue)) {
  86. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  87. var CheckMarkArr = CheckMark.split(',');
  88. if ($.inArray('0', CheckMarkArr) != -1 || $.inArray('', CheckMarkArr) != -1) {
  89. learun.alert.warning("选中记录中包含未审核项目!");
  90. return;
  91. }
  92. learun.layerConfirm('是否确认取消审核该项?', function (res) {
  93. if (res) {
  94. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/UnCheck', { keyValue: keyValue }, function () {
  95. refreshGirdData();
  96. });
  97. }
  98. });
  99. }
  100. });
  101. },
  102. // 初始化列表
  103. initGird: function () {
  104. $('#gridtable').lrAuthorizeJfGrid({
  105. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
  106. headData: [
  107. { label: "学号", name: "StuNo", width: 100, align: "left" },
  108. { label: "学籍号", name: "StuCode", width: 100, align: "left" },
  109. { label: "姓名", name: "StuName", width: 100, align: "left" },
  110. {
  111. label: "性别", name: "GenderNo", width: 80, align: "left",
  112. formatter: function (cellvalue) {
  113. return cellvalue == true ? "男" : "女";
  114. }
  115. },
  116. { label: "出生日期", name: "Birthday", width: 100, align: "left" },
  117. { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
  118. {
  119. label: "民族", name: "NationalityNo", width: 100, align: "left",
  120. formatterAsync: function (callback, value, row, op, $cell) {
  121. learun.clientdata.getAsync('dataItem', {
  122. key: value,
  123. code: 'National',
  124. callback: function (_data) {
  125. callback(_data.text);
  126. }
  127. });
  128. }
  129. },
  130. {
  131. label: "系所", name: "DeptNo", width: 100, align: "left",
  132. formatterAsync: function (callback, value, row, op, $cell) {
  133. learun.clientdata.getAsync('custmerData', {
  134. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  135. key: value,
  136. keyId: 'deptno',
  137. callback: function (_data) {
  138. callback(_data['deptname']);
  139. }
  140. });
  141. }
  142. },
  143. {
  144. label: "专业", name: "MajorNo", width: 100, align: "left",
  145. formatterAsync: function (callback, value, row, op, $cell) {
  146. learun.clientdata.getAsync('custmerData', {
  147. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  148. key: value,
  149. keyId: 'majorno',
  150. callback: function (_data) {
  151. callback(_data['majorname']);
  152. }
  153. });
  154. }
  155. },
  156. {
  157. label: "班级", name: "ClassNo", width: 100, align: "left",
  158. formatterAsync: function (callback, value, row, op, $cell) {
  159. learun.clientdata.getAsync('custmerData', {
  160. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  161. key: value,
  162. keyId: 'classno',
  163. callback: function (_data) {
  164. callback(_data['classname']);
  165. }
  166. });
  167. }
  168. },
  169. { label: "年级", name: "Grade", width: 100, align: "left" },
  170. {
  171. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  172. learun.clientdata.getAsync('dataItem', {
  173. key: value,
  174. code: 'EduSystem',
  175. callback: function (_data) {
  176. callback(_data.text);
  177. }
  178. });
  179. }
  180. },
  181. {
  182. label: "学习形式", name: "StudyModality", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  183. learun.clientdata.getAsync('dataItem', {
  184. key: value,
  185. code: 'StudyModality',
  186. callback: function (_data) {
  187. callback(_data.text);
  188. }
  189. });
  190. }
  191. },
  192. { label: "报到日期", name: "RegisterDate", width: 100, align: "left" },
  193. { label: "入学年月", name: "EntranceDate", width: 100, align: "left" },
  194. {
  195. label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center",
  196. formatter: function (cellvalue) {
  197. return cellvalue == "1" ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  198. }
  199. },
  200. {
  201. label: "审核状态", name: "CheckMark", width: 80, align: "center",
  202. formatter: function (cellvalue) {
  203. return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
  204. }
  205. }
  206. ],
  207. mainId: 'StuId',
  208. isPage: true,
  209. isMultiselect: true,
  210. //onSelectRow: function (rowdata) {
  211. // if (rowdata.CheckMark == "1") {
  212. // $("#check").hide();
  213. // $("#uncheck").show();
  214. // $("#lr_edit").hide();
  215. // $("#lr_delete").hide();
  216. // } else {
  217. // $("#uncheck").hide();
  218. // $("#check").show();
  219. // $("#lr_edit").show();
  220. // $("#lr_delete").show();
  221. // }
  222. //}
  223. });
  224. //page.search();
  225. },
  226. search: function (param) {
  227. param = param || {};
  228. param.AbmormityMoveMark = 1;
  229. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  230. }
  231. };
  232. refreshGirdData = function () {
  233. page.search();
  234. };
  235. page.init();
  236. }