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.

AllocationClass.js 11 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-08-08 17:21
  5. * 描 述:新生信息管理
  6. */
  7. var acceptClick, getParam;
  8. var keyValue = request('keyValue');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. $('.lr-form-wrap').lrscroll();
  14. page.bind();
  15. page.initGird();
  16. },
  17. bind: function () {
  18. $('#isAllocation').lrRadioCheckbox({
  19. type: 'radio',
  20. code: 'YesOrNoBit',
  21. });
  22. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  23. page.search(queryJson);
  24. }, 220, 400);
  25. $('#DeptNo').lrselect({
  26. allowSearch: true,
  27. value: "deptno",
  28. text: "deptname",
  29. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  30. });
  31. $('#MajorNo').lrselect({
  32. allowSearch: true,
  33. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  34. value: "majorno",
  35. text: "majorname",
  36. });
  37. $('#ClassNo').lrselect({
  38. allowSearch: true,
  39. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  40. value: "classno",
  41. text: "classname"
  42. });
  43. //$('#MajorNo').on("click",
  44. // function () {
  45. // var data = $('#DeptNo').lrselectGet();
  46. // if (!data) {
  47. // learun.alert.error('请先选择系');
  48. // }
  49. // });
  50. //$('#ClassNo').on("click",
  51. // function () {
  52. // var data1 = $('#DeptNo').lrselectGet();
  53. // var data2 = $('#MajorNo').lrselectGet();
  54. // if (!data1 || !data2) {
  55. // learun.alert.error('请先选择系和专业');
  56. // }
  57. // });
  58. $("#btn_search").on("click", function () {
  59. page.search(getParam());
  60. });
  61. //确认分配
  62. $("#btn_Apply").on("click", function () {
  63. var classNo = $("#ClassNo").lrselectGet();
  64. var className = $("#ClassNo").children().html();
  65. if (classNo != "") {
  66. var data = $('#gridtable').jfGridGet('rowdata');
  67. if (data.length > 0) {
  68. learun.layerConfirm('是否确认分配到班级' + className,
  69. function (res) {
  70. if (res) {
  71. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/DoAllocationClass', { classNo: classNo, dataJson: JSON.stringify(data) }, function () {
  72. page.search(getParam());
  73. });
  74. }
  75. }
  76. );
  77. } else {
  78. learun.alert.warning("您没有选中任何项,请选中后再操作!");
  79. }
  80. } else {
  81. learun.alert.warning("请选择要分配的班级");
  82. }
  83. });
  84. },
  85. // 初始化列表
  86. initGird: function () {
  87. $('#gridtable').jfGrid({
  88. url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetPageList',
  89. headData: [
  90. { label: '考生号', name: 'ksh', width: 150, align: "left" },
  91. { label: '准考证号', name: 'zkzh', width: 150, align: "left" },
  92. { label: '学号', name: 'StuNo', width: 100, align: "left" },
  93. { label: '姓名', name: 'StuName', width: 100, align: "left" },
  94. {
  95. label: '班级', name: 'ClassNo', width: 120, align: "left",
  96. formatterAsync: function (callback, value, row, op, $cell) {
  97. learun.clientdata.getAsync('custmerData', {
  98. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  99. key: value,
  100. keyId: 'classno',
  101. callback: function (_data) {
  102. callback(_data['classname']);
  103. }
  104. });
  105. }
  106. },
  107. {
  108. label: '性别', name: 'GenderNo', width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  109. learun.clientdata.getAsync('dataItem', {
  110. key: value,
  111. code: 'usersex',
  112. callback: function (_data) {
  113. callback(_data.text);
  114. }
  115. });
  116. }
  117. },
  118. { label: '身份证号', name: 'IdentityCardNo', width: 150, align: "left" },
  119. {
  120. label: '民族', name: 'NationalityNo', width: 80, align: "left", 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: 'FamilyOriginNo', width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  132. learun.clientdata.getAsync('dataItem', {
  133. key: value,
  134. code: 'ExamineeCategory',
  135. callback: function (_data) {
  136. callback(_data.text);
  137. }
  138. });
  139. }
  140. },
  141. {
  142. label: '考生类型', name: 'TestStuSortNo', width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  143. learun.clientdata.getAsync('dataItem', {
  144. key: value,
  145. code: 'ExamineeType',
  146. callback: function (_data) {
  147. callback(_data.text);
  148. }
  149. });
  150. }
  151. },
  152. {
  153. label: '科类', name: 'TestStuSubjectNo', width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  154. learun.clientdata.getAsync('dataItem', {
  155. key: value,
  156. code: 'SubjectType',
  157. callback: function (_data) {
  158. callback(_data.text);
  159. }
  160. });
  161. }
  162. },
  163. { label: '高考总分', name: 'HighAmountScore', width: 100, align: "left" },
  164. { label: '第几志愿', name: 'WillNo', width: 80, align: "left" },
  165. {
  166. label: '录取专业', name: 'RecruitMajorNo', width: 100, align: "left",
  167. formatterAsync: function (callback, value, row, op, $cell) {
  168. learun.clientdata.getAsync('custmerData', {
  169. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  170. key: value,
  171. keyId: 'majorno',
  172. callback: function (_data) {
  173. callback(_data['majorname']);
  174. }
  175. });
  176. }
  177. },
  178. {
  179. label: '录取方式', name: 'MatriculateSort', width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  180. learun.clientdata.getAsync('dataItem', {
  181. key: value,
  182. code: 'EnrollStyle',
  183. callback: function (_data) {
  184. callback(_data.text);
  185. }
  186. });
  187. }
  188. },
  189. { label: '语文', name: 'ChineseScore', width: 100, align: "left" },
  190. { label: '数学', name: 'MathScore', width: 100, align: "left" },
  191. { label: '英语', name: 'ForeignLangScore', width: 100, align: "left" },
  192. { label: '综合', name: 'ComprehensiveScore', width: 100, align: "left" },
  193. ],
  194. mainId: 'ID',
  195. isPage: true,
  196. isMultiselect: true,
  197. });
  198. page.search(getParam());
  199. },
  200. search: function (param) {
  201. param = param || {};
  202. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  203. }
  204. };
  205. getParam = function () {
  206. var majorNo = $("#MajorNo").lrselectGet();
  207. var IdCard = $("#IDCard").val();
  208. var isAllocation = $("#isAllocation").find('input:checked').val();
  209. var param = {
  210. MajorNo: majorNo,
  211. IDCard: IdCard,
  212. IsAllocation: isAllocation
  213. }
  214. return param;
  215. };
  216. // 保存数据
  217. acceptClick = function (callBack) {
  218. if (!$('body').lrValidform()) {
  219. return false;
  220. }
  221. var postData = {
  222. strEntity: JSON.stringify($('body').lrGetFormData())
  223. };
  224. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) {
  225. // 保存成功后才回调
  226. if (!!callBack) {
  227. callBack();
  228. }
  229. });
  230. };
  231. page.init();
  232. }