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
14 KiB

  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. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  11. page.search(queryJson);
  12. }, 290, 400);
  13. $('#DeptNo').lrselect({
  14. allowSearch: true,
  15. value: "deptno",
  16. text: "deptname",
  17. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  18. select: function (item) {
  19. if (item) {
  20. $('#MajorNo').lrselectRefresh({
  21. allowSearch: true,
  22. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  23. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  24. });
  25. } else {
  26. $('#MajorNo').lrselectRefresh({
  27. allowSearch: true,
  28. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  29. param: { strWhere: "1=1 AND CheckMark=1" }
  30. });
  31. }
  32. }
  33. });
  34. $('#MajorNo').lrselect({
  35. allowSearch: true,
  36. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  37. value: "majorno",
  38. text: "majorname",
  39. param: { strWhere: "1=1 AND CheckMark=1" },
  40. select: function (item) {
  41. var Grades = $("#Grade").lrselectGet();
  42. if (Grades != null && Grades != "" && Grades != "undefined") {
  43. if (item) {
  44. $('#ClassNo').lrselectRefresh({
  45. allowSearch: true,
  46. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  47. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 AND Grade='" + Grades + "' order by classno desc" }
  48. });
  49. } else {
  50. $('#ClassNo').lrselectRefresh({
  51. allowSearch: true,
  52. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  53. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  54. });
  55. }
  56. } else {
  57. if (item) {
  58. $('#ClassNo').lrselectRefresh({
  59. allowSearch: true,
  60. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  61. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" }
  62. });
  63. } else {
  64. $('#ClassNo').lrselectRefresh({
  65. allowSearch: true,
  66. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  67. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  68. });
  69. }
  70. }
  71. }
  72. });
  73. $('#Grade').lrselect({
  74. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  75. value: "value",
  76. text: "text",
  77. select: function (item) {
  78. var MajorNos = $("#MajorNo").lrselectGet();
  79. if (MajorNos != null && MajorNos != "" && MajorNos != "undefined") {
  80. if (item) {
  81. $('#ClassNo').lrselectRefresh({
  82. allowSearch: true,
  83. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  84. param: {
  85. strWhere: "majorno='" + MajorNos + "' AND CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  86. }
  87. });
  88. } else {
  89. $('#ClassNo').lrselectRefresh({
  90. allowSearch: true,
  91. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  92. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  93. });
  94. }
  95. } else {
  96. if (item) {
  97. $('#ClassNo').lrselectRefresh({
  98. allowSearch: true,
  99. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  100. param: {
  101. strWhere: "CheckMark=1 AND Grade='" + item.text + "' order by classno desc"
  102. }
  103. });
  104. } else {
  105. $('#ClassNo').lrselectRefresh({
  106. allowSearch: true,
  107. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  108. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
  109. });
  110. }
  111. }
  112. }
  113. });
  114. $('#ClassNo').lrselect({
  115. allowSearch: true,
  116. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  117. param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
  118. value: "classno",
  119. text: "classname"
  120. });
  121. $('#FinishSchoolMark').lrselect({
  122. data: [{ text: "已毕业", value: "2" }, { text: "准许毕业", value: "1" }, { text: "待准许", value: "0" }],
  123. text: "text",
  124. value: "value"
  125. })
  126. // 刷新
  127. $('#lr_refresh').on('click', function () {
  128. location.reload();
  129. });
  130. //校园卡注销
  131. $('#lr_cardderegistrate').on('click', function () {
  132. var keyValue = $('#gridtable').jfGridValue('StuId');
  133. var CardDeregistrateStatus = $('#gridtable').jfGridValue('CardDeregistrateStatus');
  134. if (learun.checkrow(keyValue)) {
  135. if (CardDeregistrateStatus.indexOf('1') != -1) {
  136. return learun.alert.warning("选中项包括已注销数据!");
  137. }
  138. learun.layerConfirm('是否确认注销校园卡!', function (res) {
  139. if (res) {
  140. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/IsCardDeregistrate', { keyValue: keyValue, status: '1' }, function () {
  141. refreshGirdData();
  142. });
  143. }
  144. });
  145. }
  146. })
  147. //取消校园卡注销
  148. $('#lr_cancelcardderegistrate').on('click', function () {
  149. var keyValue = $('#gridtable').jfGridValue('StuId');
  150. var CardDeregistrateStatus = $('#gridtable').jfGridValue('CardDeregistrateStatus');
  151. if (learun.checkrow(keyValue)) {
  152. for (var i = 0; i < CardDeregistrateStatus.split(',').length; i++) {
  153. if (CardDeregistrateStatus.split(',')[i] != 1) {
  154. return learun.alert.warning("选中项包括未注销数据!");
  155. }
  156. }
  157. learun.layerConfirm('是否确认取消注销校园卡!', function (res) {
  158. if (res) {
  159. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/IsCardDeregistrate', { keyValue: keyValue, status: '0' }, function () {
  160. refreshGirdData();
  161. });
  162. }
  163. });
  164. }
  165. })
  166. },
  167. // 初始化列表
  168. initGird: function () {
  169. $('#gridtable').jfGrid({
  170. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
  171. headData: [
  172. { label: "学号", name: "StuNo", width: 130, align: "left" },
  173. { label: "姓名", name: "StuName", width: 100, align: "left" },
  174. {
  175. label: "性别", name: "GenderNo", width: 50, align: "left",
  176. formatter: function (cellvalue) {
  177. return cellvalue == true ? "男" : "女";
  178. }
  179. },
  180. {
  181. label: "系所", name: "DeptNo", width: 100, align: "left",
  182. formatterAsync: function (callback, value, row, op, $cell) {
  183. learun.clientdata.getAsync('custmerData', {
  184. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  185. key: value,
  186. keyId: 'deptno',
  187. callback: function (_data) {
  188. callback(_data['deptname']);
  189. }
  190. });
  191. }
  192. },
  193. {
  194. label: "专业", name: "MajorNo", width: 100, align: "left",
  195. formatterAsync: function (callback, value, row, op, $cell) {
  196. learun.clientdata.getAsync('custmerData', {
  197. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  198. key: value,
  199. keyId: 'majorno',
  200. callback: function (_data) {
  201. callback(_data['majorname']);
  202. }
  203. });
  204. }
  205. },
  206. {
  207. label: "班级", name: "ClassNo", width: 100, align: "left",
  208. formatterAsync: function (callback, value, row, op, $cell) {
  209. learun.clientdata.getAsync('custmerData', {
  210. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  211. key: value,
  212. keyId: 'classno',
  213. callback: function (_data) {
  214. callback(_data['classname']);
  215. }
  216. });
  217. }
  218. },
  219. { label: "年级", name: "Grade", width: 50, align: "left" },
  220. {
  221. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  222. learun.clientdata.getAsync('dataItem', {
  223. key: value,
  224. code: 'EduSystem',
  225. callback: function (_data) {
  226. callback(_data.text);
  227. }
  228. });
  229. }
  230. },
  231. { label: "毕业证书号", name: "DiplomaNo", width: 100, align: "left" },
  232. {
  233. label: '毕业状态', name: 'FinishSchoolMark', width: 100, align: "left", formatter: function (val) {
  234. if (val == '0') {
  235. return '待准许';
  236. } else if (val == "1") {
  237. return '准许毕业';
  238. } else if (val == '2') {
  239. return '已毕业';
  240. } else {
  241. return '待准许';
  242. }
  243. }
  244. },
  245. { label: "毕业时间", name: "FinishSchoolDate", width: 130, align: "left" },
  246. {
  247. label: "校园卡注销状态", name: "CardDeregistrateStatus", width: 100, align: "left", formatter: function (cellvalue) {
  248. return cellvalue == "1" ? "已注销" : "未注销"
  249. }
  250. },
  251. { label: "校园卡注销时间", name: "CardDeregistrateDate", width: 100, align: "left" },
  252. ],
  253. mainId: 'StuId',
  254. isPage: true,
  255. rows: 100,
  256. isMultiselect: true,
  257. });
  258. page.search();
  259. },
  260. search: function (param) {
  261. param = param || {};
  262. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  263. }
  264. };
  265. refreshGirdData = function () {
  266. page.search();
  267. };
  268. page.init();
  269. }