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.
 
 
 
 
 
 

189 lines
8.9 KiB

  1. var refreshGirdData;
  2. var bootstrap = function ($, learun) {
  3. "use strict";
  4. var Class;
  5. var page = {
  6. init: function () {
  7. page.initGird();
  8. page.bind();
  9. },
  10. bind: function () {
  11. // 初始化左侧树形数据
  12. $('#dataTree').lrtree({
  13. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetTree',
  14. nodeClick: function (item) {
  15. Class = item.value;
  16. page.search({ ClassNo: item.value });
  17. }
  18. });
  19. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  20. page.search(queryJson);
  21. }, 200, 400);
  22. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  23. $('#NationalityNo').lrDataSourceSelect({ code: 'BCdNationality', value: 'nationalityno', text: 'nationality' });
  24. // 刷新
  25. $('#lr_refresh').on('click', function () {
  26. location.reload();
  27. });
  28. // 打印
  29. $('#lr_print').on('click', function () {
  30. $('#gridtable').jqprintTable();
  31. });
  32. },
  33. // 初始化列表
  34. initGird: function () {
  35. $('#gridtable').lrAuthorizeJfGrid({
  36. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
  37. headData: [
  38. { label: "学号", name: "StuNo", width: 200, align: "left" },
  39. { label: "学籍号", name: "StuCode", width: 200, align: "left" },
  40. { label: "姓名", name: "StuName", width: 100, align: "left" },
  41. {
  42. label: "性别", name: "GenderNo", width: 80, align: "left",
  43. formatter: function (cellvalue) {
  44. return cellvalue == true ? "男" : "女";
  45. }
  46. },
  47. {
  48. label: "出生日期", name: "Birthday", width: 100, align: "left",
  49. formatter: function (cellvalue) {
  50. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  51. }
  52. },
  53. { label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" },
  54. {
  55. label: "民族", name: "NationalityNo", width: 100, align: "left",
  56. formatterAsync: function (callback, value, row, op, $cell) {
  57. learun.clientdata.getAsync('dataItem', {
  58. key: value,
  59. code: 'National',
  60. callback: function (_data) {
  61. callback(_data.text);
  62. }
  63. });
  64. }
  65. },
  66. {
  67. label: "系所", name: "DeptNo", width: 100, align: "left",
  68. formatterAsync: function (callback, value, row, op, $cell) {
  69. learun.clientdata.getAsync('custmerData', {
  70. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  71. key: value,
  72. keyId: 'deptno',
  73. callback: function (_data) {
  74. callback(_data['deptname']);
  75. }
  76. });
  77. }
  78. },
  79. {
  80. label: "专业", name: "MajorNo", width: 100, align: "left",
  81. formatterAsync: function (callback, value, row, op, $cell) {
  82. learun.clientdata.getAsync('custmerData', {
  83. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  84. key: value,
  85. keyId: 'majorno',
  86. callback: function (_data) {
  87. callback(_data['majorname']);
  88. }
  89. });
  90. }
  91. },
  92. {
  93. label: "班级", name: "ClassNo", width: 100, align: "left",
  94. formatterAsync: function (callback, value, row, op, $cell) {
  95. learun.clientdata.getAsync('custmerData', {
  96. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  97. key: value,
  98. keyId: 'classno',
  99. callback: function (_data) {
  100. callback(_data['classname']);
  101. }
  102. });
  103. }
  104. },
  105. { label: "年级", name: "Grade", width: 100, align: "left" },
  106. {
  107. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  108. learun.clientdata.getAsync('dataItem', {
  109. key: value,
  110. code: 'EduSystem',
  111. callback: function (_data) {
  112. callback(_data.text);
  113. }
  114. });
  115. }
  116. },
  117. {
  118. label: "学习形式", name: "StudyModality", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  119. learun.clientdata.getAsync('dataItem', {
  120. key: value,
  121. code: 'StudyModality',
  122. callback: function (_data) {
  123. callback(_data.text);
  124. }
  125. });
  126. }
  127. },
  128. {
  129. label: "报到日期", name: "RegisterDate", width: 100, align: "left",
  130. formatter: function (cellvalue) {
  131. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  132. }
  133. },
  134. {
  135. label: "入学年月", name: "EntranceDate", width: 100, align: "left",
  136. formatter: function (cellvalue) {
  137. return learun.formatDate(cellvalue, 'yyyy-MM-dd');
  138. }
  139. },
  140. {
  141. label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center",
  142. formatter: function (cellvalue) {
  143. return cellvalue == "1" ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  144. }
  145. },
  146. {
  147. label: "审核状态", name: "CheckMark", width: 80, align: "center",
  148. formatter: function (cellvalue) {
  149. return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
  150. }
  151. }
  152. ],
  153. mainId: 'StuId',
  154. isPage: true,
  155. //isMultiselect: true,
  156. //onSelectRow: function (rowdata) {
  157. // if (rowdata.CheckMark == "1") {
  158. // $("#check").hide();
  159. // $("#uncheck").show();
  160. // $("#lr_edit").hide();
  161. // $("#lr_delete").hide();
  162. // } else {
  163. // $("#uncheck").hide();
  164. // $("#check").show();
  165. // $("#lr_edit").show();
  166. // $("#lr_delete").show();
  167. // }
  168. //}
  169. });
  170. page.search();
  171. },
  172. search: function (param) {
  173. if (learun.clientdata.get(['userinfo']).account.toLowerCase() != "system") {//登录用户是system时,列表展示所有学生;其他用户登录时,必须选择左侧班级才能查看学生;
  174. if (Class == "" || Class == undefined || Class == null) {
  175. learun.alert.warning("请选择左侧班级!");
  176. return false;
  177. }
  178. }
  179. param = param || {};
  180. param.ClassNo = Class;
  181. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  182. }
  183. };
  184. refreshGirdData = function () {
  185. page.search();
  186. };
  187. page.init();
  188. }